_ZN8PfxEntryC2EP8AffixMgr:
   90|      8|    : pmyMgr(pmgr)
   91|      8|    , next(nullptr)
   92|      8|    , nexteq(nullptr)
   93|      8|    , nextne(nullptr)
   94|      8|    , flgnxt(nullptr) {}
_ZN8PfxEntry3addEPKcm:
   97|     12|std::string PfxEntry::add(const char* word, size_t len) {
   98|     12|  std::string result;
   99|     12|  if ((len > strip.size() || (len == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (99:7): [True: 12, False: 0]
  |  Branch (99:8): [True: 12, False: 0]
  |  Branch (99:31): [True: 0, False: 0]
  |  Branch (99:43): [True: 0, False: 0]
  ------------------
  100|     12|      (len >= numconds) && test_condition(word) &&
  ------------------
  |  Branch (100:7): [True: 12, False: 0]
  |  Branch (100:28): [True: 12, False: 0]
  ------------------
  101|     12|      (strip.empty() ||
  ------------------
  |  Branch (101:8): [True: 12, False: 0]
  ------------------
  102|     12|      (len >= strip.size() && strncmp(word, strip.c_str(), strip.size()) == 0))) {
  ------------------
  |  Branch (102:8): [True: 0, False: 0]
  |  Branch (102:31): [True: 0, False: 0]
  ------------------
  103|       |    /* we have a match so add prefix */
  104|     12|    result.assign(appnd);
  105|     12|    result.append(word + strip.size());
  106|     12|  }
  107|     12|  return result;
  108|     12|}
_ZN8PfxEntry9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  213|  1.42M|                                   AffixScratch& scratch) {
  214|  1.42M|  struct hentry* he;  // hash entry of root word or NULL
  215|       |
  216|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  217|       |  // So if the remaining root word has positive length
  218|       |  // and if there are enough chars in root word and added back strip chars
  219|       |  // to meet the number of characters conditions, then test it
  220|       |
  221|  1.42M|  int tmpl = len - appnd.size(); // length of tmpword
  222|       |
  223|  1.42M|  if (tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) {
  ------------------
  |  Branch (223:7): [True: 1.42M, False: 3.77k]
  |  Branch (223:20): [True: 3.77k, False: 0]
  |  Branch (223:33): [True: 0, False: 3.77k]
  ------------------
  224|       |    // generate new root word by removing prefix and adding
  225|       |    // back any characters that would have been stripped
  226|       |
  227|  1.42M|    std::string& tmpword = scratch.pfx_check_word;
  228|  1.42M|    tmpword.assign(strip);
  229|  1.42M|    tmpword.append(word, start + appnd.size(), tmpl);
  230|       |
  231|       |    // now make sure all of the conditions on characters
  232|       |    // are met.  Please see the appendix at the end of
  233|       |    // this file for more info on exactly what is being
  234|       |    // tested
  235|       |
  236|       |    // if all conditions are met then check if resulting
  237|       |    // root word in the dictionary
  238|       |
  239|  1.42M|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (239:9): [True: 22.9k, False: 1.40M]
  ------------------
  240|  22.9k|      tmpl += strip.size();
  241|  22.9k|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (241:11): [True: 2, False: 22.9k]
  ------------------
  242|      2|        do {
  243|      2|          if (TESTAFF(he->astr, aflag, he->alen) &&
  ------------------
  |  |   99|      4|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (243:15): [True: 0, False: 2]
  ------------------
  244|       |              // forbid single prefixes with needaffix flag
  245|      0|              !TESTAFF(contclass, pmyMgr->get_needaffix(), contclasslen) &&
  ------------------
  |  |   99|      2|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (245:15): [True: 0, False: 0]
  ------------------
  246|       |              // a circumfix prefix needs a matching circumfix suffix, so it
  247|       |              // cannot stand on its own
  248|      0|              !TESTAFF(contclass, pmyMgr->get_circumfix(), contclasslen) &&
  ------------------
  |  |   99|      2|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (248:15): [True: 0, False: 0]
  ------------------
  249|       |              // needflag
  250|      0|              ((!needflag) || TESTAFF(he->astr, needflag, he->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (250:16): [True: 0, False: 0]
  ------------------
  251|      0|               (contclass && TESTAFF(contclass, needflag, contclasslen))))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (251:17): [True: 0, False: 0]
  ------------------
  252|      0|            return he;
  253|      2|          he = he->next_homonym;  // check homonyms
  254|      2|        } while (he);
  ------------------
  |  Branch (254:18): [True: 0, False: 2]
  ------------------
  255|      2|      }
  256|       |
  257|       |      // prefix matched but no root word was found
  258|       |      // if aeXPRODUCT is allowed, try again but now
  259|       |      // ross checked combined with a suffix
  260|       |
  261|       |      // if ((opts & aeXPRODUCT) && in_compound) {
  262|  22.9k|      if ((opts & aeXPRODUCT)) {
  ------------------
  |  |   65|  22.9k|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (262:11): [True: 22.9k, False: 0]
  ------------------
  263|  22.9k|        he = pmyMgr->suffix_check(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|  22.9k|#define aeXPRODUCT (1 << 0)
  ------------------
  264|  22.9k|                                  scratch, FLAG_NULL, needflag, in_compound);
  ------------------
  |  |   96|  22.9k|#define FLAG_NULL 0x00
  ------------------
  265|  22.9k|        if (he)
  ------------------
  |  Branch (265:13): [True: 0, False: 22.9k]
  ------------------
  266|      0|          return he;
  267|  22.9k|      }
  268|  22.9k|    }
  269|  1.42M|  }
  270|  1.42M|  return nullptr;
  271|  1.42M|}
_ZN8PfxEntry12check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  279|  1.41M|                                      AffixScratch& scratch) {
  280|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  281|       |  // So if the remaining root word has positive length
  282|       |  // and if there are enough chars in root word and added back strip chars
  283|       |  // to meet the number of characters conditions, then test it
  284|       |
  285|  1.41M|  int tmpl = len - appnd.size(); // length of tmpword
  286|       |
  287|  1.41M|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (287:8): [True: 1.41M, False: 3.70k]
  |  Branch (287:21): [True: 3.70k, False: 0]
  |  Branch (287:34): [True: 0, False: 3.70k]
  ------------------
  288|  1.41M|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (288:7): [True: 1.35M, False: 54.8k]
  ------------------
  289|       |    // generate new root word by removing prefix and adding
  290|       |    // back any characters that would have been stripped
  291|       |
  292|  1.35M|    std::string& tmpword = scratch.pfx_check_twosfx;
  293|  1.35M|    tmpword.assign(strip);
  294|  1.35M|    tmpword.append(word, start + appnd.size(), tmpl);
  295|       |
  296|       |    // now make sure all of the conditions on characters
  297|       |    // are met.  Please see the appendix at the end of
  298|       |    // this file for more info on exactly what is being
  299|       |    // tested
  300|       |
  301|       |    // if all conditions are met then check if resulting
  302|       |    // root word in the dictionary
  303|       |
  304|  1.35M|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (304:9): [True: 12.2k, False: 1.34M]
  ------------------
  305|  12.2k|      tmpl += strip.size();
  306|       |
  307|       |      // prefix matched but no root word was found
  308|       |      // if aeXPRODUCT is allowed, try again but now
  309|       |      // cross checked combined with a suffix
  310|       |
  311|  12.2k|      if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   65|  12.2k|#define aeXPRODUCT (1 << 0)
  ------------------
                    if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   73|  12.2k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (311:11): [True: 12.2k, False: 0]
  |  Branch (311:34): [True: 12.2k, False: 0]
  ------------------
  312|       |        // hash entry of root word or NULL
  313|  12.2k|        struct hentry* he = pmyMgr->suffix_check_twosfx(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|  12.2k|#define aeXPRODUCT (1 << 0)
  ------------------
  314|  12.2k|                                                        scratch, needflag);
  315|  12.2k|        if (he)
  ------------------
  |  Branch (315:13): [True: 0, False: 12.2k]
  ------------------
  316|      0|          return he;
  317|  12.2k|      }
  318|  12.2k|    }
  319|  1.35M|  }
  320|  1.41M|  return nullptr;
  321|  1.41M|}
_ZN8PfxEntry18check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  329|    758|                                         AffixScratch& scratch) {
  330|    758|  std::string result;
  331|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  332|       |  // So if the remaining root word has positive length
  333|       |  // and if there are enough chars in root word and added back strip chars
  334|       |  // to meet the number of characters conditions, then test it
  335|    758|  int tmpl = len - appnd.size(); // length of tmpword
  336|       |
  337|    758|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (337:8): [True: 758, False: 0]
  |  Branch (337:21): [True: 0, False: 0]
  |  Branch (337:34): [True: 0, False: 0]
  ------------------
  338|    758|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (338:7): [True: 688, False: 70]
  ------------------
  339|       |    // generate new root word by removing prefix and adding
  340|       |    // back any characters that would have been stripped
  341|       |
  342|    688|    std::string& tmpword = scratch.pfx_check_twosfx;
  343|    688|    tmpword.assign(strip);
  344|    688|    tmpword.append(word, start + appnd.size(), tmpl);
  345|       |
  346|       |    // now make sure all of the conditions on characters
  347|       |    // are met.  Please see the appendix at the end of
  348|       |    // this file for more info on exactly what is being
  349|       |    // tested
  350|       |
  351|       |    // if all conditions are met then check if resulting
  352|       |    // root word in the dictionary
  353|       |
  354|    688|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (354:9): [True: 0, False: 688]
  ------------------
  355|      0|      tmpl += strip.size();
  356|       |
  357|       |      // prefix matched but no root word was found
  358|       |      // if aeXPRODUCT is allowed, try again but now
  359|       |      // ross checked combined with a suffix
  360|       |
  361|      0|      if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
                    if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (361:11): [True: 0, False: 0]
  |  Branch (361:34): [True: 0, False: 0]
  ------------------
  362|      0|        result = pmyMgr->suffix_check_twosfx_morph(tmpword, 0, tmpl,
  363|      0|                                                   aeXPRODUCT,
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  364|      0|                                                   this, scratch, needflag);
  365|      0|      }
  366|      0|    }
  367|    688|  }
  368|    758|  return result;
  369|    758|}
_ZN8PfxEntry11check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  377|    759|                                  AffixScratch& scratch) {
  378|    759|  std::string result;
  379|       |
  380|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  381|       |  // So if the remaining root word has positive length
  382|       |  // and if there are enough chars in root word and added back strip chars
  383|       |  // to meet the number of characters conditions, then test it
  384|       |
  385|    759|  int tmpl = len - appnd.size(); // length of tmpword
  386|       |
  387|    759|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (387:8): [True: 759, False: 0]
  |  Branch (387:21): [True: 0, False: 0]
  |  Branch (387:34): [True: 0, False: 0]
  ------------------
  388|    759|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (388:7): [True: 689, False: 70]
  ------------------
  389|       |    // generate new root word by removing prefix and adding
  390|       |    // back any characters that would have been stripped
  391|       |
  392|    689|    std::string& tmpword = scratch.pfx_check_word;
  393|    689|    tmpword.assign(strip);
  394|    689|    tmpword.append(word, start + appnd.size(), tmpl);
  395|       |
  396|       |    // now make sure all of the conditions on characters
  397|       |    // are met.  Please see the appendix at the end of
  398|       |    // this file for more info on exactly what is being
  399|       |    // tested
  400|       |
  401|       |    // if all conditions are met then check if resulting
  402|       |    // root word in the dictionary
  403|       |
  404|    689|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (404:9): [True: 1, False: 688]
  ------------------
  405|      1|      tmpl += strip.size();
  406|      1|      struct hentry* he;  // hash entry of root word or NULL
  407|      1|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (407:11): [True: 0, False: 1]
  ------------------
  408|      0|        do {
  409|      0|          if (TESTAFF(he->astr, aflag, he->alen) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (409:15): [True: 0, False: 0]
  ------------------
  410|       |              // forbid single prefixes with needaffix flag
  411|      0|              !TESTAFF(contclass, pmyMgr->get_needaffix(), contclasslen) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (411:15): [True: 0, False: 0]
  ------------------
  412|       |              // a circumfix prefix needs a matching circumfix suffix, so it
  413|       |              // cannot stand on its own
  414|      0|              !TESTAFF(contclass, pmyMgr->get_circumfix(), contclasslen) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (414:15): [True: 0, False: 0]
  ------------------
  415|       |              // needflag
  416|      0|              ((!needflag) || TESTAFF(he->astr, needflag, he->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (416:16): [True: 0, False: 0]
  ------------------
  417|      0|               (contclass && TESTAFF(contclass, needflag, contclasslen)))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (417:17): [True: 0, False: 0]
  ------------------
  418|      0|            if (morphcode) {
  ------------------
  |  Branch (418:17): [True: 0, False: 0]
  ------------------
  419|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  420|      0|              result.append(morphcode);
  421|      0|            } else
  422|      0|              result.append(getKey());
  423|      0|            if (!HENTRY_FIND(he, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (423:17): [True: 0, False: 0]
  ------------------
  424|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  425|      0|              result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  426|      0|              result.append(HENTRY_WORD(he));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  427|      0|            }
  428|       |            // store the pointer of the hash entry
  429|      0|            if (HENTRY_DATA(he)) {
  ------------------
  |  Branch (429:17): [True: 0, False: 0]
  ------------------
  430|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  431|      0|              result.append(HENTRY_DATA2(he));
  432|      0|            } else {
  433|       |              // return with debug information
  434|      0|              std::string flag = pmyMgr->encode_flag(getFlag());
  435|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  436|      0|              result.append(MORPH_FLAG);
  ------------------
  |  |  117|      0|#define MORPH_FLAG "fl:"
  ------------------
  437|      0|              result.append(flag);
  438|      0|            }
  439|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
  440|      0|          }
  441|      0|          he = he->next_homonym;
  442|      0|        } while (he);
  ------------------
  |  Branch (442:18): [True: 0, False: 0]
  ------------------
  443|      0|      }
  444|       |
  445|       |      // prefix matched but no root word was found
  446|       |      // if aeXPRODUCT is allowed, try again but now
  447|       |      // ross checked combined with a suffix
  448|       |
  449|      1|      if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   65|      1|#define aeXPRODUCT (1 << 0)
  ------------------
                    if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   73|      1|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (449:11): [True: 1, False: 0]
  |  Branch (449:34): [True: 1, False: 0]
  ------------------
  450|      1|        std::string st = pmyMgr->suffix_check_morph(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|      1|#define aeXPRODUCT (1 << 0)
  ------------------
  451|      1|                                                    scratch, FLAG_NULL, needflag);
  ------------------
  |  |   96|      1|#define FLAG_NULL 0x00
  ------------------
  452|      1|        if (!st.empty()) {
  ------------------
  |  Branch (452:13): [True: 0, False: 1]
  ------------------
  453|      0|          result.append(st);
  454|      0|        }
  455|      1|      }
  456|      1|    }
  457|    689|  }
  458|       |
  459|    759|  return result;
  460|    759|}
_ZN8SfxEntryC2EP8AffixMgr:
  463|     34|    : pmyMgr(pmgr)  // register affix manager
  464|     34|    , next(nullptr)
  465|     34|    , nexteq(nullptr)
  466|     34|    , nextne(nullptr)
  467|     34|    , flgnxt(nullptr)
  468|     34|    , l_morph(nullptr)
  469|     34|    , r_morph(nullptr)
  470|     34|    , eq_morph(nullptr) {}
_ZN8SfxEntry3addEPKcm:
  473|     22|std::string SfxEntry::add(const char* word, size_t len) {
  474|     22|  std::string result;
  475|       |  /* make sure all conditions match */
  476|     22|  if ((len > strip.size() || (len == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (476:8): [True: 22, False: 0]
  |  Branch (476:31): [True: 0, False: 0]
  |  Branch (476:43): [True: 0, False: 0]
  ------------------
  477|     22|      (len >= numconds) && test_condition(word + len, word) &&
  ------------------
  |  Branch (477:7): [True: 22, False: 0]
  |  Branch (477:28): [True: 22, False: 0]
  ------------------
  478|     22|      (strip.empty() ||
  ------------------
  |  Branch (478:8): [True: 22, False: 0]
  ------------------
  479|     22|       (len >= strip.size() && strcmp(word + len - strip.size(), strip.c_str()) == 0))) {
  ------------------
  |  Branch (479:9): [True: 0, False: 0]
  |  Branch (479:32): [True: 0, False: 0]
  ------------------
  480|     22|    result.assign(word, len);
  481|       |    /* we have a match so add suffix */
  482|     22|    result.replace(len - strip.size(), std::string::npos, appnd);
  483|     22|  }
  484|     22|  return result;
  485|     22|}
_ZN8SfxEntry9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntrytttR12AffixScratch:
  627|  66.0k|                                   AffixScratch& scratch) {
  628|  66.0k|  struct hentry* he;  // hash entry pointer
  629|  66.0k|  PfxEntry* ep = ppfx;
  630|       |
  631|       |  // if this suffix is being cross checked with a prefix
  632|       |  // but it does not support cross products skip it
  633|       |
  634|  66.0k|  if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0))
  ------------------
  |  |   65|  66.0k|#define aeXPRODUCT (1 << 0)
  ------------------
                if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0))
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (634:7): [True: 0, False: 66.0k]
  |  Branch (634:41): [True: 0, False: 0]
  ------------------
  635|      0|    return nullptr;
  636|       |
  637|       |  // upon entry suffix is 0 length or already matches the end of the word.
  638|       |  // So if the remaining root word has positive length
  639|       |  // and if there are enough chars in root word and added back strip chars
  640|       |  // to meet the number of characters conditions, then test it
  641|       |
  642|  66.0k|  int tmpl = len - appnd.size(); // length of tmpword
  643|       |  // the second condition is not enough for UTF-8 strings
  644|       |  // it checked in test_condition()
  645|       |
  646|  66.0k|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (646:8): [True: 64.2k, False: 1.80k]
  |  Branch (646:21): [True: 1.80k, False: 0]
  |  Branch (646:34): [True: 0, False: 1.80k]
  ------------------
  647|  64.2k|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (647:7): [True: 64.2k, False: 0]
  ------------------
  648|       |    // generate new root word by removing suffix and adding
  649|       |    // back any characters that would have been stripped or
  650|       |    // or null terminating the shorter string
  651|       |
  652|  64.2k|    std::string& tmpword = scratch.sfx_check_word;
  653|  64.2k|    tmpword.assign(word, start, tmpl);
  654|  64.2k|    if (!strip.empty()) {
  ------------------
  |  Branch (654:9): [True: 0, False: 64.2k]
  ------------------
  655|      0|      tmpword.append(strip);
  656|      0|    }
  657|       |
  658|  64.2k|    const char* beg = tmpword.c_str();
  659|  64.2k|    const char* end = beg + tmpword.size();
  660|       |
  661|       |    // now make sure all of the conditions on characters
  662|       |    // are met.  Please see the appendix at the end of
  663|       |    // this file for more info on exactly what is being
  664|       |    // tested
  665|       |
  666|       |    // if all conditions are met then check if resulting
  667|       |    // root word in the dictionary
  668|       |
  669|  64.2k|    if (test_condition(end, beg)) {
  ------------------
  |  Branch (669:9): [True: 64.2k, False: 5]
  ------------------
  670|       |#ifdef SZOSZABLYA_POSSIBLE_ROOTS
  671|       |      fprintf(stdout, "%s %s %c\n", word.c_str() + start, beg, aflag);
  672|       |#endif
  673|  64.2k|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (673:11): [True: 148, False: 64.0k]
  ------------------
  674|    148|        do {
  675|       |          // check conditional suffix (enabled by prefix)
  676|    148|          if ((TESTAFF(he->astr, aflag, he->alen) ||
  ------------------
  |  |   99|    296|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 148]
  |  |  ------------------
  ------------------
  |  Branch (676:15): [True: 0, False: 148]
  ------------------
  677|    148|               (ep && ep->getCont() &&
  ------------------
  |  Branch (677:17): [True: 0, False: 148]
  |  Branch (677:23): [True: 0, False: 0]
  ------------------
  678|      0|                TESTAFF(ep->getCont(), aflag, ep->getContLen()))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  679|      0|              (((optflags & aeXPRODUCT) == 0) ||
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (679:16): [True: 0, False: 0]
  ------------------
  680|      0|               (ep && TESTAFF(he->astr, ep->getFlag(), he->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (680:17): [True: 0, False: 0]
  ------------------
  681|       |               // enabled by prefix
  682|      0|               ((contclass) &&
  ------------------
  |  Branch (682:17): [True: 0, False: 0]
  ------------------
  683|      0|                (ep && TESTAFF(contclass, ep->getFlag(), contclasslen)))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (683:18): [True: 0, False: 0]
  ------------------
  684|       |              // handle cont. class
  685|      0|              ((!cclass) ||
  ------------------
  |  Branch (685:16): [True: 0, False: 0]
  ------------------
  686|      0|               ((contclass) && TESTAFF(contclass, cclass, contclasslen))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (686:17): [True: 0, False: 0]
  ------------------
  687|       |              // check only in compound homonyms (bad flags)
  688|      0|              (!badflag || !TESTAFF(he->astr, badflag, he->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (688:16): [True: 0, False: 0]
  |  Branch (688:28): [True: 0, False: 0]
  ------------------
  689|       |              // handle required flag
  690|      0|              ((!needflag) ||
  ------------------
  |  Branch (690:16): [True: 0, False: 0]
  ------------------
  691|      0|               (TESTAFF(he->astr, needflag, he->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  692|      0|                ((contclass) && TESTAFF(contclass, needflag, contclasslen)))))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (692:18): [True: 0, False: 0]
  ------------------
  693|      0|            return he;
  694|    148|          he = he->next_homonym;  // check homonyms
  695|    148|        } while (he);
  ------------------
  |  Branch (695:18): [True: 0, False: 148]
  ------------------
  696|    148|      }
  697|  64.2k|    }
  698|  64.2k|  }
  699|  66.0k|  return nullptr;
  700|  66.0k|}
_ZN8SfxEntry12check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntrytR12AffixScratch:
  709|  34.3k|                                      AffixScratch& scratch) {
  710|  34.3k|  PfxEntry* ep = ppfx;
  711|       |
  712|       |  // if this suffix is being cross checked with a prefix
  713|       |  // but it does not support cross products skip it
  714|       |
  715|  34.3k|  if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0)
  ------------------
  |  |   65|  34.3k|#define aeXPRODUCT (1 << 0)
  ------------------
                if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0)
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (715:7): [True: 0, False: 34.3k]
  |  Branch (715:39): [True: 0, False: 0]
  ------------------
  716|      0|    return nullptr;
  717|       |
  718|       |  // upon entry suffix is 0 length or already matches the end of the word.
  719|       |  // So if the remaining root word has positive length
  720|       |  // and if there are enough chars in root word and added back strip chars
  721|       |  // to meet the number of characters conditions, then test it
  722|       |
  723|  34.3k|  int tmpl = len - appnd.size(); // length of tmpword
  724|       |
  725|  34.3k|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (725:8): [True: 34.1k, False: 158]
  |  Branch (725:21): [True: 158, False: 0]
  |  Branch (725:34): [True: 0, False: 158]
  ------------------
  726|  34.1k|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (726:7): [True: 34.1k, False: 0]
  ------------------
  727|       |    // generate new root word by removing suffix and adding
  728|       |    // back any characters that would have been stripped or
  729|       |    // or null terminating the shorter string
  730|       |
  731|  34.1k|    std::string& tmpword = scratch.sfx_check_twosfx;
  732|  34.1k|    tmpword.assign(word, start);
  733|  34.1k|    tmpword.resize(tmpl);
  734|  34.1k|    tmpword.append(strip);
  735|  34.1k|    tmpl += strip.size();
  736|       |
  737|  34.1k|    const char* beg = tmpword.c_str();
  738|  34.1k|    const char* end = beg + tmpl;
  739|       |
  740|       |    // now make sure all of the conditions on characters
  741|       |    // are met.  Please see the appendix at the end of
  742|       |    // this file for more info on exactly what is being
  743|       |    // tested
  744|       |
  745|       |    // if all conditions are met then recall suffix_check
  746|       |
  747|  34.1k|    if (test_condition(end, beg)) {
  ------------------
  |  Branch (747:9): [True: 34.1k, False: 0]
  ------------------
  748|  34.1k|      struct hentry* he;  // hash entry pointer
  749|  34.1k|      if (ppfx) {
  ------------------
  |  Branch (749:11): [True: 0, False: 34.1k]
  ------------------
  750|       |        // handle conditional suffix
  751|      0|        if ((contclass) && TESTAFF(contclass, ep->getFlag(), contclasslen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (751:13): [True: 0, False: 0]
  |  Branch (751:13): [True: 0, False: 0]
  ------------------
  752|      0|          he = pmyMgr->suffix_check(tmpword, 0, tmpl, 0, nullptr, scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   72|      0|#define IN_CPD_NOT 0
  ------------------
  753|      0|        else
  754|      0|          he = pmyMgr->suffix_check(tmpword, 0, tmpl, optflags, ppfx,
  755|      0|                                    scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   72|      0|#define IN_CPD_NOT 0
  ------------------
  756|  34.1k|      } else {
  757|  34.1k|        he = pmyMgr->suffix_check(tmpword, 0, tmpl, 0, nullptr, scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   72|  34.1k|#define IN_CPD_NOT 0
  ------------------
  758|  34.1k|      }
  759|  34.1k|      if (he)
  ------------------
  |  Branch (759:11): [True: 0, False: 34.1k]
  ------------------
  760|      0|        return he;
  761|  34.1k|    }
  762|  34.1k|  }
  763|  34.3k|  return nullptr;
  764|  34.3k|}
_ZN8SfxEntry15initReverseWordEv:
  875|     34|void SfxEntry::initReverseWord() {
  876|     34|  rappnd = appnd;
  877|     34|  reverseword(rappnd);
  878|     34|}
_ZN8PfxEntry14test_conditionERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  125|  2.78M|inline int PfxEntry::test_condition(const std::string& s) {
  126|  2.78M|  size_t st = 0;
  127|  2.78M|  size_t pos = std::string::npos;  // group with pos input position
  128|  2.78M|  bool neg = false;        // complementer
  129|  2.78M|  bool ingroup = false;    // character in the group
  130|  2.78M|  if (numconds == 0)
  ------------------
  |  Branch (130:7): [True: 10.6k, False: 2.77M]
  ------------------
  131|  10.6k|    return 1;
  132|  2.77M|  char* p = c.conds;
  133|  2.89M|  while (true) {
  ------------------
  |  Branch (133:10): [True: 2.89M, Folded]
  ------------------
  134|  2.89M|    switch (*p) {
  135|      0|      case '\0':
  ------------------
  |  Branch (135:7): [True: 0, False: 2.89M]
  ------------------
  136|      0|        return 1;
  137|  24.4k|      case '[': {
  ------------------
  |  Branch (137:7): [True: 24.4k, False: 2.86M]
  ------------------
  138|  24.4k|        neg = false;
  139|  24.4k|        ingroup = false;
  140|  24.4k|        p = nextchar(p);
  141|  24.4k|        pos = st;
  142|  24.4k|        break;
  143|      0|      }
  144|  24.4k|      case '^': {
  ------------------
  |  Branch (144:7): [True: 24.4k, False: 2.86M]
  ------------------
  145|  24.4k|        p = nextchar(p);
  146|  24.4k|        neg = true;
  147|  24.4k|        break;
  148|      0|      }
  149|  24.4k|      case ']': {
  ------------------
  |  Branch (149:7): [True: 24.4k, False: 2.86M]
  ------------------
  150|  24.4k|        if (bool(neg) == bool(ingroup))
  ------------------
  |  Branch (150:13): [True: 0, False: 24.4k]
  ------------------
  151|      0|          return 0;
  152|  24.4k|        pos = std::string::npos;
  153|  24.4k|        p = nextchar(p);
  154|       |        // skip the next character
  155|  24.4k|        if (!ingroup && st < s.size())
  ------------------
  |  Branch (155:13): [True: 24.4k, False: 0]
  |  Branch (155:25): [True: 23.0k, False: 1.45k]
  ------------------
  156|  23.0k|          st = (opts & aeUTF8) ? utf8_next(s, st) : st + 1;
  ------------------
  |  |   66|  23.0k|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (156:16): [True: 23.0k, False: 0]
  ------------------
  157|  24.4k|        if (st == s.size() && p)
  ------------------
  |  Branch (157:13): [True: 3.86k, False: 20.6k]
  |  Branch (157:31): [True: 0, False: 3.86k]
  ------------------
  158|      0|          return 0;  // word <= condition
  159|  24.4k|        break;
  160|  24.4k|      }
  161|  24.4k|      case '.':
  ------------------
  |  Branch (161:7): [True: 0, False: 2.89M]
  ------------------
  162|      0|        if (pos == std::string::npos) {  // dots are not metacharacters in groups: [.]
  ------------------
  |  Branch (162:13): [True: 0, False: 0]
  ------------------
  163|      0|          if (st == s.size())
  ------------------
  |  Branch (163:15): [True: 0, False: 0]
  ------------------
  164|      0|            return 0;  // dot has no character to match
  165|      0|          p = nextchar(p);
  166|       |          // skip the next character
  167|      0|          st = (opts & aeUTF8) ? utf8_next(s, st) : st + 1;
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (167:16): [True: 0, False: 0]
  ------------------
  168|      0|          break;
  169|      0|        }
  170|       |      /* FALLTHROUGH */
  171|  2.82M|      default: {
  ------------------
  |  Branch (171:7): [True: 2.82M, False: 73.4k]
  ------------------
  172|  2.82M|        if (st < s.size() && s[st] == *p) {
  ------------------
  |  Branch (172:13): [True: 2.81M, False: 2.90k]
  |  Branch (172:30): [True: 24.6k, False: 2.79M]
  ------------------
  173|  24.6k|          ++st;
  174|  24.6k|          p = nextchar(p);
  175|  24.6k|          if ((opts & aeUTF8) && (s[st - 1] & 0x80)) {  // multibyte
  ------------------
  |  |   66|  24.6k|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (175:15): [True: 24.6k, False: 0]
  |  Branch (175:34): [True: 24.6k, False: 0]
  ------------------
  176|  49.1k|            while (p && is_utf8_cont(*p)) {             // character
  ------------------
  |  Branch (176:20): [True: 49.1k, False: 0]
  |  Branch (176:25): [True: 24.6k, False: 24.4k]
  ------------------
  177|  24.6k|              if (st >= s.size() || *p != s[st]) {
  ------------------
  |  Branch (177:19): [True: 0, False: 24.6k]
  |  Branch (177:37): [True: 134, False: 24.4k]
  ------------------
  178|    134|                if (pos == std::string::npos)
  ------------------
  |  Branch (178:21): [True: 110, False: 24]
  ------------------
  179|    110|                  return 0;
  180|     24|                st = pos;
  181|     24|                break;
  182|    134|              }
  183|  24.4k|              p = nextchar(p);
  184|  24.4k|              ++st;
  185|  24.4k|            }
  186|  24.5k|            if (pos != std::string::npos && st != pos) {
  ------------------
  |  Branch (186:17): [True: 24, False: 24.4k]
  |  Branch (186:45): [True: 0, False: 24]
  ------------------
  187|      0|              ingroup = true;
  188|      0|              while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (188:22): [True: 0, False: 0]
  |  Branch (188:27): [True: 0, False: 0]
  |  Branch (188:40): [True: 0, False: 0]
  ------------------
  189|      0|              }
  190|      0|            }
  191|  24.5k|          } else if (pos != std::string::npos) {
  ------------------
  |  Branch (191:22): [True: 0, False: 0]
  ------------------
  192|      0|            ingroup = true;
  193|      0|            while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (193:20): [True: 0, False: 0]
  |  Branch (193:25): [True: 0, False: 0]
  |  Branch (193:38): [True: 0, False: 0]
  ------------------
  194|      0|            }
  195|      0|          }
  196|  2.79M|        } else if (pos != std::string::npos) {  // group
  ------------------
  |  Branch (196:20): [True: 48.9k, False: 2.74M]
  ------------------
  197|  48.9k|          p = nextchar(p);
  198|  48.9k|        } else
  199|  2.74M|          return 0;
  200|  2.82M|      }
  201|  2.89M|    }
  202|   146k|    if (!p)
  ------------------
  |  Branch (202:9): [True: 24.4k, False: 122k]
  ------------------
  203|  24.4k|      return 1;
  204|   146k|  }
  205|  2.77M|}
_ZN8PfxEntry8nextcharEPc:
  110|   171k|inline char* PfxEntry::nextchar(char* p) {
  111|   171k|  if (p) {
  ------------------
  |  Branch (111:7): [True: 171k, False: 0]
  ------------------
  112|   171k|    p++;
  113|   171k|    if (opts & aeLONGCOND) {
  ------------------
  |  |   69|   171k|#define aeLONGCOND (1 << 4)
  ------------------
  |  Branch (113:9): [True: 0, False: 171k]
  ------------------
  114|       |      // jump to the 2nd part of the condition
  115|      0|      if (p == c.conds + MAXCONDLEN_1)
  ------------------
  |  |   91|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
  |  Branch (115:11): [True: 0, False: 0]
  ------------------
  116|      0|        return c.l.conds2;
  117|       |      // end of the MAXCONDLEN length condition
  118|   171k|    } else if (p == c.conds + MAXCONDLEN)
  ------------------
  |  |   90|   171k|#define MAXCONDLEN 20
  ------------------
  |  Branch (118:16): [True: 0, False: 171k]
  ------------------
  119|      0|      return nullptr;
  120|   171k|    return *p ? p : nullptr;
  ------------------
  |  Branch (120:12): [True: 147k, False: 24.4k]
  ------------------
  121|   171k|  }
  122|      0|  return nullptr;
  123|   171k|}
_ZN8SfxEntry14test_conditionEPKcS1_:
  502|  98.3k|inline int SfxEntry::test_condition(const char* st, const char* beg) {
  503|  98.3k|  const char* pos = nullptr;  // group with pos input position
  504|  98.3k|  bool neg = false;        // complementer
  505|  98.3k|  bool ingroup = false;    // character in the group
  506|  98.3k|  if (numconds == 0)
  ------------------
  |  Branch (506:7): [True: 98.3k, False: 5]
  ------------------
  507|  98.3k|    return 1;
  508|      5|  char* p = c.conds;
  509|      5|  st--;
  510|      5|  int i = 1;
  511|     40|  while (true) {
  ------------------
  |  Branch (511:10): [True: 40, Folded]
  ------------------
  512|     40|    switch (*p) {
  513|      0|      case '\0':
  ------------------
  |  Branch (513:7): [True: 0, False: 40]
  ------------------
  514|      0|        return 1;
  515|      5|      case '[':
  ------------------
  |  Branch (515:7): [True: 5, False: 35]
  ------------------
  516|      5|        p = nextchar(p);
  517|      5|        pos = st;
  518|      5|        break;
  519|      0|      case '^':
  ------------------
  |  Branch (519:7): [True: 0, False: 40]
  ------------------
  520|      0|        p = nextchar(p);
  521|      0|        neg = true;
  522|      0|        break;
  523|      5|      case ']':
  ------------------
  |  Branch (523:7): [True: 5, False: 35]
  ------------------
  524|      5|        if (!neg && !ingroup)
  ------------------
  |  Branch (524:13): [True: 5, False: 0]
  |  Branch (524:21): [True: 5, False: 0]
  ------------------
  525|      5|          return 0;
  526|      0|        i++;
  527|       |        // skip the next character
  528|      0|        if (!ingroup) {
  ------------------
  |  Branch (528:13): [True: 0, False: 0]
  ------------------
  529|      0|          for (; (opts & aeUTF8) && (st >= beg) && is_utf8_cont(*st); st--)
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (529:18): [True: 0, False: 0]
  |  Branch (529:37): [True: 0, False: 0]
  |  Branch (529:52): [True: 0, False: 0]
  ------------------
  530|      0|            ;
  531|      0|          st--;
  532|      0|        }
  533|      0|        pos = nullptr;
  534|      0|        neg = false;
  535|      0|        ingroup = false;
  536|      0|        p = nextchar(p);
  537|      0|        if (st < beg && p)
  ------------------
  |  Branch (537:13): [True: 0, False: 0]
  |  Branch (537:25): [True: 0, False: 0]
  ------------------
  538|      0|          return 0;  // word <= condition
  539|      0|        break;
  540|      0|      case '.':
  ------------------
  |  Branch (540:7): [True: 0, False: 40]
  ------------------
  541|      0|        if (!pos) {
  ------------------
  |  Branch (541:13): [True: 0, False: 0]
  ------------------
  542|       |          // dots are not metacharacters in groups: [.]
  543|      0|          p = nextchar(p);
  544|       |          // skip one character to the left. Walk back over any UTF-8
  545|       |          // continuation bytes of that character to its leading byte first,
  546|       |          // then step past it, so a single-byte match preceded by a
  547|       |          // multibyte character does not consume the multibyte character.
  548|      0|          for (; (opts & aeUTF8) && (st >= beg) && is_utf8_cont(*st); st--)
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (548:18): [True: 0, False: 0]
  |  Branch (548:37): [True: 0, False: 0]
  |  Branch (548:52): [True: 0, False: 0]
  ------------------
  549|      0|            ;
  550|      0|          st--;
  551|      0|          if (st < beg) {  // word <= condition
  ------------------
  |  Branch (551:15): [True: 0, False: 0]
  ------------------
  552|      0|            if (p)
  ------------------
  |  Branch (552:17): [True: 0, False: 0]
  ------------------
  553|      0|              return 0;
  554|      0|            else
  555|      0|              return 1;
  556|      0|          }
  557|      0|          break;
  558|      0|        }
  559|       |      /* FALLTHROUGH */
  560|     30|      default: {
  ------------------
  |  Branch (560:7): [True: 30, False: 10]
  ------------------
  561|     30|        if (*st == *p) {
  ------------------
  |  Branch (561:13): [True: 0, False: 30]
  ------------------
  562|      0|          p = nextchar(p);
  563|      0|          if ((opts & aeUTF8) && (*st & 0x80)) {
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (563:15): [True: 0, False: 0]
  |  Branch (563:34): [True: 0, False: 0]
  ------------------
  564|      0|            st--;
  565|      0|            while (p && (st >= beg)) {
  ------------------
  |  Branch (565:20): [True: 0, False: 0]
  |  Branch (565:25): [True: 0, False: 0]
  ------------------
  566|      0|              if (*p != *st) {
  ------------------
  |  Branch (566:19): [True: 0, False: 0]
  ------------------
  567|      0|                if (!pos)
  ------------------
  |  Branch (567:21): [True: 0, False: 0]
  ------------------
  568|      0|                  return 0;
  569|      0|                st = pos;
  570|      0|                break;
  571|      0|              }
  572|       |              // first byte of the UTF-8 multibyte character
  573|      0|              if (!is_utf8_cont(*p))
  ------------------
  |  Branch (573:19): [True: 0, False: 0]
  ------------------
  574|      0|                break;
  575|      0|              p = nextchar(p);
  576|      0|              st--;
  577|      0|            }
  578|      0|            if (pos && st != pos) {
  ------------------
  |  Branch (578:17): [True: 0, False: 0]
  |  Branch (578:24): [True: 0, False: 0]
  ------------------
  579|      0|              if (neg)
  ------------------
  |  Branch (579:19): [True: 0, False: 0]
  ------------------
  580|      0|                return 0;
  581|      0|              else if (i == numconds)
  ------------------
  |  Branch (581:24): [True: 0, False: 0]
  ------------------
  582|      0|                return 1;
  583|      0|              ingroup = true;
  584|      0|              while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (584:22): [True: 0, False: 0]
  |  Branch (584:27): [True: 0, False: 0]
  |  Branch (584:40): [True: 0, False: 0]
  ------------------
  585|      0|              }
  586|      0|              st--;
  587|      0|            }
  588|      0|            if (p && *p != ']')
  ------------------
  |  Branch (588:17): [True: 0, False: 0]
  |  Branch (588:22): [True: 0, False: 0]
  ------------------
  589|      0|              p = nextchar(p);
  590|      0|          } else if (pos) {
  ------------------
  |  Branch (590:22): [True: 0, False: 0]
  ------------------
  591|      0|            if (neg)
  ------------------
  |  Branch (591:17): [True: 0, False: 0]
  ------------------
  592|      0|              return 0;
  593|      0|            else if (i == numconds)
  ------------------
  |  Branch (593:22): [True: 0, False: 0]
  ------------------
  594|      0|              return 1;
  595|      0|            ingroup = true;
  596|      0|            while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (596:20): [True: 0, False: 0]
  |  Branch (596:25): [True: 0, False: 0]
  |  Branch (596:38): [True: 0, False: 0]
  ------------------
  597|      0|            }
  598|       |            // if (p && *p != ']') p = nextchar(p);
  599|      0|            st--;
  600|      0|          }
  601|      0|          if (!pos) {
  ------------------
  |  Branch (601:15): [True: 0, False: 0]
  ------------------
  602|      0|            i++;
  603|      0|            st--;
  604|      0|          }
  605|      0|          if (st < beg && p && *p != ']')
  ------------------
  |  Branch (605:15): [True: 0, False: 0]
  |  Branch (605:27): [True: 0, False: 0]
  |  Branch (605:32): [True: 0, False: 0]
  ------------------
  606|      0|            return 0;      // word <= condition
  607|     30|        } else if (pos) {  // group
  ------------------
  |  Branch (607:20): [True: 30, False: 0]
  ------------------
  608|     30|          p = nextchar(p);
  609|     30|        } else
  610|      0|          return 0;
  611|     30|      }
  612|     40|    }
  613|     35|    if (!p)
  ------------------
  |  Branch (613:9): [True: 0, False: 35]
  ------------------
  614|      0|      return 1;
  615|     35|  }
  616|      5|}
_ZN8SfxEntry8nextcharEPc:
  487|     35|inline char* SfxEntry::nextchar(char* p) {
  488|     35|  if (p) {
  ------------------
  |  Branch (488:7): [True: 35, False: 0]
  ------------------
  489|     35|    p++;
  490|     35|    if (opts & aeLONGCOND) {
  ------------------
  |  |   69|     35|#define aeLONGCOND (1 << 4)
  ------------------
  |  Branch (490:9): [True: 0, False: 35]
  ------------------
  491|       |      // jump to the 2nd part of the condition
  492|      0|      if (p == c.l.conds1 + MAXCONDLEN_1)
  ------------------
  |  |   91|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
  |  Branch (492:11): [True: 0, False: 0]
  ------------------
  493|      0|        return c.l.conds2;
  494|       |      // end of the MAXCONDLEN length condition
  495|     35|    } else if (p == c.conds + MAXCONDLEN)
  ------------------
  |  |   90|     35|#define MAXCONDLEN 20
  ------------------
  |  Branch (495:16): [True: 0, False: 35]
  ------------------
  496|      0|      return nullptr;
  497|     35|    return *p ? p : nullptr;
  ------------------
  |  Branch (497:12): [True: 35, False: 0]
  ------------------
  498|     35|  }
  499|      0|  return nullptr;
  500|     35|}

_ZN8PfxEntry7getNextEv:
  134|  2.77M|  inline PfxEntry* getNext() { return next; }
_ZN8SfxEntry7getNextEv:
  216|    228|  inline SfxEntry* getNext() { return next; }
_ZN8PfxEntry6getKeyEv:
  124|  88.2k|  const char* getKey() { return appnd.c_str(); }
_ZN8PfxEntry7getFlagEv:
  123|    883|  FLAG getFlag() { return aflag; }
_ZN8PfxEntry9setFlgNxtEPS_:
  142|      8|  inline void setFlgNxt(PfxEntry* ptr) { flgnxt = ptr; }
_ZN8PfxEntry7setNextEPS_:
  139|      8|  inline void setNext(PfxEntry* ptr) { next = ptr; }
_ZN8PfxEntry9setNextEQEPS_:
  141|     14|  inline void setNextEQ(PfxEntry* ptr) { nexteq = ptr; }
_ZN8PfxEntry9setNextNEEPS_:
  140|     16|  inline void setNextNE(PfxEntry* ptr) { nextne = ptr; }
_ZN8PfxEntry9getNextEQEv:
  136|  72.0k|  inline PfxEntry* getNextEQ() { return nexteq; }
_ZN8PfxEntry9getNextNEEv:
  135|  15.3k|  inline PfxEntry* getNextNE() { return nextne; }
_ZN8SfxEntry6getKeyEv:
  205|   443k|  const char* getKey() { return rappnd.c_str(); }
_ZN8SfxEntry7getFlagEv:
  204|   123k|  FLAG getFlag() { return aflag; }
_ZN8SfxEntry9setFlgNxtEPS_:
  228|     34|  inline void setFlgNxt(SfxEntry* ptr) { flgnxt = ptr; }
_ZN8SfxEntry7setNextEPS_:
  225|     34|  inline void setNext(SfxEntry* ptr) { next = ptr; }
_ZN8SfxEntry9setNextEQEPS_:
  227|     88|  inline void setNextEQ(SfxEntry* ptr) { nexteq = ptr; }
_ZN8SfxEntry9setNextNEEPS_:
  226|     80|  inline void setNextNE(SfxEntry* ptr) { nextne = ptr; }
_ZN8SfxEntry9getNextEQEv:
  218|   355k|  inline SfxEntry* getNextEQ() { return nexteq; }
_ZN8SfxEntry9getNextNEEv:
  217|  87.5k|  inline SfxEntry* getNextNE() { return nextne; }
_ZN8PfxEntry7getContEv:
  131|  4.25M|  inline const unsigned short* getCont() { return contclass; }
_ZN8PfxEntry10getContLenEv:
  132|  1.41M|  inline unsigned short getContLen() { return contclasslen; }
_ZN8SfxEntry7getContEv:
  210|   459k|  inline const unsigned short* getCont() { return contclass; }
_ZN8SfxEntry10getContLenEv:
  211|  48.7k|  inline unsigned short getContLen() { return contclasslen; }
_ZN8SfxEntry9getKeyLenEv:
  214|   166k|  inline int getKeyLen() { return appnd.size(); }
_ZN8SfxEntry9getFlgNxtEv:
  223|  64.6k|  inline SfxEntry* getFlgNxt() { return flgnxt; }
_ZN8SfxEntry8getAffixEv:
  212|  36.7k|  inline const char* getAffix() { return appnd.c_str(); }
_ZNK8SfxEntry10allowCrossEv:
  171|     22|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|     22|#define aeXPRODUCT (1 << 0)
  ------------------
_ZNK8PfxEntry10allowCrossEv:
   94|     12|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|     12|#define aeXPRODUCT (1 << 0)
  ------------------
_ZN8PfxEntry9getKeyLenEv:
  127|  2.62k|  inline int getKeyLen() { return appnd.size(); }
_ZN8PfxEntry9getFlgNxtEv:
  137|    875|  inline PfxEntry* getFlgNxt() { return flgnxt; }

_ZN8AffixMgrC2EPKcRKNSt3__16vectorINS2_10unique_ptrI7HashMgrNS2_14default_deleteIS5_EEEENS2_9allocatorIS8_EEEES1_:
   93|     38|  : alldic(ptr)
   94|     38|  , pHMgr(ptr[0].get()) {
   95|       |
   96|       |  // register hash manager and load affix data from aff file
   97|     38|  csconv = nullptr;
   98|     38|  utf8 = 0;
   99|     38|  complexprefixes = 0;
  100|     38|  parsedmaptable = false;
  101|     38|  parsedbreaktable = false;
  102|     38|  iconvtable = nullptr;
  103|     38|  oconvtable = nullptr;
  104|       |  // allow simplified compound forms (see 3rd field of CHECKCOMPOUNDPATTERN)
  105|     38|  simplifiedcpd = 0;
  106|     38|  parsedcheckcpd = false;
  107|     38|  parseddefcpd = false;
  108|     38|  phone = nullptr;
  109|     38|  compoundflag = FLAG_NULL;        // permits word in compound forms
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  110|     38|  compoundbegin = FLAG_NULL;       // may be first word in compound forms
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  111|     38|  compoundmiddle = FLAG_NULL;      // may be middle word in compound forms
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  112|     38|  compoundend = FLAG_NULL;         // may be last word in compound forms
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  113|     38|  compoundroot = FLAG_NULL;        // compound word signing flag
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  114|     38|  compoundpermitflag = FLAG_NULL;  // compound permitting flag for suffixed word
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  115|     38|  compoundforbidflag = FLAG_NULL;  // compound fordidden flag for suffixed word
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  116|     38|  compoundmoresuffixes = 0;        // allow more suffixes within compound words
  117|     38|  checkcompounddup = 0;            // forbid double words in compounds
  118|     38|  checkcompoundrep = 0;  // forbid bad compounds (may be non-compound word with
  119|       |                         // a REP substitution)
  120|     38|  checkcompoundcase =
  121|     38|      0;  // forbid upper and lowercase combinations at word bounds
  122|     38|  checkcompoundtriple = 0;  // forbid compounds with triple letters
  123|     38|  simplifiedtriple = 0;     // allow simplified triple letters in compounds
  124|       |                            // (Schiff+fahrt -> Schiffahrt)
  125|     38|  forbiddenword = FORBIDDENWORD;  // forbidden word signing flag
  ------------------
  |  |  127|     38|#define FORBIDDENWORD 65510
  ------------------
  126|     38|  nosuggest = FLAG_NULL;  // don't suggest words signed with NOSUGGEST flag
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  127|     38|  nongramsuggest = FLAG_NULL;
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  128|     38|  langnum = 0;  // language code (see http://l10n.openoffice.org/languages.html)
  129|     38|  needaffix = FLAG_NULL;  // forbidden root, allowed only with suffixes
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  130|     38|  cpdwordmax = -1;        // default: unlimited wordcount in compound words
  131|     38|  cpdmin = -1;            // undefined
  132|     38|  cpdmaxsyllable = 0;     // default: unlimited syllablecount in compound words
  133|     38|  pfxappnd = nullptr;     // previous prefix for counting syllables of the prefix BUG
  134|     38|  sfxappnd = nullptr;     // previous suffix for counting syllables of the suffix BUG
  135|     38|  sfxextra = 0;     // modifier for syllable count of sfxappnd BUG
  136|     38|  checknum = 0;               // checking numbers, and word with numbers
  137|     38|  havecontclass = 0;  // flags of possible continuing classes (double affix)
  138|       |  // LEMMA_PRESENT: not put root into the morphological output. Lemma presents
  139|       |  // in morhological description in dictionary file. It's often combined with
  140|       |  // PSEUDOROOT.
  141|     38|  lemma_present = FLAG_NULL;
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  142|     38|  circumfix = FLAG_NULL;
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  143|     38|  onlyincompound = FLAG_NULL;
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  144|     38|  maxngramsugs = -1;  // undefined
  145|     38|  maxdiff = -1;       // undefined
  146|     38|  onlymaxdiff = 0;
  147|     38|  maxcpdsugs = -1;  // undefined
  148|     38|  nosplitsugs = 0;
  149|     38|  sugswithdots = 0;
  150|     38|  keepcase = 0;
  151|     38|  forceucase = 0;
  152|     38|  warn = 0;
  153|     38|  forbidwarn = 0;
  154|     38|  checksharps = 0;
  155|     38|  substandard = FLAG_NULL;
  ------------------
  |  |   96|     38|#define FLAG_NULL 0x00
  ------------------
  156|     38|  fullstrip = 0;
  157|       |
  158|     38|  sfx = nullptr;
  159|     38|  pfx = nullptr;
  160|       |
  161|  9.76k|  for (int i = 0; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.76k|#define SETSIZE 256
  ------------------
  |  Branch (161:19): [True: 9.72k, False: 38]
  ------------------
  162|  9.72k|    pStart[i] = nullptr;
  163|  9.72k|    sStart[i] = nullptr;
  164|  9.72k|    pFlag[i] = nullptr;
  165|  9.72k|    sFlag[i] = nullptr;
  166|  9.72k|  }
  167|       |
  168|     38|  memset(contclasses, 0, CONTSIZE * sizeof(char));
  ------------------
  |  |   62|     38|#define CONTSIZE 65536
  ------------------
  169|       |
  170|     38|  if (parse_file(affpath, key)) {
  ------------------
  |  Branch (170:7): [True: 0, False: 38]
  ------------------
  171|      0|    fprintf(stderr, "Failure loading aff file %s\n", affpath);
  172|      0|  }
  173|       |
  174|       |  /* get encoding for CHECKCOMPOUNDCASE */
  175|     38|  if (!utf8) {
  ------------------
  |  Branch (175:7): [True: 20, False: 18]
  ------------------
  176|     20|    csconv = get_current_cs(get_encoding());
  177|  5.14k|    for (int i = 0; i <= 255; i++) {
  ------------------
  |  Branch (177:21): [True: 5.12k, False: 20]
  ------------------
  178|  5.12k|      if ((csconv[i].cupper != csconv[i].clower) &&
  ------------------
  |  Branch (178:11): [True: 2.24k, False: 2.88k]
  ------------------
  179|  2.24k|          (wordchars.find((char)i) == std::string::npos)) {
  ------------------
  |  Branch (179:11): [True: 2.24k, False: 0]
  ------------------
  180|  2.24k|        wordchars.push_back((char)i);
  181|  2.24k|      }
  182|  5.12k|    }
  183|     20|  }
  184|       |
  185|       |  // default BREAK definition
  186|     38|  if (!parsedbreaktable) {
  ------------------
  |  Branch (186:7): [True: 34, False: 4]
  ------------------
  187|     34|    breaktable.emplace_back("-");
  188|     34|    breaktable.emplace_back("^-");
  189|     34|    breaktable.emplace_back("-$");
  190|     34|    parsedbreaktable = true;
  191|     34|  }
  192|       |
  193|     38|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  194|       |  // not entirely sure this is invalid, so only for fuzzing for now
  195|     38|  if (iconvtable && !iconvtable->check_against_breaktable(breaktable)) {
  ------------------
  |  Branch (195:7): [True: 2, False: 36]
  |  Branch (195:21): [True: 0, False: 2]
  ------------------
  196|      0|      delete iconvtable;
  197|      0|      iconvtable = nullptr;
  198|      0|  }
  199|     38|#endif
  200|       |
  201|     38|  if (cpdmin == -1)
  ------------------
  |  Branch (201:7): [True: 34, False: 4]
  ------------------
  202|     34|    cpdmin = MINCPDLEN;
  ------------------
  |  |   88|     34|#define MINCPDLEN 3
  ------------------
  203|     38|}
_ZN8AffixMgr13finishFileMgrEP7FileMgr:
  260|     38|void AffixMgr::finishFileMgr(FileMgr* afflst) {
  261|     38|  delete afflst;
  262|       |
  263|       |  // convert affix trees to sorted list
  264|     38|  process_pfx_tree_to_list();
  265|     38|  process_sfx_tree_to_list();
  266|     38|}
_ZN8AffixMgr10parse_fileEPKcS1_:
  269|     38|int AffixMgr::parse_file(const char* affpath, const char* key) {
  270|       |
  271|       |  // checking flag duplication
  272|     38|  char dupflags[CONTSIZE];
  273|     38|  char dupflags_ini = 1;
  274|       |
  275|       |  // first line indicator for removing byte order mark
  276|     38|  int firstline = 1;
  277|       |
  278|       |  // open the affix file
  279|     38|  FileMgr* afflst = new FileMgr(affpath, key);
  280|       |
  281|       |  // step one is to parse the affix file building up the internal
  282|       |  // affix data structures
  283|       |
  284|       |  // read in each line ignoring any that do not
  285|       |  // start with a known line type indicator
  286|     38|  std::string line;
  287|    646|  while (afflst->getline(line)) {
  ------------------
  |  Branch (287:10): [True: 608, False: 38]
  ------------------
  288|    608|    mychomp(line);
  289|       |
  290|       |    /* remove byte order mark */
  291|    608|    if (firstline) {
  ------------------
  |  Branch (291:9): [True: 38, False: 570]
  ------------------
  292|     38|      firstline = 0;
  293|       |      // Affix file begins with byte order mark: possible incompatibility with
  294|       |      // old Hunspell versions
  295|     38|      if (line.compare(0, 3, "\xEF\xBB\xBF", 3) == 0) {
  ------------------
  |  Branch (295:11): [True: 0, False: 38]
  ------------------
  296|      0|        line.erase(0, 3);
  297|      0|      }
  298|     38|    }
  299|       |
  300|       |    /* parse in the keyboard string */
  301|    608|    if (line.compare(0, 3, "KEY", 3) == 0) {
  ------------------
  |  Branch (301:9): [True: 0, False: 608]
  ------------------
  302|      0|      if (!parse_string(line, keystring, afflst->getlinenum())) {
  ------------------
  |  Branch (302:11): [True: 0, False: 0]
  ------------------
  303|      0|        finishFileMgr(afflst);
  304|      0|        return 1;
  305|      0|      }
  306|      0|    }
  307|       |
  308|       |    /* parse in the try string */
  309|    608|    if (line.compare(0, 3, "TRY", 3) == 0) {
  ------------------
  |  Branch (309:9): [True: 2, False: 606]
  ------------------
  310|      2|      if (!parse_string(line, trystring, afflst->getlinenum())) {
  ------------------
  |  Branch (310:11): [True: 0, False: 2]
  ------------------
  311|      0|        finishFileMgr(afflst);
  312|      0|        return 1;
  313|      0|      }
  314|      2|    }
  315|       |
  316|       |    /* parse in the name of the character set used by the .dict and .aff */
  317|    608|    if (line.compare(0, 3, "SET", 3) == 0) {
  ------------------
  |  Branch (317:9): [True: 18, False: 590]
  ------------------
  318|     18|      if (!parse_string(line, encoding, afflst->getlinenum())) {
  ------------------
  |  Branch (318:11): [True: 0, False: 18]
  ------------------
  319|      0|        finishFileMgr(afflst);
  320|      0|        return 1;
  321|      0|      }
  322|     18|      if (encoding == "UTF-8") {
  ------------------
  |  Branch (322:11): [True: 18, False: 0]
  ------------------
  323|     18|        utf8 = 1;
  324|     18|      }
  325|     18|    }
  326|       |
  327|       |    /* parse COMPLEXPREFIXES for agglutinative languages with right-to-left
  328|       |     * writing system */
  329|    608|    if (line.compare(0, 15, "COMPLEXPREFIXES", 15) == 0)
  ------------------
  |  Branch (329:9): [True: 2, False: 606]
  ------------------
  330|      2|      complexprefixes = 1;
  331|       |
  332|       |    /* parse in the flag used by the controlled compound words */
  333|    608|    if (line.compare(0, 12, "COMPOUNDFLAG", 12) == 0) {
  ------------------
  |  Branch (333:9): [True: 8, False: 600]
  ------------------
  334|      8|      if (!parse_flag(line, &compoundflag, afflst)) {
  ------------------
  |  Branch (334:11): [True: 0, False: 8]
  ------------------
  335|      0|        finishFileMgr(afflst);
  336|      0|        return 1;
  337|      0|      }
  338|      8|    }
  339|       |
  340|       |    /* parse in the flag used by compound words */
  341|    608|    if (line.compare(0, 13, "COMPOUNDBEGIN", 13) == 0) {
  ------------------
  |  Branch (341:9): [True: 0, False: 608]
  ------------------
  342|      0|      if (complexprefixes) {
  ------------------
  |  Branch (342:11): [True: 0, False: 0]
  ------------------
  343|      0|        if (!parse_flag(line, &compoundend, afflst)) {
  ------------------
  |  Branch (343:13): [True: 0, False: 0]
  ------------------
  344|      0|          finishFileMgr(afflst);
  345|      0|          return 1;
  346|      0|        }
  347|      0|      } else {
  348|      0|        if (!parse_flag(line, &compoundbegin, afflst)) {
  ------------------
  |  Branch (348:13): [True: 0, False: 0]
  ------------------
  349|      0|          finishFileMgr(afflst);
  350|      0|          return 1;
  351|      0|        }
  352|      0|      }
  353|      0|    }
  354|       |
  355|       |    /* parse in the flag used by compound words */
  356|    608|    if (line.compare(0, 14, "COMPOUNDMIDDLE", 14) == 0) {
  ------------------
  |  Branch (356:9): [True: 0, False: 608]
  ------------------
  357|      0|      if (!parse_flag(line, &compoundmiddle, afflst)) {
  ------------------
  |  Branch (357:11): [True: 0, False: 0]
  ------------------
  358|      0|        finishFileMgr(afflst);
  359|      0|        return 1;
  360|      0|      }
  361|      0|    }
  362|       |
  363|       |    /* parse in the flag used by compound words */
  364|    608|    if (line.compare(0, 11, "COMPOUNDEND", 11) == 0) {
  ------------------
  |  Branch (364:9): [True: 0, False: 608]
  ------------------
  365|      0|      if (complexprefixes) {
  ------------------
  |  Branch (365:11): [True: 0, False: 0]
  ------------------
  366|      0|        if (!parse_flag(line, &compoundbegin, afflst)) {
  ------------------
  |  Branch (366:13): [True: 0, False: 0]
  ------------------
  367|      0|          finishFileMgr(afflst);
  368|      0|          return 1;
  369|      0|        }
  370|      0|      } else {
  371|      0|        if (!parse_flag(line, &compoundend, afflst)) {
  ------------------
  |  Branch (371:13): [True: 0, False: 0]
  ------------------
  372|      0|          finishFileMgr(afflst);
  373|      0|          return 1;
  374|      0|        }
  375|      0|      }
  376|      0|    }
  377|       |
  378|       |    /* parse in the data used by compound_check() method */
  379|    608|    if (line.compare(0, 15, "COMPOUNDWORDMAX", 15) == 0) {
  ------------------
  |  Branch (379:9): [True: 2, False: 606]
  ------------------
  380|      2|      if (!parse_num(line, &cpdwordmax, afflst)) {
  ------------------
  |  Branch (380:11): [True: 0, False: 2]
  ------------------
  381|      0|        finishFileMgr(afflst);
  382|      0|        return 1;
  383|      0|      }
  384|      2|    }
  385|       |
  386|       |    /* parse in the flag sign compounds in dictionary */
  387|    608|    if (line.compare(0, 12, "COMPOUNDROOT", 12) == 0) {
  ------------------
  |  Branch (387:9): [True: 0, False: 608]
  ------------------
  388|      0|      if (!parse_flag(line, &compoundroot, afflst)) {
  ------------------
  |  Branch (388:11): [True: 0, False: 0]
  ------------------
  389|      0|        finishFileMgr(afflst);
  390|      0|        return 1;
  391|      0|      }
  392|      0|    }
  393|       |
  394|       |    /* parse in the flag used by compound_check() method */
  395|    608|    if (line.compare(0, 18, "COMPOUNDPERMITFLAG", 18) == 0) {
  ------------------
  |  Branch (395:9): [True: 2, False: 606]
  ------------------
  396|      2|      if (!parse_flag(line, &compoundpermitflag, afflst)) {
  ------------------
  |  Branch (396:11): [True: 0, False: 2]
  ------------------
  397|      0|        finishFileMgr(afflst);
  398|      0|        return 1;
  399|      0|      }
  400|      2|    }
  401|       |
  402|       |    /* parse in the flag used by compound_check() method */
  403|    608|    if (line.compare(0, 18, "COMPOUNDFORBIDFLAG", 18) == 0) {
  ------------------
  |  Branch (403:9): [True: 2, False: 606]
  ------------------
  404|      2|      if (!parse_flag(line, &compoundforbidflag, afflst)) {
  ------------------
  |  Branch (404:11): [True: 0, False: 2]
  ------------------
  405|      0|        finishFileMgr(afflst);
  406|      0|        return 1;
  407|      0|      }
  408|      2|    }
  409|       |
  410|    608|    if (line.compare(0, 20, "COMPOUNDMORESUFFIXES", 20) == 0) {
  ------------------
  |  Branch (410:9): [True: 0, False: 608]
  ------------------
  411|      0|      compoundmoresuffixes = 1;
  412|      0|    }
  413|       |
  414|    608|    if (line.compare(0, 16, "CHECKCOMPOUNDDUP", 16) == 0) {
  ------------------
  |  Branch (414:9): [True: 0, False: 608]
  ------------------
  415|      0|      checkcompounddup = 1;
  416|      0|    }
  417|       |
  418|    608|    if (line.compare(0, 16, "CHECKCOMPOUNDREP", 16) == 0) {
  ------------------
  |  Branch (418:9): [True: 2, False: 606]
  ------------------
  419|      2|      checkcompoundrep = 1;
  420|      2|    }
  421|       |
  422|    608|    if (line.compare(0, 19, "CHECKCOMPOUNDTRIPLE", 19) == 0) {
  ------------------
  |  Branch (422:9): [True: 0, False: 608]
  ------------------
  423|      0|      checkcompoundtriple = 1;
  424|      0|    }
  425|       |
  426|    608|    if (line.compare(0, 16, "SIMPLIFIEDTRIPLE", 16) == 0) {
  ------------------
  |  Branch (426:9): [True: 0, False: 608]
  ------------------
  427|      0|      simplifiedtriple = 1;
  428|      0|    }
  429|       |
  430|    608|    if (line.compare(0, 17, "CHECKCOMPOUNDCASE", 17) == 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 608]
  ------------------
  431|      0|      checkcompoundcase = 1;
  432|      0|    }
  433|       |
  434|    608|    if (line.compare(0, 9, "NOSUGGEST", 9) == 0) {
  ------------------
  |  Branch (434:9): [True: 0, False: 608]
  ------------------
  435|      0|      if (!parse_flag(line, &nosuggest, afflst)) {
  ------------------
  |  Branch (435:11): [True: 0, False: 0]
  ------------------
  436|      0|        finishFileMgr(afflst);
  437|      0|        return 1;
  438|      0|      }
  439|      0|    }
  440|       |
  441|    608|    if (line.compare(0, 14, "NONGRAMSUGGEST", 14) == 0) {
  ------------------
  |  Branch (441:9): [True: 0, False: 608]
  ------------------
  442|      0|      if (!parse_flag(line, &nongramsuggest, afflst)) {
  ------------------
  |  Branch (442:11): [True: 0, False: 0]
  ------------------
  443|      0|        finishFileMgr(afflst);
  444|      0|        return 1;
  445|      0|      }
  446|      0|    }
  447|       |
  448|       |    /* parse in the flag used by forbidden words */
  449|    608|    if (line.compare(0, 13, "FORBIDDENWORD", 13) == 0) {
  ------------------
  |  Branch (449:9): [True: 2, False: 606]
  ------------------
  450|      2|      if (!parse_flag(line, &forbiddenword, afflst)) {
  ------------------
  |  Branch (450:11): [True: 0, False: 2]
  ------------------
  451|      0|        finishFileMgr(afflst);
  452|      0|        return 1;
  453|      0|      }
  454|      2|    }
  455|       |
  456|       |    /* parse in the flag used by forbidden words (is deprecated) */
  457|    608|    if (line.compare(0, 13, "LEMMA_PRESENT", 13) == 0) {
  ------------------
  |  Branch (457:9): [True: 0, False: 608]
  ------------------
  458|      0|      if (!parse_flag(line, &lemma_present, afflst)) {
  ------------------
  |  Branch (458:11): [True: 0, False: 0]
  ------------------
  459|      0|        finishFileMgr(afflst);
  460|      0|        return 1;
  461|      0|      }
  462|      0|    }
  463|       |
  464|       |    /* parse in the flag used by circumfixes */
  465|    608|    if (line.compare(0, 9, "CIRCUMFIX", 9) == 0) {
  ------------------
  |  Branch (465:9): [True: 2, False: 606]
  ------------------
  466|      2|      if (!parse_flag(line, &circumfix, afflst)) {
  ------------------
  |  Branch (466:11): [True: 0, False: 2]
  ------------------
  467|      0|        finishFileMgr(afflst);
  468|      0|        return 1;
  469|      0|      }
  470|      2|    }
  471|       |
  472|       |    /* parse in the flag used by fogemorphemes */
  473|    608|    if (line.compare(0, 14, "ONLYINCOMPOUND", 14) == 0) {
  ------------------
  |  Branch (473:9): [True: 0, False: 608]
  ------------------
  474|      0|      if (!parse_flag(line, &onlyincompound, afflst)) {
  ------------------
  |  Branch (474:11): [True: 0, False: 0]
  ------------------
  475|      0|        finishFileMgr(afflst);
  476|      0|        return 1;
  477|      0|      }
  478|      0|    }
  479|       |
  480|       |    /* parse in the flag used by `needaffixs' (is deprecated) */
  481|    608|    if (line.compare(0, 10, "PSEUDOROOT", 10) == 0) {
  ------------------
  |  Branch (481:9): [True: 0, False: 608]
  ------------------
  482|      0|      if (!parse_flag(line, &needaffix, afflst)) {
  ------------------
  |  Branch (482:11): [True: 0, False: 0]
  ------------------
  483|      0|        finishFileMgr(afflst);
  484|      0|        return 1;
  485|      0|      }
  486|      0|    }
  487|       |
  488|       |    /* parse in the flag used by `needaffixs' */
  489|    608|    if (line.compare(0, 9, "NEEDAFFIX", 9) == 0) {
  ------------------
  |  Branch (489:9): [True: 2, False: 606]
  ------------------
  490|      2|      if (!parse_flag(line, &needaffix, afflst)) {
  ------------------
  |  Branch (490:11): [True: 0, False: 2]
  ------------------
  491|      0|        finishFileMgr(afflst);
  492|      0|        return 1;
  493|      0|      }
  494|      2|    }
  495|       |
  496|       |    /* parse in the minimal length for words in compounds */
  497|    608|    if (line.compare(0, 11, "COMPOUNDMIN", 11) == 0) {
  ------------------
  |  Branch (497:9): [True: 4, False: 604]
  ------------------
  498|      4|      if (!parse_num(line, &cpdmin, afflst)) {
  ------------------
  |  Branch (498:11): [True: 0, False: 4]
  ------------------
  499|      0|        finishFileMgr(afflst);
  500|      0|        return 1;
  501|      0|      }
  502|      4|      if (cpdmin < 1)
  ------------------
  |  Branch (502:11): [True: 0, False: 4]
  ------------------
  503|      0|        cpdmin = 1;
  504|      4|    }
  505|       |
  506|       |    /* parse in the max. words and syllables in compounds */
  507|    608|    if (line.compare(0, 16, "COMPOUNDSYLLABLE", 16) == 0) {
  ------------------
  |  Branch (507:9): [True: 2, False: 606]
  ------------------
  508|      2|      if (!parse_cpdsyllable(line, afflst)) {
  ------------------
  |  Branch (508:11): [True: 0, False: 2]
  ------------------
  509|      0|        finishFileMgr(afflst);
  510|      0|        return 1;
  511|      0|      }
  512|      2|    }
  513|       |
  514|       |    /* parse in the flag used by compound_check() method */
  515|    608|    if (line.compare(0, 11, "SYLLABLENUM", 11) == 0) {
  ------------------
  |  Branch (515:9): [True: 0, False: 608]
  ------------------
  516|      0|      if (!parse_string(line, cpdsyllablenum, afflst->getlinenum())) {
  ------------------
  |  Branch (516:11): [True: 0, False: 0]
  ------------------
  517|      0|        finishFileMgr(afflst);
  518|      0|        return 1;
  519|      0|      }
  520|      0|    }
  521|       |
  522|       |    /* parse in the flag used by the controlled compound words */
  523|    608|    if (line.compare(0, 8, "CHECKNUM", 8) == 0) {
  ------------------
  |  Branch (523:9): [True: 0, False: 608]
  ------------------
  524|      0|      checknum = 1;
  525|      0|    }
  526|       |
  527|       |    /* parse in the extra word characters */
  528|    608|    if (line.compare(0, 9, "WORDCHARS", 9) == 0) {
  ------------------
  |  Branch (528:9): [True: 6, False: 602]
  ------------------
  529|      6|      if (!parse_array(line, wordchars, wordchars_utf16,
  ------------------
  |  Branch (529:11): [True: 0, False: 6]
  ------------------
  530|      6|                       utf8, afflst->getlinenum())) {
  531|      0|        finishFileMgr(afflst);
  532|      0|        return 1;
  533|      0|      }
  534|      6|    }
  535|       |
  536|       |    /* parse in the ignored characters (for example, Arabic optional diacretics
  537|       |     * charachters */
  538|    608|    if (line.compare(0, 6, "IGNORE", 6) == 0) {
  ------------------
  |  Branch (538:9): [True: 4, False: 604]
  ------------------
  539|      4|      if (!parse_array(line, ignorechars, ignorechars_utf16,
  ------------------
  |  Branch (539:11): [True: 0, False: 4]
  ------------------
  540|      4|                       utf8, afflst->getlinenum())) {
  541|      0|        finishFileMgr(afflst);
  542|      0|        return 1;
  543|      0|      }
  544|      4|    }
  545|       |
  546|       |    /* parse in the input conversion table */
  547|    608|    if (line.compare(0, 5, "ICONV", 5) == 0) {
  ------------------
  |  Branch (547:9): [True: 2, False: 606]
  ------------------
  548|      2|      if (!parse_convtable(line, afflst, &iconvtable, "ICONV")) {
  ------------------
  |  Branch (548:11): [True: 0, False: 2]
  ------------------
  549|      0|        finishFileMgr(afflst);
  550|      0|        return 1;
  551|      0|      }
  552|      2|    }
  553|       |
  554|       |    /* parse in the output conversion table */
  555|    608|    if (line.compare(0, 5, "OCONV", 5) == 0) {
  ------------------
  |  Branch (555:9): [True: 2, False: 606]
  ------------------
  556|      2|      if (!parse_convtable(line, afflst, &oconvtable, "OCONV")) {
  ------------------
  |  Branch (556:11): [True: 0, False: 2]
  ------------------
  557|      0|        finishFileMgr(afflst);
  558|      0|        return 1;
  559|      0|      }
  560|      2|    }
  561|       |
  562|       |    /* parse in the phonetic translation table */
  563|    608|    if (line.compare(0, 5, "PHONE", 5) == 0) {
  ------------------
  |  Branch (563:9): [True: 2, False: 606]
  ------------------
  564|      2|      if (!parse_phonetable(line, afflst)) {
  ------------------
  |  Branch (564:11): [True: 0, False: 2]
  ------------------
  565|      0|        finishFileMgr(afflst);
  566|      0|        return 1;
  567|      0|      }
  568|      2|    }
  569|       |
  570|       |    /* parse in the checkcompoundpattern table */
  571|    608|    if (line.compare(0, 20, "CHECKCOMPOUNDPATTERN", 20) == 0) {
  ------------------
  |  Branch (571:9): [True: 2, False: 606]
  ------------------
  572|      2|      if (!parse_checkcpdtable(line, afflst)) {
  ------------------
  |  Branch (572:11): [True: 0, False: 2]
  ------------------
  573|      0|        finishFileMgr(afflst);
  574|      0|        return 1;
  575|      0|      }
  576|      2|    }
  577|       |
  578|       |    /* parse in the defcompound table */
  579|    608|    if (line.compare(0, 12, "COMPOUNDRULE", 12) == 0) {
  ------------------
  |  Branch (579:9): [True: 0, False: 608]
  ------------------
  580|      0|      if (!parse_defcpdtable(line, afflst)) {
  ------------------
  |  Branch (580:11): [True: 0, False: 0]
  ------------------
  581|      0|        finishFileMgr(afflst);
  582|      0|        return 1;
  583|      0|      }
  584|      0|    }
  585|       |
  586|       |    /* parse in the related character map table */
  587|    608|    if (line.compare(0, 3, "MAP", 3) == 0) {
  ------------------
  |  Branch (587:9): [True: 2, False: 606]
  ------------------
  588|      2|      if (!parse_maptable(line, afflst)) {
  ------------------
  |  Branch (588:11): [True: 0, False: 2]
  ------------------
  589|      0|        finishFileMgr(afflst);
  590|      0|        return 1;
  591|      0|      }
  592|      2|    }
  593|       |
  594|       |    /* parse in the word breakpoints table */
  595|    608|    if (line.compare(0, 5, "BREAK", 5) == 0) {
  ------------------
  |  Branch (595:9): [True: 4, False: 604]
  ------------------
  596|      4|      if (!parse_breaktable(line, afflst)) {
  ------------------
  |  Branch (596:11): [True: 0, False: 4]
  ------------------
  597|      0|        finishFileMgr(afflst);
  598|      0|        return 1;
  599|      0|      }
  600|      4|    }
  601|       |
  602|       |    /* parse in the language for language specific codes */
  603|    608|    if (line.compare(0, 4, "LANG", 4) == 0) {
  ------------------
  |  Branch (603:9): [True: 2, False: 606]
  ------------------
  604|      2|      if (!parse_string(line, lang, afflst->getlinenum())) {
  ------------------
  |  Branch (604:11): [True: 0, False: 2]
  ------------------
  605|      0|        finishFileMgr(afflst);
  606|      0|        return 1;
  607|      0|      }
  608|      2|      langnum = get_lang_num(lang);
  609|      2|    }
  610|       |
  611|    608|    if (line.compare(0, 7, "VERSION", 7) == 0) {
  ------------------
  |  Branch (611:9): [True: 0, False: 608]
  ------------------
  612|      0|      size_t startpos = line.find_first_not_of(" \t", 7);
  613|      0|      if (startpos != std::string::npos) {
  ------------------
  |  Branch (613:11): [True: 0, False: 0]
  ------------------
  614|      0|          version = line.substr(startpos);
  615|      0|      }
  616|      0|    }
  617|       |
  618|    608|    if (line.compare(0, 12, "MAXNGRAMSUGS", 12) == 0) {
  ------------------
  |  Branch (618:9): [True: 4, False: 604]
  ------------------
  619|      4|      if (!parse_num(line, &maxngramsugs, afflst)) {
  ------------------
  |  Branch (619:11): [True: 0, False: 4]
  ------------------
  620|      0|        finishFileMgr(afflst);
  621|      0|        return 1;
  622|      0|      }
  623|      4|    }
  624|       |
  625|    608|    if (line.compare(0, 11, "ONLYMAXDIFF", 11) == 0)
  ------------------
  |  Branch (625:9): [True: 0, False: 608]
  ------------------
  626|      0|      onlymaxdiff = 1;
  627|       |
  628|    608|    if (line.compare(0, 7, "MAXDIFF", 7) == 0) {
  ------------------
  |  Branch (628:9): [True: 0, False: 608]
  ------------------
  629|      0|      if (!parse_num(line, &maxdiff, afflst)) {
  ------------------
  |  Branch (629:11): [True: 0, False: 0]
  ------------------
  630|      0|        finishFileMgr(afflst);
  631|      0|        return 1;
  632|      0|      }
  633|      0|    }
  634|       |
  635|    608|    if (line.compare(0, 10, "MAXCPDSUGS", 10) == 0) {
  ------------------
  |  Branch (635:9): [True: 0, False: 608]
  ------------------
  636|      0|      if (!parse_num(line, &maxcpdsugs, afflst)) {
  ------------------
  |  Branch (636:11): [True: 0, False: 0]
  ------------------
  637|      0|        finishFileMgr(afflst);
  638|      0|        return 1;
  639|      0|      }
  640|      0|    }
  641|       |
  642|    608|    if (line.compare(0, 11, "NOSPLITSUGS", 11) == 0) {
  ------------------
  |  Branch (642:9): [True: 0, False: 608]
  ------------------
  643|      0|      nosplitsugs = 1;
  644|      0|    }
  645|       |
  646|    608|    if (line.compare(0, 9, "FULLSTRIP", 9) == 0) {
  ------------------
  |  Branch (646:9): [True: 0, False: 608]
  ------------------
  647|      0|      fullstrip = 1;
  648|      0|    }
  649|       |
  650|    608|    if (line.compare(0, 12, "SUGSWITHDOTS", 12) == 0) {
  ------------------
  |  Branch (650:9): [True: 0, False: 608]
  ------------------
  651|      0|      sugswithdots = 1;
  652|      0|    }
  653|       |
  654|       |    /* parse in the flag used by forbidden words */
  655|    608|    if (line.compare(0, 8, "KEEPCASE", 8) == 0) {
  ------------------
  |  Branch (655:9): [True: 2, False: 606]
  ------------------
  656|      2|      if (!parse_flag(line, &keepcase, afflst)) {
  ------------------
  |  Branch (656:11): [True: 0, False: 2]
  ------------------
  657|      0|        finishFileMgr(afflst);
  658|      0|        return 1;
  659|      0|      }
  660|      2|    }
  661|       |
  662|       |    /* parse in the flag used by `forceucase' */
  663|    608|    if (line.compare(0, 10, "FORCEUCASE", 10) == 0) {
  ------------------
  |  Branch (663:9): [True: 0, False: 608]
  ------------------
  664|      0|      if (!parse_flag(line, &forceucase, afflst)) {
  ------------------
  |  Branch (664:11): [True: 0, False: 0]
  ------------------
  665|      0|        finishFileMgr(afflst);
  666|      0|        return 1;
  667|      0|      }
  668|      0|    }
  669|       |
  670|       |    /* parse in the flag used by `warn' */
  671|    608|    if (line.compare(0, 4, "WARN", 4) == 0) {
  ------------------
  |  Branch (671:9): [True: 2, False: 606]
  ------------------
  672|      2|      if (!parse_flag(line, &warn, afflst)) {
  ------------------
  |  Branch (672:11): [True: 0, False: 2]
  ------------------
  673|      0|        finishFileMgr(afflst);
  674|      0|        return 1;
  675|      0|      }
  676|      2|    }
  677|       |
  678|    608|    if (line.compare(0, 10, "FORBIDWARN", 10) == 0) {
  ------------------
  |  Branch (678:9): [True: 0, False: 608]
  ------------------
  679|      0|      forbidwarn = 1;
  680|      0|    }
  681|       |
  682|       |    /* parse in the flag used by the affix generator */
  683|    608|    if (line.compare(0, 11, "SUBSTANDARD", 11) == 0) {
  ------------------
  |  Branch (683:9): [True: 0, False: 608]
  ------------------
  684|      0|      if (!parse_flag(line, &substandard, afflst)) {
  ------------------
  |  Branch (684:11): [True: 0, False: 0]
  ------------------
  685|      0|        finishFileMgr(afflst);
  686|      0|        return 1;
  687|      0|      }
  688|      0|    }
  689|       |
  690|    608|    if (line.compare(0, 11, "CHECKSHARPS", 11) == 0) {
  ------------------
  |  Branch (690:9): [True: 0, False: 608]
  ------------------
  691|      0|      checksharps = 1;
  692|      0|    }
  693|       |
  694|       |    /* parse this affix: P - prefix, S - suffix */
  695|       |    // affix type
  696|    608|    char ft = ' ';
  697|    608|    if (line.compare(0, 3, "PFX", 3) == 0)
  ------------------
  |  Branch (697:9): [True: 12, False: 596]
  ------------------
  698|     12|      ft = complexprefixes ? 'S' : 'P';
  ------------------
  |  Branch (698:12): [True: 4, False: 8]
  ------------------
  699|    608|    if (line.compare(0, 3, "SFX", 3) == 0)
  ------------------
  |  Branch (699:9): [True: 14, False: 594]
  ------------------
  700|     14|      ft = complexprefixes ? 'P' : 'S';
  ------------------
  |  Branch (700:12): [True: 0, False: 14]
  ------------------
  701|    608|    if (ft != ' ') {
  ------------------
  |  Branch (701:9): [True: 26, False: 582]
  ------------------
  702|     26|      if (dupflags_ini) {
  ------------------
  |  Branch (702:11): [True: 18, False: 8]
  ------------------
  703|     18|        memset(dupflags, 0, sizeof(dupflags));
  704|     18|        dupflags_ini = 0;
  705|     18|      }
  706|     26|      if (!parse_affix(line, ft, afflst, dupflags)) {
  ------------------
  |  Branch (706:11): [True: 0, False: 26]
  ------------------
  707|      0|        finishFileMgr(afflst);
  708|      0|        return 1;
  709|      0|      }
  710|     26|    }
  711|    608|  }
  712|       |
  713|     38|  finishFileMgr(afflst);
  714|       |  // affix trees are sorted now
  715|       |
  716|       |  // now we can speed up performance greatly taking advantage of the
  717|       |  // relationship between the affixes and the idea of "subsets".
  718|       |
  719|       |  // View each prefix as a potential leading subset of another and view
  720|       |  // each suffix (reversed) as a potential trailing subset of another.
  721|       |
  722|       |  // To illustrate this relationship if we know the prefix "ab" is found in the
  723|       |  // word to examine, only prefixes that "ab" is a leading subset of need be
  724|       |  // examined.
  725|       |  // Furthermore is "ab" is not present then none of the prefixes that "ab" is
  726|       |  // is a subset need be examined.
  727|       |  // The same argument goes for suffix string that are reversed.
  728|       |
  729|       |  // Then to top this off why not examine the first char of the word to quickly
  730|       |  // limit the set of prefixes to examine (i.e. the prefixes to examine must
  731|       |  // be leading supersets of the first character of the word (if they exist)
  732|       |
  733|       |  // To take advantage of this "subset" relationship, we need to add two links
  734|       |  // from entry.  One to take next if the current prefix is found (call it
  735|       |  // nexteq)
  736|       |  // and one to take next if the current prefix is not found (call it nextne).
  737|       |
  738|       |  // Since we have built ordered lists, all that remains is to properly
  739|       |  // initialize
  740|       |  // the nextne and nexteq pointers that relate them
  741|       |
  742|     38|  process_pfx_order();
  743|     38|  process_sfx_order();
  744|       |
  745|     38|  return 0;
  746|     38|}
_ZN8AffixMgr13build_pfxtreeEP8PfxEntry:
  752|      8|int AffixMgr::build_pfxtree(PfxEntry* pfxptr) {
  753|      8|  PfxEntry* ptr;
  754|      8|  PfxEntry* pptr;
  755|      8|  PfxEntry* ep = pfxptr;
  756|       |
  757|       |  // get the right starting points
  758|      8|  const char* key = ep->getKey();
  759|      8|  const auto flg = (unsigned char)(ep->getFlag() & 0x00FF);
  760|       |
  761|       |  // first index by flag which must exist
  762|      8|  ptr = pFlag[flg];
  763|      8|  ep->setFlgNxt(ptr);
  764|      8|  pFlag[flg] = ep;
  765|       |
  766|       |  // handle the special case of null affix string
  767|      8|  if (*key == '\0') {
  ------------------
  |  Branch (767:7): [True: 2, False: 6]
  ------------------
  768|       |    // always inset them at head of list at element 0
  769|      2|    ptr = pStart[0];
  770|      2|    ep->setNext(ptr);
  771|      2|    pStart[0] = ep;
  772|      2|    return 0;
  773|      2|  }
  774|       |
  775|       |  // now handle the normal case
  776|      6|  ep->setNextEQ(nullptr);
  777|      6|  ep->setNextNE(nullptr);
  778|       |
  779|      6|  unsigned char sp = *((const unsigned char*)key);
  780|      6|  ptr = pStart[sp];
  781|       |
  782|       |  // handle the first insert
  783|      6|  if (!ptr) {
  ------------------
  |  Branch (783:7): [True: 4, False: 2]
  ------------------
  784|      4|    pStart[sp] = ep;
  785|      4|    return 0;
  786|      4|  }
  787|       |
  788|       |  // otherwise use binary tree insertion so that a sorted
  789|       |  // list can easily be generated later
  790|      2|  pptr = nullptr;
  791|      2|  for (;;) {
  792|      2|    pptr = ptr;
  793|      2|    if (strcmp(ep->getKey(), ptr->getKey()) <= 0) {
  ------------------
  |  Branch (793:9): [True: 0, False: 2]
  ------------------
  794|      0|      ptr = ptr->getNextEQ();
  795|      0|      if (!ptr) {
  ------------------
  |  Branch (795:11): [True: 0, False: 0]
  ------------------
  796|      0|        pptr->setNextEQ(ep);
  797|      0|        break;
  798|      0|      }
  799|      2|    } else {
  800|      2|      ptr = ptr->getNextNE();
  801|      2|      if (!ptr) {
  ------------------
  |  Branch (801:11): [True: 2, False: 0]
  ------------------
  802|      2|        pptr->setNextNE(ep);
  803|      2|        break;
  804|      2|      }
  805|      2|    }
  806|      2|  }
  807|      2|  return 0;
  808|      6|}
_ZN8AffixMgr13build_sfxtreeEP8SfxEntry:
  813|     34|int AffixMgr::build_sfxtree(SfxEntry* sfxptr) {
  814|       |
  815|     34|  sfxptr->initReverseWord();
  816|       |
  817|     34|  SfxEntry* ptr;
  818|     34|  SfxEntry* pptr;
  819|     34|  SfxEntry* ep = sfxptr;
  820|       |
  821|       |  /* get the right starting point */
  822|     34|  const char* key = ep->getKey();
  823|     34|  const auto flg = (unsigned char)(ep->getFlag() & 0x00FF);
  824|       |
  825|       |  // first index by flag which must exist
  826|     34|  ptr = sFlag[flg];
  827|     34|  ep->setFlgNxt(ptr);
  828|     34|  sFlag[flg] = ep;
  829|       |
  830|       |  // next index by affix string
  831|       |
  832|       |  // handle the special case of null affix string
  833|     34|  if (*key == '\0') {
  ------------------
  |  Branch (833:7): [True: 0, False: 34]
  ------------------
  834|       |    // always inset them at head of list at element 0
  835|      0|    ptr = sStart[0];
  836|      0|    ep->setNext(ptr);
  837|      0|    sStart[0] = ep;
  838|      0|    return 0;
  839|      0|  }
  840|       |
  841|       |  // now handle the normal case
  842|     34|  ep->setNextEQ(nullptr);
  843|     34|  ep->setNextNE(nullptr);
  844|       |
  845|     34|  unsigned char sp = *((const unsigned char*)key);
  846|     34|  ptr = sStart[sp];
  847|       |
  848|       |  // handle the first insert
  849|     34|  if (!ptr) {
  ------------------
  |  Branch (849:7): [True: 22, False: 12]
  ------------------
  850|     22|    sStart[sp] = ep;
  851|     22|    return 0;
  852|     22|  }
  853|       |
  854|       |  // otherwise use binary tree insertion so that a sorted
  855|       |  // list can easily be generated later
  856|     12|  pptr = nullptr;
  857|     20|  for (;;) {
  858|     20|    pptr = ptr;
  859|     20|    if (strcmp(ep->getKey(), ptr->getKey()) <= 0) {
  ------------------
  |  Branch (859:9): [True: 18, False: 2]
  ------------------
  860|     18|      ptr = ptr->getNextEQ();
  861|     18|      if (!ptr) {
  ------------------
  |  Branch (861:11): [True: 10, False: 8]
  ------------------
  862|     10|        pptr->setNextEQ(ep);
  863|     10|        break;
  864|     10|      }
  865|     18|    } else {
  866|      2|      ptr = ptr->getNextNE();
  867|      2|      if (!ptr) {
  ------------------
  |  Branch (867:11): [True: 2, False: 0]
  ------------------
  868|      2|        pptr->setNextNE(ep);
  869|      2|        break;
  870|      2|      }
  871|      2|    }
  872|     20|  }
  873|     12|  return 0;
  874|     34|}
_ZN8AffixMgr24process_pfx_tree_to_listEv:
  877|     38|int AffixMgr::process_pfx_tree_to_list() {
  878|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (878:19): [True: 9.69k, False: 38]
  ------------------
  879|  9.69k|    pStart[i] = process_pfx_in_order(pStart[i], nullptr);
  880|  9.69k|  }
  881|     38|  return 0;
  882|     38|}
_ZN8AffixMgr20process_pfx_in_orderEP8PfxEntryS1_:
  884|  9.70k|PfxEntry* AffixMgr::process_pfx_in_order(PfxEntry* ptr, PfxEntry* nptr) {
  885|  9.70k|  if (ptr) {
  ------------------
  |  Branch (885:7): [True: 6, False: 9.69k]
  ------------------
  886|      6|    nptr = process_pfx_in_order(ptr->getNextNE(), nptr);
  887|      6|    ptr->setNext(nptr);
  888|      6|    nptr = process_pfx_in_order(ptr->getNextEQ(), ptr);
  889|      6|  }
  890|  9.70k|  return nptr;
  891|  9.70k|}
_ZN8AffixMgr24process_sfx_tree_to_listEv:
  894|     38|int AffixMgr::process_sfx_tree_to_list() {
  895|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (895:19): [True: 9.69k, False: 38]
  ------------------
  896|  9.69k|    sStart[i] = process_sfx_in_order(sStart[i], nullptr);
  897|  9.69k|  }
  898|     38|  return 0;
  899|     38|}
_ZN8AffixMgr20process_sfx_in_orderEP8SfxEntryS1_:
  901|  9.75k|SfxEntry* AffixMgr::process_sfx_in_order(SfxEntry* ptr, SfxEntry* nptr) {
  902|  9.75k|  if (ptr) {
  ------------------
  |  Branch (902:7): [True: 34, False: 9.72k]
  ------------------
  903|     34|    nptr = process_sfx_in_order(ptr->getNextNE(), nptr);
  904|     34|    ptr->setNext(nptr);
  905|     34|    nptr = process_sfx_in_order(ptr->getNextEQ(), ptr);
  906|     34|  }
  907|  9.75k|  return nptr;
  908|  9.75k|}
_ZN8AffixMgr17process_pfx_orderEv:
  912|     38|int AffixMgr::process_pfx_order() {
  913|     38|  PfxEntry* ptr;
  914|       |
  915|       |  // loop through each prefix list starting point
  916|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (916:19): [True: 9.69k, False: 38]
  ------------------
  917|  9.69k|    ptr = pStart[i];
  918|       |
  919|       |    // look through the remainder of the list
  920|       |    //  and find next entry with affix that
  921|       |    // the current one is not a subset of
  922|       |    // mark that as destination for NextNE
  923|       |    // use next in list that you are a subset
  924|       |    // of as NextEQ
  925|       |
  926|  9.69k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (926:12): [True: 6, False: 9.69k]
  ------------------
  927|      6|      PfxEntry* nptr = ptr->getNext();
  928|      8|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (928:14): [True: 2, False: 6]
  ------------------
  929|      2|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (929:13): [True: 0, False: 2]
  ------------------
  930|      0|          break;
  931|      2|      }
  932|      6|      ptr->setNextNE(nptr);
  933|      6|      ptr->setNextEQ(nullptr);
  934|      6|      if ((ptr->getNext()) &&
  ------------------
  |  Branch (934:11): [True: 2, False: 4]
  ------------------
  935|      2|          isSubset(ptr->getKey(), (ptr->getNext())->getKey()))
  ------------------
  |  Branch (935:11): [True: 2, False: 0]
  ------------------
  936|      2|        ptr->setNextEQ(ptr->getNext());
  937|      6|    }
  938|       |
  939|       |    // now clean up by adding smart search termination strings:
  940|       |    // if you are already a superset of the previous prefix
  941|       |    // but not a subset of the next, search can end here
  942|       |    // so set NextNE properly
  943|       |
  944|  9.69k|    ptr = pStart[i];
  945|  9.69k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (945:12): [True: 6, False: 9.69k]
  ------------------
  946|      6|      PfxEntry* nptr = ptr->getNext();
  947|      6|      PfxEntry* mptr = nullptr;
  948|      8|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (948:14): [True: 2, False: 6]
  ------------------
  949|      2|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (949:13): [True: 0, False: 2]
  ------------------
  950|      0|          break;
  951|      2|        mptr = nptr;
  952|      2|      }
  953|      6|      if (mptr)
  ------------------
  |  Branch (953:11): [True: 2, False: 4]
  ------------------
  954|      2|        mptr->setNextNE(nullptr);
  955|      6|    }
  956|  9.69k|  }
  957|     38|  return 0;
  958|     38|}
_ZN8AffixMgr17process_sfx_orderEv:
  962|     38|int AffixMgr::process_sfx_order() {
  963|     38|  SfxEntry* ptr;
  964|       |
  965|       |  // loop through each prefix list starting point
  966|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (966:19): [True: 9.69k, False: 38]
  ------------------
  967|  9.69k|    ptr = sStart[i];
  968|       |
  969|       |    // look through the remainder of the list
  970|       |    //  and find next entry with affix that
  971|       |    // the current one is not a subset of
  972|       |    // mark that as destination for NextNE
  973|       |    // use next in list that you are a subset
  974|       |    // of as NextEQ
  975|       |
  976|  9.72k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (976:12): [True: 34, False: 9.69k]
  ------------------
  977|     34|      SfxEntry* nptr = ptr->getNext();
  978|     52|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (978:14): [True: 20, False: 32]
  ------------------
  979|     20|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (979:13): [True: 2, False: 18]
  ------------------
  980|      2|          break;
  981|     20|      }
  982|     34|      ptr->setNextNE(nptr);
  983|     34|      ptr->setNextEQ(nullptr);
  984|     34|      if ((ptr->getNext()) &&
  ------------------
  |  Branch (984:11): [True: 12, False: 22]
  ------------------
  985|     12|          isSubset(ptr->getKey(), (ptr->getNext())->getKey()))
  ------------------
  |  Branch (985:11): [True: 10, False: 2]
  ------------------
  986|     10|        ptr->setNextEQ(ptr->getNext());
  987|     34|    }
  988|       |
  989|       |    // now clean up by adding smart search termination strings:
  990|       |    // if you are already a superset of the previous suffix
  991|       |    // but not a subset of the next, search can end here
  992|       |    // so set NextNE properly
  993|       |
  994|  9.69k|    ptr = sStart[i];
  995|  9.72k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (995:12): [True: 34, False: 9.69k]
  ------------------
  996|     34|      SfxEntry* nptr = ptr->getNext();
  997|     34|      SfxEntry* mptr = nullptr;
  998|     52|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (998:14): [True: 20, False: 32]
  ------------------
  999|     20|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (999:13): [True: 2, False: 18]
  ------------------
 1000|      2|          break;
 1001|     18|        mptr = nptr;
 1002|     18|      }
 1003|     34|      if (mptr)
  ------------------
  |  Branch (1003:11): [True: 10, False: 24]
  ------------------
 1004|     10|        mptr->setNextNE(nullptr);
 1005|     34|    }
 1006|  9.69k|  }
 1007|     38|  return 0;
 1008|     38|}
_ZN8AffixMgr7condlenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1021|      8|int AffixMgr::condlen(const std::string& s) {
 1022|      8|  int l = 0;
 1023|      8|  bool group = false;
 1024|      8|  size_t i = 0;
 1025|     42|  while (i < s.size()) {
  ------------------
  |  Branch (1025:10): [True: 34, False: 8]
  ------------------
 1026|     34|    if (s[i] == '[') {
  ------------------
  |  Branch (1026:9): [True: 4, False: 30]
  ------------------
 1027|      4|      group = true;
 1028|      4|      ++l;
 1029|      4|      ++i;
 1030|     30|    } else if (s[i] == ']') {
  ------------------
  |  Branch (1030:16): [True: 4, False: 26]
  ------------------
 1031|      4|      group = false;
 1032|      4|      ++i;
 1033|     26|    } else if (group) {
  ------------------
  |  Branch (1033:16): [True: 18, False: 8]
  ------------------
 1034|     18|      ++i;
 1035|     18|    } else {
 1036|      8|      ++l;
 1037|      8|      i = utf8 ? utf8_next(s, i) : i + 1;
  ------------------
  |  Branch (1037:11): [True: 8, False: 0]
  ------------------
 1038|      8|    }
 1039|     34|  }
 1040|      8|  return l;
 1041|      8|}
_ZN8AffixMgr8encodeitER8AffEntryRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1043|     42|int AffixMgr::encodeit(AffEntry& entry, const std::string& cs) {
 1044|     42|  if (cs.compare(".") != 0) {
  ------------------
  |  Branch (1044:7): [True: 8, False: 34]
  ------------------
 1045|      8|    entry.numconds = (char)condlen(cs);
 1046|      8|    const size_t cslen = cs.size();
 1047|      8|    const size_t short_part = std::min<size_t>(MAXCONDLEN, cslen);
  ------------------
  |  |   90|      8|#define MAXCONDLEN 20
  ------------------
 1048|      8|    memcpy(entry.c.conds, cs.data(), short_part);
 1049|      8|    if (short_part < MAXCONDLEN) {
  ------------------
  |  |   90|      8|#define MAXCONDLEN 20
  ------------------
  |  Branch (1049:9): [True: 8, False: 0]
  ------------------
 1050|       |      //blank out the remaining space
 1051|      8|      memset(entry.c.conds + short_part, 0, MAXCONDLEN - short_part);
  ------------------
  |  |   90|      8|#define MAXCONDLEN 20
  ------------------
 1052|      8|    } else if (cs[MAXCONDLEN]) {
  ------------------
  |  |   90|      0|#define MAXCONDLEN 20
  ------------------
  |  Branch (1052:16): [True: 0, False: 0]
  ------------------
 1053|       |      //there is more conditions than fit in fixed space, so its
 1054|       |      //a long condition
 1055|      0|      entry.opts |= aeLONGCOND;
  ------------------
  |  |   69|      0|#define aeLONGCOND (1 << 4)
  ------------------
 1056|      0|      size_t remaining = cs.size() - MAXCONDLEN_1;
  ------------------
  |  |   91|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
 1057|      0|      entry.c.l.conds2 = new char[1 + remaining];
 1058|      0|      memcpy(entry.c.l.conds2, cs.data() + MAXCONDLEN_1, remaining);
  ------------------
  |  |   91|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
 1059|      0|      entry.c.l.conds2[remaining] = 0;
 1060|      0|    }
 1061|     34|  } else {
 1062|     34|    entry.numconds = 0;
 1063|     34|    entry.c.conds[0] = '\0';
 1064|     34|  }
 1065|     42|  return 0;
 1066|     42|}
_ZN8AffixMgr12prefix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratchtt:
 1084|   556M|                                      const FLAG avoidflag) {
 1085|   556M|  struct hentry* rv = nullptr;
 1086|       |
 1087|   556M|  pfx = nullptr;
 1088|   556M|  pfxappnd = nullptr;
 1089|   556M|  sfxappnd = nullptr;
 1090|   556M|  sfxextra = 0;
 1091|       |
 1092|       |  // first handle the special case of 0 length prefixes
 1093|   556M|  PfxEntry* pe = pStart[0];
 1094|   557M|  while (pe) {
  ------------------
  |  Branch (1094:10): [True: 1.38M, False: 556M]
  ------------------
 1095|  1.38M|    if (
 1096|       |        // fogemorpheme
 1097|  1.38M|        ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   72|  1.38M|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1097:10): [True: 0, False: 1.38M]
  ------------------
 1098|  1.38M|         !(pe->getCont() &&
  ------------------
  |  Branch (1098:12): [True: 1.38M, False: 0]
  ------------------
 1099|  1.38M|           (TESTAFF(pe->getCont(), onlyincompound, pe->getContLen())))) &&
  ------------------
  |  |   99|  1.38M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1099:12): [True: 0, False: 1.38M]
  ------------------
 1100|       |        // permit prefixes in compounds
 1101|  1.38M|        ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   74|  1.38M|#define IN_CPD_END 2
  ------------------
  |  Branch (1101:10): [True: 1.38M, False: 0]
  ------------------
 1102|      0|         (pe->getCont() &&
  ------------------
  |  Branch (1102:11): [True: 0, False: 0]
  ------------------
 1103|  1.38M|          (TESTAFF(pe->getCont(), compoundpermitflag, pe->getContLen()))))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1103:11): [True: 0, False: 0]
  ------------------
 1104|       |      // check prefix
 1105|  1.38M|      rv = pe->checkword(word, start, len, in_compound, needflag, scratch);
 1106|       |      // Skip a stem with the avoid flag and keep scanning the other prefixes.
 1107|  1.38M|      if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen))
  ------------------
  |  |   96|  1.38M|#define FLAG_NULL 0x00
  ------------------
                    if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1107:11): [True: 0, False: 1.38M]
  |  Branch (1107:17): [True: 0, False: 0]
  ------------------
 1108|      0|        rv = nullptr;
 1109|  1.38M|      if (rv) {
  ------------------
  |  Branch (1109:11): [True: 0, False: 1.38M]
  ------------------
 1110|      0|        pfx = pe;  // BUG: pfx not stateless
 1111|      0|        return rv;
 1112|      0|      }
 1113|  1.38M|    }
 1114|  1.38M|    pe = pe->getNext();
 1115|  1.38M|  }
 1116|       |
 1117|       |  // now handle the general case
 1118|   556M|  unsigned char sp = word[start];
 1119|   556M|  PfxEntry* pptr = pStart[sp];
 1120|       |
 1121|   556M|  while (pptr) {
  ------------------
  |  Branch (1121:10): [True: 49.0k, False: 556M]
  ------------------
 1122|  49.0k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1122:9): [True: 41.3k, False: 7.65k]
  ------------------
 1123|  41.3k|      if (
 1124|       |          // fogemorpheme
 1125|  41.3k|          ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   72|  41.3k|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1125:12): [True: 0, False: 41.3k]
  ------------------
 1126|  41.3k|           !(pptr->getCont() &&
  ------------------
  |  Branch (1126:14): [True: 30.6k, False: 10.7k]
  ------------------
 1127|  30.6k|             (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen())))) &&
  ------------------
  |  |   99|  30.6k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1127:14): [True: 0, False: 30.6k]
  ------------------
 1128|       |          // permit prefixes in compounds
 1129|  41.3k|          ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   74|  41.3k|#define IN_CPD_END 2
  ------------------
  |  Branch (1129:12): [True: 41.3k, False: 0]
  ------------------
 1130|      0|           (pptr->getCont() && (TESTAFF(pptr->getCont(), compoundpermitflag,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1130:13): [True: 0, False: 0]
  |  Branch (1130:32): [True: 0, False: 0]
  ------------------
 1131|  41.3k|                                        pptr->getContLen()))))) {
 1132|       |        // check prefix
 1133|  41.3k|        rv = pptr->checkword(word, start, len, in_compound, needflag, scratch);
 1134|  41.3k|        if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen))
  ------------------
  |  |   96|  41.3k|#define FLAG_NULL 0x00
  ------------------
                      if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1134:13): [True: 0, False: 41.3k]
  |  Branch (1134:19): [True: 0, False: 0]
  ------------------
 1135|      0|          rv = nullptr;
 1136|  41.3k|        if (rv) {
  ------------------
  |  Branch (1136:13): [True: 0, False: 41.3k]
  ------------------
 1137|      0|          pfx = pptr;  // BUG: pfx not stateless
 1138|      0|          return rv;
 1139|      0|        }
 1140|  41.3k|      }
 1141|  41.3k|      pptr = pptr->getNextEQ();
 1142|  41.3k|    } else {
 1143|  7.65k|      pptr = pptr->getNextNE();
 1144|  7.65k|    }
 1145|  49.0k|  }
 1146|       |
 1147|   556M|  return nullptr;
 1148|   556M|}
_ZN8AffixMgr19prefix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1156|  16.7M|                                             const FLAG needflag) {
 1157|  16.7M|  struct hentry* rv = nullptr;
 1158|       |
 1159|  16.7M|  pfx = nullptr;
 1160|  16.7M|  sfxappnd = nullptr;
 1161|  16.7M|  sfxextra = 0;
 1162|       |
 1163|       |  // first handle the special case of 0 length prefixes
 1164|  16.7M|  PfxEntry* pe = pStart[0];
 1165|       |
 1166|  18.0M|  while (pe) {
  ------------------
  |  Branch (1166:10): [True: 1.38M, False: 16.7M]
  ------------------
 1167|  1.38M|    rv = pe->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1168|  1.38M|    if (rv)
  ------------------
  |  Branch (1168:9): [True: 0, False: 1.38M]
  ------------------
 1169|      0|      return rv;
 1170|  1.38M|    pe = pe->getNext();
 1171|  1.38M|  }
 1172|       |
 1173|       |  // now handle the general case
 1174|  16.7M|  unsigned char sp = word[start];
 1175|  16.7M|  PfxEntry* pptr = pStart[sp];
 1176|       |
 1177|  16.7M|  while (pptr) {
  ------------------
  |  Branch (1177:10): [True: 38.2k, False: 16.7M]
  ------------------
 1178|  38.2k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1178:9): [True: 30.6k, False: 7.65k]
  ------------------
 1179|  30.6k|      rv = pptr->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1180|  30.6k|      if (rv) {
  ------------------
  |  Branch (1180:11): [True: 0, False: 30.6k]
  ------------------
 1181|      0|        pfx = pptr;
 1182|      0|        return rv;
 1183|      0|      }
 1184|  30.6k|      pptr = pptr->getNextEQ();
 1185|  30.6k|    } else {
 1186|  7.65k|      pptr = pptr->getNextNE();
 1187|  7.65k|    }
 1188|  38.2k|  }
 1189|       |
 1190|  16.7M|  return nullptr;
 1191|  16.7M|}
_ZN8AffixMgr18prefix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1199|  14.2k|                                         const FLAG needflag) {
 1200|       |
 1201|  14.2k|  std::string result;
 1202|       |
 1203|  14.2k|  pfx = nullptr;
 1204|  14.2k|  sfxappnd = nullptr;
 1205|  14.2k|  sfxextra = 0;
 1206|       |
 1207|       |  // first handle the special case of 0 length prefixes
 1208|  14.2k|  PfxEntry* pe = pStart[0];
 1209|  14.9k|  while (pe) {
  ------------------
  |  Branch (1209:10): [True: 758, False: 14.2k]
  ------------------
 1210|    758|    std::string st = pe->check_morph(word, start, len, in_compound, needflag, scratch);
 1211|    758|    if (!st.empty()) {
  ------------------
  |  Branch (1211:9): [True: 0, False: 758]
  ------------------
 1212|      0|      result.append(st);
 1213|      0|    }
 1214|    758|    pe = pe->getNext();
 1215|    758|  }
 1216|       |
 1217|       |  // now handle the general case
 1218|  14.2k|  unsigned char sp = word[start];
 1219|  14.2k|  PfxEntry* pptr = pStart[sp];
 1220|       |
 1221|  14.2k|  while (pptr) {
  ------------------
  |  Branch (1221:10): [True: 3, False: 14.2k]
  ------------------
 1222|      3|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1222:9): [True: 1, False: 2]
  ------------------
 1223|      1|      std::string st = pptr->check_morph(word, start, len, in_compound, needflag, scratch);
 1224|      1|      if (!st.empty()) {
  ------------------
  |  Branch (1224:11): [True: 0, False: 1]
  ------------------
 1225|       |        // fogemorpheme
 1226|      0|        if ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   72|      0|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1226:13): [True: 0, False: 0]
  ------------------
 1227|      0|            !((pptr->getCont() && (TESTAFF(pptr->getCont(), onlyincompound,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1227:16): [True: 0, False: 0]
  |  Branch (1227:35): [True: 0, False: 0]
  ------------------
 1228|      0|                                           pptr->getContLen()))))) {
 1229|      0|          result.append(st);
 1230|      0|          pfx = pptr;
 1231|      0|        }
 1232|      0|      }
 1233|      1|      pptr = pptr->getNextEQ();
 1234|      2|    } else {
 1235|      2|      pptr = pptr->getNextNE();
 1236|      2|    }
 1237|      3|  }
 1238|       |
 1239|  14.2k|  return result;
 1240|  14.2k|}
_ZN8AffixMgr25prefix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1248|  4.46k|                                                const FLAG needflag) {
 1249|  4.46k|  std::string result;
 1250|       |
 1251|  4.46k|  pfx = nullptr;
 1252|  4.46k|  sfxappnd = nullptr;
 1253|  4.46k|  sfxextra = 0;
 1254|       |
 1255|       |  // first handle the special case of 0 length prefixes
 1256|  4.46k|  PfxEntry* pe = pStart[0];
 1257|  5.22k|  while (pe) {
  ------------------
  |  Branch (1257:10): [True: 758, False: 4.46k]
  ------------------
 1258|    758|    std::string st = pe->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1259|    758|    if (!st.empty()) {
  ------------------
  |  Branch (1259:9): [True: 0, False: 758]
  ------------------
 1260|      0|      result.append(st);
 1261|      0|    }
 1262|    758|    pe = pe->getNext();
 1263|    758|  }
 1264|       |
 1265|       |  // now handle the general case
 1266|  4.46k|  unsigned char sp = word[start];
 1267|  4.46k|  PfxEntry* pptr = pStart[sp];
 1268|       |
 1269|  4.46k|  while (pptr) {
  ------------------
  |  Branch (1269:10): [True: 2, False: 4.46k]
  ------------------
 1270|      2|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1270:9): [True: 0, False: 2]
  ------------------
 1271|      0|      std::string st = pptr->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1272|      0|      if (!st.empty()) {
  ------------------
  |  Branch (1272:11): [True: 0, False: 0]
  ------------------
 1273|      0|        result.append(st);
 1274|      0|        pfx = pptr;
 1275|      0|      }
 1276|      0|      pptr = pptr->getNextEQ();
 1277|      2|    } else {
 1278|      2|      pptr = pptr->getNextNE();
 1279|      2|    }
 1280|      2|  }
 1281|       |
 1282|  4.46k|  return result;
 1283|  4.46k|}
_ZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1559|    670|short AffixMgr::get_syllable(const std::string& word) {
 1560|    670|  if (cpdmaxsyllable == 0)
  ------------------
  |  Branch (1560:7): [True: 0, False: 670]
  ------------------
 1561|      0|    return 0;
 1562|       |
 1563|    670|  short num = 0;
 1564|       |
 1565|    670|  if (!utf8) {
  ------------------
  |  Branch (1565:7): [True: 0, False: 670]
  ------------------
 1566|      0|    num = (short)std::count_if(word.begin(), word.end(),
 1567|      0|          [&](char c) {
 1568|      0|            return std::binary_search(cpdvowels.begin(), cpdvowels.end(), c);
 1569|      0|          });
 1570|    670|  } else if (!cpdvowels_utf16.empty()) {
  ------------------
  |  Branch (1570:14): [True: 670, False: 0]
  ------------------
 1571|    670|    std::vector<w_char> w;
 1572|    670|    u8_u16(w, word);
 1573|    670|    num = (short)std::count_if(w.begin(), w.end(),
 1574|    670|          [&](w_char wc) {
 1575|    670|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1576|    670|          });
 1577|    670|  }
 1578|       |
 1579|    670|  return num;
 1580|    670|}
_ZN8AffixMgr10setcminmaxEPmS0_PKcm:
 1582|  23.2M|void AffixMgr::setcminmax(size_t* cmin, size_t* cmax, const char* word, size_t len) {
 1583|  23.2M|  if (utf8) {
  ------------------
  |  Branch (1583:7): [True: 1.66M, False: 21.5M]
  ------------------
 1584|  1.66M|    int i;
 1585|  4.96M|    for (*cmin = 0, i = 0; (i < cpdmin) && *cmin < len; i++) {
  ------------------
  |  Branch (1585:28): [True: 3.32M, False: 1.63M]
  |  Branch (1585:44): [True: 3.29M, False: 25.1k]
  ------------------
 1586|  3.68M|      for ((*cmin)++; *cmin < len && is_utf8_cont(word[*cmin]); (*cmin)++)
  ------------------
  |  Branch (1586:23): [True: 3.64M, False: 43.7k]
  |  Branch (1586:38): [True: 384k, False: 3.25M]
  ------------------
 1587|   384k|        ;
 1588|  3.29M|    }
 1589|  3.32M|    for (*cmax = len, i = 0; (i < (cpdmin - 1)) && *cmax > 0; i++) {
  ------------------
  |  Branch (1589:30): [True: 1.66M, False: 1.66M]
  |  Branch (1589:52): [True: 1.66M, False: 3.49k]
  ------------------
 1590|  2.57M|      for ((*cmax)--; *cmax > 0 && is_utf8_cont(word[*cmax]); (*cmax)--)
  ------------------
  |  Branch (1590:23): [True: 2.55M, False: 21.6k]
  |  Branch (1590:36): [True: 916k, False: 1.63M]
  ------------------
 1591|   916k|        ;
 1592|  1.66M|    }
 1593|  21.5M|  } else {
 1594|  21.5M|    *cmin = cpdmin;
 1595|  21.5M|    *cmax = len - cpdmin + 1;
 1596|  21.5M|  }
 1597|  23.2M|}
_ZN8AffixMgr14compound_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEssssPP6hentrySB_ccPiR12AffixScratch:
 1611|  23.2M|                                        AffixScratch& scratch) {
 1612|  23.2M|  short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2;
 1613|  23.2M|  hentry *rv = nullptr, *rv_first;
 1614|  23.2M|  std::string st;
 1615|  23.2M|  char ch = '\0', affixed;
 1616|  23.2M|  size_t cmin, cmax;
 1617|  23.2M|  int striple = 0, soldi = 0, oldcmin = 0, oldcmax = 0, oldlen = 0, checkedstriple = 0;
 1618|  23.2M|  hentry** oldwords = words;
 1619|  23.2M|  size_t scpd = 0, len = word.size();
 1620|       |
 1621|       |  // protect subsequent words[wnum + 1] reads and any recursion
 1622|  23.2M|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (1622:7): [True: 0, False: 23.2M]
  ------------------
 1623|      0|    return nullptr;
 1624|       |
 1625|  23.2M|  int checked_prefix;
 1626|       |
 1627|       |  // add a time limit to handle possible
 1628|       |  // combinatorical explosion of the overlapping words
 1629|       |
 1630|  23.2M|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  23.2M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1631|  23.2M|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  23.2M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1632|       |
 1633|       |  // get the current time
 1634|  23.2M|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 1635|       |
 1636|  23.2M|  if (wnum == 0) {
  ------------------
  |  Branch (1636:7): [True: 23.2M, False: 487]
  ------------------
 1637|       |      // set the start time
 1638|  23.2M|      clock_time_start = clock_now;
 1639|  23.2M|      timelimit_exceeded = false;
 1640|  23.2M|  }
 1641|    487|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  106|    487|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1641:12): [True: 0, False: 487]
  ------------------
 1642|      0|      timelimit_exceeded = true;
 1643|       |
 1644|  23.2M|  setcminmax(&cmin, &cmax, word.c_str(), len);
 1645|       |
 1646|  23.2M|  st.assign(word);
 1647|       |
 1648|   531M|  for (size_t i = cmin; i < cmax; ++i) {
  ------------------
  |  Branch (1648:25): [True: 508M, False: 22.1M]
  ------------------
 1649|       |    // go to end of the UTF-8 character
 1650|   508M|    if (utf8) {
  ------------------
  |  Branch (1650:9): [True: 38.1M, False: 470M]
  ------------------
 1651|  46.7M|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (1651:14): [True: 8.58M, False: 38.1M]
  ------------------
 1652|  8.58M|        ;
 1653|  38.1M|      if (i >= cmax)
  ------------------
  |  Branch (1653:11): [True: 176k, False: 37.9M]
  ------------------
 1654|   176k|        return nullptr;
 1655|  38.1M|    }
 1656|       |
 1657|   508M|    words = oldwords;
 1658|   508M|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (1658:23): [True: 0, False: 508M]
  ------------------
 1659|       |
 1660|   508M|    do {  // onlycpdrule loop
 1661|       |
 1662|   508M|      oldnumsyllable = numsyllable;
 1663|   508M|      oldwordnum = wordnum;
 1664|   508M|      checked_prefix = 0;
 1665|       |
 1666|   508M|      do {  // simplified checkcompoundpattern loop
 1667|       |
 1668|   508M|        if (timelimit_exceeded ||
  ------------------
  |  Branch (1668:13): [True: 0, False: 508M]
  |  Branch (1668:13): [True: 0, False: 508M]
  ------------------
 1669|   508M|            std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  106|   508M|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1669:13): [True: 0, False: 508M]
  ------------------
 1670|      0|          timelimit_exceeded = true;
 1671|      0|          return nullptr;
 1672|      0|        }
 1673|       |
 1674|   508M|        if (scpd > 0) {
  ------------------
  |  Branch (1674:13): [True: 0, False: 508M]
  ------------------
 1675|      0|          for (; scpd <= checkcpdtable.size() &&
  ------------------
  |  Branch (1675:18): [True: 0, False: 0]
  ------------------
 1676|      0|                 (checkcpdtable[scpd - 1].pattern3.empty() ||
  ------------------
  |  Branch (1676:19): [True: 0, False: 0]
  ------------------
 1677|      0|                  i > word.size() ||
  ------------------
  |  Branch (1677:19): [True: 0, False: 0]
  ------------------
 1678|      0|                  word.compare(i, checkcpdtable[scpd - 1].pattern3.size(), checkcpdtable[scpd - 1].pattern3) != 0);
  ------------------
  |  Branch (1678:19): [True: 0, False: 0]
  ------------------
 1679|      0|               scpd++)
 1680|      0|            ;
 1681|       |
 1682|      0|          if (scpd > checkcpdtable.size())
  ------------------
  |  Branch (1682:15): [True: 0, False: 0]
  ------------------
 1683|      0|            break;  // break simplified checkcompoundpattern loop
 1684|      0|          st.replace(i, std::string::npos, checkcpdtable[scpd - 1].pattern);
 1685|      0|          soldi = i;
 1686|      0|          i += checkcpdtable[scpd - 1].pattern.size();
 1687|      0|          st.replace(i, std::string::npos, checkcpdtable[scpd - 1].pattern2);
 1688|      0|          st.replace(i + checkcpdtable[scpd - 1].pattern2.size(), std::string::npos,
 1689|      0|                 word.substr(soldi + checkcpdtable[scpd - 1].pattern3.size()));
 1690|       |
 1691|      0|          oldlen = len;
 1692|      0|          len += checkcpdtable[scpd - 1].pattern.size() +
 1693|      0|                 checkcpdtable[scpd - 1].pattern2.size() -
 1694|      0|                 checkcpdtable[scpd - 1].pattern3.size();
 1695|      0|          oldcmin = cmin;
 1696|      0|          oldcmax = cmax;
 1697|      0|          setcminmax(&cmin, &cmax, st.c_str(), len);
 1698|       |
 1699|      0|          cmax = len - cpdmin + 1;
 1700|      0|        }
 1701|       |
 1702|   508M|        if (i >= st.size())
  ------------------
  |  Branch (1702:13): [True: 849k, False: 507M]
  ------------------
 1703|   849k|          return nullptr;
 1704|       |
 1705|   507M|        ch = st[i];
 1706|   507M|        st[i] = '\0';
 1707|       |
 1708|   507M|        sfx = nullptr;
 1709|   507M|        pfx = nullptr;
 1710|       |
 1711|       |        // FIRST WORD
 1712|       |
 1713|   507M|        affixed = 1;
 1714|   507M|        rv = lookup(st.c_str(), i);  // perhaps without prefix
 1715|       |
 1716|       |        // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 1717|       |        // compound words, overriding the effect of COMPOUNDPERMITFLAG
 1718|   507M|        if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (1718:13): [True: 3.19M, False: 504M]
  |  Branch (1718:21): [True: 114k, False: 3.08M]
  ------------------
 1719|   114k|                TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule) {
  ------------------
  |  |   99|   507M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 114k]
  |  |  ------------------
  ------------------
  |  Branch (1719:68): [True: 0, False: 0]
  ------------------
 1720|      0|            bool would_continue = !onlycpdrule && simplifiedcpd;
  ------------------
  |  Branch (1720:35): [True: 0, False: 0]
  |  Branch (1720:51): [True: 0, False: 0]
  ------------------
 1721|      0|            if (!scpd && would_continue) {
  ------------------
  |  Branch (1721:17): [True: 0, False: 0]
  |  Branch (1721:26): [True: 0, False: 0]
  ------------------
 1722|       |                // given the while conditions that continue jumps to, this situation
 1723|       |                // never ends
 1724|      0|                HUNSPELL_WARNING(stderr, "break infinite loop\n");
 1725|      0|                break;
 1726|      0|            }
 1727|       |
 1728|      0|            if (scpd > 0 && would_continue) {
  ------------------
  |  Branch (1728:17): [True: 0, False: 0]
  |  Branch (1728:29): [True: 0, False: 0]
  ------------------
 1729|       |                // under these conditions we loop again, but the assumption above
 1730|       |                // appears to be that cmin and cmax are the original values they
 1731|       |                // had in the outside loop
 1732|      0|                cmin = oldcmin;
 1733|      0|                cmax = oldcmax;
 1734|      0|            }
 1735|      0|            continue;
 1736|      0|        }
 1737|       |
 1738|       |        // search homonym with compound flag
 1739|   510M|        while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1739:16): [True: 3.19M, False: 507M]
  |  Branch (1739:24): [True: 3.19M, False: 524]
  ------------------
 1740|  3.19M|               ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |   99|  1.02M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 1.02M]
  |  |  ------------------
  ------------------
  |  Branch (1740:18): [True: 1.02M, False: 2.16M]
  ------------------
 1741|  3.19M|                !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (1741:20): [True: 3.19M, False: 0]
  |  Branch (1741:36): [True: 3.19M, False: 0]
  |  Branch (1741:46): [True: 3.19M, False: 0]
  ------------------
 1742|  3.19M|                   TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|  3.19M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 864, False: 3.19M]
  |  |  ------------------
  ------------------
 1743|  3.19M|                  (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (1743:20): [True: 0, False: 3.19M]
  |  Branch (1743:37): [True: 0, False: 0]
  |  Branch (1743:49): [True: 0, False: 0]
  ------------------
 1744|      0|                   TESTAFF(rv->astr, compoundbegin, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1745|  3.19M|                  (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (1745:20): [True: 0, False: 3.19M]
  |  Branch (1745:38): [True: 0, False: 0]
  |  Branch (1745:49): [True: 0, False: 0]
  |  Branch (1745:59): [True: 0, False: 0]
  ------------------
 1746|      0|                   TESTAFF(rv->astr, compoundmiddle, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1747|  3.19M|                  (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (1747:20): [True: 0, False: 3.19M]
  |  Branch (1747:44): [True: 0, False: 0]
  ------------------
 1748|      0|                   ((!words && !wordnum &&
  ------------------
  |  Branch (1748:22): [True: 0, False: 0]
  |  Branch (1748:32): [True: 0, False: 0]
  ------------------
 1749|      0|                     defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (1749:22): [True: 0, False: 0]
  ------------------
 1750|      0|                    (words &&
  ------------------
  |  Branch (1750:22): [True: 0, False: 0]
  ------------------
 1751|      0|                     defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))) ||
  ------------------
  |  Branch (1751:22): [True: 0, False: 0]
  ------------------
 1752|    864|                (scpd != 0 && checkcpdtable[scpd - 1].cond != FLAG_NULL &&
  ------------------
  |  |   96|    864|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1752:18): [True: 0, False: 864]
  |  Branch (1752:31): [True: 0, False: 0]
  ------------------
 1753|  3.19M|                 !TESTAFF(rv->astr, checkcpdtable[scpd - 1].cond, rv->alen)))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1753:18): [True: 0, False: 0]
  ------------------
 1754|  3.19M|          rv = rv->next_homonym;
 1755|  3.19M|        }
 1756|       |
 1757|   507M|        if (rv)
  ------------------
  |  Branch (1757:13): [True: 1.38k, False: 507M]
  ------------------
 1758|  1.38k|          affixed = 0;
 1759|       |
 1760|   507M|        if (!rv) {
  ------------------
  |  Branch (1760:13): [True: 507M, False: 1.38k]
  ------------------
 1761|   507M|          if (onlycpdrule)
  ------------------
  |  Branch (1761:15): [True: 0, False: 507M]
  ------------------
 1762|      0|            break;
 1763|   507M|          if (compoundflag &&
  ------------------
  |  Branch (1763:15): [True: 507M, False: 0]
  ------------------
 1764|   507M|              !(rv = prefix_check(st, 0, i,
  ------------------
  |  Branch (1764:15): [True: 507M, False: 0]
  ------------------
 1765|   507M|                                  hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   75|   101k|#define IN_CPD_OTHER 3
  ------------------
                                                hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   73|  1.01G|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1765:35): [True: 101k, False: 507M]
  ------------------
 1766|   507M|                                  scratch, compoundflag))) {
 1767|   507M|            if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   96|   507M|#define FLAG_NULL 0x00
  ------------------
                          if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   75|   101k|#define IN_CPD_OTHER 3
  ------------------
                          if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   73|  1.01G|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1767:18): [True: 0, False: 507M]
  |  Branch (1767:93): [True: 101k, False: 507M]
  ------------------
 1768|   507M|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (1768:19): [True: 0, False: 507M]
  |  Branch (1768:43): [True: 0, False: 0]
  ------------------
 1769|      0|                !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (1769:17): [True: 0, False: 0]
  |  Branch (1769:33): [True: 0, False: 0]
  ------------------
 1770|      0|                ((compoundforbidflag && TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1770:19): [True: 0, False: 0]
  ------------------
 1771|      0|                 (compoundend && TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1771:19): [True: 0, False: 0]
  ------------------
 1772|      0|              rv = nullptr;
 1773|      0|            }
 1774|   507M|          }
 1775|       |
 1776|   507M|          if (rv ||
  ------------------
  |  Branch (1776:15): [True: 0, False: 507M]
  ------------------
 1777|   507M|              (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (1777:17): [True: 507M, False: 104k]
  |  Branch (1777:35): [True: 0, False: 507M]
  ------------------
 1778|      0|                ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
                              ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   75|      0|#define IN_CPD_OTHER 3
  ------------------
                              ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1778:18): [True: 0, False: 0]
  |  Branch (1778:94): [True: 0, False: 0]
  ------------------
 1779|      0|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (1779:19): [True: 0, False: 0]
  |  Branch (1779:43): [True: 0, False: 0]
  ------------------
 1780|      0|                                                                    compoundbegin))) ||  // twofold suffixes + compound
 1781|      0|                 (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundbegin)))) ||
  ------------------
  |  |   75|      0|#define IN_CPD_OTHER 3
  ------------------
                               (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundbegin)))) ||
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1781:18): [True: 0, False: 0]
  |  Branch (1781:47): [True: 0, False: 0]
  ------------------
 1782|   507M|               ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (1782:17): [True: 2.52k, False: 507M]
  |  Branch (1782:34): [True: 0, False: 2.52k]
  ------------------
 1783|      0|                ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
                              ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   75|      0|#define IN_CPD_OTHER 3
  ------------------
                              ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1783:18): [True: 0, False: 0]
  |  Branch (1783:95): [True: 0, False: 0]
  ------------------
 1784|      0|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (1784:19): [True: 0, False: 0]
  |  Branch (1784:43): [True: 0, False: 0]
  ------------------
 1785|      0|                                                                    compoundmiddle))) ||  // twofold suffixes + compound
 1786|      0|                 (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundmiddle))))))
  ------------------
  |  |   75|      0|#define IN_CPD_OTHER 3
  ------------------
                               (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundmiddle))))))
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1786:18): [True: 0, False: 0]
  |  Branch (1786:47): [True: 0, False: 0]
  ------------------
 1787|      0|            checked_prefix = 1;
 1788|       |          // else check forbiddenwords and needaffix
 1789|   507M|        } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|  1.85k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 925]
  |  |  ------------------
  ------------------
  |  Branch (1789:20): [True: 925, False: 463]
  |  Branch (1789:20): [True: 3, False: 1.38k]
  ------------------
 1790|    925|                                TESTAFF(rv->astr, needaffix, rv->alen) ||
  ------------------
  |  |   99|  1.85k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 925]
  |  |  ------------------
  ------------------
 1791|    925|                                TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|  1.85k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 3, False: 922]
  |  |  ------------------
  ------------------
 1792|    922|                                (is_sug && nosuggest &&
  ------------------
  |  Branch (1792:34): [True: 0, False: 922]
  |  Branch (1792:44): [True: 0, False: 0]
  ------------------
 1793|      3|                                 TESTAFF(rv->astr, nosuggest, rv->alen)))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1794|      3|          st[i] = ch;
 1795|       |          // continue;
 1796|      3|          break;
 1797|      3|        }
 1798|       |
 1799|       |        // check non_compound flag in suffix and prefix
 1800|   507M|        if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1800:13): [True: 1.38k, False: 507M]
  |  Branch (1800:21): [True: 864, False: 521]
  ------------------
 1801|    864|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1801:15): [True: 0, False: 864]
  |  Branch (1801:22): [True: 0, False: 0]
  ------------------
 1802|      0|              TESTAFF(pfx->getCont(), compoundforbidflag, pfx->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1803|    864|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1803:15): [True: 0, False: 864]
  |  Branch (1803:22): [True: 0, False: 0]
  ------------------
 1804|      0|              TESTAFF(sfx->getCont(), compoundforbidflag,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1805|    864|                      sfx->getContLen())))) {
 1806|      0|          rv = nullptr;
 1807|      0|        }
 1808|       |
 1809|       |        // check compoundend flag in suffix and prefix
 1810|   507M|        if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (1810:13): [True: 1.38k, False: 507M]
  |  Branch (1810:21): [True: 1.38k, False: 0]
  |  Branch (1810:40): [True: 0, False: 1.38k]
  |  Branch (1810:55): [True: 0, False: 0]
  ------------------
 1811|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1811:15): [True: 0, False: 0]
  |  Branch (1811:22): [True: 0, False: 0]
  ------------------
 1812|      0|              TESTAFF(pfx->getCont(), compoundend, pfx->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1813|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1813:15): [True: 0, False: 0]
  |  Branch (1813:22): [True: 0, False: 0]
  ------------------
 1814|      0|              TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1815|      0|          rv = nullptr;
 1816|      0|        }
 1817|       |
 1818|       |        // check compoundmiddle flag in suffix and prefix
 1819|   507M|        if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (1819:13): [True: 1.38k, False: 507M]
  |  Branch (1819:21): [True: 1.38k, False: 0]
  |  Branch (1819:40): [True: 864, False: 521]
  |  Branch (1819:58): [True: 0, False: 864]
  ------------------
 1820|      0|            !hu_mov_rule &&
  ------------------
  |  Branch (1820:13): [True: 0, False: 0]
  ------------------
 1821|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1821:15): [True: 0, False: 0]
  |  Branch (1821:22): [True: 0, False: 0]
  ------------------
 1822|      0|              TESTAFF(pfx->getCont(), compoundmiddle, pfx->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1823|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1823:15): [True: 0, False: 0]
  |  Branch (1823:22): [True: 0, False: 0]
  ------------------
 1824|      0|              TESTAFF(sfx->getCont(), compoundmiddle, sfx->getContLen())))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1825|      0|          rv = nullptr;
 1826|      0|        }
 1827|       |
 1828|       |        // check forbiddenwords
 1829|   507M|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1829:13): [True: 1.38k, False: 507M]
  |  Branch (1829:13): [True: 0, False: 507M]
  |  Branch (1829:21): [True: 922, False: 463]
  ------------------
 1830|    922|            (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|  1.84k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 922]
  |  |  ------------------
  ------------------
 1831|    922|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|  1.84k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 922]
  |  |  ------------------
  ------------------
 1832|    922|             (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1832:15): [True: 0, False: 922]
  |  Branch (1832:25): [True: 0, False: 0]
  ------------------
 1833|      0|          return nullptr;
 1834|      0|        }
 1835|       |
 1836|       |        // increment word number, if the second root has a compoundroot flag
 1837|   507M|        if ((rv) && compoundroot &&
  ------------------
  |  Branch (1837:13): [True: 1.38k, False: 507M]
  |  Branch (1837:21): [True: 0, False: 1.38k]
  ------------------
 1838|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1838:13): [True: 0, False: 0]
  ------------------
 1839|      0|          wordnum++;
 1840|      0|        }
 1841|       |
 1842|       |        // first word is acceptable in compound words?
 1843|   507M|        if (((rv) &&
  ------------------
  |  Branch (1843:13): [True: 919, False: 507M]
  |  Branch (1843:14): [True: 1.38k, False: 507M]
  ------------------
 1844|  1.38k|             (checked_prefix || (words && words[wnum]) ||
  ------------------
  |  Branch (1844:15): [True: 0, False: 1.38k]
  |  Branch (1844:34): [True: 0, False: 1.38k]
  |  Branch (1844:43): [True: 0, False: 0]
  ------------------
 1845|  1.38k|              (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|  1.38k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 919, False: 466]
  |  |  ------------------
  ------------------
  |  Branch (1845:16): [True: 1.38k, False: 0]
  ------------------
 1846|    466|              ((oldwordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (1846:16): [True: 0, False: 466]
  |  Branch (1846:37): [True: 0, False: 0]
  ------------------
 1847|      0|               TESTAFF(rv->astr, compoundbegin, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1848|    466|              ((oldwordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (1848:16): [True: 0, False: 466]
  |  Branch (1848:36): [True: 0, False: 0]
  ------------------
 1849|      0|               TESTAFF(rv->astr, compoundmiddle, rv->alen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1850|       |
 1851|       |              // LANG_hu section: spec. Hungarian rule
 1852|    466|              || ((langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (1852:19): [True: 466, False: 0]
  |  Branch (1852:43): [True: 466, False: 0]
  ------------------
 1853|    466|                  (TESTAFF(
  ------------------
  |  |   99|    932|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 466]
  |  |  ------------------
  ------------------
 1854|    466|                       rv->astr, 'F',
 1855|    466|                       rv->alen) ||  // XXX hardwired Hungarian dictionary codes
 1856|    466|                   TESTAFF(rv->astr, 'G', rv->alen) ||
  ------------------
  |  |   99|    932|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 466]
  |  |  ------------------
  ------------------
 1857|    466|                   TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |   99|    466|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 466]
  |  |  ------------------
  ------------------
 1858|       |              // END of LANG_hu section
 1859|  1.38k|              ) &&
 1860|    919|             (
 1861|       |                 // test CHECKCOMPOUNDPATTERN conditions
 1862|    919|                 scpd == 0 || checkcpdtable[scpd - 1].cond == FLAG_NULL ||
  ------------------
  |  |   96|    919|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1862:18): [True: 919, False: 0]
  |  Branch (1862:31): [True: 0, False: 0]
  ------------------
 1863|      0|                 TESTAFF(rv->astr, checkcpdtable[scpd - 1].cond, rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1864|    919|             !((checkcompoundtriple && scpd == 0 &&
  ------------------
  |  Branch (1864:17): [True: 0, False: 919]
  |  Branch (1864:40): [True: 0, False: 0]
  ------------------
 1865|      0|                !words && i < word.size() && // test triple letters
  ------------------
  |  Branch (1865:17): [True: 0, False: 0]
  |  Branch (1865:27): [True: 0, False: 0]
  ------------------
 1866|      0|                (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (1866:17): [True: 0, False: 0]
  ------------------
 1867|      0|                (((i > 1) && (word[i - 1] == word[i - 2])) ||
  ------------------
  |  Branch (1867:19): [True: 0, False: 0]
  |  Branch (1867:30): [True: 0, False: 0]
  ------------------
 1868|      0|                 ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (1868:18): [True: 0, False: 0]
  ------------------
 1869|      0|                 )) ||
 1870|    919|               (checkcompoundcase && scpd == 0 && !words && i < word.size() &&
  ------------------
  |  Branch (1870:17): [True: 0, False: 919]
  |  Branch (1870:38): [True: 0, False: 0]
  |  Branch (1870:51): [True: 0, False: 0]
  |  Branch (1870:61): [True: 0, False: 0]
  ------------------
 1871|      0|                cpdcase_check(word, i))))
  ------------------
  |  Branch (1871:17): [True: 0, False: 0]
  ------------------
 1872|       |            // LANG_hu section: spec. Hungarian rule
 1873|   507M|            || ((!rv) && (langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (1873:17): [True: 507M, False: 466]
  |  Branch (1873:26): [True: 37.9M, False: 469M]
  |  Branch (1873:50): [True: 101k, False: 37.8M]
  ------------------
 1874|   101k|                (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (1874:17): [True: 0, False: 101k]
  ------------------
 1875|      0|                (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1875:18): [True: 0, False: 0]
  |  Branch (1875:25): [True: 0, False: 0]
  ------------------
 1876|      0|                 (  // XXX hardwired Hungarian dic. codes
 1877|      0|                     TESTAFF(sfx->getCont(), (unsigned short)'x',
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1878|      0|                             sfx->getContLen()) ||
 1879|      0|                     TESTAFF(
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1880|      0|                         sfx->getCont(), (unsigned short)'%',
 1881|    919|                         sfx->getContLen()))))) {  // first word is ok condition
 1882|       |
 1883|       |          // LANG_hu section: spec. Hungarian rule
 1884|    919|          if (langnum == LANG_hu) {
  ------------------
  |  Branch (1884:15): [True: 335, False: 584]
  ------------------
 1885|       |            // calculate syllable number of the word
 1886|    335|            numsyllable += get_syllable(st.substr(0, i));
 1887|       |            // + 1 word, if syllable number of the prefix > 1 (hungarian
 1888|       |            // convention)
 1889|    335|            if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (1889:17): [True: 0, False: 335]
  |  Branch (1889:17): [True: 0, False: 335]
  |  Branch (1889:24): [True: 0, False: 0]
  ------------------
 1890|      0|              wordnum++;
 1891|    335|          }
 1892|       |          // END of LANG_hu section
 1893|       |
 1894|       |          // NEXT WORD(S)
 1895|    919|          rv_first = rv;
 1896|    919|          st[i] = ch;
 1897|       |
 1898|    919|          do {  // striple loop
 1899|       |
 1900|       |            // check simplifiedtriple
 1901|    919|            if (simplifiedtriple) {
  ------------------
  |  Branch (1901:17): [True: 0, False: 919]
  ------------------
 1902|      0|              if (striple) {
  ------------------
  |  Branch (1902:19): [True: 0, False: 0]
  ------------------
 1903|      0|                checkedstriple = 1;
 1904|      0|                i--;  // check "fahrt" instead of "ahrt" in "Schiffahrt"
 1905|      0|              } else if (i > 2 && i <= word.size() && word[i - 1] == word[i - 2])
  ------------------
  |  Branch (1905:26): [True: 0, False: 0]
  |  Branch (1905:35): [True: 0, False: 0]
  |  Branch (1905:55): [True: 0, False: 0]
  ------------------
 1906|      0|                striple = 1;
 1907|      0|            }
 1908|       |
 1909|    919|            rv = lookup(st.c_str() + i, st.size() - i);  // perhaps without prefix
 1910|       |
 1911|       |            // search homonym with compound flag
 1912|    919|            while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1912:20): [True: 0, False: 919]
  |  Branch (1912:30): [True: 0, False: 0]
  ------------------
 1913|      0|                            !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1913:32): [True: 0, False: 0]
  |  Branch (1913:48): [True: 0, False: 0]
  ------------------
 1914|      0|                              (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1914:32): [True: 0, False: 0]
  |  Branch (1914:47): [True: 0, False: 0]
  ------------------
 1915|      0|                              (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))) ||
  ------------------
  |  Branch (1915:32): [True: 0, False: 0]
  |  Branch (1915:56): [True: 0, False: 0]
  |  Branch (1915:65): [True: 0, False: 0]
  ------------------
 1916|      0|                            (scpd != 0 && checkcpdtable[scpd - 1].cond2 != FLAG_NULL &&
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1916:30): [True: 0, False: 0]
  |  Branch (1916:43): [True: 0, False: 0]
  ------------------
 1917|      0|                             !TESTAFF(rv->astr, checkcpdtable[scpd - 1].cond2, rv->alen)))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1917:30): [True: 0, False: 0]
  ------------------
 1918|      0|              rv = rv->next_homonym;
 1919|      0|            }
 1920|       |
 1921|       |            // check FORCEUCASE
 1922|    919|            if (rv && forceucase &&
  ------------------
  |  Branch (1922:17): [True: 0, False: 919]
  |  Branch (1922:23): [True: 0, False: 0]
  ------------------
 1923|      0|                (TESTAFF(rv->astr, forceucase, rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1923:17): [True: 0, False: 0]
  ------------------
 1924|      0|                !(info && *info & SPELL_ORIGCAP))
  ------------------
  |  |   83|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  |  Branch (1924:19): [True: 0, False: 0]
  |  Branch (1924:27): [True: 0, False: 0]
  ------------------
 1925|      0|              rv = nullptr;
 1926|       |
 1927|    919|            if (rv && words && words[wnum + 1])
  ------------------
  |  Branch (1927:17): [True: 0, False: 919]
  |  Branch (1927:23): [True: 0, False: 0]
  |  Branch (1927:32): [True: 0, False: 0]
  ------------------
 1928|      0|              return rv_first;
 1929|       |
 1930|    919|            oldnumsyllable2 = numsyllable;
 1931|    919|            oldwordnum2 = wordnum;
 1932|       |
 1933|       |            // LANG_hu section: spec. Hungarian rule, XXX hardwired dictionary
 1934|       |            // code
 1935|    919|            if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (1935:17): [True: 0, False: 919]
  |  Branch (1935:17): [True: 0, False: 919]
  |  Branch (1935:25): [True: 0, False: 0]
  ------------------
 1936|      0|                (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1936:17): [True: 0, False: 0]
  ------------------
 1937|      0|                !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1937:17): [True: 0, False: 0]
  ------------------
 1938|      0|              numsyllable--;
 1939|      0|            }
 1940|       |            // END of LANG_hu section
 1941|       |
 1942|       |            // increment word number, if the second root has a compoundroot flag
 1943|    919|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (1943:17): [True: 0, False: 919]
  |  Branch (1943:25): [True: 0, False: 0]
  ------------------
 1944|      0|                (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1944:17): [True: 0, False: 0]
  ------------------
 1945|      0|              wordnum++;
 1946|      0|            }
 1947|       |
 1948|       |            // check forbiddenwords
 1949|    919|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1949:17): [True: 0, False: 919]
  |  Branch (1949:17): [True: 0, False: 919]
  |  Branch (1949:25): [True: 0, False: 0]
  ------------------
 1950|      0|                (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1951|      0|                 TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1952|      0|                 (is_sug && nosuggest &&
  ------------------
  |  Branch (1952:19): [True: 0, False: 0]
  |  Branch (1952:29): [True: 0, False: 0]
  ------------------
 1953|      0|                  TESTAFF(rv->astr, nosuggest, rv->alen))))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1954|      0|              return nullptr;
 1955|       |
 1956|       |            // second word is acceptable, as a root?
 1957|       |            // hungarian conventions: compounding is acceptable,
 1958|       |            // when compound forms consist of 2 words, or if more,
 1959|       |            // then the syllable number of root words must be 6, or lesser.
 1960|       |
 1961|    919|            if ((rv) &&
  ------------------
  |  Branch (1961:17): [True: 0, False: 919]
  |  Branch (1961:17): [True: 0, False: 919]
  ------------------
 1962|      0|                ((compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1962:19): [True: 0, False: 0]
  ------------------
 1963|      0|                 (compoundend && TESTAFF(rv->astr, compoundend, rv->alen))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1963:19): [True: 0, False: 0]
  ------------------
 1964|      0|                (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (1964:19): [True: 0, False: 0]
  |  Branch (1964:41): [True: 0, False: 0]
  ------------------
 1965|      0|                 ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (1965:19): [True: 0, False: 0]
  ------------------
 1966|      0|                  (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (1966:19): [True: 0, False: 0]
  ------------------
 1967|      0|                   cpdmaxsyllable))) &&
 1968|      0|                (
 1969|       |                    // test CHECKCOMPOUNDPATTERN
 1970|      0|                    checkcpdtable.empty() || scpd != 0 ||
  ------------------
  |  Branch (1970:21): [True: 0, False: 0]
  |  Branch (1970:46): [True: 0, False: 0]
  ------------------
 1971|      0|                    (i < word.size() && !cpdpat_check(word, i, rv_first, rv, 0))) &&
  ------------------
  |  Branch (1971:22): [True: 0, False: 0]
  |  Branch (1971:41): [True: 0, False: 0]
  ------------------
 1972|      0|                ((!checkcompounddup || (rv != rv_first)))
  ------------------
  |  Branch (1972:19): [True: 0, False: 0]
  |  Branch (1972:40): [True: 0, False: 0]
  ------------------
 1973|       |                // test CHECKCOMPOUNDPATTERN conditions
 1974|      0|                &&
 1975|      0|                (scpd == 0 || checkcpdtable[scpd - 1].cond2 == FLAG_NULL ||
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1975:18): [True: 0, False: 0]
  |  Branch (1975:31): [True: 0, False: 0]
  ------------------
 1976|      0|                 TESTAFF(rv->astr, checkcpdtable[scpd - 1].cond2, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1977|       |              // forbid compound word, if it is a non-compound word with typical
 1978|       |              // fault
 1979|      0|              if ((checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (1979:20): [True: 0, False: 0]
  |  Branch (1979:40): [True: 0, False: 0]
  ------------------
 1980|      0|                  cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (1980:19): [True: 0, False: 0]
  ------------------
 1981|      0|                return nullptr;
 1982|      0|              return rv_first;
 1983|      0|            }
 1984|       |
 1985|    919|            numsyllable = oldnumsyllable2;
 1986|    919|            wordnum = oldwordnum2;
 1987|       |
 1988|       |            // perhaps second word has prefix or/and suffix
 1989|    919|            sfx = nullptr;
 1990|    919|            sfxflag = FLAG_NULL;
  ------------------
  |  |   96|    919|#define FLAG_NULL 0x00
  ------------------
 1991|    919|            rv = (compoundflag && !onlycpdrule && i < word.size()) ? affix_check(word, i, word.size() - i, scratch, compoundflag, IN_CPD_END)
  ------------------
  |  |   74|    919|#define IN_CPD_END 2
  ------------------
  |  Branch (1991:19): [True: 919, False: 0]
  |  Branch (1991:35): [True: 919, False: 0]
  |  Branch (1991:51): [True: 919, False: 0]
  ------------------
 1992|    919|                                                                   : nullptr;
 1993|    919|            if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (1993:17): [True: 919, False: 0]
  |  Branch (1993:24): [True: 0, False: 919]
  |  Branch (1993:39): [True: 0, False: 0]
  ------------------
 1994|      0|              sfx = nullptr;
 1995|      0|              pfx = nullptr;
 1996|      0|              if (i < word.size())
  ------------------
  |  Branch (1996:19): [True: 0, False: 0]
  ------------------
 1997|      0|                rv = affix_check(word, i, word.size() - i, scratch, compoundend, IN_CPD_END);
  ------------------
  |  |   74|      0|#define IN_CPD_END 2
  ------------------
 1998|      0|            }
 1999|       |
 2000|    919|            if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (2000:17): [True: 919, False: 0]
  |  Branch (2000:24): [True: 0, False: 919]
  |  Branch (2000:48): [True: 0, False: 0]
  ------------------
 2001|      0|              if (i < word.size())
  ------------------
  |  Branch (2001:19): [True: 0, False: 0]
  ------------------
 2002|      0|                rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   74|      0|#define IN_CPD_END 2
  ------------------
 2003|      0|              if (rv && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))
  ------------------
  |  Branch (2003:19): [True: 0, False: 0]
  |  Branch (2003:25): [True: 0, False: 0]
  ------------------
 2004|      0|                return rv_first;
 2005|      0|              rv = nullptr;
 2006|      0|            }
 2007|       |
 2008|       |            // test CHECKCOMPOUNDPATTERN conditions (allowed forms)
 2009|    919|            if (rv &&
  ------------------
  |  Branch (2009:17): [True: 0, False: 919]
  ------------------
 2010|      0|                !(scpd == 0 || checkcpdtable[scpd - 1].cond2 == FLAG_NULL ||
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2010:19): [True: 0, False: 0]
  |  Branch (2010:32): [True: 0, False: 0]
  ------------------
 2011|      0|                  TESTAFF(rv->astr, checkcpdtable[scpd - 1].cond2, rv->alen)))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2012|      0|              rv = nullptr;
 2013|       |
 2014|       |            // test CHECKCOMPOUNDPATTERN conditions (forbidden compounds)
 2015|    919|            if (rv && !checkcpdtable.empty() && scpd == 0 &&
  ------------------
  |  Branch (2015:17): [True: 0, False: 919]
  |  Branch (2015:23): [True: 0, False: 0]
  |  Branch (2015:49): [True: 0, False: 0]
  ------------------
 2016|      0|                cpdpat_check(word, i, rv_first, rv, affixed))
  ------------------
  |  Branch (2016:17): [True: 0, False: 0]
  ------------------
 2017|      0|              rv = nullptr;
 2018|       |
 2019|       |            // check non_compound flag in suffix and prefix
 2020|    919|            if ((rv) && ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2020:17): [True: 0, False: 919]
  |  Branch (2020:27): [True: 0, False: 0]
  |  Branch (2020:34): [True: 0, False: 0]
  ------------------
 2021|      0|                          TESTAFF(pfx->getCont(), compoundforbidflag,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2022|      0|                                  pfx->getContLen())) ||
 2023|      0|                         (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2023:27): [True: 0, False: 0]
  |  Branch (2023:34): [True: 0, False: 0]
  ------------------
 2024|      0|                          TESTAFF(sfx->getCont(), compoundforbidflag,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2025|      0|                                  sfx->getContLen())))) {
 2026|      0|              rv = nullptr;
 2027|      0|            }
 2028|       |
 2029|       |            // check FORCEUCASE
 2030|    919|            if (rv && forceucase &&
  ------------------
  |  Branch (2030:17): [True: 0, False: 919]
  |  Branch (2030:23): [True: 0, False: 0]
  ------------------
 2031|      0|                (TESTAFF(rv->astr, forceucase, rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2031:17): [True: 0, False: 0]
  ------------------
 2032|      0|                !(info && *info & SPELL_ORIGCAP))
  ------------------
  |  |   83|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  |  Branch (2032:19): [True: 0, False: 0]
  |  Branch (2032:27): [True: 0, False: 0]
  ------------------
 2033|      0|              rv = nullptr;
 2034|       |
 2035|       |            // check forbiddenwords
 2036|    919|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2036:17): [True: 0, False: 919]
  |  Branch (2036:17): [True: 0, False: 919]
  |  Branch (2036:25): [True: 0, False: 0]
  ------------------
 2037|      0|                (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2038|      0|                 TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2039|      0|                 (is_sug && nosuggest &&
  ------------------
  |  Branch (2039:19): [True: 0, False: 0]
  |  Branch (2039:29): [True: 0, False: 0]
  ------------------
 2040|      0|                  TESTAFF(rv->astr, nosuggest, rv->alen))))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2041|      0|              return nullptr;
 2042|       |
 2043|       |            // pfxappnd = prefix of word+i, or NULL
 2044|       |            // calculate syllable number of prefix.
 2045|       |            // hungarian convention: when syllable number of prefix is more,
 2046|       |            // than 1, the prefix+word counts as two words.
 2047|       |
 2048|    919|            if (langnum == LANG_hu) {
  ------------------
  |  Branch (2048:17): [True: 335, False: 584]
  ------------------
 2049|    335|              if (i < word.size()) {
  ------------------
  |  Branch (2049:19): [True: 335, False: 0]
  ------------------
 2050|       |                // calculate syllable number of the word
 2051|    335|                numsyllable += get_syllable(word.substr(i));
 2052|    335|              }
 2053|       |
 2054|       |              // - affix syllable num.
 2055|       |              // XXX only second suffix (inflections, not derivations)
 2056|    335|              if (sfxappnd) {
  ------------------
  |  Branch (2056:19): [True: 0, False: 335]
  ------------------
 2057|      0|                std::string tmp(sfxappnd);
 2058|      0|                reverseword(tmp);
 2059|      0|                numsyllable -= short(get_syllable(tmp) + sfxextra);
 2060|    335|              } else {
 2061|    335|                numsyllable -= short(sfxextra);
 2062|    335|              }
 2063|       |
 2064|       |              // + 1 word, if syllable number of the prefix > 1 (hungarian
 2065|       |              // convention)
 2066|    335|              if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2066:19): [True: 0, False: 335]
  |  Branch (2066:19): [True: 0, False: 335]
  |  Branch (2066:26): [True: 0, False: 0]
  ------------------
 2067|      0|                wordnum++;
 2068|       |
 2069|       |              // increment syllable num, if last word has a SYLLABLENUM flag
 2070|       |              // and the suffix is beginning `s'
 2071|       |
 2072|    335|              if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2072:19): [True: 0, False: 335]
  ------------------
 2073|      0|                switch (sfxflag) {
  ------------------
  |  Branch (2073:25): [True: 0, False: 0]
  ------------------
 2074|      0|                  case 'c': {
  ------------------
  |  Branch (2074:19): [True: 0, False: 0]
  ------------------
 2075|      0|                    numsyllable += 2;
 2076|      0|                    break;
 2077|      0|                  }
 2078|      0|                  case 'J': {
  ------------------
  |  Branch (2078:19): [True: 0, False: 0]
  ------------------
 2079|      0|                    numsyllable += 1;
 2080|      0|                    break;
 2081|      0|                  }
 2082|      0|                  case 'I': {
  ------------------
  |  Branch (2082:19): [True: 0, False: 0]
  ------------------
 2083|      0|                    if (rv && TESTAFF(rv->astr, 'J', rv->alen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2083:25): [True: 0, False: 0]
  |  Branch (2083:25): [True: 0, False: 0]
  ------------------
 2084|      0|                      numsyllable += 1;
 2085|      0|                    break;
 2086|      0|                  }
 2087|      0|                }
 2088|      0|              }
 2089|    335|            }
 2090|       |
 2091|       |            // increment word number, if the second word has a compoundroot flag
 2092|    919|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2092:17): [True: 0, False: 919]
  |  Branch (2092:25): [True: 0, False: 0]
  ------------------
 2093|      0|                (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2093:17): [True: 0, False: 0]
  ------------------
 2094|      0|              wordnum++;
 2095|      0|            }
 2096|       |            // second word is acceptable, as a word with prefix or/and suffix?
 2097|       |            // hungarian conventions: compounding is acceptable,
 2098|       |            // when compound forms consist 2 word, otherwise
 2099|       |            // the syllable number of root words is 6, or lesser.
 2100|    919|            if ((rv) &&
  ------------------
  |  Branch (2100:17): [True: 0, False: 919]
  ------------------
 2101|      0|                (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2101:19): [True: 0, False: 0]
  |  Branch (2101:41): [True: 0, False: 0]
  ------------------
 2102|      0|                 ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2102:19): [True: 0, False: 0]
  |  Branch (2102:44): [True: 0, False: 0]
  ------------------
 2103|      0|                ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2103:19): [True: 0, False: 0]
  |  Branch (2103:40): [True: 0, False: 0]
  ------------------
 2104|       |              // forbid compound word, if it is a non-compound word with typical
 2105|       |              // fault
 2106|      0|              if ((checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2106:20): [True: 0, False: 0]
  |  Branch (2106:40): [True: 0, False: 0]
  ------------------
 2107|      0|                  cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2107:19): [True: 0, False: 0]
  ------------------
 2108|      0|                return nullptr;
 2109|      0|              return rv_first;
 2110|      0|            }
 2111|       |
 2112|    919|            numsyllable = oldnumsyllable2;
 2113|    919|            wordnum = oldwordnum2;
 2114|       |
 2115|       |            // perhaps second word is a compound word (recursive call)
 2116|       |            // (only if SPELL_COMPOUND_2 is not set and maxwordnum is not exceeded)
 2117|    919|            if ((!info || !(*info & SPELL_COMPOUND_2)) && wordnum + 2 < maxwordnum && wnum + 1 < maxwordnum) {
  ------------------
  |  |   85|    919|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (2117:18): [True: 0, False: 919]
  |  Branch (2117:27): [True: 487, False: 432]
  |  Branch (2117:59): [True: 487, False: 0]
  |  Branch (2117:87): [True: 487, False: 0]
  ------------------
 2118|    487|              rv = compound_check(st.substr(i), wordnum + 1,
 2119|    487|                                  numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2120|    487|                                  is_sug, info, scratch);
 2121|       |
 2122|    487|              if (rv && !checkcpdtable.empty() && i < word.size() &&
  ------------------
  |  Branch (2122:19): [True: 0, False: 487]
  |  Branch (2122:25): [True: 0, False: 0]
  |  Branch (2122:51): [True: 0, False: 0]
  ------------------
 2123|      0|                  ((scpd == 0 &&
  ------------------
  |  Branch (2123:21): [True: 0, False: 0]
  ------------------
 2124|      0|                    cpdpat_check(word, i, rv_first, rv, affixed)) ||
  ------------------
  |  Branch (2124:21): [True: 0, False: 0]
  ------------------
 2125|      0|                   (scpd != 0 &&
  ------------------
  |  Branch (2125:21): [True: 0, False: 0]
  ------------------
 2126|      0|                    !cpdpat_check(word, i, rv_first, rv, affixed))))
  ------------------
  |  Branch (2126:21): [True: 0, False: 0]
  ------------------
 2127|      0|                rv = nullptr;
 2128|    487|            } else {
 2129|    432|              rv = nullptr;
 2130|    432|            }
 2131|    919|            if (rv) {
  ------------------
  |  Branch (2131:17): [True: 0, False: 919]
  ------------------
 2132|       |              // forbid compound word, if it is a non-compound word with typical
 2133|       |              // fault, or a dictionary word pair
 2134|       |
 2135|      0|              if (cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2135:19): [True: 0, False: 0]
  ------------------
 2136|      0|                return nullptr;
 2137|       |
 2138|      0|              if (checkcompoundrep || forbiddenword) {
  ------------------
  |  Branch (2138:19): [True: 0, False: 0]
  |  Branch (2138:39): [True: 0, False: 0]
  ------------------
 2139|      0|                if (checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2139:21): [True: 0, False: 0]
  |  Branch (2139:41): [True: 0, False: 0]
  ------------------
 2140|      0|                  return nullptr;
 2141|       |
 2142|       |                // check first part
 2143|      0|                if (i < word.size() && word.compare(i, rv->blen, rv->word, rv->blen) == 0) {
  ------------------
  |  Branch (2143:21): [True: 0, False: 0]
  |  Branch (2143:40): [True: 0, False: 0]
  ------------------
 2144|      0|                  char r = st[i + rv->blen];
 2145|      0|                  st[i + rv->blen] = '\0';
 2146|       |
 2147|      0|                  if ((checkcompoundrep && cpdrep_check(st, i + rv->blen, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2147:24): [True: 0, False: 0]
  |  Branch (2147:44): [True: 0, False: 0]
  ------------------
 2148|      0|                      cpdwordpair_check(st, i + rv->blen, scratch, timelimit_exceeded, clock_time_start)) {
  ------------------
  |  Branch (2148:23): [True: 0, False: 0]
  ------------------
 2149|      0|                    st[ + i + rv->blen] = r;
 2150|      0|                    continue;
 2151|      0|                  }
 2152|       |
 2153|      0|                  if (forbiddenword) {
  ------------------
  |  Branch (2153:23): [True: 0, False: 0]
  ------------------
 2154|      0|                    struct hentry* rv2 = lookup(word.c_str(), word.size());
 2155|      0|                    if (!rv2 && len <= word.size())
  ------------------
  |  Branch (2155:25): [True: 0, False: 0]
  |  Branch (2155:33): [True: 0, False: 0]
  ------------------
 2156|      0|                      rv2 = affix_check(word, 0, len, scratch);
 2157|      0|                    if (rv2 && rv2->astr &&
  ------------------
  |  Branch (2157:25): [True: 0, False: 0]
  |  Branch (2157:32): [True: 0, False: 0]
  ------------------
 2158|      0|                        TESTAFF(rv2->astr, forbiddenword, rv2->alen) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2159|      0|                        (strncmp(rv2->word, st.c_str(), i + rv->blen) == 0)) {
  ------------------
  |  Branch (2159:25): [True: 0, False: 0]
  ------------------
 2160|      0|                      return nullptr;
 2161|      0|                    }
 2162|      0|                  }
 2163|      0|                  st[i + rv->blen] = r;
 2164|      0|                }
 2165|      0|              }
 2166|      0|              return rv_first;
 2167|      0|            }
 2168|    919|          } while (striple && !checkedstriple);  // end of striple loop
  ------------------
  |  Branch (2168:20): [True: 0, False: 919]
  |  Branch (2168:31): [True: 0, False: 0]
  ------------------
 2169|       |
 2170|    919|          if (checkedstriple) {
  ------------------
  |  Branch (2170:15): [True: 0, False: 919]
  ------------------
 2171|      0|            i++;
 2172|      0|            checkedstriple = 0;
 2173|      0|            striple = 0;
 2174|      0|          }
 2175|       |
 2176|    919|        }  // first word is ok condition
 2177|       |
 2178|   507M|        if (soldi != 0) {
  ------------------
  |  Branch (2178:13): [True: 0, False: 507M]
  ------------------
 2179|      0|          i = soldi;
 2180|      0|          soldi = 0;
 2181|      0|          len = oldlen;
 2182|      0|          cmin = oldcmin;
 2183|      0|          cmax = oldcmax;
 2184|      0|        }
 2185|   507M|        scpd++;
 2186|       |
 2187|   507M|      } while (!onlycpdrule && simplifiedcpd &&
  ------------------
  |  Branch (2187:16): [True: 507M, False: 0]
  |  Branch (2187:32): [True: 0, False: 507M]
  ------------------
 2188|      0|               scpd <= checkcpdtable.size());  // end of simplifiedcpd loop
  ------------------
  |  Branch (2188:16): [True: 0, False: 0]
  ------------------
 2189|       |
 2190|   507M|      scpd = 0;
 2191|   507M|      wordnum = oldwordnum;
 2192|   507M|      numsyllable = oldnumsyllable;
 2193|       |
 2194|   507M|      if (soldi != 0) {
  ------------------
  |  Branch (2194:11): [True: 0, False: 507M]
  ------------------
 2195|      0|        i = soldi;
 2196|      0|        st.assign(word);  // XXX add more optim.
 2197|      0|        soldi = 0;
 2198|      0|        len = oldlen;
 2199|      0|        cmin = oldcmin;
 2200|      0|        cmax = oldcmax;
 2201|      0|      } else
 2202|   507M|        st[i] = ch;
 2203|       |
 2204|   507M|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2204:14): [True: 0, False: 507M]
  |  Branch (2204:38): [True: 0, False: 0]
  ------------------
 2205|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2205:14): [True: 0, False: 0]
  ------------------
 2206|   508M|  }
 2207|       |
 2208|  22.1M|  return nullptr;
 2209|  23.2M|}
_ZN8AffixMgr20compound_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEssssPP6hentrySB_cRS6_PS7_R12AffixScratch:
 2223|  2.30k|                                   AffixScratch& scratch) {
 2224|  2.30k|  short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2;
 2225|  2.30k|  hentry *rv = nullptr, *rv_first;
 2226|  2.30k|  std::string st, presult;
 2227|  2.30k|  char ch, affixed = 0;
 2228|  2.30k|  int checked_prefix, ok = 0;
 2229|  2.30k|  size_t cmin, cmax;
 2230|  2.30k|  hentry** oldwords = words;
 2231|  2.30k|  size_t len = word.size();
 2232|       |
 2233|       |  // protect subsequent words[wnum + 1] reads and any recursion
 2234|  2.30k|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (2234:7): [True: 0, False: 2.30k]
  ------------------
 2235|      0|    return 0;
 2236|       |
 2237|       |  // add a time limit to handle possible
 2238|       |  // combinatorical explosion of the overlapping words
 2239|       |
 2240|  2.30k|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  2.30k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2241|  2.30k|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  2.30k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2242|       |
 2243|       |  // get the current time
 2244|  2.30k|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 2245|       |
 2246|  2.30k|  if (wnum == 0) {
  ------------------
  |  Branch (2246:7): [True: 2.30k, False: 0]
  ------------------
 2247|       |      // set the start time
 2248|  2.30k|      clock_time_start = clock_now;
 2249|  2.30k|      timelimit_exceeded = false;
 2250|  2.30k|  }
 2251|      0|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  106|      0|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2251:12): [True: 0, False: 0]
  ------------------
 2252|      0|      timelimit_exceeded = true;
 2253|       |
 2254|  2.30k|  setcminmax(&cmin, &cmax, word.c_str(), len);
 2255|       |
 2256|  2.30k|  st.assign(word);
 2257|       |
 2258|  32.5k|  for (size_t i = cmin; i < cmax; ++i) {
  ------------------
  |  Branch (2258:25): [True: 30.4k, False: 2.11k]
  ------------------
 2259|       |    // go to end of the UTF-8 character
 2260|  30.4k|    if (utf8) {
  ------------------
  |  Branch (2260:9): [True: 7.78k, False: 22.6k]
  ------------------
 2261|  10.6k|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (2261:14): [True: 2.83k, False: 7.78k]
  ------------------
 2262|  2.83k|        ;
 2263|  7.78k|      if (i >= cmax)
  ------------------
  |  Branch (2263:11): [True: 57, False: 7.73k]
  ------------------
 2264|     57|        return 0;
 2265|  7.78k|    }
 2266|       |
 2267|  30.4k|    words = oldwords;
 2268|  30.4k|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (2268:23): [True: 0, False: 30.4k]
  ------------------
 2269|       |
 2270|  30.4k|    do {  // onlycpdrule loop
 2271|       |
 2272|  30.4k|      if (timelimit_exceeded ||
  ------------------
  |  Branch (2272:11): [True: 0, False: 30.4k]
  |  Branch (2272:11): [True: 0, False: 30.4k]
  ------------------
 2273|  30.4k|          std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  106|  30.4k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2273:11): [True: 0, False: 30.4k]
  ------------------
 2274|      0|        timelimit_exceeded = true;
 2275|      0|        return 0;
 2276|      0|      }
 2277|       |
 2278|  30.4k|      if (result.size() > MAXMORPHRESULT)
  ------------------
  |  |  111|  30.4k|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (2278:11): [True: 0, False: 30.4k]
  ------------------
 2279|      0|        return 0;
 2280|       |
 2281|  30.4k|      oldnumsyllable = numsyllable;
 2282|  30.4k|      oldwordnum = wordnum;
 2283|  30.4k|      checked_prefix = 0;
 2284|       |
 2285|  30.4k|      if (i >= st.size())
  ------------------
  |  Branch (2285:11): [True: 132, False: 30.2k]
  ------------------
 2286|    132|        return 0;
 2287|       |
 2288|  30.2k|      ch = st[i];
 2289|  30.2k|      st[i] = '\0';
 2290|  30.2k|      sfx = nullptr;
 2291|       |
 2292|       |      // FIRST WORD
 2293|       |
 2294|  30.2k|      affixed = 1;
 2295|       |
 2296|  30.2k|      presult.clear();
 2297|  30.2k|      if (partresult)
  ------------------
  |  Branch (2297:11): [True: 0, False: 30.2k]
  ------------------
 2298|      0|        presult.append(*partresult);
 2299|       |
 2300|  30.2k|      rv = lookup(st.c_str(), i);  // perhaps without prefix
 2301|       |
 2302|       |      // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 2303|       |      // compound words, overriding the effect of COMPOUNDPERMITFLAG
 2304|  30.2k|      if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (2304:11): [True: 145, False: 30.1k]
  |  Branch (2304:19): [True: 94, False: 51]
  ------------------
 2305|     94|              TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule)
  ------------------
  |  |   99|  30.3k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 94]
  |  |  ------------------
  ------------------
  |  Branch (2305:66): [True: 0, False: 0]
  ------------------
 2306|      0|          continue;
 2307|       |
 2308|       |      // search homonym with compound flag
 2309|  30.4k|      while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2309:14): [True: 145, False: 30.2k]
  |  Branch (2309:22): [True: 145, False: 0]
  ------------------
 2310|    145|             ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |   99|     17|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 17]
  |  |  ------------------
  ------------------
  |  Branch (2310:16): [True: 17, False: 128]
  ------------------
 2311|    145|              !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (2311:18): [True: 145, False: 0]
  |  Branch (2311:34): [True: 145, False: 0]
  |  Branch (2311:44): [True: 145, False: 0]
  ------------------
 2312|    145|                 TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|    145|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 145]
  |  |  ------------------
  ------------------
 2313|    145|                (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (2313:18): [True: 0, False: 145]
  |  Branch (2313:35): [True: 0, False: 0]
  |  Branch (2313:47): [True: 0, False: 0]
  ------------------
 2314|      0|                 TESTAFF(rv->astr, compoundbegin, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2315|    145|                (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (2315:18): [True: 0, False: 145]
  |  Branch (2315:36): [True: 0, False: 0]
  |  Branch (2315:47): [True: 0, False: 0]
  |  Branch (2315:57): [True: 0, False: 0]
  ------------------
 2316|      0|                 TESTAFF(rv->astr, compoundmiddle, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2317|    145|                (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (2317:18): [True: 0, False: 145]
  |  Branch (2317:42): [True: 0, False: 0]
  ------------------
 2318|      0|                 ((!words && !wordnum &&
  ------------------
  |  Branch (2318:20): [True: 0, False: 0]
  |  Branch (2318:30): [True: 0, False: 0]
  ------------------
 2319|      0|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (2319:20): [True: 0, False: 0]
  ------------------
 2320|      0|                  (words &&
  ------------------
  |  Branch (2320:20): [True: 0, False: 0]
  ------------------
 2321|    145|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))))) {
  ------------------
  |  Branch (2321:20): [True: 0, False: 0]
  ------------------
 2322|    145|        rv = rv->next_homonym;
 2323|    145|      }
 2324|       |
 2325|       |
 2326|  30.2k|      if (rv)
  ------------------
  |  Branch (2326:11): [True: 0, False: 30.2k]
  ------------------
 2327|      0|        affixed = 0;
 2328|       |
 2329|  30.2k|      if (rv) {
  ------------------
  |  Branch (2329:11): [True: 0, False: 30.2k]
  ------------------
 2330|      0|        presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2331|      0|        presult.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2332|      0|        presult.append(st, 0, i);
 2333|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2333:13): [True: 0, False: 0]
  ------------------
 2334|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2335|      0|          presult.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2336|      0|          presult.append(st, 0, i);
 2337|      0|        }
 2338|      0|        if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2338:13): [True: 0, False: 0]
  ------------------
 2339|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2340|      0|          presult.append(HENTRY_DATA2(rv));
 2341|      0|        }
 2342|      0|      }
 2343|       |
 2344|  30.2k|      if (!rv) {
  ------------------
  |  Branch (2344:11): [True: 30.2k, False: 0]
  ------------------
 2345|  30.2k|        if (compoundflag &&
  ------------------
  |  Branch (2345:13): [True: 30.2k, False: 0]
  ------------------
 2346|  30.2k|            !(rv =
  ------------------
  |  Branch (2346:13): [True: 30.2k, False: 0]
  ------------------
 2347|  30.2k|                  prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   75|      0|#define IN_CPD_OTHER 3
  ------------------
                                prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   73|  60.5k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2347:42): [True: 0, False: 30.2k]
  ------------------
 2348|  30.2k|                               scratch, compoundflag))) {
 2349|  30.2k|          if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   96|  30.2k|#define FLAG_NULL 0x00
  ------------------
                        if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   75|      0|#define IN_CPD_OTHER 3
  ------------------
                        if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   73|  60.5k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2349:16): [True: 0, False: 30.2k]
  |  Branch (2349:91): [True: 0, False: 30.2k]
  ------------------
 2350|  30.2k|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (2350:17): [True: 0, False: 30.2k]
  |  Branch (2350:41): [True: 0, False: 0]
  ------------------
 2351|      0|              !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (2351:15): [True: 0, False: 0]
  |  Branch (2351:31): [True: 0, False: 0]
  ------------------
 2352|      0|              ((compoundforbidflag && TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2352:17): [True: 0, False: 0]
  ------------------
 2353|      0|               (compoundend && TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2353:17): [True: 0, False: 0]
  ------------------
 2354|      0|            rv = nullptr;
 2355|      0|          }
 2356|  30.2k|        }
 2357|       |
 2358|  30.2k|        if (rv ||
  ------------------
  |  Branch (2358:13): [True: 0, False: 30.2k]
  ------------------
 2359|  30.2k|            (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (2359:15): [True: 30.2k, False: 0]
  |  Branch (2359:33): [True: 0, False: 30.2k]
  ------------------
 2360|      0|              ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
                            ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   75|      0|#define IN_CPD_OTHER 3
  ------------------
                            ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2360:16): [True: 0, False: 0]
  |  Branch (2360:92): [True: 0, False: 0]
  ------------------
 2361|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2361:17): [True: 0, False: 0]
  |  Branch (2361:41): [True: 0, False: 0]
  ------------------
 2362|      0|                                                                  compoundbegin))) ||  // twofold suffix+compound
 2363|      0|               (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundbegin)))) ||
  ------------------
  |  |   75|      0|#define IN_CPD_OTHER 3
  ------------------
                             (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundbegin)))) ||
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2363:16): [True: 0, False: 0]
  |  Branch (2363:45): [True: 0, False: 0]
  ------------------
 2364|  30.2k|             ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (2364:15): [True: 0, False: 30.2k]
  |  Branch (2364:32): [True: 0, False: 0]
  ------------------
 2365|      0|              ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
                            ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   75|      0|#define IN_CPD_OTHER 3
  ------------------
                            ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2365:16): [True: 0, False: 0]
  |  Branch (2365:93): [True: 0, False: 0]
  ------------------
 2366|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2366:17): [True: 0, False: 0]
  |  Branch (2366:41): [True: 0, False: 0]
  ------------------
 2367|      0|                                                                  compoundmiddle))) ||  // twofold suffix+compound
 2368|      0|               (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundmiddle)))))) {
  ------------------
  |  |   75|      0|#define IN_CPD_OTHER 3
  ------------------
                             (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundmiddle)))))) {
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2368:16): [True: 0, False: 0]
  |  Branch (2368:45): [True: 0, False: 0]
  ------------------
 2369|      0|          std::string p;
 2370|      0|          if (compoundflag)
  ------------------
  |  Branch (2370:15): [True: 0, False: 0]
  ------------------
 2371|      0|            p = affix_check_morph(st, 0, i, scratch, compoundflag);
 2372|      0|          if (p.empty()) {
  ------------------
  |  Branch (2372:15): [True: 0, False: 0]
  ------------------
 2373|      0|            if ((wordnum == 0) && compoundbegin) {
  ------------------
  |  Branch (2373:17): [True: 0, False: 0]
  |  Branch (2373:35): [True: 0, False: 0]
  ------------------
 2374|      0|              p = affix_check_morph(st, 0, i, scratch, compoundbegin);
 2375|      0|            } else if ((wordnum > 0) && compoundmiddle) {
  ------------------
  |  Branch (2375:24): [True: 0, False: 0]
  |  Branch (2375:41): [True: 0, False: 0]
  ------------------
 2376|      0|              p = affix_check_morph(st, 0, i, scratch, compoundmiddle);
 2377|      0|            }
 2378|      0|          }
 2379|      0|          if (!p.empty()) {
  ------------------
  |  Branch (2379:15): [True: 0, False: 0]
  ------------------
 2380|      0|            presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2381|      0|            presult.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2382|      0|            presult.append(st, 0, i);
 2383|      0|            line_uniq_app(p, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2384|      0|            if (!p.empty() && p[0] != MSEP_FLD)
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  |  Branch (2384:17): [True: 0, False: 0]
  |  Branch (2384:31): [True: 0, False: 0]
  ------------------
 2385|      0|              presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2386|      0|            presult.append(p);
 2387|      0|          }
 2388|      0|          checked_prefix = 1;
 2389|      0|        }
 2390|       |        // else check forbiddenwords
 2391|  30.2k|      } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2391:18): [True: 0, False: 0]
  |  Branch (2391:18): [True: 0, False: 0]
  ------------------
 2392|      0|                              TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2393|      0|                              TESTAFF(rv->astr, needaffix, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2394|      0|        st[i] = ch;
 2395|      0|        continue;
 2396|      0|      }
 2397|       |
 2398|       |      // check non_compound flag in suffix and prefix
 2399|  30.2k|      if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2399:11): [True: 0, False: 30.2k]
  |  Branch (2399:19): [True: 0, False: 0]
  ------------------
 2400|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2400:13): [True: 0, False: 0]
  |  Branch (2400:20): [True: 0, False: 0]
  ------------------
 2401|      0|            TESTAFF(pfx->getCont(), compoundforbidflag, pfx->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2402|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2402:13): [True: 0, False: 0]
  |  Branch (2402:20): [True: 0, False: 0]
  ------------------
 2403|      0|            TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2404|      0|        continue;
 2405|      0|      }
 2406|       |
 2407|       |      // check compoundend flag in suffix and prefix
 2408|  30.2k|      if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (2408:11): [True: 0, False: 30.2k]
  |  Branch (2408:19): [True: 0, False: 0]
  |  Branch (2408:38): [True: 0, False: 0]
  |  Branch (2408:53): [True: 0, False: 0]
  ------------------
 2409|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2409:13): [True: 0, False: 0]
  |  Branch (2409:20): [True: 0, False: 0]
  ------------------
 2410|      0|            TESTAFF(pfx->getCont(), compoundend, pfx->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2411|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2411:13): [True: 0, False: 0]
  |  Branch (2411:20): [True: 0, False: 0]
  ------------------
 2412|      0|            TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2413|      0|        continue;
 2414|      0|      }
 2415|       |
 2416|       |      // check compoundmiddle flag in suffix and prefix
 2417|  30.2k|      if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (2417:11): [True: 0, False: 30.2k]
  |  Branch (2417:19): [True: 0, False: 0]
  |  Branch (2417:38): [True: 0, False: 0]
  |  Branch (2417:56): [True: 0, False: 0]
  ------------------
 2418|      0|          !hu_mov_rule &&
  ------------------
  |  Branch (2418:11): [True: 0, False: 0]
  ------------------
 2419|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2419:13): [True: 0, False: 0]
  |  Branch (2419:20): [True: 0, False: 0]
  ------------------
 2420|      0|            TESTAFF(pfx->getCont(), compoundmiddle, pfx->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2421|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2421:13): [True: 0, False: 0]
  |  Branch (2421:20): [True: 0, False: 0]
  ------------------
 2422|      0|            TESTAFF(sfx->getCont(), compoundmiddle, sfx->getContLen())))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2423|      0|        rv = nullptr;
 2424|      0|      }
 2425|       |
 2426|       |      // check forbiddenwords
 2427|  30.2k|      if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2427:11): [True: 0, False: 30.2k]
  |  Branch (2427:11): [True: 0, False: 30.2k]
  |  Branch (2427:19): [True: 0, False: 0]
  ------------------
 2428|      0|                                 TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen)))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2429|      0|        continue;
 2430|       |
 2431|       |      // increment word number, if the second root has a compoundroot flag
 2432|  30.2k|      if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2432:11): [True: 0, False: 30.2k]
  |  Branch (2432:19): [True: 0, False: 0]
  ------------------
 2433|      0|          (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2433:11): [True: 0, False: 0]
  ------------------
 2434|      0|        wordnum++;
 2435|      0|      }
 2436|       |
 2437|       |      // first word is acceptable in compound words?
 2438|  30.2k|      if (((rv) &&
  ------------------
  |  Branch (2438:11): [True: 0, False: 30.2k]
  |  Branch (2438:12): [True: 0, False: 30.2k]
  ------------------
 2439|      0|           (checked_prefix || (words && words[wnum]) || (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2439:13): [True: 0, False: 0]
  |  Branch (2439:32): [True: 0, False: 0]
  |  Branch (2439:41): [True: 0, False: 0]
  |  Branch (2439:58): [True: 0, False: 0]
  ------------------
 2440|      0|            ((oldwordnum == 0) && compoundbegin && TESTAFF(rv->astr, compoundbegin, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2440:14): [True: 0, False: 0]
  |  Branch (2440:35): [True: 0, False: 0]
  ------------------
 2441|      0|            ((oldwordnum > 0) && compoundmiddle && TESTAFF(rv->astr, compoundmiddle, rv->alen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2441:14): [True: 0, False: 0]
  |  Branch (2441:34): [True: 0, False: 0]
  ------------------
 2442|       |            // LANG_hu section: spec. Hungarian rule
 2443|      0|            || ((langnum == LANG_hu) &&  // hu_mov_rule
  ------------------
  |  Branch (2443:17): [True: 0, False: 0]
  ------------------
 2444|      0|                hu_mov_rule &&
  ------------------
  |  Branch (2444:17): [True: 0, False: 0]
  ------------------
 2445|      0|                (TESTAFF(rv->astr, 'F', rv->alen) || TESTAFF(rv->astr, 'G', rv->alen) || TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              (TESTAFF(rv->astr, 'F', rv->alen) || TESTAFF(rv->astr, 'G', rv->alen) || TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              (TESTAFF(rv->astr, 'F', rv->alen) || TESTAFF(rv->astr, 'G', rv->alen) || TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2446|       |            // END of LANG_hu section
 2447|      0|            ) &&
 2448|      0|           !((checkcompoundtriple && !words &&  // test triple letters
  ------------------
  |  Branch (2448:15): [True: 0, False: 0]
  |  Branch (2448:38): [True: 0, False: 0]
  ------------------
 2449|      0|              (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (2449:15): [True: 0, False: 0]
  ------------------
 2450|      0|              (((i > 1) && (word[i - 1] == word[i - 2])) || ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (2450:17): [True: 0, False: 0]
  |  Branch (2450:28): [True: 0, False: 0]
  |  Branch (2450:61): [True: 0, False: 0]
  ------------------
 2451|      0|               )) ||
 2452|      0|             (
 2453|       |                 // test CHECKCOMPOUNDPATTERN
 2454|      0|                 !checkcpdtable.empty() && !words && cpdpat_check(word, i, rv, nullptr, affixed)) ||
  ------------------
  |  Branch (2454:18): [True: 0, False: 0]
  |  Branch (2454:44): [True: 0, False: 0]
  |  Branch (2454:54): [True: 0, False: 0]
  ------------------
 2455|      0|             (checkcompoundcase && !words && cpdcase_check(word, i))))
  ------------------
  |  Branch (2455:15): [True: 0, False: 0]
  |  Branch (2455:36): [True: 0, False: 0]
  |  Branch (2455:46): [True: 0, False: 0]
  ------------------
 2456|       |          // LANG_hu section: spec. Hungarian rule
 2457|  30.2k|          || ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (2457:15): [True: 30.2k, False: 0]
  |  Branch (2457:24): [True: 7.73k, False: 22.5k]
  |  Branch (2457:48): [True: 0, False: 7.73k]
  |  Branch (2457:63): [True: 0, False: 0]
  ------------------
 2458|      0|              (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2458:16): [True: 0, False: 0]
  |  Branch (2458:23): [True: 0, False: 0]
  ------------------
 2459|      0|               (TESTAFF(sfx->getCont(), (unsigned short)'x', sfx->getContLen()) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2460|      0|                TESTAFF(sfx->getCont(), (unsigned short)'%', sfx->getContLen()))))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2461|       |          // END of LANG_hu section
 2462|  30.2k|      ) {
 2463|       |        // LANG_hu section: spec. Hungarian rule
 2464|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2464:13): [True: 0, False: 0]
  ------------------
 2465|       |          // calculate syllable number of the word
 2466|      0|          numsyllable += get_syllable(st.substr(0, i));
 2467|       |
 2468|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2469|       |          // convention)
 2470|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2470:15): [True: 0, False: 0]
  |  Branch (2470:15): [True: 0, False: 0]
  |  Branch (2470:22): [True: 0, False: 0]
  ------------------
 2471|      0|            wordnum++;
 2472|      0|        }
 2473|       |        // END of LANG_hu section
 2474|       |
 2475|       |        // NEXT WORD(S)
 2476|      0|        rv_first = rv;
 2477|      0|        rv = lookup(word.c_str() + i, word.size() - i);  // perhaps without prefix
 2478|       |
 2479|       |        // search homonym with compound flag
 2480|      0|        while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2480:16): [True: 0, False: 0]
  |  Branch (2480:26): [True: 0, False: 0]
  ------------------
 2481|      0|                        !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2481:28): [True: 0, False: 0]
  |  Branch (2481:44): [True: 0, False: 0]
  ------------------
 2482|      0|                          (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2482:28): [True: 0, False: 0]
  |  Branch (2482:43): [True: 0, False: 0]
  ------------------
 2483|      0|                          (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))))) {
  ------------------
  |  Branch (2483:28): [True: 0, False: 0]
  |  Branch (2483:52): [True: 0, False: 0]
  |  Branch (2483:61): [True: 0, False: 0]
  ------------------
 2484|      0|          rv = rv->next_homonym;
 2485|      0|        }
 2486|       |
 2487|      0|        if (rv && words && words[wnum + 1]) {
  ------------------
  |  Branch (2487:13): [True: 0, False: 0]
  |  Branch (2487:19): [True: 0, False: 0]
  |  Branch (2487:28): [True: 0, False: 0]
  ------------------
 2488|      0|          result.append(presult);
 2489|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2490|      0|          result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2491|      0|          result.append(word, i, word.size());
 2492|      0|          if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (2492:15): [True: 0, False: 0]
  |  Branch (2492:34): [True: 0, False: 0]
  ------------------
 2493|      0|            result.append(HENTRY_DATA2(rv));
 2494|      0|          if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2494:15): [True: 0, False: 0]
  ------------------
 2495|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2496|      0|            result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2497|      0|            result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2498|      0|          }
 2499|       |          // store the pointer of the hash entry
 2500|      0|          if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2500:15): [True: 0, False: 0]
  |  Branch (2500:35): [True: 0, False: 0]
  ------------------
 2501|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2502|      0|            result.append(HENTRY_DATA2(rv));
 2503|      0|          }
 2504|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2505|      0|          return 0;
 2506|      0|        }
 2507|       |
 2508|      0|        oldnumsyllable2 = numsyllable;
 2509|      0|        oldwordnum2 = wordnum;
 2510|       |
 2511|       |        // LANG_hu section: spec. Hungarian rule
 2512|      0|        if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (2512:13): [True: 0, False: 0]
  |  Branch (2512:13): [True: 0, False: 0]
  |  Branch (2512:21): [True: 0, False: 0]
  ------------------
 2513|      0|            (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2513:13): [True: 0, False: 0]
  ------------------
 2514|      0|            !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2514:13): [True: 0, False: 0]
  ------------------
 2515|      0|          numsyllable--;
 2516|      0|        }
 2517|       |        // END of LANG_hu section
 2518|       |        // increment word number, if the second root has a compoundroot flag
 2519|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2519:13): [True: 0, False: 0]
  |  Branch (2519:21): [True: 0, False: 0]
  ------------------
 2520|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2520:13): [True: 0, False: 0]
  ------------------
 2521|      0|          wordnum++;
 2522|      0|        }
 2523|       |
 2524|       |        // check forbiddenwords
 2525|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2525:13): [True: 0, False: 0]
  |  Branch (2525:13): [True: 0, False: 0]
  |  Branch (2525:21): [True: 0, False: 0]
  ------------------
 2526|      0|            (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2527|      0|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2528|      0|          st[i] = ch;
 2529|      0|          continue;
 2530|      0|        }
 2531|       |
 2532|       |        // second word is acceptable, as a root?
 2533|       |        // hungarian conventions: compounding is acceptable,
 2534|       |        // when compound forms consist of 2 words, or if more,
 2535|       |        // then the syllable number of root words must be 6, or lesser.
 2536|      0|        if ((rv) &&
  ------------------
  |  Branch (2536:13): [True: 0, False: 0]
  |  Branch (2536:13): [True: 0, False: 0]
  ------------------
 2537|      0|            ((compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2537:15): [True: 0, False: 0]
  ------------------
 2538|      0|             (compoundend && TESTAFF(rv->astr, compoundend, rv->alen))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2538:15): [True: 0, False: 0]
  ------------------
 2539|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2539:15): [True: 0, False: 0]
  |  Branch (2539:37): [True: 0, False: 0]
  ------------------
 2540|      0|             ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (2540:15): [True: 0, False: 0]
  ------------------
 2541|      0|              (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (2541:15): [True: 0, False: 0]
  ------------------
 2542|      0|               cpdmaxsyllable))) &&
 2543|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2543:15): [True: 0, False: 0]
  |  Branch (2543:36): [True: 0, False: 0]
  ------------------
 2544|       |          // bad compound word
 2545|      0|          result.append(presult);
 2546|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2547|      0|          result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2548|      0|          result.append(word, i, word.size());
 2549|       |
 2550|      0|          if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2550:15): [True: 0, False: 0]
  ------------------
 2551|      0|            if (complexprefixes)
  ------------------
  |  Branch (2551:17): [True: 0, False: 0]
  ------------------
 2552|      0|              result.append(HENTRY_DATA2(rv));
 2553|      0|            if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2553:17): [True: 0, False: 0]
  ------------------
 2554|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2555|      0|              result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2556|      0|              result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2557|      0|            }
 2558|       |            // store the pointer of the hash entry
 2559|      0|            if (!complexprefixes) {
  ------------------
  |  Branch (2559:17): [True: 0, False: 0]
  ------------------
 2560|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2561|      0|              result.append(HENTRY_DATA2(rv));
 2562|      0|            }
 2563|      0|          }
 2564|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2565|      0|          ok = 1;
 2566|      0|        }
 2567|       |
 2568|      0|        numsyllable = oldnumsyllable2;
 2569|      0|        wordnum = oldwordnum2;
 2570|       |
 2571|       |        // perhaps second word has prefix or/and suffix
 2572|      0|        sfx = nullptr;
 2573|      0|        sfxflag = FLAG_NULL;
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
 2574|       |
 2575|      0|        if (compoundflag && !onlycpdrule)
  ------------------
  |  Branch (2575:13): [True: 0, False: 0]
  |  Branch (2575:29): [True: 0, False: 0]
  ------------------
 2576|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundflag);
 2577|      0|        else
 2578|      0|          rv = nullptr;
 2579|       |
 2580|      0|        if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (2580:13): [True: 0, False: 0]
  |  Branch (2580:20): [True: 0, False: 0]
  |  Branch (2580:35): [True: 0, False: 0]
  ------------------
 2581|      0|          sfx = nullptr;
 2582|      0|          pfx = nullptr;
 2583|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundend);
 2584|      0|        }
 2585|       |
 2586|      0|        if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (2586:13): [True: 0, False: 0]
  |  Branch (2586:20): [True: 0, False: 0]
  |  Branch (2586:44): [True: 0, False: 0]
  ------------------
 2587|      0|          rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   74|      0|#define IN_CPD_END 2
  ------------------
 2588|      0|          if (rv && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1)) {
  ------------------
  |  Branch (2588:15): [True: 0, False: 0]
  |  Branch (2588:21): [True: 0, False: 0]
  |  Branch (2588:30): [True: 0, False: 0]
  ------------------
 2589|      0|            std::string m;
 2590|      0|            if (compoundflag)
  ------------------
  |  Branch (2590:17): [True: 0, False: 0]
  ------------------
 2591|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag);
 2592|      0|            if (m.empty() && compoundend) {
  ------------------
  |  Branch (2592:17): [True: 0, False: 0]
  |  Branch (2592:30): [True: 0, False: 0]
  ------------------
 2593|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundend);
 2594|      0|            }
 2595|      0|            result.append(presult);
 2596|      0|            if (!m.empty()) {
  ------------------
  |  Branch (2596:17): [True: 0, False: 0]
  ------------------
 2597|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2598|      0|              result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2599|      0|              result.append(word, i, word.size());
 2600|      0|              line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2601|      0|              result.append(m);
 2602|      0|            }
 2603|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2604|      0|            ok = 1;
 2605|      0|          }
 2606|      0|        }
 2607|       |
 2608|       |        // check non_compound flag in suffix and prefix
 2609|      0|        if ((rv) &&
  ------------------
  |  Branch (2609:13): [True: 0, False: 0]
  ------------------
 2610|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2610:15): [True: 0, False: 0]
  |  Branch (2610:22): [True: 0, False: 0]
  ------------------
 2611|      0|              TESTAFF(pfx->getCont(), compoundforbidflag, pfx->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2612|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2612:15): [True: 0, False: 0]
  |  Branch (2612:22): [True: 0, False: 0]
  ------------------
 2613|      0|              TESTAFF(sfx->getCont(), compoundforbidflag,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2614|      0|                      sfx->getContLen())))) {
 2615|      0|          rv = nullptr;
 2616|      0|        }
 2617|       |
 2618|       |        // check forbiddenwords
 2619|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2619:13): [True: 0, False: 0]
  |  Branch (2619:13): [True: 0, False: 0]
  |  Branch (2619:21): [True: 0, False: 0]
  ------------------
 2620|      0|            (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2621|      0|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2622|      0|            (!TESTAFF(rv->astr, needaffix, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2622:13): [True: 0, False: 0]
  ------------------
 2623|      0|          st[i] = ch;
 2624|      0|          continue;
 2625|      0|        }
 2626|       |
 2627|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2627:13): [True: 0, False: 0]
  ------------------
 2628|       |          // calculate syllable number of the word
 2629|      0|          numsyllable += get_syllable(word.c_str() + i);
 2630|       |
 2631|       |          // - affix syllable num.
 2632|       |          // XXX only second suffix (inflections, not derivations)
 2633|      0|          if (sfxappnd) {
  ------------------
  |  Branch (2633:15): [True: 0, False: 0]
  ------------------
 2634|      0|            std::string tmp(sfxappnd);
 2635|      0|            reverseword(tmp);
 2636|      0|            numsyllable -= short(get_syllable(tmp) + sfxextra);
 2637|      0|          } else {
 2638|      0|            numsyllable -= short(sfxextra);
 2639|      0|          }
 2640|       |
 2641|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2642|       |          // convention)
 2643|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2643:15): [True: 0, False: 0]
  |  Branch (2643:15): [True: 0, False: 0]
  |  Branch (2643:22): [True: 0, False: 0]
  ------------------
 2644|      0|            wordnum++;
 2645|       |
 2646|       |          // increment syllable num, if last word has a SYLLABLENUM flag
 2647|       |          // and the suffix is beginning `s'
 2648|       |
 2649|      0|          if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2649:15): [True: 0, False: 0]
  ------------------
 2650|      0|            switch (sfxflag) {
  ------------------
  |  Branch (2650:21): [True: 0, False: 0]
  ------------------
 2651|      0|              case 'c': {
  ------------------
  |  Branch (2651:15): [True: 0, False: 0]
  ------------------
 2652|      0|                numsyllable += 2;
 2653|      0|                break;
 2654|      0|              }
 2655|      0|              case 'J': {
  ------------------
  |  Branch (2655:15): [True: 0, False: 0]
  ------------------
 2656|      0|                numsyllable += 1;
 2657|      0|                break;
 2658|      0|              }
 2659|      0|              case 'I': {
  ------------------
  |  Branch (2659:15): [True: 0, False: 0]
  ------------------
 2660|      0|                if (rv && TESTAFF(rv->astr, 'J', rv->alen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2660:21): [True: 0, False: 0]
  |  Branch (2660:21): [True: 0, False: 0]
  ------------------
 2661|      0|                  numsyllable += 1;
 2662|      0|                break;
 2663|      0|              }
 2664|      0|            }
 2665|      0|          }
 2666|      0|        }
 2667|       |
 2668|       |        // increment word number, if the second word has a compoundroot flag
 2669|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2669:13): [True: 0, False: 0]
  |  Branch (2669:21): [True: 0, False: 0]
  ------------------
 2670|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2670:13): [True: 0, False: 0]
  ------------------
 2671|      0|          wordnum++;
 2672|      0|        }
 2673|       |        // second word is acceptable, as a word with prefix or/and suffix?
 2674|       |        // hungarian conventions: compounding is acceptable,
 2675|       |        // when compound forms consist 2 word, otherwise
 2676|       |        // the syllable number of root words is 6, or lesser.
 2677|      0|        if ((rv) &&
  ------------------
  |  Branch (2677:13): [True: 0, False: 0]
  ------------------
 2678|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2678:15): [True: 0, False: 0]
  |  Branch (2678:37): [True: 0, False: 0]
  ------------------
 2679|      0|             ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2679:15): [True: 0, False: 0]
  |  Branch (2679:40): [True: 0, False: 0]
  ------------------
 2680|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2680:15): [True: 0, False: 0]
  |  Branch (2680:36): [True: 0, False: 0]
  ------------------
 2681|      0|          std::string m;
 2682|      0|          if (compoundflag)
  ------------------
  |  Branch (2682:15): [True: 0, False: 0]
  ------------------
 2683|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag);
 2684|      0|          if (m.empty() && compoundend) {
  ------------------
  |  Branch (2684:15): [True: 0, False: 0]
  |  Branch (2684:28): [True: 0, False: 0]
  ------------------
 2685|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundend);
 2686|      0|          }
 2687|      0|          result.append(presult);
 2688|      0|          if (!m.empty()) {
  ------------------
  |  Branch (2688:15): [True: 0, False: 0]
  ------------------
 2689|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2690|      0|            result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2691|      0|            result.append(word, i, word.size());
 2692|      0|            line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2693|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2694|      0|            result.append(m);
 2695|      0|          }
 2696|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2697|      0|          ok = 1;
 2698|      0|        }
 2699|       |
 2700|      0|        numsyllable = oldnumsyllable2;
 2701|      0|        wordnum = oldwordnum2;
 2702|       |
 2703|       |        // perhaps second word is a compound word (recursive call)
 2704|      0|        if ((wordnum + 2 < maxwordnum) && (wnum + 1 < maxwordnum) && (ok == 0)) {
  ------------------
  |  Branch (2704:13): [True: 0, False: 0]
  |  Branch (2704:43): [True: 0, False: 0]
  |  Branch (2704:70): [True: 0, False: 0]
  ------------------
 2705|      0|          compound_check_morph(word.substr(i), wordnum + 1,
 2706|      0|                               numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2707|      0|                               result, &presult, scratch);
 2708|      0|        } else {
 2709|      0|          rv = nullptr;
 2710|      0|        }
 2711|      0|      }
 2712|  30.2k|      st[i] = ch;
 2713|  30.2k|      wordnum = oldwordnum;
 2714|  30.2k|      numsyllable = oldnumsyllable;
 2715|       |
 2716|  30.2k|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2716:14): [True: 0, False: 30.2k]
  |  Branch (2716:38): [True: 0, False: 0]
  ------------------
 2717|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2717:14): [True: 0, False: 0]
  ------------------
 2718|  30.4k|  }
 2719|  2.11k|  return 0;
 2720|  2.30k|}
_ZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttct:
 2744|   556M|                                      const FLAG avoidflag) {
 2745|   556M|  struct hentry* rv = nullptr;
 2746|   556M|  PfxEntry* ep = ppfx;
 2747|       |
 2748|       |  // first handle the special case of 0 length suffixes
 2749|   556M|  SfxEntry* se = sStart[0];
 2750|       |
 2751|   556M|  while (se) {
  ------------------
  |  Branch (2751:10): [True: 0, False: 556M]
  ------------------
 2752|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (2752:9): [True: 0, False: 0]
  |  Branch (2752:20): [True: 0, False: 0]
  ------------------
 2753|       |      // suffixes are not allowed in beginning of compounds
 2754|      0|      if ((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2754:12): [True: 0, False: 0]
  ------------------
 2755|       |           // except when signed with compoundpermitflag flag
 2756|      0|           (se->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2756:13): [True: 0, False: 0]
  |  Branch (2756:30): [True: 0, False: 0]
  ------------------
 2757|      0|            TESTAFF(se->getCont(), compoundpermitflag, se->getContLen()))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2758|      0|          (!circumfix ||
  ------------------
  |  Branch (2758:12): [True: 0, False: 0]
  ------------------
 2759|       |           // no circumfix flag in prefix and suffix
 2760|      0|           ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (2760:14): [True: 0, False: 0]
  |  Branch (2760:23): [True: 0, False: 0]
  ------------------
 2761|      0|             !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2761:14): [True: 0, False: 0]
  ------------------
 2762|      0|            (!se->getCont() ||
  ------------------
  |  Branch (2762:14): [True: 0, False: 0]
  ------------------
 2763|      0|             !(TESTAFF(se->getCont(), circumfix, se->getContLen())))) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2763:14): [True: 0, False: 0]
  ------------------
 2764|       |           // circumfix flag in prefix AND suffix
 2765|      0|           ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (2765:14): [True: 0, False: 0]
  |  Branch (2765:22): [True: 0, False: 0]
  ------------------
 2766|      0|             TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2767|      0|            (se->getCont() &&
  ------------------
  |  Branch (2767:14): [True: 0, False: 0]
  ------------------
 2768|      0|             (TESTAFF(se->getCont(), circumfix, se->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2768:14): [True: 0, False: 0]
  ------------------
 2769|       |          // fogemorpheme
 2770|      0|          (in_compound ||
  ------------------
  |  Branch (2770:12): [True: 0, False: 0]
  ------------------
 2771|      0|           !(se->getCont() &&
  ------------------
  |  Branch (2771:14): [True: 0, False: 0]
  ------------------
 2772|      0|             (TESTAFF(se->getCont(), onlyincompound, se->getContLen())))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2772:14): [True: 0, False: 0]
  ------------------
 2773|       |          // needaffix on prefix or first suffix
 2774|      0|          (cclass ||
  ------------------
  |  Branch (2774:12): [True: 0, False: 0]
  ------------------
 2775|      0|           !(se->getCont() &&
  ------------------
  |  Branch (2775:14): [True: 0, False: 0]
  ------------------
 2776|      0|             TESTAFF(se->getCont(), needaffix, se->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2777|      0|           (ppfx &&
  ------------------
  |  Branch (2777:13): [True: 0, False: 0]
  ------------------
 2778|      0|            !((ep->getCont()) &&
  ------------------
  |  Branch (2778:15): [True: 0, False: 0]
  ------------------
 2779|      0|              TESTAFF(ep->getCont(), needaffix, ep->getContLen()))))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2780|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx,
 2781|      0|                           (FLAG)cclass, needflag,
 2782|      0|                           (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (2782:29): [True: 0, False: 0]
  ------------------
 2783|      0|                           scratch);
 2784|       |        // Skip a stem with the avoid flag and keep scanning the other suffixes.
 2785|      0|        if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen))
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
                      if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2785:13): [True: 0, False: 0]
  |  Branch (2785:19): [True: 0, False: 0]
  ------------------
 2786|      0|          rv = nullptr;
 2787|      0|        if (rv) {
  ------------------
  |  Branch (2787:13): [True: 0, False: 0]
  ------------------
 2788|      0|          sfx = se;  // BUG: sfx not stateless
 2789|      0|          return rv;
 2790|      0|        }
 2791|      0|      }
 2792|      0|    }
 2793|      0|    se = se->getNext();
 2794|      0|  }
 2795|       |
 2796|       |  // now handle the general case
 2797|   556M|  if (len == 0)
  ------------------
  |  Branch (2797:7): [True: 56.8k, False: 556M]
  ------------------
 2798|  56.8k|    return nullptr;  // FULLSTRIP
 2799|   556M|  unsigned char sp = word[start + len - 1];
 2800|   556M|  SfxEntry* sptr = sStart[sp];
 2801|       |
 2802|   556M|  while (sptr) {
  ------------------
  |  Branch (2802:10): [True: 344k, False: 556M]
  ------------------
 2803|   344k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (2803:9): [True: 296k, False: 47.9k]
  ------------------
 2804|       |      // suffixes are not allowed in beginning of compounds
 2805|   296k|      if ((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|   296k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2805:12): [True: 66.0k, False: 230k]
  ------------------
 2806|       |           // except when signed with compoundpermitflag flag
 2807|   230k|           (sptr->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2807:13): [True: 230k, False: 0]
  |  Branch (2807:32): [True: 0, False: 230k]
  ------------------
 2808|      0|            TESTAFF(sptr->getCont(), compoundpermitflag,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2809|   230k|                    sptr->getContLen()))) &&
 2810|  66.0k|          (!circumfix ||
  ------------------
  |  Branch (2810:12): [True: 66.0k, False: 0]
  ------------------
 2811|       |           // no circumfix flag in prefix and suffix
 2812|      0|           ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (2812:14): [True: 0, False: 0]
  |  Branch (2812:23): [True: 0, False: 0]
  ------------------
 2813|      0|             !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2813:14): [True: 0, False: 0]
  ------------------
 2814|      0|            (!sptr->getCont() ||
  ------------------
  |  Branch (2814:14): [True: 0, False: 0]
  ------------------
 2815|      0|             !(TESTAFF(sptr->getCont(), circumfix, sptr->getContLen())))) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2815:14): [True: 0, False: 0]
  ------------------
 2816|       |           // circumfix flag in prefix AND suffix
 2817|      0|           ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (2817:14): [True: 0, False: 0]
  |  Branch (2817:22): [True: 0, False: 0]
  ------------------
 2818|      0|             TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2819|      0|            (sptr->getCont() &&
  ------------------
  |  Branch (2819:14): [True: 0, False: 0]
  ------------------
 2820|      0|             (TESTAFF(sptr->getCont(), circumfix, sptr->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2820:14): [True: 0, False: 0]
  ------------------
 2821|       |          // fogemorpheme
 2822|  66.0k|          (in_compound ||
  ------------------
  |  Branch (2822:12): [True: 0, False: 66.0k]
  ------------------
 2823|  66.0k|           !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound,
  ------------------
  |  |   99|  24.3k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2823:15): [True: 24.3k, False: 41.6k]
  |  Branch (2823:34): [True: 0, False: 24.3k]
  ------------------
 2824|  24.3k|                                          sptr->getContLen()))))) &&
 2825|       |          // needaffix on prefix or first suffix
 2826|  66.0k|          (cclass ||
  ------------------
  |  Branch (2826:12): [True: 629, False: 65.3k]
  ------------------
 2827|  65.3k|           !(sptr->getCont() &&
  ------------------
  |  Branch (2827:14): [True: 24.3k, False: 41.0k]
  ------------------
 2828|  24.3k|             TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) ||
  ------------------
  |  |   99|  24.3k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 24.3k]
  |  |  ------------------
  ------------------
 2829|      0|           (ppfx &&
  ------------------
  |  Branch (2829:13): [True: 0, False: 0]
  ------------------
 2830|      0|            !((ep->getCont()) &&
  ------------------
  |  Branch (2830:15): [True: 0, False: 0]
  ------------------
 2831|      0|              TESTAFF(ep->getCont(), needaffix, ep->getContLen())))))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2832|  66.0k|        if (in_compound != IN_CPD_END || ppfx ||
  ------------------
  |  |   74|   132k|#define IN_CPD_END 2
  ------------------
  |  Branch (2832:13): [True: 66.0k, False: 0]
  |  Branch (2832:42): [True: 0, False: 0]
  ------------------
 2833|      0|            !(sptr->getCont() &&
  ------------------
  |  Branch (2833:15): [True: 0, False: 0]
  ------------------
 2834|  66.0k|              TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2835|  66.0k|          rv = sptr->checkword(word, start, len, sfxopts, ppfx,
 2836|  66.0k|                               cclass, needflag,
 2837|  66.0k|                               (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (2837:33): [True: 0, False: 66.0k]
  ------------------
 2838|  66.0k|                               scratch);
 2839|  66.0k|          if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen))
  ------------------
  |  |   96|  66.0k|#define FLAG_NULL 0x00
  ------------------
                        if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2839:15): [True: 0, False: 66.0k]
  |  Branch (2839:21): [True: 0, False: 0]
  ------------------
 2840|      0|            rv = nullptr;
 2841|  66.0k|          if (rv) {
  ------------------
  |  Branch (2841:15): [True: 0, False: 66.0k]
  ------------------
 2842|      0|            sfx = sptr;                 // BUG: sfx not stateless
 2843|      0|            sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 2844|      0|            if (!sptr->getCont())
  ------------------
  |  Branch (2844:17): [True: 0, False: 0]
  ------------------
 2845|      0|              sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 2846|       |            // LANG_hu section: spec. Hungarian rule
 2847|      0|            else if (langnum == LANG_hu && sptr->getKeyLen() &&
  ------------------
  |  Branch (2847:22): [True: 0, False: 0]
  |  Branch (2847:44): [True: 0, False: 0]
  ------------------
 2848|      0|                     sptr->getKey()[0] == 'i' && sptr->getKey()[1] != 'y' &&
  ------------------
  |  Branch (2848:22): [True: 0, False: 0]
  |  Branch (2848:50): [True: 0, False: 0]
  ------------------
 2849|      0|                     sptr->getKey()[1] != 't') {
  ------------------
  |  Branch (2849:22): [True: 0, False: 0]
  ------------------
 2850|      0|              sfxextra = 1;
 2851|      0|            }
 2852|       |            // END of LANG_hu section
 2853|      0|            return rv;
 2854|      0|          }
 2855|  66.0k|        }
 2856|   296k|      sptr = sptr->getNextEQ();
 2857|   296k|    } else {
 2858|  47.9k|      sptr = sptr->getNextNE();
 2859|  47.9k|    }
 2860|   344k|  }
 2861|       |
 2862|   556M|  return nullptr;
 2863|   556M|}
_ZN8AffixMgr19suffix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratcht:
 2872|  16.7M|                                             const FLAG needflag) {
 2873|  16.7M|  struct hentry* rv = nullptr;
 2874|       |
 2875|       |  // first handle the special case of 0 length suffixes
 2876|  16.7M|  SfxEntry* se = sStart[0];
 2877|  16.7M|  while (se) {
  ------------------
  |  Branch (2877:10): [True: 0, False: 16.7M]
  ------------------
 2878|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (2878:9): [True: 0, False: 0]
  ------------------
 2879|      0|      rv = se->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 2880|      0|      if (rv)
  ------------------
  |  Branch (2880:11): [True: 0, False: 0]
  ------------------
 2881|      0|        return rv;
 2882|      0|    }
 2883|      0|    se = se->getNext();
 2884|      0|  }
 2885|       |
 2886|       |  // now handle the general case
 2887|  16.7M|  if (len == 0)
  ------------------
  |  Branch (2887:7): [True: 17.4k, False: 16.6M]
  ------------------
 2888|  17.4k|    return nullptr;  // FULLSTRIP
 2889|  16.6M|  unsigned char sp = word[start + len - 1];
 2890|  16.6M|  SfxEntry* sptr = sStart[sp];
 2891|       |
 2892|  16.7M|  while (sptr) {
  ------------------
  |  Branch (2892:10): [True: 98.2k, False: 16.6M]
  ------------------
 2893|  98.2k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (2893:9): [True: 58.6k, False: 39.5k]
  ------------------
 2894|  58.6k|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (2894:11): [True: 34.3k, False: 24.3k]
  ------------------
 2895|  34.3k|        rv = sptr->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 2896|  34.3k|        if (rv) {
  ------------------
  |  Branch (2896:13): [True: 0, False: 34.3k]
  ------------------
 2897|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 2898|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (2898:15): [True: 0, False: 0]
  ------------------
 2899|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 2900|      0|          return rv;
 2901|      0|        }
 2902|  34.3k|      }
 2903|  58.6k|      sptr = sptr->getNextEQ();
 2904|  58.6k|    } else {
 2905|  39.5k|      sptr = sptr->getNextNE();
 2906|  39.5k|    }
 2907|  98.2k|  }
 2908|       |
 2909|  16.6M|  return nullptr;
 2910|  16.6M|}
_ZN8AffixMgr25suffix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratcht:
 2919|  4.46k|                                                const FLAG needflag) {
 2920|  4.46k|  std::string result;
 2921|  4.46k|  std::string result2;
 2922|  4.46k|  std::string result3;
 2923|       |
 2924|       |  // first handle the special case of 0 length suffixes
 2925|  4.46k|  SfxEntry* se = sStart[0];
 2926|  4.46k|  while (se) {
  ------------------
  |  Branch (2926:10): [True: 0, False: 4.46k]
  ------------------
 2927|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (2927:9): [True: 0, False: 0]
  ------------------
 2928|      0|      std::string st = se->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 2929|      0|      if (!st.empty()) {
  ------------------
  |  Branch (2929:11): [True: 0, False: 0]
  ------------------
 2930|      0|        if (ppfx) {
  ------------------
  |  Branch (2930:13): [True: 0, False: 0]
  ------------------
 2931|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (2931:15): [True: 0, False: 0]
  ------------------
 2932|      0|            result.append(ppfx->getMorph());
 2933|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2934|      0|          } else
 2935|      0|            debugflag(result, ppfx->getFlag());
 2936|      0|        }
 2937|      0|        result.append(st);
 2938|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (2938:13): [True: 0, False: 0]
  ------------------
 2939|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2940|      0|          result.append(se->getMorph());
 2941|      0|        } else
 2942|      0|          debugflag(result, se->getFlag());
 2943|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2944|      0|      }
 2945|      0|    }
 2946|      0|    se = se->getNext();
 2947|      0|  }
 2948|       |
 2949|       |  // now handle the general case
 2950|  4.46k|  if (len == 0)
  ------------------
  |  Branch (2950:7): [True: 1, False: 4.46k]
  ------------------
 2951|      1|    return { };  // FULLSTRIP
 2952|  4.46k|  unsigned char sp = word[start + len - 1];
 2953|  4.46k|  SfxEntry* sptr = sStart[sp];
 2954|       |
 2955|  4.47k|  while (sptr) {
  ------------------
  |  Branch (2955:10): [True: 7, False: 4.46k]
  ------------------
 2956|      7|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (2956:9): [True: 1, False: 6]
  ------------------
 2957|      1|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (2957:11): [True: 0, False: 1]
  ------------------
 2958|      0|        std::string st = sptr->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 2959|      0|        if (!st.empty()) {
  ------------------
  |  Branch (2959:13): [True: 0, False: 0]
  ------------------
 2960|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 2961|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (2961:15): [True: 0, False: 0]
  ------------------
 2962|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 2963|      0|          result2.assign(st);
 2964|       |
 2965|      0|          result3.clear();
 2966|       |
 2967|      0|          if (sptr->getMorph()) {
  ------------------
  |  Branch (2967:15): [True: 0, False: 0]
  ------------------
 2968|      0|            result3.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2969|      0|            result3.append(sptr->getMorph());
 2970|      0|          } else
 2971|      0|            debugflag(result3, sptr->getFlag());
 2972|      0|          strlinecat(result2, result3);
 2973|      0|          result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2974|      0|          result.append(result2);
 2975|      0|        }
 2976|      0|      }
 2977|      1|      sptr = sptr->getNextEQ();
 2978|      6|    } else {
 2979|      6|      sptr = sptr->getNextNE();
 2980|      6|    }
 2981|      7|  }
 2982|       |
 2983|  4.46k|  return result;
 2984|  4.46k|}
_ZN8AffixMgr18suffix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttc:
 2994|  14.2k|                                         char in_compound) {
 2995|  14.2k|  std::string result;
 2996|       |
 2997|  14.2k|  struct hentry* rv = nullptr;
 2998|       |
 2999|  14.2k|  PfxEntry* ep = ppfx;
 3000|       |
 3001|       |  // first handle the special case of 0 length suffixes
 3002|  14.2k|  SfxEntry* se = sStart[0];
 3003|  14.2k|  while (se) {
  ------------------
  |  Branch (3003:10): [True: 0, False: 14.2k]
  ------------------
 3004|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (3004:9): [True: 0, False: 0]
  |  Branch (3004:20): [True: 0, False: 0]
  ------------------
 3005|       |      // suffixes are not allowed in beginning of compounds
 3006|      0|      if (((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (3006:13): [True: 0, False: 0]
  ------------------
 3007|       |            // except when signed with compoundpermitflag flag
 3008|      0|            (se->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (3008:14): [True: 0, False: 0]
  |  Branch (3008:31): [True: 0, False: 0]
  ------------------
 3009|      0|             TESTAFF(se->getCont(), compoundpermitflag, se->getContLen()))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3010|      0|           (!circumfix ||
  ------------------
  |  Branch (3010:13): [True: 0, False: 0]
  ------------------
 3011|       |            // no circumfix flag in prefix and suffix
 3012|      0|            ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (3012:15): [True: 0, False: 0]
  |  Branch (3012:24): [True: 0, False: 0]
  ------------------
 3013|      0|              !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3013:15): [True: 0, False: 0]
  ------------------
 3014|      0|             (!se->getCont() ||
  ------------------
  |  Branch (3014:15): [True: 0, False: 0]
  ------------------
 3015|      0|              !(TESTAFF(se->getCont(), circumfix, se->getContLen())))) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3015:15): [True: 0, False: 0]
  ------------------
 3016|       |            // circumfix flag in prefix AND suffix
 3017|      0|            ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (3017:15): [True: 0, False: 0]
  |  Branch (3017:23): [True: 0, False: 0]
  ------------------
 3018|      0|              TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3019|      0|             (se->getCont() &&
  ------------------
  |  Branch (3019:15): [True: 0, False: 0]
  ------------------
 3020|      0|              (TESTAFF(se->getCont(), circumfix, se->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3020:15): [True: 0, False: 0]
  ------------------
 3021|       |           // fogemorpheme
 3022|      0|           (in_compound ||
  ------------------
  |  Branch (3022:13): [True: 0, False: 0]
  ------------------
 3023|      0|            !((se->getCont() &&
  ------------------
  |  Branch (3023:16): [True: 0, False: 0]
  ------------------
 3024|      0|               (TESTAFF(se->getCont(), onlyincompound, se->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3024:16): [True: 0, False: 0]
  ------------------
 3025|       |           // needaffix on prefix or first suffix
 3026|      0|           (cclass ||
  ------------------
  |  Branch (3026:13): [True: 0, False: 0]
  ------------------
 3027|      0|            !(se->getCont() &&
  ------------------
  |  Branch (3027:15): [True: 0, False: 0]
  ------------------
 3028|      0|              TESTAFF(se->getCont(), needaffix, se->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3029|      0|            (ppfx &&
  ------------------
  |  Branch (3029:14): [True: 0, False: 0]
  ------------------
 3030|      0|             !((ep->getCont()) &&
  ------------------
  |  Branch (3030:16): [True: 0, False: 0]
  ------------------
 3031|      0|               TESTAFF(ep->getCont(), needaffix, ep->getContLen()))))))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3032|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx, cclass,
 3033|      0|                           needflag, FLAG_NULL, scratch);
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
 3034|      0|      while (rv) {
  ------------------
  |  Branch (3034:14): [True: 0, False: 0]
  ------------------
 3035|      0|        if (ppfx) {
  ------------------
  |  Branch (3035:13): [True: 0, False: 0]
  ------------------
 3036|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3036:15): [True: 0, False: 0]
  ------------------
 3037|      0|            result.append(ppfx->getMorph());
 3038|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3039|      0|          } else
 3040|      0|            debugflag(result, ppfx->getFlag());
 3041|      0|        }
 3042|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3042:13): [True: 0, False: 0]
  |  Branch (3042:32): [True: 0, False: 0]
  ------------------
 3043|      0|          result.append(HENTRY_DATA2(rv));
 3044|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (3044:13): [True: 0, False: 0]
  ------------------
 3045|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3046|      0|          result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 3047|      0|          result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 3048|      0|        }
 3049|       |
 3050|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3050:13): [True: 0, False: 0]
  |  Branch (3050:33): [True: 0, False: 0]
  ------------------
 3051|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3052|      0|          result.append(HENTRY_DATA2(rv));
 3053|      0|        }
 3054|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (3054:13): [True: 0, False: 0]
  ------------------
 3055|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3056|      0|          result.append(se->getMorph());
 3057|      0|        } else
 3058|      0|          debugflag(result, se->getFlag());
 3059|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 3060|      0|        rv = se->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3061|      0|      }
 3062|      0|    }
 3063|      0|    se = se->getNext();
 3064|      0|  }
 3065|       |
 3066|       |  // now handle the general case
 3067|  14.2k|  if (len == 0)
  ------------------
  |  Branch (3067:7): [True: 1, False: 14.2k]
  ------------------
 3068|      1|    return { };  // FULLSTRIP
 3069|  14.2k|  unsigned char sp = word[start + len - 1];
 3070|  14.2k|  SfxEntry* sptr = sStart[sp];
 3071|       |
 3072|  14.2k|  while (sptr) {
  ------------------
  |  Branch (3072:10): [True: 8, False: 14.2k]
  ------------------
 3073|      8|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3073:9): [True: 2, False: 6]
  ------------------
 3074|       |      // suffixes are not allowed in beginning of compounds
 3075|      2|      if (((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|      2|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (3075:13): [True: 2, False: 0]
  ------------------
 3076|       |            // except when signed with compoundpermitflag flag
 3077|      0|            (sptr->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (3077:14): [True: 0, False: 0]
  |  Branch (3077:33): [True: 0, False: 0]
  ------------------
 3078|      0|             TESTAFF(sptr->getCont(), compoundpermitflag,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3079|      0|                     sptr->getContLen()))) &&
 3080|      2|           (!circumfix ||
  ------------------
  |  Branch (3080:13): [True: 2, False: 0]
  ------------------
 3081|       |            // no circumfix flag in prefix and suffix
 3082|      0|            ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (3082:15): [True: 0, False: 0]
  |  Branch (3082:24): [True: 0, False: 0]
  ------------------
 3083|      0|              !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3083:15): [True: 0, False: 0]
  ------------------
 3084|      0|             (!sptr->getCont() ||
  ------------------
  |  Branch (3084:15): [True: 0, False: 0]
  ------------------
 3085|      0|              !(TESTAFF(sptr->getCont(), circumfix, sptr->getContLen())))) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3085:15): [True: 0, False: 0]
  ------------------
 3086|       |            // circumfix flag in prefix AND suffix
 3087|      0|            ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (3087:15): [True: 0, False: 0]
  |  Branch (3087:23): [True: 0, False: 0]
  ------------------
 3088|      0|              TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3089|      0|             (sptr->getCont() &&
  ------------------
  |  Branch (3089:15): [True: 0, False: 0]
  ------------------
 3090|      0|              (TESTAFF(sptr->getCont(), circumfix, sptr->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3090:15): [True: 0, False: 0]
  ------------------
 3091|       |           // fogemorpheme
 3092|      2|           (in_compound ||
  ------------------
  |  Branch (3092:13): [True: 0, False: 2]
  ------------------
 3093|      2|            !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound,
  ------------------
  |  |   99|      1|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3093:16): [True: 1, False: 1]
  |  Branch (3093:35): [True: 0, False: 1]
  ------------------
 3094|      1|                                           sptr->getContLen()))))) &&
 3095|       |           // needaffix on first suffix
 3096|      2|           (cclass ||
  ------------------
  |  Branch (3096:13): [True: 0, False: 2]
  ------------------
 3097|      2|            !(sptr->getCont() &&
  ------------------
  |  Branch (3097:15): [True: 1, False: 1]
  ------------------
 3098|      1|              TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())))))
  ------------------
  |  |   99|      1|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 3099|      2|        rv = sptr->checkword(word, start, len, sfxopts, ppfx, cclass,
 3100|      2|                             needflag, FLAG_NULL, scratch);
  ------------------
  |  |   96|      2|#define FLAG_NULL 0x00
  ------------------
 3101|      2|      while (rv) {
  ------------------
  |  Branch (3101:14): [True: 0, False: 2]
  ------------------
 3102|      0|        if (ppfx) {
  ------------------
  |  Branch (3102:13): [True: 0, False: 0]
  ------------------
 3103|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3103:15): [True: 0, False: 0]
  ------------------
 3104|      0|            result.append(ppfx->getMorph());
 3105|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3106|      0|          } else
 3107|      0|            debugflag(result, ppfx->getFlag());
 3108|      0|        }
 3109|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3109:13): [True: 0, False: 0]
  |  Branch (3109:32): [True: 0, False: 0]
  ------------------
 3110|      0|          result.append(HENTRY_DATA2(rv));
 3111|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (3111:13): [True: 0, False: 0]
  ------------------
 3112|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3113|      0|          result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 3114|      0|          result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 3115|      0|        }
 3116|       |
 3117|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3117:13): [True: 0, False: 0]
  |  Branch (3117:33): [True: 0, False: 0]
  ------------------
 3118|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3119|      0|          result.append(HENTRY_DATA2(rv));
 3120|      0|        }
 3121|       |
 3122|      0|        if (sptr->getMorph()) {
  ------------------
  |  Branch (3122:13): [True: 0, False: 0]
  ------------------
 3123|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3124|      0|          result.append(sptr->getMorph());
 3125|      0|        } else
 3126|      0|          debugflag(result, sptr->getFlag());
 3127|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 3128|      0|        rv = sptr->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3129|      0|      }
 3130|      2|      sptr = sptr->getNextEQ();
 3131|      6|    } else {
 3132|      6|      sptr = sptr->getNextNE();
 3133|      6|    }
 3134|      8|  }
 3135|       |
 3136|  14.2k|  return result;
 3137|  14.2k|}
_ZN8AffixMgr11affix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtct:
 3146|  16.5M|                                     const FLAG avoidflag) {
 3147|       |
 3148|       |  // check all prefixes (also crossed with suffixes if allowed)
 3149|  16.5M|  struct hentry* rv = prefix_check(word, start, len, in_compound, scratch, needflag, avoidflag);
 3150|  16.5M|  if (rv)
  ------------------
  |  Branch (3150:7): [True: 0, False: 16.5M]
  ------------------
 3151|      0|    return rv;
 3152|       |
 3153|       |  // if still not found check all suffixes
 3154|  16.5M|  rv = suffix_check(word, start, len, 0, nullptr, scratch, FLAG_NULL, needflag, in_compound, avoidflag);
  ------------------
  |  |   96|  16.5M|#define FLAG_NULL 0x00
  ------------------
 3155|       |
 3156|  16.5M|  if (havecontclass) {
  ------------------
  |  Branch (3156:7): [True: 5.57M, False: 10.9M]
  ------------------
 3157|  5.57M|    sfx = nullptr;
 3158|  5.57M|    pfx = nullptr;
 3159|       |
 3160|  5.57M|    if (rv)
  ------------------
  |  Branch (3160:9): [True: 0, False: 5.57M]
  ------------------
 3161|      0|      return rv;
 3162|       |    // if still not found check all two-level suffixes
 3163|  5.57M|    rv = suffix_check_twosfx(word, start, len, 0, nullptr, scratch, needflag);
 3164|       |
 3165|  5.57M|    if (rv)
  ------------------
  |  Branch (3165:9): [True: 0, False: 5.57M]
  ------------------
 3166|      0|      return rv;
 3167|       |    // if still not found check all two-level suffixes
 3168|  5.57M|    rv = prefix_check_twosfx(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   72|  5.57M|#define IN_CPD_NOT 0
  ------------------
 3169|  5.57M|  }
 3170|       |
 3171|  16.5M|  return rv;
 3172|  16.5M|}
_ZN8AffixMgr17affix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtc:
 3180|  14.2k|                                  char in_compound) {
 3181|  14.2k|  std::string result;
 3182|       |
 3183|       |  // check all prefixes (also crossed with suffixes if allowed)
 3184|  14.2k|  std::string st = prefix_check_morph(word, start, len, in_compound, scratch);
 3185|  14.2k|  if (!st.empty()) {
  ------------------
  |  Branch (3185:7): [True: 0, False: 14.2k]
  ------------------
 3186|      0|    result.append(st);
 3187|      0|  }
 3188|       |
 3189|       |  // if still not found check all suffixes
 3190|  14.2k|  st = suffix_check_morph(word, start, len, 0, nullptr, scratch, '\0', needflag, in_compound);
 3191|  14.2k|  if (!st.empty()) {
  ------------------
  |  Branch (3191:7): [True: 0, False: 14.2k]
  ------------------
 3192|      0|    result.append(st);
 3193|      0|  }
 3194|       |
 3195|  14.2k|  if (havecontclass) {
  ------------------
  |  Branch (3195:7): [True: 4.46k, False: 9.75k]
  ------------------
 3196|  4.46k|    sfx = nullptr;
 3197|  4.46k|    pfx = nullptr;
 3198|       |    // if still not found check all two-level suffixes
 3199|  4.46k|    st = suffix_check_twosfx_morph(word, start, len, 0, nullptr, scratch, needflag);
 3200|  4.46k|    if (!st.empty()) {
  ------------------
  |  Branch (3200:9): [True: 0, False: 4.46k]
  ------------------
 3201|      0|      result.append(st);
 3202|      0|    }
 3203|       |
 3204|       |    // if still not found check all two-level suffixes
 3205|  4.46k|    st = prefix_check_twosfx_morph(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   72|  4.46k|#define IN_CPD_NOT 0
  ------------------
 3206|  4.46k|    if (!st.empty()) {
  ------------------
  |  Branch (3206:9): [True: 0, False: 4.46k]
  ------------------
 3207|      0|      result.append(st);
 3208|      0|    }
 3209|  4.46k|  }
 3210|       |
 3211|  14.2k|  return result;
 3212|  14.2k|}
_ZN8AffixMgr15expand_rootwordEP9guesswordiPKciPKttS3_iS3_:
 3408|   576k|                              const char* phon) {
 3409|   576k|  int nh = 0;
 3410|       |  // first add root word to list
 3411|   576k|  if ((nh < maxn) &&
  ------------------
  |  Branch (3411:7): [True: 576k, False: 0]
  ------------------
 3412|   576k|      !(al && ((needaffix && TESTAFF(ap, needaffix, al)) ||
  ------------------
  |  |   99|  4.47k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 2.23k, False: 2.23k]
  |  |  ------------------
  ------------------
  |  Branch (3412:9): [True: 97.0k, False: 479k]
  |  Branch (3412:17): [True: 4.47k, False: 92.5k]
  ------------------
 3413|   574k|               (onlyincompound && TESTAFF(ap, onlyincompound, al))))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3413:17): [True: 0, False: 94.8k]
  ------------------
 3414|   574k|    wlst[nh].word = mystrdup(ts);
 3415|   574k|    wlst[nh].allow = false;
 3416|   574k|    wlst[nh].orig = nullptr;
 3417|   574k|    nh++;
 3418|       |    // add special phonetic version
 3419|   574k|    if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3419:9): [True: 859, False: 573k]
  |  Branch (3419:17): [True: 859, False: 0]
  ------------------
 3420|    859|      wlst[nh].word = mystrdup(phon);
 3421|    859|      wlst[nh].allow = false;
 3422|    859|      wlst[nh].orig = mystrdup(ts);
 3423|    859|      nh++;
 3424|    859|    }
 3425|   574k|  }
 3426|       |
 3427|       |  // handle suffixes
 3428|   685k|  for (int i = 0; i < al; i++) {
  ------------------
  |  Branch (3428:19): [True: 109k, False: 576k]
  ------------------
 3429|   109k|    const auto c = (unsigned char)(ap[i] & 0x00FF);
 3430|   109k|    SfxEntry* sptr = sFlag[c];
 3431|   173k|    while (sptr) {
  ------------------
  |  Branch (3431:12): [True: 64.6k, False: 109k]
  ------------------
 3432|  64.6k|      if ((sptr->getFlag() == ap[i]) &&
  ------------------
  |  Branch (3432:11): [True: 64.6k, False: 0]
  ------------------
 3433|  64.6k|          (!sptr->getKeyLen() ||
  ------------------
  |  Branch (3433:12): [True: 0, False: 64.6k]
  ------------------
 3434|  64.6k|           ((badl > sptr->getKeyLen()) &&
  ------------------
  |  Branch (3434:13): [True: 36.7k, False: 27.8k]
  ------------------
 3435|  36.7k|            (strcmp(sptr->getAffix(), bad + badl - sptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3435:13): [True: 22, False: 36.7k]
  ------------------
 3436|       |          // check needaffix flag
 3437|     22|          !(sptr->getCont() &&
  ------------------
  |  Branch (3437:13): [True: 10, False: 12]
  ------------------
 3438|     10|            ((needaffix &&
  ------------------
  |  Branch (3438:15): [True: 8, False: 2]
  ------------------
 3439|      8|              TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) ||
  ------------------
  |  |   99|      8|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 8]
  |  |  ------------------
  ------------------
 3440|     10|             (circumfix &&
  ------------------
  |  Branch (3440:15): [True: 0, False: 10]
  ------------------
 3441|      0|              TESTAFF(sptr->getCont(), circumfix, sptr->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3442|     10|             (onlyincompound &&
  ------------------
  |  Branch (3442:15): [True: 0, False: 10]
  ------------------
 3443|     22|              TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3444|     22|        std::string newword = sptr->add(ts, wl);
 3445|     22|        if (!newword.empty()) {
  ------------------
  |  Branch (3445:13): [True: 22, False: 0]
  ------------------
 3446|     22|          if (nh < maxn) {
  ------------------
  |  Branch (3446:15): [True: 22, False: 0]
  ------------------
 3447|     22|            wlst[nh].word = mystrdup(newword.c_str());
 3448|     22|            wlst[nh].allow = sptr->allowCross();
 3449|     22|            wlst[nh].orig = nullptr;
 3450|     22|            nh++;
 3451|       |            // add special phonetic version
 3452|     22|            if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3452:17): [True: 0, False: 22]
  |  Branch (3452:25): [True: 0, False: 0]
  ------------------
 3453|      0|              std::string prefix(phon);
 3454|      0|              std::string key(sptr->getKey());
 3455|      0|              reverseword(key);
 3456|      0|              prefix.append(key);
 3457|      0|              wlst[nh].word = mystrdup(prefix.c_str());
 3458|      0|              wlst[nh].allow = false;
 3459|      0|              wlst[nh].orig = mystrdup(newword.c_str());
 3460|      0|              nh++;
 3461|      0|            }
 3462|     22|          }
 3463|     22|        }
 3464|     22|      }
 3465|  64.6k|      sptr = sptr->getFlgNxt();
 3466|  64.6k|    }
 3467|   109k|  }
 3468|       |
 3469|   576k|  int n = nh;
 3470|       |
 3471|       |  // handle cross products of prefixes and suffixes
 3472|   577k|  for (int j = 1; j < n; j++)
  ------------------
  |  Branch (3472:19): [True: 873, False: 576k]
  ------------------
 3473|    873|    if (wlst[j].allow) {
  ------------------
  |  Branch (3473:9): [True: 14, False: 859]
  ------------------
 3474|     42|      for (int k = 0; k < al; k++) {
  ------------------
  |  Branch (3474:23): [True: 28, False: 14]
  ------------------
 3475|     28|        const auto c = (unsigned char)(ap[k] & 0x00FF);
 3476|     28|        PfxEntry* cptr = pFlag[c];
 3477|     28|        while (cptr) {
  ------------------
  |  Branch (3477:16): [True: 0, False: 28]
  ------------------
 3478|      0|          if ((cptr->getFlag() == ap[k]) && cptr->allowCross() &&
  ------------------
  |  Branch (3478:15): [True: 0, False: 0]
  |  Branch (3478:45): [True: 0, False: 0]
  ------------------
 3479|      0|              (!cptr->getKeyLen() ||
  ------------------
  |  Branch (3479:16): [True: 0, False: 0]
  ------------------
 3480|      0|               ((badl > cptr->getKeyLen()) &&
  ------------------
  |  Branch (3480:17): [True: 0, False: 0]
  ------------------
 3481|      0|                (strncmp(cptr->getKey(), bad, cptr->getKeyLen()) == 0)))) {
  ------------------
  |  Branch (3481:17): [True: 0, False: 0]
  ------------------
 3482|      0|            int l1 = strlen(wlst[j].word);
 3483|      0|            std::string newword = cptr->add(wlst[j].word, l1);
 3484|      0|            if (!newword.empty()) {
  ------------------
  |  Branch (3484:17): [True: 0, False: 0]
  ------------------
 3485|      0|              if (nh < maxn) {
  ------------------
  |  Branch (3485:19): [True: 0, False: 0]
  ------------------
 3486|      0|                wlst[nh].word = mystrdup(newword.c_str());
 3487|      0|                wlst[nh].allow = cptr->allowCross();
 3488|      0|                wlst[nh].orig = nullptr;
 3489|      0|                nh++;
 3490|      0|              }
 3491|      0|            }
 3492|      0|          }
 3493|      0|          cptr = cptr->getFlgNxt();
 3494|      0|        }
 3495|     28|      }
 3496|     14|    }
 3497|       |
 3498|       |  // now handle pure prefixes
 3499|   685k|  for (int m = 0; m < al; m++) {
  ------------------
  |  Branch (3499:19): [True: 109k, False: 576k]
  ------------------
 3500|   109k|    const auto c = (unsigned char)(ap[m] & 0x00FF);
 3501|   109k|    PfxEntry* ptr = pFlag[c];
 3502|   109k|    while (ptr) {
  ------------------
  |  Branch (3502:12): [True: 875, False: 109k]
  ------------------
 3503|    875|      if ((ptr->getFlag() == ap[m]) &&
  ------------------
  |  Branch (3503:11): [True: 875, False: 0]
  ------------------
 3504|    875|          (!ptr->getKeyLen() ||
  ------------------
  |  Branch (3504:12): [True: 0, False: 875]
  ------------------
 3505|    875|           ((badl > ptr->getKeyLen()) &&
  ------------------
  |  Branch (3505:13): [True: 875, False: 0]
  ------------------
 3506|    875|            (strncmp(ptr->getKey(), bad, ptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3506:13): [True: 12, False: 863]
  ------------------
 3507|       |          // check needaffix flag
 3508|     12|          !(ptr->getCont() &&
  ------------------
  |  Branch (3508:13): [True: 0, False: 12]
  ------------------
 3509|      0|            ((needaffix &&
  ------------------
  |  Branch (3509:15): [True: 0, False: 0]
  ------------------
 3510|      0|              TESTAFF(ptr->getCont(), needaffix, ptr->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3511|      0|             (circumfix &&
  ------------------
  |  Branch (3511:15): [True: 0, False: 0]
  ------------------
 3512|      0|              TESTAFF(ptr->getCont(), circumfix, ptr->getContLen())) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3513|      0|             (onlyincompound &&
  ------------------
  |  Branch (3513:15): [True: 0, False: 0]
  ------------------
 3514|     12|              TESTAFF(ptr->getCont(), onlyincompound, ptr->getContLen()))))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3515|     12|        std::string newword = ptr->add(ts, wl);
 3516|     12|        if (!newword.empty()) {
  ------------------
  |  Branch (3516:13): [True: 12, False: 0]
  ------------------
 3517|     12|          if (nh < maxn) {
  ------------------
  |  Branch (3517:15): [True: 12, False: 0]
  ------------------
 3518|     12|            wlst[nh].word = mystrdup(newword.c_str());
 3519|     12|            wlst[nh].allow = ptr->allowCross();
 3520|     12|            wlst[nh].orig = nullptr;
 3521|     12|            nh++;
 3522|     12|          }
 3523|     12|        }
 3524|     12|      }
 3525|    875|      ptr = ptr->getFlgNxt();
 3526|    875|    }
 3527|   109k|  }
 3528|       |
 3529|   576k|  return nh;
 3530|   576k|}
_ZNK8AffixMgr12get_reptableEv:
 3533|   380k|const std::vector<replentry>& AffixMgr::get_reptable() const {
 3534|   380k|  return pHMgr->get_reptable();
 3535|   380k|}
_ZNK8AffixMgr14get_iconvtableEv:
 3538|  14.3M|RepList* AffixMgr::get_iconvtable() const {
 3539|  14.3M|  if (!iconvtable)
  ------------------
  |  Branch (3539:7): [True: 13.9M, False: 417k]
  ------------------
 3540|  13.9M|    return nullptr;
 3541|   417k|  return iconvtable;
 3542|  14.3M|}
_ZNK8AffixMgr14get_oconvtableEv:
 3545|   101k|RepList* AffixMgr::get_oconvtable() const {
 3546|   101k|  if (!oconvtable)
  ------------------
  |  Branch (3546:7): [True: 96.0k, False: 5.44k]
  ------------------
 3547|  96.0k|    return nullptr;
 3548|  5.44k|  return oconvtable;
 3549|   101k|}
_ZNK8AffixMgr14get_phonetableEv:
 3552|  62.2k|struct phonetable* AffixMgr::get_phonetable() const {
 3553|  62.2k|  if (!phone)
  ------------------
  |  Branch (3553:7): [True: 58.7k, False: 3.54k]
  ------------------
 3554|  58.7k|    return nullptr;
 3555|  3.54k|  return phone;
 3556|  62.2k|}
_ZNK8AffixMgr12get_maptableEv:
 3559|   380k|const std::vector<mapentry>& AffixMgr::get_maptable() const {
 3560|   380k|  return maptable;
 3561|   380k|}
_ZNK8AffixMgr14get_breaktableEv:
 3564|     38|const std::vector<std::string>& AffixMgr::get_breaktable() const {
 3565|     38|  return breaktable;
 3566|     38|}
_ZN8AffixMgr12get_encodingEv:
 3569|     78|const std::string& AffixMgr::get_encoding() {
 3570|     78|  if (encoding.empty())
  ------------------
  |  Branch (3570:7): [True: 20, False: 58]
  ------------------
 3571|     20|    encoding = SPELL_ENCODING;
  ------------------
  |  |   99|     20|#define SPELL_ENCODING "ISO8859-1"
  ------------------
 3572|     78|  return encoding;
 3573|     78|}
_ZNK8AffixMgr11get_langnumEv:
 3576|     76|int AffixMgr::get_langnum() const {
 3577|     76|  return langnum;
 3578|     76|}
_ZNK8AffixMgr19get_complexprefixesEv:
 3581|     76|int AffixMgr::get_complexprefixes() const {
 3582|     76|  return complexprefixes;
 3583|     76|}
_ZNK8AffixMgr13get_fullstripEv:
 3586|  9.43k|int AffixMgr::get_fullstrip() const {
 3587|  9.43k|  return fullstrip;
 3588|  9.43k|}
_ZNK8AffixMgr12get_keepcaseEv:
 3590|   103k|FLAG AffixMgr::get_keepcase() const {
 3591|   103k|  return keepcase;
 3592|   103k|}
_ZNK8AffixMgr14get_forceucaseEv:
 3594|  20.4k|FLAG AffixMgr::get_forceucase() const {
 3595|  20.4k|  return forceucase;
 3596|  20.4k|}
_ZNK8AffixMgr8get_warnEv:
 3598|  81.9k|FLAG AffixMgr::get_warn() const {
 3599|  81.9k|  return warn;
 3600|  81.9k|}
_ZNK8AffixMgr14get_forbidwarnEv:
 3602|      7|int AffixMgr::get_forbidwarn() const {
 3603|      7|  return forbidwarn;
 3604|      7|}
_ZNK8AffixMgr15get_checksharpsEv:
 3606|   320k|int AffixMgr::get_checksharps() const {
 3607|   320k|  return checksharps;
 3608|   320k|}
_ZNK8AffixMgr10get_ignoreEv:
 3615|  30.8M|const char* AffixMgr::get_ignore() const {
 3616|  30.8M|  if (ignorechars.empty())
  ------------------
  |  Branch (3616:7): [True: 27.7M, False: 3.08M]
  ------------------
 3617|  27.7M|    return nullptr;
 3618|  3.08M|  return ignorechars.c_str();
 3619|  30.8M|}
_ZNK8AffixMgr16get_ignore_utf16Ev:
 3622|   684k|const std::vector<w_char>& AffixMgr::get_ignore_utf16() const {
 3623|   684k|  return ignorechars_utf16;
 3624|   684k|}
_ZN8AffixMgr14get_key_stringEv:
 3627|     38|const std::string& AffixMgr::get_key_string() {
 3628|     38|  if (keystring.empty())
  ------------------
  |  Branch (3628:7): [True: 38, False: 0]
  ------------------
 3629|     38|    keystring = SPELL_KEYSTRING;
  ------------------
  |  |  100|     38|#define SPELL_KEYSTRING "qwertyuiop|asdfghjkl|zxcvbnm"
  ------------------
 3630|     38|  return keystring;
 3631|     38|}
_ZNK8AffixMgr14get_try_stringEv:
 3634|     38|const std::string& AffixMgr::get_try_string() const {
 3635|     38|  return trystring;
 3636|     38|}
_ZNK8AffixMgr12get_compoundEv:
 3648|  76.4M|int AffixMgr::get_compound() const {
 3649|  76.4M|  return compoundflag || compoundbegin || !defcpdtable.empty();
  ------------------
  |  Branch (3649:10): [True: 19.0M, False: 57.4M]
  |  Branch (3649:26): [True: 0, False: 57.4M]
  |  Branch (3649:43): [True: 0, False: 57.4M]
  ------------------
 3650|  76.4M|}
_ZNK8AffixMgr16get_compoundflagEv:
 3653|  70.3k|FLAG AffixMgr::get_compoundflag() const {
 3654|  70.3k|  return compoundflag;
 3655|  70.3k|}
_ZNK8AffixMgr17get_forbiddenwordEv:
 3658|   162k|FLAG AffixMgr::get_forbiddenword() const {
 3659|   162k|  return forbiddenword;
 3660|   162k|}
_ZNK8AffixMgr13get_nosuggestEv:
 3663|  62.4k|FLAG AffixMgr::get_nosuggest() const {
 3664|  62.4k|  return nosuggest;
 3665|  62.4k|}
_ZNK8AffixMgr18get_nongramsuggestEv:
 3668|  62.2k|FLAG AffixMgr::get_nongramsuggest() const {
 3669|  62.2k|  return nongramsuggest;
 3670|  62.2k|}
_ZNK8AffixMgr15get_substandardEv:
 3673|    134|FLAG AffixMgr::get_substandard() const {
 3674|    134|  return substandard;
 3675|    134|}
_ZNK8AffixMgr13get_needaffixEv:
 3678|  1.02k|FLAG AffixMgr::get_needaffix() const {
 3679|  1.02k|  return needaffix;
 3680|  1.02k|}
_ZNK8AffixMgr18get_onlyincompoundEv:
 3688|  63.1k|FLAG AffixMgr::get_onlyincompound() const {
 3689|  63.1k|  return onlyincompound;
 3690|  63.1k|}
_ZN8AffixMgr6lookupEPKcm:
 3698|   539M|struct hentry* AffixMgr::lookup(const char* word, size_t len) {
 3699|   539M|  struct hentry* he = nullptr;
 3700|  1.07G|  for (size_t i = 0; i < alldic.size() && !he; ++i) {
  ------------------
  |  Branch (3700:22): [True: 539M, False: 539M]
  |  Branch (3700:43): [True: 539M, False: 0]
  ------------------
 3701|   539M|    he = alldic[i]->lookup(word, len);
 3702|   539M|  }
 3703|   539M|  return he;
 3704|   539M|}
_ZNK8AffixMgr14have_contclassEv:
 3707|  31.7M|int AffixMgr::have_contclass() const {
 3708|  31.7M|  return havecontclass;
 3709|  31.7M|}
_ZNK8AffixMgr8get_utf8Ev:
 3712|     76|int AffixMgr::get_utf8() const {
 3713|     76|  return utf8;
 3714|     76|}
_ZNK8AffixMgr16get_maxngramsugsEv:
 3716|  69.8k|int AffixMgr::get_maxngramsugs() const {
 3717|  69.8k|  return maxngramsugs;
 3718|  69.8k|}
_ZNK8AffixMgr14get_maxcpdsugsEv:
 3720|     38|int AffixMgr::get_maxcpdsugs() const {
 3721|     38|  return maxcpdsugs;
 3722|     38|}
_ZNK8AffixMgr11get_maxdiffEv:
 3724|  47.9k|int AffixMgr::get_maxdiff() const {
 3725|  47.9k|  return maxdiff;
 3726|  47.9k|}
_ZNK8AffixMgr15get_onlymaxdiffEv:
 3728|  8.22k|int AffixMgr::get_onlymaxdiff() const {
 3729|  8.22k|  return onlymaxdiff;
 3730|  8.22k|}
_ZNK8AffixMgr15get_nosplitsugsEv:
 3733|     38|int AffixMgr::get_nosplitsugs() const {
 3734|     38|  return nosplitsugs;
 3735|     38|}
_ZNK8AffixMgr16get_sugswithdotsEv:
 3738|  3.70k|int AffixMgr::get_sugswithdots() const {
 3739|  3.70k|  return sugswithdots;
 3740|  3.70k|}
_ZN8AffixMgr10parse_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPtP7FileMgr:
 3743|     22|bool AffixMgr::parse_flag(const std::string& line, unsigned short* out, FileMgr* af) {
 3744|     22|  if (*out != FLAG_NULL && !(*out >= DEFAULTFLAGS)) {
  ------------------
  |  |   96|     44|#define FLAG_NULL 0x00
  ------------------
                if (*out != FLAG_NULL && !(*out >= DEFAULTFLAGS)) {
  ------------------
  |  |  126|      2|#define DEFAULTFLAGS 65510
  ------------------
  |  Branch (3744:7): [True: 2, False: 20]
  |  Branch (3744:28): [True: 0, False: 2]
  ------------------
 3745|      0|    HUNSPELL_WARNING(
 3746|      0|        stderr,
 3747|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 3748|      0|        af->getlinenum());
 3749|      0|    return false;
 3750|      0|  }
 3751|     22|  std::string s;
 3752|     22|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (3752:7): [True: 0, False: 22]
  ------------------
 3753|      0|    return false;
 3754|     22|  *out = pHMgr->decode_flag(s);
 3755|     22|  return true;
 3756|     22|}
_ZN8AffixMgr9parse_numERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiP7FileMgr:
 3759|     10|bool AffixMgr::parse_num(const std::string& line, int* out, FileMgr* af) {
 3760|     10|  if (*out != -1) {
  ------------------
  |  Branch (3760:7): [True: 0, False: 10]
  ------------------
 3761|      0|    HUNSPELL_WARNING(
 3762|      0|        stderr,
 3763|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 3764|      0|        af->getlinenum());
 3765|      0|    return false;
 3766|      0|  }
 3767|     10|  std::string s;
 3768|     10|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (3768:7): [True: 0, False: 10]
  ------------------
 3769|      0|    return false;
 3770|     10|  *out = atoi(s.c_str());
 3771|     10|  return true;
 3772|     10|}
_ZN8AffixMgr17parse_cpdsyllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 3775|      2|bool AffixMgr::parse_cpdsyllable(const std::string& line, FileMgr* af) {
 3776|      2|  int i = 0;
 3777|      2|  int np = 0;
 3778|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3779|      8|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3779:10): [True: 6, False: 2]
  ------------------
 3780|      6|    switch (i) {
 3781|      2|      case 0: {
  ------------------
  |  Branch (3781:7): [True: 2, False: 4]
  ------------------
 3782|      2|        np++;
 3783|      2|        break;
 3784|      0|      }
 3785|      2|      case 1: {
  ------------------
  |  Branch (3785:7): [True: 2, False: 4]
  ------------------
 3786|      2|        cpdmaxsyllable = atoi(std::string(start_piece, iter).c_str());
 3787|      2|        np++;
 3788|      2|        break;
 3789|      0|      }
 3790|      2|      case 2: {
  ------------------
  |  Branch (3790:7): [True: 2, False: 4]
  ------------------
 3791|      2|        if (!utf8) {
  ------------------
  |  Branch (3791:13): [True: 0, False: 2]
  ------------------
 3792|      0|          cpdvowels.assign(start_piece, iter);
 3793|      0|          std::sort(cpdvowels.begin(), cpdvowels.end());
 3794|      2|        } else {
 3795|      2|          std::string piece(start_piece, iter);
 3796|      2|          u8_u16(cpdvowels_utf16, piece);
 3797|      2|          std::sort(cpdvowels_utf16.begin(), cpdvowels_utf16.end());
 3798|      2|        }
 3799|      2|        np++;
 3800|      2|        break;
 3801|      0|      }
 3802|      0|      default:
  ------------------
  |  Branch (3802:7): [True: 0, False: 6]
  ------------------
 3803|      0|        break;
 3804|      6|    }
 3805|      6|    ++i;
 3806|      6|    start_piece = mystrsep(line, iter);
 3807|      6|  }
 3808|      2|  if (np < 2) {
  ------------------
  |  Branch (3808:7): [True: 0, False: 2]
  ------------------
 3809|      0|    HUNSPELL_WARNING(stderr,
 3810|      0|                     "error: line %d: missing compoundsyllable information\n",
 3811|      0|                     af->getlinenum());
 3812|      0|    return false;
 3813|      0|  }
 3814|      2|  if (np == 2)
  ------------------
  |  Branch (3814:7): [True: 0, False: 2]
  ------------------
 3815|      0|    cpdvowels = "AEIOUaeiou";
 3816|      2|  return true;
 3817|      2|}
_ZN8AffixMgr15parse_convtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgrPP7RepListS8_:
 3822|      4|                              const std::string& keyword) {
 3823|      4|  if (*rl) {
  ------------------
  |  Branch (3823:7): [True: 0, False: 4]
  ------------------
 3824|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 3825|      0|                     af->getlinenum());
 3826|      0|    return false;
 3827|      0|  }
 3828|      4|  int i = 0;
 3829|      4|  int np = 0;
 3830|      4|  int numrl = 0;
 3831|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3832|     18|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3832:10): [True: 14, False: 4]
  ------------------
 3833|     14|    switch (i) {
 3834|      4|      case 0: {
  ------------------
  |  Branch (3834:7): [True: 4, False: 10]
  ------------------
 3835|      4|        np++;
 3836|      4|        break;
 3837|      0|      }
 3838|      4|      case 1: {
  ------------------
  |  Branch (3838:7): [True: 4, False: 10]
  ------------------
 3839|      4|        numrl = atoi(std::string(start_piece, iter).c_str());
 3840|      4|        if (numrl < 1) {
  ------------------
  |  Branch (3840:13): [True: 0, False: 4]
  ------------------
 3841|      0|          HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n",
 3842|      0|                           af->getlinenum());
 3843|      0|          return false;
 3844|      0|        }
 3845|      4|        *rl = new RepList(numrl);
 3846|      4|        if (!*rl)
  ------------------
  |  Branch (3846:13): [True: 0, False: 4]
  ------------------
 3847|      0|          return false;
 3848|      4|        np++;
 3849|      4|        break;
 3850|      4|      }
 3851|      6|      default:
  ------------------
  |  Branch (3851:7): [True: 6, False: 8]
  ------------------
 3852|      6|        break;
 3853|     14|    }
 3854|     14|    ++i;
 3855|     14|    start_piece = mystrsep(line, iter);
 3856|     14|  }
 3857|      4|  if (np != 2) {
  ------------------
  |  Branch (3857:7): [True: 0, False: 4]
  ------------------
 3858|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 3859|      0|                     af->getlinenum());
 3860|      0|    return false;
 3861|      0|  }
 3862|       |
 3863|       |  /* now parse the num lines to read in the remainder of the table */
 3864|     26|  for (int j = 0; j < numrl; j++) {
  ------------------
  |  Branch (3864:19): [True: 22, False: 4]
  ------------------
 3865|     22|    std::string nl;
 3866|     22|    if (!af->getline(nl))
  ------------------
  |  Branch (3866:9): [True: 0, False: 22]
  ------------------
 3867|      0|      return false;
 3868|     22|    mychomp(nl);
 3869|     22|    i = 0;
 3870|     22|    std::string pattern;
 3871|     22|    std::string pattern2;
 3872|     22|    iter = nl.begin();
 3873|     22|    start_piece = mystrsep(nl, iter);
 3874|    130|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (3874:12): [True: 108, False: 22]
  ------------------
 3875|    108|      {
 3876|    108|        switch (i) {
 3877|     22|          case 0: {
  ------------------
  |  Branch (3877:11): [True: 22, False: 86]
  ------------------
 3878|     22|            if (nl.compare(start_piece - nl.begin(), keyword.size(), keyword, 0, keyword.size()) != 0) {
  ------------------
  |  Branch (3878:17): [True: 0, False: 22]
  ------------------
 3879|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3880|      0|                               af->getlinenum());
 3881|      0|              delete *rl;
 3882|      0|              *rl = nullptr;
 3883|      0|              return false;
 3884|      0|            }
 3885|     22|            break;
 3886|     22|          }
 3887|     22|          case 1: {
  ------------------
  |  Branch (3887:11): [True: 22, False: 86]
  ------------------
 3888|     22|            pattern.assign(start_piece, iter);
 3889|     22|            break;
 3890|     22|          }
 3891|     22|          case 2: {
  ------------------
  |  Branch (3891:11): [True: 22, False: 86]
  ------------------
 3892|     22|            pattern2.assign(start_piece, iter);
 3893|     22|            break;
 3894|     22|          }
 3895|     42|          default:
  ------------------
  |  Branch (3895:11): [True: 42, False: 66]
  ------------------
 3896|     42|            break;
 3897|    108|        }
 3898|    108|        ++i;
 3899|    108|      }
 3900|      0|      start_piece = mystrsep(nl, iter);
 3901|    108|    }
 3902|     22|    if (pattern.empty() || pattern2.empty()) {
  ------------------
  |  Branch (3902:9): [True: 0, False: 22]
  |  Branch (3902:28): [True: 0, False: 22]
  ------------------
 3903|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3904|      0|                       af->getlinenum());
 3905|      0|      return false;
 3906|      0|    }
 3907|       |
 3908|     22|    (*rl)->add(pattern, pattern2);
 3909|     22|  }
 3910|      4|  return true;
 3911|      4|}
_ZN8AffixMgr16parse_phonetableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 3914|      2|bool AffixMgr::parse_phonetable(const std::string& line, FileMgr* af) {
 3915|      2|  if (phone) {
  ------------------
  |  Branch (3915:7): [True: 0, False: 2]
  ------------------
 3916|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 3917|      0|                     af->getlinenum());
 3918|      0|    return false;
 3919|      0|  }
 3920|      2|  std::unique_ptr<phonetable> new_phone;
 3921|      2|  int num = -1;
 3922|      2|  int i = 0;
 3923|      2|  int np = 0;
 3924|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3925|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3925:10): [True: 4, False: 2]
  ------------------
 3926|      4|    switch (i) {
 3927|      2|      case 0: {
  ------------------
  |  Branch (3927:7): [True: 2, False: 2]
  ------------------
 3928|      2|        np++;
 3929|      2|        break;
 3930|      0|      }
 3931|      2|      case 1: {
  ------------------
  |  Branch (3931:7): [True: 2, False: 2]
  ------------------
 3932|      2|        num = atoi(std::string(start_piece, iter).c_str());
 3933|      2|        if (num < 1) {
  ------------------
  |  Branch (3933:13): [True: 0, False: 2]
  ------------------
 3934|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 3935|      0|                           af->getlinenum());
 3936|      0|          return false;
 3937|      0|        }
 3938|      2|        new_phone = std::make_unique<phonetable>();
 3939|      2|        new_phone->utf8 = (char)utf8;
 3940|      2|        np++;
 3941|      2|        break;
 3942|      2|      }
 3943|      0|      default:
  ------------------
  |  Branch (3943:7): [True: 0, False: 4]
  ------------------
 3944|      0|        break;
 3945|      4|    }
 3946|      4|    ++i;
 3947|      4|    start_piece = mystrsep(line, iter);
 3948|      4|  }
 3949|      2|  if (np != 2) {
  ------------------
  |  Branch (3949:7): [True: 0, False: 2]
  ------------------
 3950|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 3951|      0|                     af->getlinenum());
 3952|      0|    return false;
 3953|      0|  }
 3954|       |
 3955|       |  /* now parse the phone->num lines to read in the remainder of the table */
 3956|    212|  for (int j = 0; j < num; ++j) {
  ------------------
  |  Branch (3956:19): [True: 210, False: 2]
  ------------------
 3957|    210|    std::string nl;
 3958|    210|    if (!af->getline(nl))
  ------------------
  |  Branch (3958:9): [True: 0, False: 210]
  ------------------
 3959|      0|      return false;
 3960|    210|    mychomp(nl);
 3961|    210|    i = 0;
 3962|    210|    const size_t old_size = new_phone->rules.size();
 3963|    210|    iter = nl.begin();
 3964|    210|    start_piece = mystrsep(nl, iter);
 3965|    840|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (3965:12): [True: 630, False: 210]
  ------------------
 3966|    630|      {
 3967|    630|        switch (i) {
 3968|    210|          case 0: {
  ------------------
  |  Branch (3968:11): [True: 210, False: 420]
  ------------------
 3969|    210|            if (nl.compare(start_piece - nl.begin(), 5, "PHONE", 5) != 0) {
  ------------------
  |  Branch (3969:17): [True: 0, False: 210]
  ------------------
 3970|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3971|      0|                               af->getlinenum());
 3972|      0|              return false;
 3973|      0|            }
 3974|    210|            break;
 3975|    210|          }
 3976|    210|          case 1: {
  ------------------
  |  Branch (3976:11): [True: 210, False: 420]
  ------------------
 3977|    210|            new_phone->rules.emplace_back(start_piece, iter);
 3978|    210|            break;
 3979|    210|          }
 3980|    210|          case 2: {
  ------------------
  |  Branch (3980:11): [True: 210, False: 420]
  ------------------
 3981|    210|            new_phone->rules.emplace_back(start_piece, iter);
 3982|    210|            mystrrep(new_phone->rules.back(), "_", "");
 3983|    210|            break;
 3984|    210|          }
 3985|      0|          default:
  ------------------
  |  Branch (3985:11): [True: 0, False: 630]
  ------------------
 3986|      0|            break;
 3987|    630|        }
 3988|    630|        ++i;
 3989|    630|      }
 3990|      0|      start_piece = mystrsep(nl, iter);
 3991|    630|    }
 3992|    210|    if (new_phone->rules.size() != old_size + 2) {
  ------------------
  |  Branch (3992:9): [True: 0, False: 210]
  ------------------
 3993|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3994|      0|                       af->getlinenum());
 3995|      0|      return false;
 3996|      0|    }
 3997|    210|  }
 3998|      2|  new_phone->rules.emplace_back("");
 3999|      2|  new_phone->rules.emplace_back("");
 4000|      2|  init_phonet_hash(*new_phone);
 4001|      2|  phone = new_phone.release();
 4002|      2|  return true;
 4003|      2|}
_ZN8AffixMgr19parse_checkcpdtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4006|      2|bool AffixMgr::parse_checkcpdtable(const std::string& line, FileMgr* af) {
 4007|      2|  if (parsedcheckcpd) {
  ------------------
  |  Branch (4007:7): [True: 0, False: 2]
  ------------------
 4008|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4009|      0|                     af->getlinenum());
 4010|      0|    return false;
 4011|      0|  }
 4012|      2|  parsedcheckcpd = true;
 4013|      2|  int numcheckcpd = -1;
 4014|      2|  int i = 0;
 4015|      2|  int np = 0;
 4016|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4017|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4017:10): [True: 4, False: 2]
  ------------------
 4018|      4|    switch (i) {
 4019|      2|      case 0: {
  ------------------
  |  Branch (4019:7): [True: 2, False: 2]
  ------------------
 4020|      2|        np++;
 4021|      2|        break;
 4022|      0|      }
 4023|      2|      case 1: {
  ------------------
  |  Branch (4023:7): [True: 2, False: 2]
  ------------------
 4024|      2|        numcheckcpd = atoi(std::string(start_piece, iter).c_str());
 4025|      2|        if (numcheckcpd < 1) {
  ------------------
  |  Branch (4025:13): [True: 0, False: 2]
  ------------------
 4026|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4027|      0|                           af->getlinenum());
 4028|      0|          return false;
 4029|      0|        }
 4030|      2|        checkcpdtable.reserve(std::min(numcheckcpd, 16384));
 4031|      2|        np++;
 4032|      2|        break;
 4033|      2|      }
 4034|      0|      default:
  ------------------
  |  Branch (4034:7): [True: 0, False: 4]
  ------------------
 4035|      0|        break;
 4036|      4|    }
 4037|      4|    ++i;
 4038|      4|    start_piece = mystrsep(line, iter);
 4039|      4|  }
 4040|      2|  if (np != 2) {
  ------------------
  |  Branch (4040:7): [True: 0, False: 2]
  ------------------
 4041|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4042|      0|                     af->getlinenum());
 4043|      0|    return false;
 4044|      0|  }
 4045|       |
 4046|       |  /* now parse the numcheckcpd lines to read in the remainder of the table */
 4047|      6|  for (int j = 0; j < numcheckcpd; ++j) {
  ------------------
  |  Branch (4047:19): [True: 4, False: 2]
  ------------------
 4048|      4|    std::string nl;
 4049|      4|    if (!af->getline(nl))
  ------------------
  |  Branch (4049:9): [True: 0, False: 4]
  ------------------
 4050|      0|      return false;
 4051|      4|    mychomp(nl);
 4052|      4|    i = 0;
 4053|      4|    checkcpdtable.emplace_back();
 4054|      4|    iter = nl.begin();
 4055|      4|    start_piece = mystrsep(nl, iter);
 4056|     16|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4056:12): [True: 12, False: 4]
  ------------------
 4057|     12|      switch (i) {
 4058|      4|        case 0: {
  ------------------
  |  Branch (4058:9): [True: 4, False: 8]
  ------------------
 4059|      4|          if (nl.compare(start_piece - nl.begin(), 20, "CHECKCOMPOUNDPATTERN", 20) != 0) {
  ------------------
  |  Branch (4059:15): [True: 0, False: 4]
  ------------------
 4060|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4061|      0|                             af->getlinenum());
 4062|      0|            checkcpdtable.clear();
 4063|      0|            return false;
 4064|      0|          }
 4065|      4|          break;
 4066|      4|        }
 4067|      4|        case 1: {
  ------------------
  |  Branch (4067:9): [True: 4, False: 8]
  ------------------
 4068|      4|          checkcpdtable.back().pattern.assign(start_piece, iter);
 4069|      4|          size_t slash_pos = checkcpdtable.back().pattern.find('/');
 4070|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4070:15): [True: 0, False: 4]
  ------------------
 4071|      0|            std::string chunk(checkcpdtable.back().pattern, slash_pos + 1);
 4072|      0|            checkcpdtable.back().pattern.resize(slash_pos);
 4073|      0|            checkcpdtable.back().cond = pHMgr->decode_flag(chunk);
 4074|      0|          }
 4075|      4|          break;
 4076|      4|        }
 4077|      4|        case 2: {
  ------------------
  |  Branch (4077:9): [True: 4, False: 8]
  ------------------
 4078|      4|          checkcpdtable.back().pattern2.assign(start_piece, iter);
 4079|      4|          size_t slash_pos = checkcpdtable.back().pattern2.find('/');
 4080|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4080:15): [True: 0, False: 4]
  ------------------
 4081|      0|            std::string chunk(checkcpdtable.back().pattern2, slash_pos + 1);
 4082|      0|            checkcpdtable.back().pattern2.resize(slash_pos);
 4083|      0|            checkcpdtable.back().cond2 = pHMgr->decode_flag(chunk);
 4084|      0|          }
 4085|      4|          break;
 4086|      4|        }
 4087|      0|        case 3: {
  ------------------
  |  Branch (4087:9): [True: 0, False: 12]
  ------------------
 4088|      0|          checkcpdtable.back().pattern3.assign(start_piece, iter);
 4089|      0|          simplifiedcpd = 1;
 4090|      0|          break;
 4091|      4|        }
 4092|      0|        default:
  ------------------
  |  Branch (4092:9): [True: 0, False: 12]
  ------------------
 4093|      0|          break;
 4094|     12|      }
 4095|     12|      i++;
 4096|     12|      start_piece = mystrsep(nl, iter);
 4097|     12|    }
 4098|      4|  }
 4099|      2|  return true;
 4100|      2|}
_ZN8AffixMgr14parse_maptableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4204|      2|bool AffixMgr::parse_maptable(const std::string& line, FileMgr* af) {
 4205|      2|  if (parsedmaptable) {
  ------------------
  |  Branch (4205:7): [True: 0, False: 2]
  ------------------
 4206|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4207|      0|                     af->getlinenum());
 4208|      0|    return false;
 4209|      0|  }
 4210|      2|  parsedmaptable = true;
 4211|      2|  int nummap = -1;
 4212|      2|  int i = 0;
 4213|      2|  int np = 0;
 4214|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4215|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4215:10): [True: 4, False: 2]
  ------------------
 4216|      4|    switch (i) {
 4217|      2|      case 0: {
  ------------------
  |  Branch (4217:7): [True: 2, False: 2]
  ------------------
 4218|      2|        np++;
 4219|      2|        break;
 4220|      0|      }
 4221|      2|      case 1: {
  ------------------
  |  Branch (4221:7): [True: 2, False: 2]
  ------------------
 4222|      2|        nummap = atoi(std::string(start_piece, iter).c_str());
 4223|      2|        if (nummap < 1) {
  ------------------
  |  Branch (4223:13): [True: 0, False: 2]
  ------------------
 4224|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4225|      0|                           af->getlinenum());
 4226|      0|          return false;
 4227|      0|        }
 4228|      2|        maptable.reserve(std::min(nummap, 16384));
 4229|      2|        np++;
 4230|      2|        break;
 4231|      2|      }
 4232|      0|      default:
  ------------------
  |  Branch (4232:7): [True: 0, False: 4]
  ------------------
 4233|      0|        break;
 4234|      4|    }
 4235|      4|    ++i;
 4236|      4|    start_piece = mystrsep(line, iter);
 4237|      4|  }
 4238|      2|  if (np != 2) {
  ------------------
  |  Branch (4238:7): [True: 0, False: 2]
  ------------------
 4239|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4240|      0|                     af->getlinenum());
 4241|      0|    return false;
 4242|      0|  }
 4243|       |
 4244|       |  /* now parse the nummap lines to read in the remainder of the table */
 4245|      8|  for (int j = 0; j < nummap; ++j) {
  ------------------
  |  Branch (4245:19): [True: 6, False: 2]
  ------------------
 4246|      6|    std::string nl;
 4247|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4247:9): [True: 0, False: 6]
  ------------------
 4248|      0|      return false;
 4249|      6|    mychomp(nl);
 4250|      6|    i = 0;
 4251|      6|    maptable.emplace_back();
 4252|      6|    iter = nl.begin();
 4253|      6|    start_piece = mystrsep(nl, iter);
 4254|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4254:12): [True: 12, False: 6]
  ------------------
 4255|     12|      switch (i) {
 4256|      6|        case 0: {
  ------------------
  |  Branch (4256:9): [True: 6, False: 6]
  ------------------
 4257|      6|          if (nl.compare(start_piece - nl.begin(), 3, "MAP", 3) != 0) {
  ------------------
  |  Branch (4257:15): [True: 0, False: 6]
  ------------------
 4258|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4259|      0|                             af->getlinenum());
 4260|      0|            nummap = 0;
 4261|      0|            return false;
 4262|      0|          }
 4263|      6|          break;
 4264|      6|        }
 4265|      6|        case 1: {
  ------------------
  |  Branch (4265:9): [True: 6, False: 6]
  ------------------
 4266|     22|          for (auto k = start_piece; k != iter; ++k) {
  ------------------
  |  Branch (4266:38): [True: 16, False: 6]
  ------------------
 4267|     16|            auto chb = k, che = k + 1;
 4268|     16|            if (*k == '(') {
  ------------------
  |  Branch (4268:17): [True: 2, False: 14]
  ------------------
 4269|      2|              auto parpos = std::find(k, iter, ')');
 4270|      2|              if (parpos != iter) {
  ------------------
  |  Branch (4270:19): [True: 2, False: 0]
  ------------------
 4271|      2|                chb = k + 1;
 4272|      2|                che = parpos;
 4273|      2|                k = parpos;
 4274|      2|              }
 4275|     14|            } else {
 4276|     14|              if (utf8 && (*k & 0xc0) == 0xc0) {
  ------------------
  |  Branch (4276:19): [True: 14, False: 0]
  |  Branch (4276:27): [True: 10, False: 4]
  ------------------
 4277|     10|                ++k;
 4278|     20|                while (k != iter && is_utf8_cont(*k))
  ------------------
  |  Branch (4278:24): [True: 18, False: 2]
  |  Branch (4278:37): [True: 10, False: 8]
  ------------------
 4279|     10|                    ++k;
 4280|     10|                che = k;
 4281|     10|                --k;
 4282|     10|              }
 4283|     14|            }
 4284|     16|            if (chb == che) {
  ------------------
  |  Branch (4284:17): [True: 0, False: 16]
  ------------------
 4285|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4286|      0|                              af->getlinenum());
 4287|      0|            }
 4288|       |
 4289|     16|            maptable.back().emplace_back(chb, che);
 4290|     16|          }
 4291|      6|          break;
 4292|      6|        }
 4293|      0|        default:
  ------------------
  |  Branch (4293:9): [True: 0, False: 12]
  ------------------
 4294|      0|          break;
 4295|     12|      }
 4296|     12|      ++i;
 4297|     12|      start_piece = mystrsep(nl, iter);
 4298|     12|    }
 4299|      6|    if (maptable.back().empty()) {
  ------------------
  |  Branch (4299:9): [True: 0, False: 6]
  ------------------
 4300|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4301|      0|                       af->getlinenum());
 4302|      0|      return false;
 4303|      0|    }
 4304|      6|  }
 4305|      2|  return true;
 4306|      2|}
_ZN8AffixMgr16parse_breaktableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4309|      4|bool AffixMgr::parse_breaktable(const std::string& line, FileMgr* af) {
 4310|      4|  if (parsedbreaktable) {
  ------------------
  |  Branch (4310:7): [True: 0, False: 4]
  ------------------
 4311|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4312|      0|                     af->getlinenum());
 4313|      0|    return false;
 4314|      0|  }
 4315|      4|  parsedbreaktable = true;
 4316|      4|  int numbreak = -1;
 4317|      4|  int i = 0;
 4318|      4|  int np = 0;
 4319|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4320|     12|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4320:10): [True: 8, False: 4]
  ------------------
 4321|      8|    switch (i) {
 4322|      4|      case 0: {
  ------------------
  |  Branch (4322:7): [True: 4, False: 4]
  ------------------
 4323|      4|        np++;
 4324|      4|        break;
 4325|      0|      }
 4326|      4|      case 1: {
  ------------------
  |  Branch (4326:7): [True: 4, False: 4]
  ------------------
 4327|      4|        numbreak = atoi(std::string(start_piece, iter).c_str());
 4328|      4|        if (numbreak < 0) {
  ------------------
  |  Branch (4328:13): [True: 0, False: 4]
  ------------------
 4329|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4330|      0|                           af->getlinenum());
 4331|      0|          return false;
 4332|      0|        }
 4333|      4|        if (numbreak == 0)
  ------------------
  |  Branch (4333:13): [True: 0, False: 4]
  ------------------
 4334|      0|          return true;
 4335|      4|        breaktable.reserve(std::min(numbreak, 16384));
 4336|      4|        np++;
 4337|      4|        break;
 4338|      4|      }
 4339|      0|      default:
  ------------------
  |  Branch (4339:7): [True: 0, False: 8]
  ------------------
 4340|      0|        break;
 4341|      8|    }
 4342|      8|    ++i;
 4343|      8|    start_piece = mystrsep(line, iter);
 4344|      8|  }
 4345|      4|  if (np != 2) {
  ------------------
  |  Branch (4345:7): [True: 0, False: 4]
  ------------------
 4346|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4347|      0|                     af->getlinenum());
 4348|      0|    return false;
 4349|      0|  }
 4350|       |
 4351|       |  /* now parse the numbreak lines to read in the remainder of the table */
 4352|     10|  for (int j = 0; j < numbreak; ++j) {
  ------------------
  |  Branch (4352:19): [True: 6, False: 4]
  ------------------
 4353|      6|    std::string nl;
 4354|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4354:9): [True: 0, False: 6]
  ------------------
 4355|      0|      return false;
 4356|      6|    mychomp(nl);
 4357|      6|    i = 0;
 4358|      6|    iter = nl.begin();
 4359|      6|    start_piece = mystrsep(nl, iter);
 4360|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4360:12): [True: 12, False: 6]
  ------------------
 4361|     12|      switch (i) {
 4362|      6|        case 0: {
  ------------------
  |  Branch (4362:9): [True: 6, False: 6]
  ------------------
 4363|      6|          if (nl.compare(start_piece - nl.begin(), 5, "BREAK", 5) != 0) {
  ------------------
  |  Branch (4363:15): [True: 0, False: 6]
  ------------------
 4364|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4365|      0|                             af->getlinenum());
 4366|      0|            numbreak = 0;
 4367|      0|            return false;
 4368|      0|          }
 4369|      6|          break;
 4370|      6|        }
 4371|      6|        case 1: {
  ------------------
  |  Branch (4371:9): [True: 6, False: 6]
  ------------------
 4372|      6|          breaktable.emplace_back(start_piece, iter);
 4373|      6|          break;
 4374|      6|        }
 4375|      0|        default:
  ------------------
  |  Branch (4375:9): [True: 0, False: 12]
  ------------------
 4376|      0|          break;
 4377|     12|      }
 4378|     12|      ++i;
 4379|     12|      start_piece = mystrsep(nl, iter);
 4380|     12|    }
 4381|      6|  }
 4382|       |
 4383|      4|  if (breaktable.size() != static_cast<size_t>(numbreak)) {
  ------------------
  |  Branch (4383:7): [True: 0, False: 4]
  ------------------
 4384|      0|    HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4385|      0|                     af->getlinenum());
 4386|      0|    return false;
 4387|      0|  }
 4388|       |
 4389|      4|  return true;
 4390|      4|}
_ZN8AffixMgr17reverse_conditionERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 4392|     38|void AffixMgr::reverse_condition(std::string& piece) {
 4393|     38|  if (piece.empty())
  ------------------
  |  Branch (4393:7): [True: 0, False: 38]
  ------------------
 4394|      0|      return;
 4395|       |
 4396|     38|  int neg = 0;
 4397|       |  // iterate backwards; k wraps to npos (SIZE_MAX) when decremented past 0
 4398|     92|  for (size_t k = piece.size() - 1; k != std::string::npos; --k) {
  ------------------
  |  Branch (4398:37): [True: 54, False: 38]
  ------------------
 4399|     54|    switch (piece[k]) {
 4400|      2|      case '[': {
  ------------------
  |  Branch (4400:7): [True: 2, False: 52]
  ------------------
 4401|      2|        if (neg)
  ------------------
  |  Branch (4401:13): [True: 0, False: 2]
  ------------------
 4402|      0|          piece[k + 1] = '[';
 4403|      2|        else
 4404|      2|          piece[k] = ']';
 4405|      2|        break;
 4406|      0|      }
 4407|      2|      case ']': {
  ------------------
  |  Branch (4407:7): [True: 2, False: 52]
  ------------------
 4408|      2|        piece[k] = '[';
 4409|      2|        if (neg)
  ------------------
  |  Branch (4409:13): [True: 0, False: 2]
  ------------------
 4410|      0|          piece[k + 1] = '^';
 4411|      2|        neg = 0;
 4412|      2|        break;
 4413|      0|      }
 4414|      0|      case '^': {
  ------------------
  |  Branch (4414:7): [True: 0, False: 54]
  ------------------
 4415|      0|        if (piece[k + 1] == ']')
  ------------------
  |  Branch (4415:13): [True: 0, False: 0]
  ------------------
 4416|      0|          neg = 1;
 4417|      0|        else if (neg)
  ------------------
  |  Branch (4417:18): [True: 0, False: 0]
  ------------------
 4418|      0|          piece[k + 1] = piece[k];
 4419|      0|        break;
 4420|      0|      }
 4421|     50|      default: {
  ------------------
  |  Branch (4421:7): [True: 50, False: 4]
  ------------------
 4422|     50|        if (neg)
  ------------------
  |  Branch (4422:13): [True: 0, False: 50]
  ------------------
 4423|      0|          piece[k + 1] = piece[k];
 4424|     50|      }
 4425|     54|    }
 4426|     54|  }
 4427|     38|}
_ZN8AffixMgr11parse_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEcP7FileMgrPc:
 4481|     26|                          char* dupflags) {
 4482|     26|  int numents = 0;  // number of AffEntry structures to parse
 4483|       |
 4484|     26|  unsigned short aflag = 0;  // affix char identifier
 4485|       |
 4486|     26|  char ff = 0;
 4487|     26|  entries_container affentries(at, this);
 4488|       |
 4489|     26|  int i = 0;
 4490|       |
 4491|       |// checking lines with bad syntax
 4492|       |#ifdef DEBUG
 4493|       |  int basefieldnum = 0;
 4494|       |#endif
 4495|       |
 4496|       |  // split affix header line into pieces
 4497|       |
 4498|     26|  int np = 0;
 4499|     26|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4500|    130|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4500:10): [True: 104, False: 26]
  ------------------
 4501|    104|    switch (i) {
 4502|       |      // piece 1 - is type of affix
 4503|     26|      case 0: {
  ------------------
  |  Branch (4503:7): [True: 26, False: 78]
  ------------------
 4504|     26|        np++;
 4505|     26|        break;
 4506|      0|      }
 4507|       |
 4508|       |      // piece 2 - is affix char
 4509|     26|      case 1: {
  ------------------
  |  Branch (4509:7): [True: 26, False: 78]
  ------------------
 4510|     26|        np++;
 4511|     26|        aflag = pHMgr->decode_flag(std::string(start_piece, iter));
 4512|     26|        if (((at == 'S') && (dupflags[aflag] & dupSFX)) ||
  ------------------
  |  |   88|     18|#define dupSFX (1 << 0)
  ------------------
  |  Branch (4512:14): [True: 18, False: 8]
  |  Branch (4512:29): [True: 0, False: 18]
  ------------------
 4513|     26|            ((at == 'P') && (dupflags[aflag] & dupPFX))) {
  ------------------
  |  |   89|      8|#define dupPFX (1 << 1)
  ------------------
  |  Branch (4513:14): [True: 8, False: 18]
  |  Branch (4513:29): [True: 0, False: 8]
  ------------------
 4514|      0|          HUNSPELL_WARNING(
 4515|      0|              stderr,
 4516|      0|              "error: line %d: multiple definitions of an affix flag\n",
 4517|      0|              af->getlinenum());
 4518|      0|        }
 4519|     26|        dupflags[aflag] += (char)((at == 'S') ? dupSFX : dupPFX);
  ------------------
  |  |   88|     18|#define dupSFX (1 << 0)
  ------------------
                      dupflags[aflag] += (char)((at == 'S') ? dupSFX : dupPFX);
  ------------------
  |  |   89|      8|#define dupPFX (1 << 1)
  ------------------
  |  Branch (4519:35): [True: 18, False: 8]
  ------------------
 4520|     26|        break;
 4521|      0|      }
 4522|       |      // piece 3 - is cross product indicator
 4523|     26|      case 2: {
  ------------------
  |  Branch (4523:7): [True: 26, False: 78]
  ------------------
 4524|     26|        np++;
 4525|     26|        if (*start_piece == 'Y')
  ------------------
  |  Branch (4525:13): [True: 26, False: 0]
  ------------------
 4526|     26|          ff = aeXPRODUCT;
  ------------------
  |  |   65|     26|#define aeXPRODUCT (1 << 0)
  ------------------
 4527|     26|        break;
 4528|      0|      }
 4529|       |
 4530|       |      // piece 4 - is number of affentries
 4531|     26|      case 3: {
  ------------------
  |  Branch (4531:7): [True: 26, False: 78]
  ------------------
 4532|     26|        np++;
 4533|     26|        numents = atoi(std::string(start_piece, iter).c_str());
 4534|     26|        if ((numents <= 0) || ((std::numeric_limits<size_t>::max() /
  ------------------
  |  Branch (4534:13): [True: 0, False: 26]
  |  Branch (4534:31): [True: 0, False: 26]
  ------------------
 4535|     26|                                sizeof(AffEntry)) < static_cast<size_t>(numents))) {
 4536|      0|          std::string err = pHMgr->encode_flag(aflag);
 4537|      0|          HUNSPELL_WARNING(stderr, "error: line %d: affix %s: bad entry number\n",
 4538|      0|                           af->getlinenum(), err.c_str());
 4539|      0|          return false;
 4540|      0|        }
 4541|       |
 4542|     26|        char opts = ff;
 4543|     26|        if (utf8)
  ------------------
  |  Branch (4543:13): [True: 6, False: 20]
  ------------------
 4544|      6|          opts |= aeUTF8;
  ------------------
  |  |   66|      6|#define aeUTF8 (1 << 1)
  ------------------
 4545|     26|        if (pHMgr->is_aliasf())
  ------------------
  |  Branch (4545:13): [True: 4, False: 22]
  ------------------
 4546|      4|          opts |= aeALIASF;
  ------------------
  |  |   67|      4|#define aeALIASF (1 << 2)
  ------------------
 4547|     26|        if (pHMgr->is_aliasm())
  ------------------
  |  Branch (4547:13): [True: 0, False: 26]
  ------------------
 4548|      0|          opts |= aeALIASM;
  ------------------
  |  |   68|      0|#define aeALIASM (1 << 3)
  ------------------
 4549|     26|        affentries.initialize(numents, opts, aflag);
 4550|     26|      }
 4551|       |
 4552|     26|      default:
  ------------------
  |  Branch (4552:7): [True: 0, False: 104]
  ------------------
 4553|     26|        break;
 4554|    104|    }
 4555|    104|    ++i;
 4556|    104|    start_piece = mystrsep(line, iter);
 4557|    104|  }
 4558|       |  // check to make sure we parsed enough pieces
 4559|     26|  if (np != 4) {
  ------------------
  |  Branch (4559:7): [True: 0, False: 26]
  ------------------
 4560|      0|    std::string err = pHMgr->encode_flag(aflag);
 4561|      0|    HUNSPELL_WARNING(stderr, "error: line %d: affix %s: missing data\n",
 4562|      0|                     af->getlinenum(), err.c_str());
 4563|      0|    return false;
 4564|      0|  }
 4565|       |
 4566|       |  // now parse numents affentries for this affix
 4567|     26|  AffEntry* entry = affentries.first_entry();
 4568|     68|  for (int ent = 0; ent < numents; ++ent) {
  ------------------
  |  Branch (4568:21): [True: 42, False: 26]
  ------------------
 4569|     42|    std::string nl;
 4570|     42|    if (!af->getline(nl))
  ------------------
  |  Branch (4570:9): [True: 0, False: 42]
  ------------------
 4571|      0|      return false;
 4572|     42|    mychomp(nl);
 4573|       |
 4574|     42|    iter = nl.begin();
 4575|     42|    i = 0;
 4576|     42|    np = 0;
 4577|       |
 4578|       |    // split line into pieces
 4579|     42|    start_piece = mystrsep(nl, iter);
 4580|    258|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4580:12): [True: 216, False: 42]
  ------------------
 4581|    216|      switch (i) {
 4582|       |        // piece 1 - is type
 4583|     42|        case 0: {
  ------------------
  |  Branch (4583:9): [True: 42, False: 174]
  ------------------
 4584|     42|          np++;
 4585|     42|          if (ent != 0)
  ------------------
  |  Branch (4585:15): [True: 16, False: 26]
  ------------------
 4586|     16|            entry = affentries.add_entry((char)(aeXPRODUCT | aeUTF8 | aeALIASF | aeALIASM));
  ------------------
  |  |   65|     16|#define aeXPRODUCT (1 << 0)
  ------------------
                          entry = affentries.add_entry((char)(aeXPRODUCT | aeUTF8 | aeALIASF | aeALIASM));
  ------------------
  |  |   66|     16|#define aeUTF8 (1 << 1)
  ------------------
                          entry = affentries.add_entry((char)(aeXPRODUCT | aeUTF8 | aeALIASF | aeALIASM));
  ------------------
  |  |   67|     16|#define aeALIASF (1 << 2)
  ------------------
                          entry = affentries.add_entry((char)(aeXPRODUCT | aeUTF8 | aeALIASF | aeALIASM));
  ------------------
  |  |   68|     16|#define aeALIASM (1 << 3)
  ------------------
 4587|     42|          break;
 4588|      0|        }
 4589|       |
 4590|       |        // piece 2 - is affix char
 4591|     42|        case 1: {
  ------------------
  |  Branch (4591:9): [True: 42, False: 174]
  ------------------
 4592|     42|          np++;
 4593|     42|          std::string chunk(start_piece, iter);
 4594|     42|          if (pHMgr->decode_flag(chunk) != aflag) {
  ------------------
  |  Branch (4594:15): [True: 0, False: 42]
  ------------------
 4595|      0|            std::string err = pHMgr->encode_flag(aflag);
 4596|      0|            HUNSPELL_WARNING(stderr,
 4597|      0|                             "error: line %d: affix %s is corrupt\n",
 4598|      0|                             af->getlinenum(), err.c_str());
 4599|      0|            return false;
 4600|      0|          }
 4601|       |
 4602|     42|          if (ent != 0) {
  ------------------
  |  Branch (4602:15): [True: 16, False: 26]
  ------------------
 4603|     16|            AffEntry* start_entry = affentries.first_entry();
 4604|     16|            entry->aflag = start_entry->aflag;
 4605|     16|          }
 4606|     42|          break;
 4607|     42|        }
 4608|       |
 4609|       |        // piece 3 - is string to strip or 0 for null
 4610|     42|        case 2: {
  ------------------
  |  Branch (4610:9): [True: 42, False: 174]
  ------------------
 4611|     42|          np++;
 4612|     42|          entry->strip = std::string(start_piece, iter);
 4613|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4613:15): [True: 4, False: 38]
  ------------------
 4614|      4|            if (utf8)
  ------------------
  |  Branch (4614:17): [True: 0, False: 4]
  ------------------
 4615|      0|              reverseword_utf(entry->strip);
 4616|      4|            else
 4617|      4|              reverseword(entry->strip);
 4618|      4|          }
 4619|     42|          if (entry->strip.compare("0") == 0) {
  ------------------
  |  Branch (4619:15): [True: 36, False: 6]
  ------------------
 4620|     36|            entry->strip.clear();
 4621|     36|          }
 4622|     42|          break;
 4623|     42|        }
 4624|       |
 4625|       |        // piece 4 - is affix string or 0 for null
 4626|     42|        case 3: {
  ------------------
  |  Branch (4626:9): [True: 42, False: 174]
  ------------------
 4627|     42|          entry->morphcode = nullptr;
 4628|     42|          entry->contclass = nullptr;
 4629|     42|          entry->contclasslen = 0;
 4630|     42|          np++;
 4631|     42|          std::string::const_iterator dash = std::find(start_piece, iter, '/');
 4632|     42|          if (dash != iter) {
  ------------------
  |  Branch (4632:15): [True: 18, False: 24]
  ------------------
 4633|     18|            entry->appnd = std::string(start_piece, dash);
 4634|     18|            std::string dash_str(dash + 1, iter);
 4635|       |
 4636|     18|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4636:17): [True: 2, False: 16]
  |  Branch (4636:41): [True: 0, False: 2]
  ------------------
 4637|      0|              if (utf8) {
  ------------------
  |  Branch (4637:19): [True: 0, False: 0]
  ------------------
 4638|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4639|      0|              } else {
 4640|      0|                remove_ignored_chars(entry->appnd, ignorechars);
 4641|      0|              }
 4642|      0|            }
 4643|       |
 4644|     18|            if (complexprefixes) {
  ------------------
  |  Branch (4644:17): [True: 2, False: 16]
  ------------------
 4645|      2|              if (utf8)
  ------------------
  |  Branch (4645:19): [True: 0, False: 2]
  ------------------
 4646|      0|                reverseword_utf(entry->appnd);
 4647|      2|              else
 4648|      2|                reverseword(entry->appnd);
 4649|      2|            }
 4650|       |
 4651|     18|            if (pHMgr->is_aliasf()) {
  ------------------
  |  Branch (4651:17): [True: 2, False: 16]
  ------------------
 4652|      2|              int index = atoi(dash_str.c_str());
 4653|      2|              entry->contclasslen = (unsigned short)pHMgr->get_aliasf(
 4654|      2|                  index, &(entry->contclass), af);
 4655|      2|              if (!entry->contclasslen)
  ------------------
  |  Branch (4655:19): [True: 0, False: 2]
  ------------------
 4656|      0|                HUNSPELL_WARNING(stderr,
 4657|      0|                                 "error: bad affix flag alias: \"%s\"\n",
 4658|      0|                                 dash_str.c_str());
 4659|     16|            } else {
 4660|     16|              entry->contclasslen = (unsigned short)pHMgr->decode_flags(
 4661|     16|                  &(entry->contclass), dash_str, af);
 4662|     16|              std::sort(entry->contclass, entry->contclass + entry->contclasslen);
 4663|     16|            }
 4664|       |
 4665|     18|            havecontclass = 1;
 4666|     44|            for (unsigned short _i = 0; _i < entry->contclasslen; _i++) {
  ------------------
  |  Branch (4666:41): [True: 26, False: 18]
  ------------------
 4667|     26|              contclasses[(entry->contclass)[_i]] = 1;
 4668|     26|            }
 4669|     24|          } else {
 4670|     24|            entry->appnd = std::string(start_piece, iter);
 4671|       |
 4672|     24|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4672:17): [True: 2, False: 22]
  |  Branch (4672:41): [True: 2, False: 0]
  ------------------
 4673|      2|              if (utf8) {
  ------------------
  |  Branch (4673:19): [True: 0, False: 2]
  ------------------
 4674|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4675|      2|              } else {
 4676|      2|                remove_ignored_chars(entry->appnd, ignorechars);
 4677|      2|              }
 4678|      2|            }
 4679|       |
 4680|     24|            if (complexprefixes) {
  ------------------
  |  Branch (4680:17): [True: 2, False: 22]
  ------------------
 4681|      2|              if (utf8)
  ------------------
  |  Branch (4681:19): [True: 0, False: 2]
  ------------------
 4682|      0|                reverseword_utf(entry->appnd);
 4683|      2|              else
 4684|      2|                reverseword(entry->appnd);
 4685|      2|            }
 4686|     24|          }
 4687|       |
 4688|     42|          if (entry->appnd.compare("0") == 0) {
  ------------------
  |  Branch (4688:15): [True: 2, False: 40]
  ------------------
 4689|      2|            entry->appnd.clear();
 4690|      2|          }
 4691|     42|          break;
 4692|     42|        }
 4693|       |
 4694|       |        // piece 5 - is the conditions descriptions
 4695|     42|        case 4: {
  ------------------
  |  Branch (4695:9): [True: 42, False: 174]
  ------------------
 4696|     42|          std::string chunk(start_piece, iter);
 4697|     42|          np++;
 4698|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4698:15): [True: 4, False: 38]
  ------------------
 4699|      4|            if (utf8)
  ------------------
  |  Branch (4699:17): [True: 0, False: 4]
  ------------------
 4700|      0|              reverseword_utf(chunk);
 4701|      4|            else
 4702|      4|              reverseword(chunk);
 4703|      4|            reverse_condition(chunk);
 4704|      4|          }
 4705|     42|          if (!entry->strip.empty() && chunk != "." &&
  ------------------
  |  Branch (4705:15): [True: 6, False: 36]
  |  Branch (4705:40): [True: 6, False: 0]
  ------------------
 4706|      6|              redundant_condition(at, entry->strip, chunk,
  ------------------
  |  Branch (4706:15): [True: 6, False: 0]
  ------------------
 4707|      6|                                  af->getlinenum()))
 4708|      6|            chunk = ".";
 4709|     42|          if (at == 'S') {
  ------------------
  |  Branch (4709:15): [True: 34, False: 8]
  ------------------
 4710|     34|            reverseword(chunk);
 4711|     34|            reverse_condition(chunk);
 4712|     34|          }
 4713|     42|          if (encodeit(*entry, chunk))
  ------------------
  |  Branch (4713:15): [True: 0, False: 42]
  ------------------
 4714|      0|            return false;
 4715|     42|          break;
 4716|     42|        }
 4717|       |
 4718|     42|        case 5: {
  ------------------
  |  Branch (4718:9): [True: 6, False: 210]
  ------------------
 4719|      6|          std::string chunk(start_piece, iter);
 4720|      6|          np++;
 4721|      6|          if (pHMgr->is_aliasm()) {
  ------------------
  |  Branch (4721:15): [True: 0, False: 6]
  ------------------
 4722|      0|            int index = atoi(chunk.c_str());
 4723|      0|            entry->morphcode = pHMgr->get_aliasm(index);
 4724|      6|          } else {
 4725|      6|            if (complexprefixes) {  // XXX - fix me for morph. gen.
  ------------------
  |  Branch (4725:17): [True: 0, False: 6]
  ------------------
 4726|      0|              if (utf8)
  ------------------
  |  Branch (4726:19): [True: 0, False: 0]
  ------------------
 4727|      0|                reverseword_utf(chunk);
 4728|      0|              else
 4729|      0|                reverseword(chunk);
 4730|      0|            }
 4731|       |            // add the remaining of the line
 4732|      6|            std::string::const_iterator end = nl.end();
 4733|      6|            if (iter != end) {
  ------------------
  |  Branch (4733:17): [True: 0, False: 6]
  ------------------
 4734|      0|              chunk.append(iter, end);
 4735|      0|            }
 4736|      6|            entry->morphcode = mystrdup(chunk.c_str());
 4737|      6|          }
 4738|      6|          break;
 4739|     42|        }
 4740|      0|        default:
  ------------------
  |  Branch (4740:9): [True: 0, False: 216]
  ------------------
 4741|      0|          break;
 4742|    216|      }
 4743|    216|      i++;
 4744|    216|      start_piece = mystrsep(nl, iter);
 4745|    216|    }
 4746|       |    // check to make sure we parsed enough pieces
 4747|     42|    if (np < 4) {
  ------------------
  |  Branch (4747:9): [True: 0, False: 42]
  ------------------
 4748|      0|      std::string err = pHMgr->encode_flag(aflag);
 4749|      0|      HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n",
 4750|      0|                       af->getlinenum(), err.c_str());
 4751|      0|      return false;
 4752|      0|    }
 4753|       |
 4754|       |#ifdef DEBUG
 4755|       |    // detect unnecessary fields, excepting comments
 4756|       |    if (basefieldnum) {
 4757|       |      int fieldnum =
 4758|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 4759|       |      if (fieldnum != basefieldnum)
 4760|       |        HUNSPELL_WARNING(stderr, "warning: line %d: bad field number\n",
 4761|       |                         af->getlinenum());
 4762|       |    } else {
 4763|       |      basefieldnum =
 4764|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 4765|       |    }
 4766|       |#endif
 4767|     42|  }
 4768|       |
 4769|       |  // now create SfxEntry or PfxEntry objects and use links to
 4770|       |  // build an ordered (sorted by affix string) list
 4771|     26|  auto start = affentries.begin(), end = affentries.end();
 4772|     68|  for (auto affentry = start; affentry != end; ++affentry) {
  ------------------
  |  Branch (4772:31): [True: 42, False: 26]
  ------------------
 4773|     42|    if (at == 'P') {
  ------------------
  |  Branch (4773:9): [True: 8, False: 34]
  ------------------
 4774|      8|      build_pfxtree(static_cast<PfxEntry*>(*affentry));
 4775|     34|    } else {
 4776|     34|      build_sfxtree(static_cast<SfxEntry*>(*affentry));
 4777|     34|    }
 4778|     42|  }
 4779|       |
 4780|       |  //contents belong to AffixMgr now
 4781|     26|  affentries.release();
 4782|       |
 4783|     26|  return true;
 4784|     26|}
_ZN8AffixMgr19redundant_conditionEcRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 4789|      6|                                  int linenum) {
 4790|      6|  int stripl = strip.size(), condl = cond.size(), i, j, neg, in;
 4791|      6|  if (ft == 'P') {  // prefix
  ------------------
  |  Branch (4791:7): [True: 0, False: 6]
  ------------------
 4792|      0|    if (strip.compare(0, condl, cond) == 0)
  ------------------
  |  Branch (4792:9): [True: 0, False: 0]
  ------------------
 4793|      0|      return 1;
 4794|      0|    if (utf8) {
  ------------------
  |  Branch (4794:9): [True: 0, False: 0]
  ------------------
 4795|      0|    } else {
 4796|      0|      for (i = 0, j = 0; (i < stripl) && (j < condl); i++, j++) {
  ------------------
  |  Branch (4796:26): [True: 0, False: 0]
  |  Branch (4796:42): [True: 0, False: 0]
  ------------------
 4797|      0|        if (cond[j] != '[') {
  ------------------
  |  Branch (4797:13): [True: 0, False: 0]
  ------------------
 4798|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (4798:15): [True: 0, False: 0]
  ------------------
 4799|      0|            HUNSPELL_WARNING(stderr,
 4800|      0|                             "warning: line %d: incompatible stripping "
 4801|      0|                             "characters and condition\n",
 4802|      0|                             linenum);
 4803|      0|            return 0;
 4804|      0|          }
 4805|      0|        } else {
 4806|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (4806:17): [True: 0, False: 0]
  ------------------
 4807|      0|          in = 0;
 4808|      0|          do {
 4809|      0|            j++;
 4810|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (4810:17): [True: 0, False: 0]
  ------------------
 4811|      0|              in = 1;
 4812|      0|          } while ((j < (condl - 1)) && (cond[j] != ']'));
  ------------------
  |  Branch (4812:20): [True: 0, False: 0]
  |  Branch (4812:41): [True: 0, False: 0]
  ------------------
 4813|      0|          if (j == (condl - 1) && (cond[j] != ']')) {
  ------------------
  |  Branch (4813:15): [True: 0, False: 0]
  |  Branch (4813:35): [True: 0, False: 0]
  ------------------
 4814|      0|            HUNSPELL_WARNING(stderr,
 4815|      0|                             "error: line %d: missing ] in condition:\n%s\n",
 4816|      0|                             linenum, cond.c_str());
 4817|      0|            return 0;
 4818|      0|          }
 4819|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (4819:16): [True: 0, False: 0]
  |  Branch (4819:24): [True: 0, False: 0]
  |  Branch (4819:33): [True: 0, False: 0]
  |  Branch (4819:40): [True: 0, False: 0]
  ------------------
 4820|      0|            HUNSPELL_WARNING(stderr,
 4821|      0|                             "warning: line %d: incompatible stripping "
 4822|      0|                             "characters and condition\n",
 4823|      0|                             linenum);
 4824|      0|            return 0;
 4825|      0|          }
 4826|      0|        }
 4827|      0|      }
 4828|      0|      if (j >= condl)
  ------------------
  |  Branch (4828:11): [True: 0, False: 0]
  ------------------
 4829|      0|        return 1;
 4830|      0|    }
 4831|      6|  } else {  // suffix
 4832|      6|    if ((stripl >= condl) && strip.compare(stripl - condl, std::string::npos, cond) == 0)
  ------------------
  |  Branch (4832:9): [True: 6, False: 0]
  |  Branch (4832:30): [True: 6, False: 0]
  ------------------
 4833|      6|      return 1;
 4834|      0|    if (utf8) {
  ------------------
  |  Branch (4834:9): [True: 0, False: 0]
  ------------------
 4835|      0|    } else {
 4836|      0|      for (i = stripl - 1, j = condl - 1; (i >= 0) && (j >= 0); i--, j--) {
  ------------------
  |  Branch (4836:43): [True: 0, False: 0]
  |  Branch (4836:55): [True: 0, False: 0]
  ------------------
 4837|      0|        if (cond[j] != ']') {
  ------------------
  |  Branch (4837:13): [True: 0, False: 0]
  ------------------
 4838|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (4838:15): [True: 0, False: 0]
  ------------------
 4839|      0|            HUNSPELL_WARNING(stderr,
 4840|      0|                             "warning: line %d: incompatible stripping "
 4841|      0|                             "characters and condition\n",
 4842|      0|                             linenum);
 4843|      0|            return 0;
 4844|      0|          }
 4845|      0|        } else if (j > 0) {
  ------------------
  |  Branch (4845:20): [True: 0, False: 0]
  ------------------
 4846|      0|          in = 0;
 4847|      0|          do {
 4848|      0|            j--;
 4849|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (4849:17): [True: 0, False: 0]
  ------------------
 4850|      0|              in = 1;
 4851|      0|          } while ((j > 0) && (cond[j] != '['));
  ------------------
  |  Branch (4851:20): [True: 0, False: 0]
  |  Branch (4851:31): [True: 0, False: 0]
  ------------------
 4852|      0|          if ((j == 0) && (cond[j] != '[')) {
  ------------------
  |  Branch (4852:15): [True: 0, False: 0]
  |  Branch (4852:27): [True: 0, False: 0]
  ------------------
 4853|      0|            HUNSPELL_WARNING(stderr,
 4854|      0|                             "error: line: %d: missing ] in condition:\n%s\n",
 4855|      0|                             linenum, cond.c_str());
 4856|      0|            return 0;
 4857|      0|          }
 4858|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (4858:17): [True: 0, False: 0]
  ------------------
 4859|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (4859:16): [True: 0, False: 0]
  |  Branch (4859:24): [True: 0, False: 0]
  |  Branch (4859:33): [True: 0, False: 0]
  |  Branch (4859:40): [True: 0, False: 0]
  ------------------
 4860|      0|            HUNSPELL_WARNING(stderr,
 4861|      0|                             "warning: line %d: incompatible stripping "
 4862|      0|                             "characters and condition\n",
 4863|      0|                             linenum);
 4864|      0|            return 0;
 4865|      0|          }
 4866|      0|        }
 4867|      0|      }
 4868|      0|      if (j < 0)
  ------------------
  |  Branch (4868:11): [True: 0, False: 0]
  ------------------
 4869|      0|        return 1;
 4870|      0|    }
 4871|      0|  }
 4872|      0|  return 0;
 4873|      6|}
_ZN8AffixMgr8isSubsetEPKcS1_:
 1069|  87.3k|inline int AffixMgr::isSubset(const char* s1, const char* s2) {
 1070|   113k|  while (((*s1 == *s2) || (*s1 == '.')) && (*s1 != '\0') && (*s2 != '\0')) {
  ------------------
  |  Branch (1070:11): [True: 88.2k, False: 25.4k]
  |  Branch (1070:27): [True: 0, False: 25.4k]
  |  Branch (1070:44): [True: 26.2k, False: 61.9k]
  |  Branch (1070:61): [True: 26.2k, False: 0]
  ------------------
 1071|  26.2k|    s1++;
 1072|  26.2k|    s2++;
 1073|  26.2k|  }
 1074|  87.3k|  return (*s1 == '\0');
 1075|  87.3k|}
_ZN8AffixMgr11isRevSubsetEPKcS1_i:
 2725|   442k|                                 int len) {
 2726|   887k|  while ((len > 0) && (*s1 != '\0') && ((*s1 == *end_of_s2) || (*s1 == '.'))) {
  ------------------
  |  Branch (2726:10): [True: 882k, False: 4.79k]
  |  Branch (2726:23): [True: 530k, False: 352k]
  |  Branch (2726:41): [True: 444k, False: 86.1k]
  |  Branch (2726:64): [True: 0, False: 86.1k]
  ------------------
 2727|   444k|    s1++;
 2728|   444k|    end_of_s2--;
 2729|   444k|    len--;
 2730|   444k|  }
 2731|   442k|  return (*s1 == '\0');
 2732|   442k|}
affixmgr.cxx:_ZN12_GLOBAL__N_18mystrdupEPKc:
 3389|   576k|  char* mystrdup(const char* s) {
 3390|   576k|    char* d = nullptr;
 3391|   576k|    if (s) {
  ------------------
  |  Branch (3391:9): [True: 576k, False: 0]
  ------------------
 3392|   576k|      size_t sl = strlen(s) + 1;
 3393|   576k|      d = new char[sl];
 3394|   576k|      memcpy(d, s, sl);
 3395|   576k|    }
 3396|   576k|    return d;
 3397|   576k|  }
_ZN17entries_containerC2EcP8AffixMgr:
 4435|     26|    : m_mgr(mgr)
 4436|     26|    , m_at(at) {
 4437|     26|  }
_ZN17entries_container10initializeEict:
 4442|     26|                  char opts, unsigned short aflag) {
 4443|     26|    entries.reserve(std::min(numents, 16384));
 4444|       |
 4445|     26|    if (m_at == 'P') {
  ------------------
  |  Branch (4445:9): [True: 8, False: 18]
  ------------------
 4446|      8|      entries.push_back(new PfxEntry(m_mgr));
 4447|     18|    } else {
 4448|     18|      entries.push_back(new SfxEntry(m_mgr));
 4449|     18|    }
 4450|       |
 4451|     26|    entries.back()->opts = opts;
 4452|     26|    entries.back()->aflag = aflag;
 4453|     26|  }
_ZN17entries_container11first_entryEv:
 4466|     42|  AffEntry* first_entry() { return entries.empty() ? nullptr : entries[0]; }
  ------------------
  |  Branch (4466:36): [True: 0, False: 42]
  ------------------
_ZN17entries_container9add_entryEc:
 4455|     16|  AffEntry* add_entry(char opts) {
 4456|     16|    if (m_at == 'P') {
  ------------------
  |  Branch (4456:9): [True: 0, False: 16]
  ------------------
 4457|      0|      entries.push_back(new PfxEntry(m_mgr));
 4458|     16|    } else {
 4459|     16|      entries.push_back(new SfxEntry(m_mgr));
 4460|     16|    }
 4461|     16|    AffEntry* ret = entries.back();
 4462|     16|    ret->opts = entries[0]->opts & opts;
 4463|     16|    return ret;
 4464|     16|  }
_ZN17entries_container5beginEv:
 4474|     26|  std::vector<AffEntry*>::iterator begin() { return entries.begin(); }
_ZN17entries_container3endEv:
 4475|     26|  std::vector<AffEntry*>::iterator end() { return entries.end(); }
_ZN17entries_container7releaseEv:
 4438|     26|  void release() {
 4439|     26|    entries.clear();
 4440|     26|  }
_ZN17entries_containerD2Ev:
 4468|     26|  ~entries_container() {
 4469|     26|    for (auto& entry : entries) {
  ------------------
  |  Branch (4469:22): [True: 0, False: 26]
  ------------------
 4470|      0|      delete entry;
 4471|      0|    }
 4472|     26|  }
affixmgr.cxx:_ZZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEENK3$_1clE6w_char:
 1574|  3.45k|          [&](w_char wc) {
 1575|  3.45k|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1576|  3.45k|          });

_ZN9guesswordC2Ev:
  118|  4.79M|    : word(nullptr)
  119|  4.79M|    , allow(false)
  120|  4.79M|    , orig(nullptr)
  121|  4.79M|  {
  122|  4.79M|  }
_ZN8patentryC2Ev:
  135|      4|    : cond(FLAG_NULL)
  ------------------
  |  |   96|      4|#define FLAG_NULL 0x00
  ------------------
  136|      4|    , cond2(FLAG_NULL) {
  ------------------
  |  |   96|      4|#define FLAG_NULL 0x00
  ------------------
  137|      4|  }
csutil.cxx:_ZL16HUNSPELL_WARNINGP8_IO_FILEPKcz:
   48|  1.20M|static inline void HUNSPELL_WARNING(FILE*, const char*, ...) {}

_ZN8AffEntryC2Ev:
   46|     42|      : morphcode(nullptr)
   47|     42|      , contclass(nullptr)
   48|     42|      , aflag(0)
   49|     42|      , contclasslen(0)
   50|     42|      , numconds(0)
   51|     42|      , opts(0) {}

_Z6myopenRNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEEPKcj:
  111|    114|{
  112|       |#if defined(_WIN32) && defined(_MSC_VER)
  113|       |#define WIN32_LONG_PATH_PREFIX "\\\\?\\"
  114|       |  if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
  115|       |    int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
  116|       |    wchar_t* buff = new wchar_t[len];
  117|       |    wchar_t* buff2 = new wchar_t[len];
  118|       |    MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
  119|       |    if (_wfullpath(buff2, buff, len) != NULL) {
  120|       |      stream.open(buff2, mode);
  121|       |    }
  122|       |    delete [] buff;
  123|       |    delete [] buff2;
  124|       |  }
  125|       |  else
  126|       |#endif
  127|    114|  stream.open(path, mode);
  128|    114|}
_Z6u16_u8RNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEE:
  135|  21.8M|std::string& u16_u8(std::string& dest, const std::vector<w_char>& src) {
  136|  21.8M|  dest.clear();
  137|  21.8M|  dest.reserve(src.size());
  138|   575M|  for (const w_char& wc : src) {
  ------------------
  |  Branch (138:25): [True: 575M, False: 21.8M]
  ------------------
  139|   575M|    uint16_t cp = (static_cast<uint16_t>(wc.h) << 8) | wc.l;
  140|   575M|    if (cp < 0x80) {
  ------------------
  |  Branch (140:9): [True: 505M, False: 69.5M]
  ------------------
  141|   505M|      dest.push_back(static_cast<char>(cp));
  142|   505M|    } else if (cp < 0x800) {
  ------------------
  |  Branch (142:16): [True: 3.19M, False: 66.3M]
  ------------------
  143|  3.19M|      dest.push_back(static_cast<char>(0xc0 | (cp >> 6)));
  144|  3.19M|      dest.push_back(static_cast<char>(0x80 | (cp & 0x3f)));
  145|  66.3M|    } else {
  146|  66.3M|      dest.push_back(static_cast<char>(0xe0 | (cp >> 12)));
  147|  66.3M|      dest.push_back(static_cast<char>(0x80 | ((cp >> 6) & 0x3f)));
  148|  66.3M|      dest.push_back(static_cast<char>(0x80 | (cp & 0x3f)));
  149|  66.3M|    }
  150|   575M|  }
  151|  21.8M|  return dest;
  152|  21.8M|}
_Z6u8_u16RNSt3__16vectorI6w_charNS_9allocatorIS1_EEEERKNS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEb:
  170|  4.28M|int u8_u16(std::vector<w_char>& dest, const std::string& src, bool only_convert_first_letter) {
  171|       |  // faster to oversize initially, assign to elements and resize to what's used
  172|       |  // than to reserve and push_back
  173|  4.28M|  dest.resize(only_convert_first_letter ? 1 : src.size());
  ------------------
  |  Branch (173:15): [True: 0, False: 4.28M]
  ------------------
  174|  4.28M|  auto out = dest.begin();
  175|  4.28M|  auto p = src.begin(), end = src.end();
  176|       |
  177|  36.5M|  while (p < end) {
  ------------------
  |  Branch (177:10): [True: 32.4M, False: 4.11M]
  ------------------
  178|  32.4M|    uint8_t b0 = static_cast<uint8_t>(*p);
  179|  32.4M|    uint16_t cp;
  180|       |
  181|  32.4M|    if (b0 < 0x80) {
  ------------------
  |  Branch (181:9): [True: 29.5M, False: 2.88M]
  ------------------
  182|       |      // 1-byte ASCII
  183|  29.5M|      cp = b0;
  184|  29.5M|    } else if (b0 < 0xc0) {
  ------------------
  |  Branch (184:16): [True: 266k, False: 2.62M]
  ------------------
  185|       |      // continuation byte at lead position
  186|   266k|      HUNSPELL_WARNING(stderr,
  187|   266k|                       "UTF-8 encoding error. Unexpected continuation bytes "
  188|   266k|                       "in %ld. character position\n%s\n",
  189|   266k|                       static_cast<long>(std::distance(src.begin(), p)),
  190|   266k|                       src.c_str());
  191|   266k|      cp = 0xfffd;
  192|  2.62M|    } else if (b0 < 0xe0) {
  ------------------
  |  Branch (192:16): [True: 910k, False: 1.71M]
  ------------------
  193|       |      // 2-byte sequence: 110xxxxx 10yyyyyy
  194|   910k|      if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (194:11): [True: 764k, False: 145k]
  |  Branch (194:11): [True: 237k, False: 672k]
  |  Branch (194:26): [True: 237k, False: 527k]
  ------------------
  195|   237k|        cp = ((b0 & 0x1f) << 6) | (static_cast<uint8_t>(p[1]) & 0x3f);
  196|   237k|        ++p;  // step past lead; loop bottom steps past cont
  197|   672k|      } else {
  198|   672k|        warn_missing_cont(src, p);
  199|   672k|        cp = 0xfffd;
  200|   672k|      }
  201|  1.71M|    } else if (b0 < 0xf0) {
  ------------------
  |  Branch (201:16): [True: 1.54M, False: 171k]
  ------------------
  202|       |      // 3-byte sequence: 1110xxxx 10yyyyyy 10zzzzzz
  203|  1.54M|      if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (203:11): [True: 1.51M, False: 21.8k]
  |  Branch (203:11): [True: 1.45M, False: 86.5k]
  |  Branch (203:26): [True: 1.45M, False: 64.7k]
  ------------------
  204|  1.45M|        uint8_t b1 = static_cast<uint8_t>(p[1]);
  205|  1.45M|        ++p;  // step past lead
  206|  1.45M|        if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (206:13): [True: 1.45M, False: 1.32k]
  |  Branch (206:13): [True: 1.45M, False: 4.14k]
  |  Branch (206:28): [True: 1.45M, False: 2.81k]
  ------------------
  207|  1.45M|          cp = ((b0 & 0x0f) << 12) | ((b1 & 0x3f) << 6) | (static_cast<uint8_t>(p[1]) & 0x3f);
  208|  1.45M|          ++p;  // step past first cont; loop bottom steps past second cont
  209|  1.45M|        } else {
  210|  4.14k|          warn_missing_cont(src, p);
  211|  4.14k|          cp = 0xfffd;
  212|  4.14k|        }
  213|  1.45M|      } else {
  214|  86.5k|        warn_missing_cont(src, p);
  215|  86.5k|        cp = 0xfffd;
  216|  86.5k|      }
  217|  1.54M|    } else {
  218|       |      // 4+ byte lead: codepoint >= U+10000, can't fit in w_char
  219|   171k|      HUNSPELL_WARNING(stderr,
  220|   171k|                       "This UTF-8 encoding can't convert to UTF-16:\n%s\n",
  221|   171k|                       src.c_str());
  222|   171k|      out->h = 0xff;
  223|   171k|      out->l = 0xfd;
  224|   171k|      ++out;
  225|   171k|      dest.resize(out - dest.begin());
  226|   171k|      return -1;
  227|   171k|    }
  228|       |
  229|  32.2M|    out->h = static_cast<unsigned char>(cp >> 8);
  230|  32.2M|    out->l = static_cast<unsigned char>(cp);
  231|  32.2M|    ++out;
  232|  32.2M|    if (only_convert_first_letter)
  ------------------
  |  Branch (232:9): [True: 0, False: 32.2M]
  ------------------
  233|      0|      break;
  234|  32.2M|    ++p;  // consume lead byte
  235|  32.2M|  }
  236|       |
  237|  4.11M|  int size = static_cast<int>(out - dest.begin());
  238|  4.11M|  dest.resize(size);
  239|  4.11M|  return size;
  240|  4.28M|}
_Z8mystrsepRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_11__wrap_iterIPKcEE:
  255|  1.80k|                                     std::string::const_iterator& start) {
  256|  1.80k|  auto end = str.end();
  257|       |
  258|  1.80k|  is_any_of op(" \t");
  259|       |  // don't use isspace() here, the string can be in some random charset
  260|       |  // that's way different than the locale's
  261|  1.80k|  auto sp = start;
  262|  5.87k|  while (sp != end && op(*sp))
  ------------------
  |  Branch (262:10): [True: 5.43k, False: 442]
  |  Branch (262:23): [True: 4.07k, False: 1.35k]
  ------------------
  263|  4.07k|      ++sp;
  264|       |
  265|  1.80k|  auto dp = sp;
  266|  6.69k|  while (dp != end && !op(*dp))
  ------------------
  |  Branch (266:10): [True: 5.81k, False: 882]
  |  Branch (266:23): [True: 4.89k, False: 918]
  ------------------
  267|  4.89k|      ++dp;
  268|       |
  269|  1.80k|  start = dp;
  270|  1.80k|  return sp;
  271|  1.80k|}
_Z7mychompRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  274|  1.99k|void mychomp(std::string& s) {
  275|  1.99k|  size_t k = s.size();
  276|  1.99k|  size_t newsize = k;
  277|  1.99k|  if ((k > 0) && ((s[k - 1] == '\r') || (s[k - 1] == '\n')))
  ------------------
  |  Branch (277:7): [True: 1.80k, False: 190]
  |  Branch (277:19): [True: 0, False: 1.80k]
  |  Branch (277:41): [True: 0, False: 1.80k]
  ------------------
  278|      0|    --newsize;
  279|  1.99k|  if ((k > 1) && (s[k - 2] == '\r'))
  ------------------
  |  Branch (279:7): [True: 1.60k, False: 384]
  |  Branch (279:18): [True: 0, False: 1.60k]
  ------------------
  280|      0|    --newsize;
  281|  1.99k|  s.resize(newsize);
  282|  1.99k|}
_Z8line_tokRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEc:
  285|   255k|std::vector<std::string> line_tok(const std::string& text, char breakchar) {
  286|   255k|  std::vector<std::string> ret;
  287|   255k|  if (text.empty()) {
  ------------------
  |  Branch (287:7): [True: 11.4k, False: 243k]
  ------------------
  288|  11.4k|    return ret;
  289|  11.4k|  }
  290|       |
  291|   243k|  std::stringstream ss(text);
  292|   243k|  std::string tok;
  293|   523k|  while(std::getline(ss, tok, breakchar)) {
  ------------------
  |  Branch (293:9): [True: 279k, False: 243k]
  ------------------
  294|   279k|    if (!tok.empty()) {
  ------------------
  |  Branch (294:9): [True: 279k, False: 100]
  ------------------
  295|   279k|      ret.push_back(tok);
  296|   279k|    }
  297|   279k|  }
  298|       |
  299|   243k|  return ret;
  300|   255k|}
_Z9line_uniqRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEc:
  312|  14.2k|{
  313|  14.2k|  std::vector<std::string> lines = line_tok(text, breakchar);
  314|  14.2k|  text.clear();
  315|  14.2k|  if (lines.empty()) {
  ------------------
  |  Branch (315:7): [True: 11.3k, False: 2.82k]
  ------------------
  316|  11.3k|    return;
  317|  11.3k|  }
  318|       |
  319|  2.82k|  drop_repeated_lines(lines);
  320|       |
  321|  2.82k|  text = lines[0];
  322|  2.83k|  for (size_t i = 1; i < lines.size(); ++i) {
  ------------------
  |  Branch (322:22): [True: 10, False: 2.82k]
  ------------------
  323|     10|    text.push_back(breakchar);
  324|     10|    text.append(lines[i]);
  325|     10|  }
  326|  2.82k|}
_Z21append_compound_partsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_:
  375|   238k|size_t append_compound_parts(const std::string& desc, std::string& result) {
  376|       |  // find by offset, a search from a bare pointer remeasures the rest of desc on every step
  377|   238k|  size_t part = desc.find(MORPH_PART);
  ------------------
  |  |  116|   238k|#define MORPH_PART "pa:"
  ------------------
  378|   238k|  if (part == std::string::npos)
  ------------------
  |  Branch (378:7): [True: 238k, False: 0]
  ------------------
  379|   238k|    return 0;
  380|      0|  size_t nextpart = desc.find(MORPH_PART, part + 1);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
  381|      0|  while (nextpart != std::string::npos) {
  ------------------
  |  Branch (381:10): [True: 0, False: 0]
  ------------------
  382|      0|    const char* field = desc.c_str() + part + MORPH_TAG_LEN;
  ------------------
  |  |  119|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
  383|      0|    result.append(field, fieldlen(field));
  384|      0|    part = nextpart;
  385|      0|    nextpart = desc.find(MORPH_PART, part + 1);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
  386|      0|  }
  387|      0|  return part;
  388|   238k|}
_Z10copy_fieldRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_S8_:
  392|   254k|                const std::string& var) {
  393|   254k|  if (morph.empty())
  ------------------
  |  Branch (393:7): [True: 0, False: 254k]
  ------------------
  394|      0|    return false;
  395|   254k|  size_t pos = morph.find(var);
  396|   254k|  if (pos == std::string::npos)
  ------------------
  |  Branch (396:7): [True: 17, False: 254k]
  ------------------
  397|     17|    return false;
  398|   254k|  pos += MORPH_TAG_LEN;
  ------------------
  |  |  119|   254k|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|   254k|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
  399|       |  // copy the field value up to the next whitespace, without first
  400|       |  // making a throwaway copy of the whole remaining tail of the string
  401|   254k|  size_t end = morph.find_first_of(" \t\n", pos);
  402|   254k|  dest.assign(morph, pos, end == std::string::npos ? std::string::npos : end - pos);
  ------------------
  |  Branch (402:27): [True: 254k, False: 0]
  ------------------
  403|       |
  404|   254k|  return true;
  405|   254k|}
_Z8mystrrepRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_S8_:
  409|  1.05M|                      const std::string& replace) {
  410|  1.05M|  size_t pos = 0;
  411|  1.12M|  while ((pos = str.find(search, pos)) != std::string::npos) {
  ------------------
  |  Branch (411:10): [True: 74.7k, False: 1.05M]
  ------------------
  412|  74.7k|    str.replace(pos, search.length(), replace);
  413|  74.7k|    pos += replace.length();
  414|  74.7k|  }
  415|  1.05M|  return str;
  416|  1.05M|}
_Z11reversewordRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  419|  1.01M|size_t reverseword(std::string& word) {
  420|  1.01M|  std::reverse(word.begin(), word.end());
  421|  1.01M|  return word.size();
  422|  1.01M|}
_Z8uniqlistRNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE:
  499|  6.61k|void uniqlist(std::vector<std::string>& list) {
  500|  6.61k|  if (list.size() < 2)
  ------------------
  |  Branch (500:7): [True: 6.61k, False: 0]
  ------------------
  501|  6.61k|    return;
  502|       |
  503|      0|  std::vector<std::string> ret;
  504|      0|  ret.push_back(list[0]);
  505|       |
  506|      0|  for (size_t i = 1; i < list.size(); ++i) {
  ------------------
  |  Branch (506:22): [True: 0, False: 0]
  ------------------
  507|      0|    if (std::find(ret.begin(), ret.end(), list[i]) == ret.end())
  ------------------
  |  Branch (507:9): [True: 0, False: 0]
  ------------------
  508|      0|        ret.push_back(list[i]);
  509|      0|  }
  510|       |
  511|      0|  list.swap(ret);
  512|      0|}
_Z9upper_utf6w_chari:
  531|  4.03M|w_char upper_utf(w_char u, int langnum) {
  532|       |
  533|  4.03M|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  534|       |
  535|       |//with these optimizations, msvc can optimize this function to one jmp instruction
  536|       |//but g++ remains in five instructions
  537|       |//maybe use inline asm for g++?
  538|       |
  539|       |#if (__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)) && defined __cpp_lib_bit_cast && __cpp_lib_bit_cast >= 201806L
  540|       |  return std::bit_cast<w_char>(unicodetoupper((unsigned short)u, langnum));
  541|       |#else
  542|  4.03M|  const auto us = unicodetoupper((unsigned short)u, langnum);
  543|  4.03M|  memcpy(&u, &us, sizeof(unsigned short));
  544|  4.03M|  return u;
  545|  4.03M|#endif
  546|       |
  547|       |#else
  548|       |  const auto us = unicodetoupper((unsigned short)u, langnum);
  549|       |  u.h = (unsigned char)(us >> 8);
  550|       |  u.l = (unsigned char)(us & 0xff);
  551|       |  return u;
  552|       |#endif
  553|  4.03M|}
_Z9lower_utf6w_chari:
  555|  6.03M|w_char lower_utf(w_char u, int langnum) {
  556|       |
  557|  6.03M|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  558|       |
  559|       |//with these optimizations, msvc can optimize this function to one jmp instruction
  560|       |//but g++ remains in five instructions
  561|       |//maybe use inline asm for g++?
  562|       |
  563|       |#if (__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)) && defined __cpp_lib_bit_cast && __cpp_lib_bit_cast >= 201806L
  564|       |  return std::bit_cast<w_char>(unicodetolower((unsigned short)u, langnum));
  565|       |#else
  566|  6.03M|  const auto us = unicodetolower((unsigned short)u, langnum);
  567|  6.03M|  memcpy(&u, &us, sizeof(unsigned short));
  568|  6.03M|  return u;
  569|  6.03M|#endif
  570|       |
  571|       |#else
  572|       |  const auto us = unicodetolower((unsigned short)u, langnum);
  573|       |  u.h = (unsigned char)(us >> 8);
  574|       |  u.l = (unsigned char)(us & 0xff);
  575|       |  return u;
  576|       |#endif
  577|  6.03M|}
_Z8mkallcapRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  580|   273k|std::string& mkallcap(std::string& s, const struct cs_info* csconv) {
  581|  5.44M|  for (char& aI : s) {
  ------------------
  |  Branch (581:17): [True: 5.44M, False: 273k]
  ------------------
  582|  5.44M|    aI = cupper(csconv, static_cast<unsigned char>(aI));
  583|  5.44M|  }
  584|   273k|  return s;
  585|   273k|}
_Z10mkallsmallRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  588|  1.93M|std::string& mkallsmall(std::string& s, const struct cs_info* csconv) {
  589|  21.4M|  for (char& aI : s) {
  ------------------
  |  Branch (589:17): [True: 21.4M, False: 1.93M]
  ------------------
  590|  21.4M|    aI = clower(csconv, static_cast<unsigned char>(aI));
  591|  21.4M|  }
  592|  1.93M|  return s;
  593|  1.93M|}
_Z14mkallsmall_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  595|   881k|std::vector<w_char>& mkallsmall_utf(std::vector<w_char>& u, int langnum) {
  596|  5.97M|  for (auto& i : u) {
  ------------------
  |  Branch (596:16): [True: 5.97M, False: 881k]
  ------------------
  597|  5.97M|    i = lower_utf(i, langnum);
  598|  5.97M|  }
  599|   881k|  return u;
  600|   881k|}
_Z12mkallcap_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  602|   158k|std::vector<w_char>& mkallcap_utf(std::vector<w_char>& u, int langnum) {
  603|  1.88M|  for (auto& i : u) {
  ------------------
  |  Branch (603:16): [True: 1.88M, False: 158k]
  ------------------
  604|  1.88M|    i = upper_utf(i, langnum);
  605|  1.88M|  }
  606|   158k|  return u;
  607|   158k|}
_Z9mkinitcapRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  609|  1.11M|std::string& mkinitcap(std::string& s, const struct cs_info* csconv) {
  610|  1.11M|  if (!s.empty()) {
  ------------------
  |  Branch (610:7): [True: 1.11M, False: 154]
  ------------------
  611|  1.11M|    s[0] = cupper(csconv, static_cast<unsigned char>(s[0]));
  612|  1.11M|  }
  613|  1.11M|  return s;
  614|  1.11M|}
_Z13mkinitcap_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  616|   268k|std::vector<w_char>& mkinitcap_utf(std::vector<w_char>& u, int langnum) {
  617|   268k|  if (!u.empty()) {
  ------------------
  |  Branch (617:7): [True: 268k, False: 0]
  ------------------
  618|   268k|    u[0] = upper_utf(u[0], langnum);
  619|   268k|  }
  620|   268k|  return u;
  621|   268k|}
_Z11mkinitsmallRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  623|   179k|std::string& mkinitsmall(std::string& s, const struct cs_info* csconv) {
  624|   179k|  if (!s.empty()) {
  ------------------
  |  Branch (624:7): [True: 179k, False: 0]
  ------------------
  625|   179k|    s[0] = clower(csconv, static_cast<unsigned char>(s[0]));
  626|   179k|  }
  627|   179k|  return s;
  628|   179k|}
_Z15mkinitsmall_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  630|  44.6k|std::vector<w_char>& mkinitsmall_utf(std::vector<w_char>& u, int langnum) {
  631|  44.6k|  if (!u.empty()) {
  ------------------
  |  Branch (631:7): [True: 44.6k, False: 0]
  ------------------
  632|  44.6k|    u[0] = lower_utf(u[0], langnum);
  633|  44.6k|  }
  634|  44.6k|  return u;
  635|  44.6k|}
_Z14get_current_csRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 2293|  2.10k|const struct cs_info* get_current_cs(const std::string& es) {
 2294|  2.10k|  char* normalized_encoding = new char[es.size() + 1];
 2295|  2.10k|  toAsciiLowerAndRemoveNonAlphanumeric(es.c_str(), normalized_encoding);
 2296|       |
 2297|  2.10k|  const struct cs_info* ccs = nullptr;
 2298|  2.10k|  for (const auto& encd : encds) {
  ------------------
  |  Branch (2298:25): [True: 2.10k, False: 0]
  ------------------
 2299|  2.10k|    if (strcmp(normalized_encoding, encd.enc_name) == 0) {
  ------------------
  |  Branch (2299:9): [True: 2.10k, False: 0]
  ------------------
 2300|  2.10k|      ccs = encd.cs_table;
 2301|  2.10k|      break;
 2302|  2.10k|    }
 2303|  2.10k|  }
 2304|       |
 2305|  2.10k|  delete[] normalized_encoding;
 2306|       |
 2307|  2.10k|  if (!ccs) {
  ------------------
  |  Branch (2307:7): [True: 0, False: 2.10k]
  ------------------
 2308|      0|    HUNSPELL_WARNING(stderr,
 2309|      0|                     "error: unknown encoding %s: using %s as fallback\n", es.c_str(),
 2310|      0|                     encds[0].enc_name);
 2311|      0|    ccs = encds[0].cs_table;
 2312|      0|  }
 2313|       |
 2314|  2.10k|  return ccs;
 2315|  2.10k|}
_Z12get_lang_numRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 2445|      4|int get_lang_num(const std::string& lang) {
 2446|     72|  for (const auto& i : lang2enc) {
  ------------------
  |  Branch (2446:22): [True: 72, False: 0]
  ------------------
 2447|     72|    if (strcmp(lang.c_str(), i.lang) == 0) {
  ------------------
  |  Branch (2447:9): [True: 4, False: 68]
  ------------------
 2448|      4|      return i.num;
 2449|      4|    }
 2450|     72|  }
 2451|      0|  return LANG_xx;
 2452|      4|}
_Z14unicodetoupperti:
 2454|  26.5M|unsigned short unicodetoupper(unsigned short c, int langnum) {
 2455|       |  // In Azeri and Turkish, I and i dictinct letters:
 2456|       |  // There are a dotless lower case i pair of upper `I',
 2457|       |  // and an upper I with dot pair of lower `i'.
 2458|  26.5M|  if (c == 0x0069 && ((langnum == LANG_az) || (langnum == LANG_tr) || (langnum == LANG_crh)))
  ------------------
  |  Branch (2458:7): [True: 198k, False: 26.3M]
  |  Branch (2458:23): [True: 0, False: 198k]
  |  Branch (2458:47): [True: 0, False: 198k]
  |  Branch (2458:71): [True: 0, False: 198k]
  ------------------
 2459|      0|    return 0x0130;
 2460|       |#ifdef OPENOFFICEORG
 2461|       |  return static_cast<unsigned short>(u_toupper(c));
 2462|       |#else
 2463|       |#ifdef MOZILLA_CLIENT
 2464|       |  return ToUpperCase((char16_t)c);
 2465|       |#else
 2466|  26.5M|  unsigned short up = utf_pages[utf_page_index[c >> 8]][c & 0xFF].cupper;
 2467|  26.5M|  return up ? up : c;
  ------------------
  |  Branch (2467:10): [True: 4.30M, False: 22.2M]
  ------------------
 2468|  26.5M|#endif
 2469|  26.5M|#endif
 2470|  26.5M|}
_Z14unicodetolowerti:
 2472|  29.3M|unsigned short unicodetolower(unsigned short c, int langnum) {
 2473|       |  // In Azeri and Turkish, I and i dictinct letters:
 2474|       |  // There are a dotless lower case i pair of upper `I',
 2475|       |  // and an upper I with dot pair of lower `i'.
 2476|  29.3M|  if (c == 0x0049 && ((langnum == LANG_az) || (langnum == LANG_tr) || (langnum == LANG_crh)))
  ------------------
  |  Branch (2476:7): [True: 93.1k, False: 29.2M]
  |  Branch (2476:23): [True: 0, False: 93.1k]
  |  Branch (2476:47): [True: 0, False: 93.1k]
  |  Branch (2476:71): [True: 0, False: 93.1k]
  ------------------
 2477|      0|    return 0x0131;
 2478|       |#ifdef OPENOFFICEORG
 2479|       |  return static_cast<unsigned short>(u_tolower(c));
 2480|       |#else
 2481|       |#ifdef MOZILLA_CLIENT
 2482|       |  return ToLowerCase((char16_t)c);
 2483|       |#else
 2484|  29.3M|  unsigned short lo = utf_pages[utf_page_index[c >> 8]][c & 0xFF].clower;
 2485|  29.3M|  return lo ? lo : c;
  ------------------
  |  Branch (2485:10): [True: 2.58M, False: 26.8M]
  ------------------
 2486|  29.3M|#endif
 2487|  29.3M|#endif
 2488|  29.3M|}
_Z11get_captypeRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
 2499|  11.1M|int get_captype(const std::string& word, const cs_info* csconv) {
 2500|       |  // now determine the capitalization type of the first nl letters
 2501|  11.1M|  size_t ncap = 0;
 2502|  11.1M|  size_t nneutral = 0;
 2503|  11.1M|  size_t firstcap = 0;
 2504|  11.1M|  if (csconv == nullptr)
  ------------------
  |  Branch (2504:7): [True: 0, False: 11.1M]
  ------------------
 2505|      0|    return NOCAP;
  ------------------
  |  |   92|      0|#define NOCAP 0
  ------------------
 2506|   116M|  for (char q : word) {
  ------------------
  |  Branch (2506:15): [True: 116M, False: 11.1M]
  ------------------
 2507|   116M|    const auto nIndex = static_cast<unsigned char>(q);
 2508|   116M|    if (ccase(csconv, nIndex))
  ------------------
  |  Branch (2508:9): [True: 4.58M, False: 111M]
  ------------------
 2509|  4.58M|      ncap++;
 2510|   116M|    if (cupper(csconv, nIndex) == clower(csconv, nIndex))
  ------------------
  |  Branch (2510:9): [True: 92.0M, False: 24.5M]
  ------------------
 2511|  92.0M|      nneutral++;
 2512|   116M|  }
 2513|  11.1M|  if (ncap) {
  ------------------
  |  Branch (2513:7): [True: 1.93M, False: 9.20M]
  ------------------
 2514|  1.93M|    const auto nIndex = static_cast<unsigned char>(word[0]);
 2515|  1.93M|    firstcap = csconv[nIndex].ccase;
 2516|  1.93M|  }
 2517|       |
 2518|       |  // now finally set the captype
 2519|  11.1M|  if (ncap == 0) {
  ------------------
  |  Branch (2519:7): [True: 9.20M, False: 1.93M]
  ------------------
 2520|  9.20M|    return NOCAP;
  ------------------
  |  |   92|  9.20M|#define NOCAP 0
  ------------------
 2521|  9.20M|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (2521:14): [True: 1.11M, False: 818k]
  |  Branch (2521:29): [True: 469k, False: 643k]
  ------------------
 2522|   469k|    return INITCAP;
  ------------------
  |  |   93|   469k|#define INITCAP 1
  ------------------
 2523|  1.46M|  } else if ((ncap == word.size()) || ((ncap + nneutral) == word.size())) {
  ------------------
  |  Branch (2523:14): [True: 6.81k, False: 1.45M]
  |  Branch (2523:39): [True: 253k, False: 1.20M]
  ------------------
 2524|   260k|    return ALLCAP;
  ------------------
  |  |   94|   260k|#define ALLCAP 2
  ------------------
 2525|  1.20M|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (2525:14): [True: 650k, False: 551k]
  |  Branch (2525:28): [True: 184k, False: 465k]
  ------------------
 2526|   184k|    return HUHINITCAP;
  ------------------
  |  |   96|   184k|#define HUHINITCAP 4
  ------------------
 2527|   184k|  }
 2528|  1.01M|  return HUHCAP;
  ------------------
  |  |   95|  1.01M|#define HUHCAP 3
  ------------------
 2529|  11.1M|}
_Z16get_captype_utf8RKNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
 2531|  2.76M|int get_captype_utf8(const std::vector<w_char>& word, int langnum) {
 2532|       |  // now determine the capitalization type of the first nl letters
 2533|  2.76M|  size_t ncap = 0;
 2534|  2.76M|  size_t nneutral = 0;
 2535|  2.76M|  size_t firstcap = 0;
 2536|       |
 2537|  2.76M|  auto it = word.begin(), it_end = word.end();
 2538|  25.0M|  while (it != it_end) {
  ------------------
  |  Branch (2538:10): [True: 22.3M, False: 2.76M]
  ------------------
 2539|  22.3M|    const auto idx = (unsigned short)*it;
 2540|  22.3M|    const auto lwridx = unicodetolower(idx, langnum);
 2541|  22.3M|    if (idx != lwridx)
  ------------------
  |  Branch (2541:9): [True: 1.13M, False: 21.1M]
  ------------------
 2542|  1.13M|      ncap++;
 2543|  22.3M|    if (unicodetoupper(idx, langnum) == lwridx)
  ------------------
  |  Branch (2543:9): [True: 17.9M, False: 4.41M]
  ------------------
 2544|  17.9M|      nneutral++;
 2545|  22.3M|    ++it;
 2546|  22.3M|  }
 2547|  2.76M|  if (ncap) {
  ------------------
  |  Branch (2547:7): [True: 353k, False: 2.41M]
  ------------------
 2548|   353k|    const auto idx = (unsigned short)word[0];
 2549|   353k|    firstcap = (idx != unicodetolower(idx, langnum));
 2550|   353k|  }
 2551|       |
 2552|       |  // now finally set the captype
 2553|  2.76M|  if (ncap == 0) {
  ------------------
  |  Branch (2553:7): [True: 2.41M, False: 353k]
  ------------------
 2554|  2.41M|    return NOCAP;
  ------------------
  |  |   92|  2.41M|#define NOCAP 0
  ------------------
 2555|  2.41M|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (2555:14): [True: 192k, False: 160k]
  |  Branch (2555:29): [True: 89.8k, False: 103k]
  ------------------
 2556|  89.8k|    return INITCAP;
  ------------------
  |  |   93|  89.8k|#define INITCAP 1
  ------------------
 2557|   263k|  } else if ((ncap == word.size()) || ((ncap + nneutral) == word.size())) {
  ------------------
  |  Branch (2557:14): [True: 3.13k, False: 260k]
  |  Branch (2557:39): [True: 69.0k, False: 191k]
  ------------------
 2558|  72.1k|    return ALLCAP;
  ------------------
  |  |   94|  72.1k|#define ALLCAP 2
  ------------------
 2559|   191k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (2559:14): [True: 111k, False: 80.1k]
  |  Branch (2559:28): [True: 45.1k, False: 66.1k]
  ------------------
 2560|  45.1k|    return HUHINITCAP;
  ------------------
  |  |   96|  45.1k|#define HUHINITCAP 4
  ------------------
 2561|  45.1k|  }
 2562|   146k|  return HUHCAP;
  ------------------
  |  |   95|   146k|#define HUHCAP 3
  ------------------
 2563|  2.76M|}
_Z24remove_ignored_chars_utfRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEE:
 2567|   684k|                                const std::vector<w_char>& ignored_chars) {
 2568|   684k|  std::vector<w_char> w;
 2569|   684k|  std::vector<w_char> w2;
 2570|   684k|  u8_u16(w, word);
 2571|       |
 2572|   684k|  std::copy_if(w.begin(), w.end(), std::back_inserter(w2),
 2573|   684k|  [&ignored_chars](w_char wc) {
 2574|   684k|    return !std::binary_search(ignored_chars.begin(), ignored_chars.end(), wc);
 2575|   684k|  });
 2576|       |
 2577|   684k|  u16_u8(word, w2);
 2578|   684k|  return w2.size();
 2579|   684k|}
_Z20remove_ignored_charsRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_:
 2583|  2.40M|                            const std::string& ignored_chars) {
 2584|  2.40M|  word.erase(
 2585|  2.40M|      std::remove_if(word.begin(), word.end(), is_any_of(ignored_chars)),
 2586|  2.40M|      word.end());
 2587|  2.40M|  return word.size();
 2588|  2.40M|}
_Z12parse_stringRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_i:
 2590|     90|bool parse_string(const std::string& line, std::string& out, int ln) {
 2591|     90|  if (!out.empty()) {
  ------------------
  |  Branch (2591:7): [True: 0, False: 90]
  ------------------
 2592|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions\n", ln);
 2593|      0|    return false;
 2594|      0|  }
 2595|     90|  int i = 0;
 2596|     90|  int np = 0;
 2597|     90|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 2598|    270|  while (start_piece != line.end()) {
  ------------------
  |  Branch (2598:10): [True: 180, False: 90]
  ------------------
 2599|    180|    switch (i) {
 2600|     90|      case 0: {
  ------------------
  |  Branch (2600:7): [True: 90, False: 90]
  ------------------
 2601|     90|        np++;
 2602|     90|        break;
 2603|      0|      }
 2604|     90|      case 1: {
  ------------------
  |  Branch (2604:7): [True: 90, False: 90]
  ------------------
 2605|     90|        out.assign(start_piece, iter);
 2606|     90|        np++;
 2607|     90|        break;
 2608|      0|      }
 2609|      0|      default:
  ------------------
  |  Branch (2609:7): [True: 0, False: 180]
  ------------------
 2610|      0|        break;
 2611|    180|    }
 2612|    180|    ++i;
 2613|    180|     start_piece = mystrsep(line, iter);
 2614|    180|  }
 2615|     90|  if (np != 2) {
  ------------------
  |  Branch (2615:7): [True: 0, False: 90]
  ------------------
 2616|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", ln);
 2617|      0|    return false;
 2618|      0|  }
 2619|     90|  return true;
 2620|     90|}
_Z11parse_arrayRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_RNS_6vectorI6w_charNS3_ISA_EEEEii:
 2626|     14|                 int ln) {
 2627|     14|  if (!parse_string(line, out, ln))
  ------------------
  |  Branch (2627:7): [True: 0, False: 14]
  ------------------
 2628|      0|    return false;
 2629|     14|  if (utf8) {
  ------------------
  |  Branch (2629:7): [True: 8, False: 6]
  ------------------
 2630|      8|    u8_u16(out_utf16, out);
 2631|      8|    std::sort(out_utf16.begin(), out_utf16.end());
 2632|      8|  }
 2633|     14|  return true;
 2634|     14|}
csutil.cxx:_ZL17warn_missing_contRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_11__wrap_iterIPKcEE:
  154|   763k|static void warn_missing_cont(const std::string& src, std::string::const_iterator p) {
  155|       |  HUNSPELL_WARNING(stderr,
  156|   763k|                   "UTF-8 encoding error. Missing continuation byte in "
  157|   763k|                   "%ld. character position:\n%s\n",
  158|   763k|                   static_cast<long>(std::distance(src.begin(), p)),
  159|   763k|                   src.c_str());
  160|   763k|}
csutil.cxx:_ZN12_GLOBAL__N_19is_any_ofC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  245|  2.40M|  explicit is_any_of(const std::string& in) : chars(in) {}
csutil.cxx:_ZNK12_GLOBAL__N_19is_any_ofclEc:
  247|  26.5M|  bool operator()(char c) const { return chars.find(c) != std::string::npos; }
csutil.cxx:_ZL19drop_repeated_linesRNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE:
  303|  2.82k|static void drop_repeated_lines(std::vector<std::string>& lines) {
  304|  2.82k|  std::unordered_set<std::string> seen;
  305|  2.82k|  auto firstrepeat = std::remove_if(lines.begin(), lines.end(),
  306|  2.82k|                                    [&seen](const std::string& line) { return !seen.insert(line).second; });
  307|  2.82k|  lines.erase(firstrepeat, lines.end());
  308|  2.82k|}
csutil.cxx:_ZZL19drop_repeated_linesRNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEEENK3$_0clERKS6_:
  306|  2.84k|                                    [&seen](const std::string& line) { return !seen.insert(line).second; });
csutil.cxx:_ZN12_GLOBAL__N_16cupperEPK7cs_infoi:
  515|   123M|unsigned char cupper(const struct cs_info* csconv, int nIndex) {
  516|   123M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (516:3): [True: 123M, False: 0]
  |  Branch (516:3): [True: 123M, False: 0]
  |  Branch (516:3): [True: 123M, False: 0]
  ------------------
  517|   123M|  return csconv[nIndex].cupper;
  518|   123M|}
csutil.cxx:_ZN12_GLOBAL__N_16clowerEPK7cs_infoi:
  520|   138M|unsigned char clower(const struct cs_info* csconv, int nIndex) {
  521|   138M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (521:3): [True: 138M, False: 0]
  |  Branch (521:3): [True: 138M, False: 0]
  |  Branch (521:3): [True: 138M, False: 0]
  ------------------
  522|   138M|  return csconv[nIndex].clower;
  523|   138M|}
csutil.cxx:_ZL36toAsciiLowerAndRemoveNonAlphanumericPKcPc:
 2273|  2.10k|                                                 char* pBuf) {
 2274|  19.0k|  while (*pName) {
  ------------------
  |  Branch (2274:10): [True: 16.9k, False: 2.10k]
  ------------------
 2275|       |    /* A-Z */
 2276|  16.9k|    if ((*pName >= 0x41) && (*pName <= 0x5A)) {
  ------------------
  |  Branch (2276:9): [True: 6.30k, False: 10.6k]
  |  Branch (2276:29): [True: 294, False: 6.01k]
  ------------------
 2277|    294|      *pBuf = (*pName) + 0x20; /* toAsciiLower */
 2278|    294|      pBuf++;
 2279|    294|    }
 2280|       |    /* a-z, 0-9 */
 2281|  16.6k|    else if (((*pName >= 0x61) && (*pName <= 0x7A)) ||
  ------------------
  |  Branch (2281:15): [True: 6.01k, False: 10.6k]
  |  Branch (2281:35): [True: 6.01k, False: 0]
  ------------------
 2282|  16.5k|             ((*pName >= 0x30) && (*pName <= 0x39))) {
  ------------------
  |  Branch (2282:15): [True: 10.5k, False: 98]
  |  Branch (2282:35): [True: 10.5k, False: 0]
  ------------------
 2283|  16.5k|      *pBuf = *pName;
 2284|  16.5k|      pBuf++;
 2285|  16.5k|    }
 2286|       |
 2287|  16.9k|    pName++;
 2288|  16.9k|  }
 2289|       |
 2290|  2.10k|  *pBuf = '\0';
 2291|  2.10k|}
csutil.cxx:_ZN12_GLOBAL__N_15ccaseEPK7cs_infoi:
  525|   116M|unsigned char ccase(const struct cs_info* csconv, int nIndex) {
  526|   116M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (526:3): [True: 116M, False: 0]
  |  Branch (526:3): [True: 116M, False: 0]
  |  Branch (526:3): [True: 116M, False: 0]
  ------------------
  527|   116M|  return csconv[nIndex].ccase;
  528|   116M|}
csutil.cxx:_ZZ24remove_ignored_chars_utfRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEEENK3$_0clES8_:
 2573|  5.82M|  [&ignored_chars](w_char wc) {
 2574|  5.82M|    return !std::binary_search(ignored_chars.begin(), ignored_chars.end(), wc);
 2575|  5.82M|  });

_Z12is_utf8_contc:
  143|  58.2M|inline bool is_utf8_cont(char c) {
  144|  58.2M|  return (static_cast<unsigned char>(c) & 0xc0) == 0x80;
  145|  58.2M|}
_Z9utf8_nextRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm:
  148|  23.0k|inline size_t utf8_next(const std::string& s, size_t pos) {
  149|  23.0k|  if (pos < s.size()) {
  ------------------
  |  Branch (149:7): [True: 23.0k, False: 0]
  ------------------
  150|  23.0k|    ++pos;
  151|  27.3k|    while (pos < s.size() && is_utf8_cont(s[pos]))
  ------------------
  |  Branch (151:12): [True: 24.9k, False: 2.42k]
  |  Branch (151:30): [True: 4.27k, False: 20.6k]
  ------------------
  152|  4.27k|      ++pos;
  153|  23.0k|  }
  154|  23.0k|  return pos;
  155|  23.0k|}
_Z20has_no_ignored_charsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_:
  295|    877|                            const std::string& ignored_chars) {
  296|    877|  return std::all_of(ignored_chars.begin(), ignored_chars.end(),
  297|    877|    [&word](char ic) { return word.find(ic) == std::string::npos; });
  298|    877|}
_Z11HENTRY_DATAP6hentry:
  301|  1.52M|inline char* HENTRY_DATA(struct hentry* h) {
  302|  1.52M|  char* ret;
  303|  1.52M|  if (!(h->var & H_OPT))
  ------------------
  |  |   47|  1.52M|#define H_OPT (1 << 0)          // is there optional morphological data?
  ------------------
  |  Branch (303:7): [True: 1.52M, False: 1.72k]
  ------------------
  304|  1.52M|    ret = nullptr;
  305|  1.72k|  else if (h->var & H_OPT_ALIASM)
  ------------------
  |  |   48|  1.72k|#define H_OPT_ALIASM (1 << 1)   // using alias compression?
  ------------------
  |  Branch (305:12): [True: 0, False: 1.72k]
  ------------------
  306|      0|    ret = get_stored_pointer(HENTRY_WORD(h) + h->blen + 1);
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  307|  1.72k|  else
  308|  1.72k|    ret = HENTRY_WORD(h) + h->blen + 1;
  ------------------
  |  |   54|  1.72k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  309|  1.52M|  return ret;
  310|  1.52M|}
_Z11HENTRY_FINDP6hentryPKc:
  337|  2.83k|inline char* HENTRY_FIND(struct hentry* h, const char* p) {
  338|  2.83k|  char* data = HENTRY_DATA(h);
  339|  2.83k|  return data ? strstr(data, p) : nullptr;
  ------------------
  |  Branch (339:10): [True: 4, False: 2.83k]
  ------------------
  340|  2.83k|}
_ZZ20has_no_ignored_charsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_ENKUlcE_clEc:
  297|  6.85k|    [&word](char ic) { return word.find(ic) == std::string::npos; });

_ZN7FileMgrC2EPKcS1_:
   84|    114|    : hin(nullptr)
   85|    114|    , linenum(0) {
   86|    114|  in[0] = '\0';
   87|       |
   88|    114|  if (!file || !strlen(file))
  ------------------
  |  Branch (88:7): [True: 0, False: 114]
  |  Branch (88:16): [True: 0, False: 114]
  ------------------
   89|      0|    return;
   90|    114|  myopen(fin, file, std::ios_base::in);
   91|    114|  if (!fin.is_open()) {
  ------------------
  |  Branch (91:7): [True: 0, False: 114]
  ------------------
   92|       |    // check hzipped file
   93|      0|    std::string st(file);
   94|      0|    st.append(HZIP_EXTENSION);
  ------------------
  |  |   51|      0|#define HZIP_EXTENSION ".hz"
  ------------------
   95|      0|    hin = new Hunzip(st.c_str(), key);
   96|      0|  }
   97|    114|  if (!fin.is_open() && !hin->is_open())
  ------------------
  |  Branch (97:7): [True: 0, False: 114]
  |  Branch (97:25): [True: 0, False: 0]
  ------------------
   98|      0|    fail(MSG_OPEN, file);
  ------------------
  |  |   53|      0|#define MSG_OPEN "error: %s: cannot open\n"
  ------------------
   99|    114|}
_ZN7FileMgrD2Ev:
  101|    114|FileMgr::~FileMgr() {
  102|    114|  delete hin;
  103|    114|}
_ZN7FileMgr7getlineERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  105|  2.10k|bool FileMgr::getline(std::string& dest) {
  106|  2.10k|  bool ret = false;
  107|  2.10k|  ++linenum;
  108|  2.10k|  if (fin.is_open()) {
  ------------------
  |  Branch (108:7): [True: 2.10k, False: 0]
  ------------------
  109|  2.10k|    ret = static_cast<bool>(std::getline(fin, dest));
  110|  2.10k|  } else if (hin && hin->is_open()) {
  ------------------
  |  Branch (110:14): [True: 0, False: 0]
  |  Branch (110:21): [True: 0, False: 0]
  ------------------
  111|      0|    ret = hin->getline(dest);
  112|      0|  }
  113|  2.10k|  if (!ret) {
  ------------------
  |  Branch (113:7): [True: 112, False: 1.99k]
  ------------------
  114|    112|    --linenum;
  115|    112|  }
  116|  2.10k|  return ret;
  117|  2.10k|}
_ZN7FileMgr10getlinenumEv:
  119|     96|int FileMgr::getlinenum() {
  120|     96|  return linenum;
  121|     96|}

_ZN7HashMgrC2EPKcS1_S1_:
   93|     38|    : flag_mode(FLAG_CHAR)
   94|     38|    , complexprefixes(0)
   95|     38|    , utf8(0)
   96|     38|    , forbiddenword(FORBIDDENWORD)  // forbidden word signing flag
  ------------------
  |  |  127|     38|#define FORBIDDENWORD 65510
  ------------------
   97|     38|    , langnum(0)
   98|     38|    , csconv(nullptr) {
   99|     38|  load_config(apath, key);
  100|     38|  if (!csconv)
  ------------------
  |  Branch (100:7): [True: 38, False: 0]
  ------------------
  101|     38|    csconv = get_current_cs(SPELL_ENCODING);
  ------------------
  |  |   99|     38|#define SPELL_ENCODING "ISO8859-1"
  ------------------
  102|     38|  int ec = load_tables(tpath, key);
  103|     38|  if (ec) {
  ------------------
  |  Branch (103:7): [True: 0, False: 38]
  ------------------
  104|       |    /* error condition - what should we do here */
  105|      0|    fprintf(stderr, "Hash Manager Error : %d\n", ec);
  106|      0|    free_table();
  107|       |    //keep table size to 1 to fix possible division with zero
  108|      0|    tableptr.resize(1, nullptr);
  109|      0|  }
  110|     38|}
_ZN7HashMgr13release_flagsEPtb:
  112|    436|void HashMgr::release_flags(unsigned short* astr, bool owned) {
  113|    436|  if (owned)
  ------------------
  |  Branch (113:7): [True: 257, False: 179]
  ------------------
  114|    257|    delete[] astr;
  115|    436|}
_ZNK7HashMgr6lookupEPKcm:
  154|   556M|struct hentry* HashMgr::lookup(const char* word, size_t len) const {
  155|   556M|  struct hentry* dp = tableptr[hash(word, len)];
  156|   556M|  if (!dp)
  ------------------
  |  Branch (156:7): [True: 491M, False: 64.8M]
  ------------------
  157|   491M|    return nullptr;
  158|   137M|  for (; dp != nullptr; dp = dp->next) {
  ------------------
  |  Branch (158:10): [True: 76.2M, False: 61.2M]
  ------------------
  159|  76.2M|    if (strcmp(word, dp->word) == 0)
  ------------------
  |  Branch (159:9): [True: 3.59M, False: 72.6M]
  ------------------
  160|  3.59M|      return dp;
  161|  76.2M|  }
  162|  61.2M|  return nullptr;
  163|  64.8M|}
_ZN7HashMgr8add_wordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPtiPS7_bib:
  173|  8.51k|                      bool own_aff) {
  174|       |
  175|  8.51k|  if (al > std::numeric_limits<short>::max()) {
  ------------------
  |  Branch (175:7): [True: 0, False: 8.51k]
  ------------------
  176|      0|    HUNSPELL_WARNING(stderr, "error: affix len %d is over max limit\n", al);
  177|      0|    release_flags(aff, own_aff);
  178|      0|    return 1;
  179|      0|  }
  180|       |
  181|  8.51k|  const std::string* word = &in_word;
  182|  8.51k|  const std::string* desc = in_desc;
  183|       |
  184|  8.51k|  std::string* word_copy = nullptr;
  185|  8.51k|  std::string* desc_copy = nullptr;
  186|  8.51k|  if ((!ignorechars.empty() && !has_no_ignored_chars(in_word, ignorechars)) || complexprefixes) {
  ------------------
  |  Branch (186:8): [True: 873, False: 7.64k]
  |  Branch (186:32): [True: 170, False: 703]
  |  Branch (186:80): [True: 515, False: 7.82k]
  ------------------
  187|    685|    word_copy = new std::string(in_word);
  188|       |
  189|    685|    if (!ignorechars.empty()) {
  ------------------
  |  Branch (189:9): [True: 170, False: 515]
  ------------------
  190|    170|      if (utf8) {
  ------------------
  |  Branch (190:11): [True: 34, False: 136]
  ------------------
  191|     34|        wcl = remove_ignored_chars_utf(*word_copy, ignorechars_utf16);
  192|    136|      } else {
  193|    136|        remove_ignored_chars(*word_copy, ignorechars);
  194|    136|      }
  195|    170|    }
  196|       |
  197|    685|    if (complexprefixes) {
  ------------------
  |  Branch (197:9): [True: 515, False: 170]
  ------------------
  198|    515|      if (utf8)
  ------------------
  |  Branch (198:11): [True: 0, False: 515]
  ------------------
  199|      0|        wcl = reverseword_utf(*word_copy);
  200|    515|      else
  201|    515|        reverseword(*word_copy);
  202|       |
  203|    515|      if (in_desc && aliasm.empty()) {
  ------------------
  |  Branch (203:11): [True: 0, False: 515]
  |  Branch (203:22): [True: 0, False: 0]
  ------------------
  204|      0|        desc_copy = new std::string(*in_desc);
  205|       |
  206|      0|        if (complexprefixes) {
  ------------------
  |  Branch (206:13): [True: 0, False: 0]
  ------------------
  207|      0|          if (utf8)
  ------------------
  |  Branch (207:15): [True: 0, False: 0]
  ------------------
  208|      0|            reverseword_utf(*desc_copy);
  209|      0|          else
  210|      0|            reverseword(*desc_copy);
  211|      0|        }
  212|      0|        desc = desc_copy;
  213|      0|      }
  214|    515|    }
  215|       |
  216|    685|    word = word_copy;
  217|    685|  }
  218|       |
  219|       |  // limit of hp->blen
  220|  8.51k|  if (word->size() > std::numeric_limits<unsigned short>::max()) {
  ------------------
  |  Branch (220:7): [True: 0, False: 8.51k]
  ------------------
  221|      0|    HUNSPELL_WARNING(stderr, "error: word len %ld is over max limit\n", word->size());
  222|      0|    delete desc_copy;
  223|      0|    delete word_copy;
  224|      0|    release_flags(aff, own_aff);
  225|      0|    return 1;
  226|      0|  }
  227|       |
  228|  8.51k|  bool upcasehomonym = false;
  229|  8.51k|  int descl = desc ? (!aliasm.empty() ? sizeof(char*) : desc->size() + 1) : 0;
  ------------------
  |  Branch (229:15): [True: 4, False: 8.51k]
  |  Branch (229:23): [True: 0, False: 4]
  ------------------
  230|       |  // variable-length hash record with word and optional fields
  231|  8.51k|  auto hp =
  232|  8.51k|      (struct hentry*)arena_alloc(sizeof(struct hentry) + word->size() + descl,
  233|  8.51k|                                  alignof(struct hentry));
  234|  8.51k|  if (!hp) {
  ------------------
  |  Branch (234:7): [True: 0, False: 8.51k]
  ------------------
  235|      0|    delete desc_copy;
  236|      0|    delete word_copy;
  237|      0|    release_flags(aff, own_aff);
  238|      0|    return 1;
  239|      0|  }
  240|       |
  241|  8.51k|  char* hpw = hp->word;
  242|  8.51k|  memcpy(hpw, word->data(), word->size());
  243|  8.51k|  hpw[word->size()] = 0;
  244|       |
  245|  8.51k|  int i = hash(hpw, word->size());
  246|       |
  247|  8.51k|  hp->blen = (unsigned short)word->size();
  248|  8.51k|  hp->clen = (unsigned short)wcl;
  249|  8.51k|  hp->alen = (short)al;
  250|  8.51k|  hp->astr = aff;
  251|  8.51k|  hp->next = nullptr;
  252|  8.51k|  hp->next_homonym = nullptr;
  253|  8.51k|  hp->var = (captype == INITCAP) ? H_OPT_INITCAP : 0;
  ------------------
  |  |   93|  8.51k|#define INITCAP 1
  ------------------
                hp->var = (captype == INITCAP) ? H_OPT_INITCAP : 0;
  ------------------
  |  |   50|  5.16k|#define H_OPT_INITCAP (1 << 3)  // is dictionary word capitalized?
  ------------------
  |  Branch (253:13): [True: 5.16k, False: 3.34k]
  ------------------
  254|  8.51k|  if (own_aff)
  ------------------
  |  Branch (254:7): [True: 5.75k, False: 2.76k]
  ------------------
  255|  5.75k|    hp->var |= H_OPT_OWNFLAGS;
  ------------------
  |  |   51|  5.75k|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  256|       |
  257|       |  // store the description string or its pointer
  258|  8.51k|  if (desc) {
  ------------------
  |  Branch (258:7): [True: 4, False: 8.51k]
  ------------------
  259|      4|    hp->var |= H_OPT;
  ------------------
  |  |   47|      4|#define H_OPT (1 << 0)          // is there optional morphological data?
  ------------------
  260|      4|    if (!aliasm.empty()) {
  ------------------
  |  Branch (260:9): [True: 0, False: 4]
  ------------------
  261|      0|      hp->var |= H_OPT_ALIASM;
  ------------------
  |  |   48|      0|#define H_OPT_ALIASM (1 << 1)   // using alias compression?
  ------------------
  262|      0|      store_pointer(hpw + word->size() + 1, get_aliasm(atoi(desc->c_str())));
  263|      4|    } else {
  264|      4|      strcpy(hpw + word->size() + 1, desc->c_str());
  265|      4|    }
  266|      4|    if (HENTRY_FIND(hp, MORPH_PHON)) {
  ------------------
  |  |  114|      4|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (266:9): [True: 2, False: 2]
  ------------------
  267|      2|      hp->var |= H_OPT_PHON;
  ------------------
  |  |   49|      2|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  268|       |      // store ph: fields (pronounciation, misspellings, old orthography etc.)
  269|       |      // of a morphological description in reptable to use in REP replacements.
  270|      2|      size_t predicted = tableptr.size() / MORPH_PHON_RATIO;
  ------------------
  |  |   90|      2|#define MORPH_PHON_RATIO 500
  ------------------
  271|      2|      if (reptable.capacity() < predicted)
  ------------------
  |  Branch (271:11): [True: 2, False: 0]
  ------------------
  272|      2|          reptable.reserve(predicted);
  273|      2|      std::string fields = HENTRY_DATA(hp);
  274|      2|      std::string::const_iterator iter = fields.begin(), start_piece = mystrsep(fields, iter);
  275|      4|      while (start_piece != fields.end()) {
  ------------------
  |  Branch (275:14): [True: 2, False: 2]
  ------------------
  276|      2|        if (std::string(start_piece, iter).find(MORPH_PHON) == 0) {
  ------------------
  |  |  114|      2|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (276:13): [True: 2, False: 0]
  ------------------
  277|      2|          std::string ph = std::string(start_piece, iter).substr(sizeof MORPH_PHON - 1);
  ------------------
  |  |  114|      2|#define MORPH_PHON "ph:"
  ------------------
  278|      2|          if (!ph.empty()) {
  ------------------
  |  Branch (278:15): [True: 2, False: 0]
  ------------------
  279|      2|            std::vector<w_char> w;
  280|      2|            size_t strippatt;
  281|      2|            std::string wordpart;
  282|       |            // dictionary based REP replacement, separated by "->"
  283|       |            // for example "pretty ph:prity ph:priti->pretti" to handle
  284|       |            // both prity -> pretty and pritier -> prettiest suggestions.
  285|      2|            if (((strippatt = ph.find("->")) != std::string::npos) &&
  ------------------
  |  Branch (285:17): [True: 0, False: 2]
  ------------------
  286|      0|                    (strippatt > 0) && (strippatt < ph.size() - 2)) {
  ------------------
  |  Branch (286:21): [True: 0, False: 0]
  |  Branch (286:40): [True: 0, False: 0]
  ------------------
  287|      0|                wordpart = ph.substr(strippatt + 2);
  288|      0|                ph.erase(ph.begin() + strippatt, ph.end());
  289|      0|            } else
  290|      2|                wordpart = in_word;
  291|       |            // when the ph: field ends with the character *,
  292|       |            // strip last character of the pattern and the replacement
  293|       |            // to match in REP suggestions also at character changes,
  294|       |            // for example, "pretty ph:prity*" results "prit->prett"
  295|       |            // REP replacement instead of "prity->pretty", to get
  296|       |            // prity->pretty and pritiest->prettiest suggestions.
  297|      2|            if (ph.at(ph.size()-1) == '*') {
  ------------------
  |  Branch (297:17): [True: 0, False: 2]
  ------------------
  298|      0|              strippatt = 1;
  299|      0|              size_t stripword = 0;
  300|      0|              if (utf8) {
  ------------------
  |  Branch (300:19): [True: 0, False: 0]
  ------------------
  301|      0|                while ((strippatt < ph.size()) &&
  ------------------
  |  Branch (301:24): [True: 0, False: 0]
  ------------------
  302|      0|                  is_utf8_cont(ph.at(ph.size()-strippatt-1)))
  ------------------
  |  Branch (302:19): [True: 0, False: 0]
  ------------------
  303|      0|                     ++strippatt;
  304|      0|                while ((stripword < wordpart.size()) &&
  ------------------
  |  Branch (304:24): [True: 0, False: 0]
  ------------------
  305|      0|                  is_utf8_cont(wordpart.at(wordpart.size()-stripword-1)))
  ------------------
  |  Branch (305:19): [True: 0, False: 0]
  ------------------
  306|      0|                     ++stripword;
  307|      0|              }
  308|      0|              ++strippatt;
  309|      0|              ++stripword;
  310|      0|              if ((ph.size() > strippatt) && (wordpart.size() > stripword)) {
  ------------------
  |  Branch (310:19): [True: 0, False: 0]
  |  Branch (310:46): [True: 0, False: 0]
  ------------------
  311|      0|                ph.erase(ph.size()-strippatt, strippatt);
  312|      0|                wordpart.erase(wordpart.size()-stripword, stripword);
  313|      0|              }
  314|      0|            }
  315|       |            // capitalize lowercase pattern for capitalized words to support
  316|       |            // good suggestions also for capitalized misspellings, eg.
  317|       |            // Wednesday ph:wendsay
  318|       |            // results wendsay -> Wednesday and Wendsay -> Wednesday, too.
  319|      2|            if (captype == INITCAP) {
  ------------------
  |  |   93|      2|#define INITCAP 1
  ------------------
  |  Branch (319:17): [True: 0, False: 2]
  ------------------
  320|      0|              std::string ph_capitalized;
  321|      0|              if (utf8) {
  ------------------
  |  Branch (321:19): [True: 0, False: 0]
  ------------------
  322|      0|                u8_u16(w, ph);
  323|      0|                if (get_captype_utf8(w, langnum) == NOCAP) {
  ------------------
  |  |   92|      0|#define NOCAP 0
  ------------------
  |  Branch (323:21): [True: 0, False: 0]
  ------------------
  324|      0|                  mkinitcap_utf(w, langnum);
  325|      0|                  u16_u8(ph_capitalized, w);
  326|      0|                }
  327|      0|              } else if (get_captype(ph, csconv) == NOCAP)
  ------------------
  |  |   92|      0|#define NOCAP 0
  ------------------
  |  Branch (327:26): [True: 0, False: 0]
  ------------------
  328|      0|                  mkinitcap(ph_capitalized, csconv);
  329|       |
  330|      0|              if (!ph_capitalized.empty()) {
  ------------------
  |  Branch (330:19): [True: 0, False: 0]
  ------------------
  331|       |                // add also lowercase word in the case of German or
  332|       |                // Hungarian to support lowercase suggestions lowercased by
  333|       |                // compound word generation or derivational suffixes
  334|       |                // (for example by adjectival suffix "-i" of geographical
  335|       |                // names in Hungarian:
  336|       |                // Massachusetts ph:messzecsuzec
  337|       |                // messzecsuzeci -> massachusettsi (adjective)
  338|       |                // For lowercasing by conditional PFX rules, see
  339|       |                // tests/germancompounding test example or the
  340|       |                // Hungarian dictionary.)
  341|      0|                if (langnum == LANG_de || langnum == LANG_hu) {
  ------------------
  |  Branch (341:21): [True: 0, False: 0]
  |  Branch (341:43): [True: 0, False: 0]
  ------------------
  342|      0|                  std::string wordpart_lower(wordpart);
  343|      0|                  if (utf8) {
  ------------------
  |  Branch (343:23): [True: 0, False: 0]
  ------------------
  344|      0|                    u8_u16(w, wordpart_lower);
  345|      0|                    mkallsmall_utf(w, langnum);
  346|      0|                    u16_u8(wordpart_lower, w);
  347|      0|                  } else {
  348|      0|                    mkallsmall(wordpart_lower, csconv);
  349|      0|                  }
  350|      0|                  reptable.emplace_back();
  351|      0|                  reptable.back().pattern.assign(ph);
  352|      0|                  reptable.back().outstrings[0].assign(wordpart_lower);
  353|      0|                }
  354|      0|                reptable.emplace_back();
  355|      0|                reptable.back().pattern.assign(ph_capitalized);
  356|      0|                reptable.back().outstrings[0].assign(wordpart);
  357|      0|              }
  358|      0|            }
  359|      2|            reptable.emplace_back();
  360|      2|            reptable.back().pattern.assign(ph);
  361|      2|            reptable.back().outstrings[0].assign(wordpart);
  362|      2|          }
  363|      2|        }
  364|      2|        start_piece = mystrsep(fields, iter);
  365|      2|      }
  366|      2|    }
  367|      4|  }
  368|       |
  369|  8.51k|  struct hentry* dp = tableptr[i];
  370|  8.51k|  if (!dp) {
  ------------------
  |  Branch (370:7): [True: 6.51k, False: 1.99k]
  ------------------
  371|  6.51k|    tableptr[i] = hp;
  372|  6.51k|    delete desc_copy;
  373|  6.51k|    delete word_copy;
  374|  6.51k|    return 0;
  375|  6.51k|  }
  376|  2.51k|  while (dp->next != nullptr) {
  ------------------
  |  Branch (376:10): [True: 530, False: 1.98k]
  ------------------
  377|    530|    if ((!dp->next_homonym) && (strcmp(hp->word, dp->word) == 0)) {
  ------------------
  |  Branch (377:9): [True: 512, False: 18]
  |  Branch (377:32): [True: 18, False: 494]
  ------------------
  378|       |      // remove hidden onlyupcase homonym
  379|     18|      if (!onlyupcase) {
  ------------------
  |  Branch (379:11): [True: 17, False: 1]
  ------------------
  380|     17|        if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) {
  ------------------
  |  |   99|     12|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 12, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (380:13): [True: 12, False: 5]
  |  Branch (380:13): [True: 12, False: 5]
  ------------------
  381|     12|          release_flags(dp->astr, dp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     12|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  382|     12|          dp->astr = hp->astr;
  383|     12|          dp->alen = hp->alen;
  384|     12|          dp->var &= ~H_OPT_OWNFLAGS;
  ------------------
  |  |   51|     12|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  385|     12|          dp->var |= (hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     12|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  386|     12|          arena_free(hp);
  387|     12|          delete desc_copy;
  388|     12|          delete word_copy;
  389|     12|          return 0;
  390|     12|        } else if (!dp->astr && dp->alen == 0 &&
  ------------------
  |  Branch (390:20): [True: 5, False: 0]
  |  Branch (390:33): [True: 5, False: 0]
  ------------------
  391|      5|                   !hp->astr && hp->alen == 0) {
  ------------------
  |  Branch (391:20): [True: 5, False: 0]
  |  Branch (391:33): [True: 5, False: 0]
  ------------------
  392|       |          // word already exists with no flags, skip duplicate
  393|      5|          release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|      5|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  394|      5|          arena_free(hp);
  395|      5|          delete desc_copy;
  396|      5|          delete word_copy;
  397|      5|          return 0;
  398|      5|        } else {
  399|      0|          dp->next_homonym = hp;
  400|      0|        }
  401|     17|      } else {
  402|      1|        upcasehomonym = true;
  403|      1|      }
  404|     18|    }
  405|    513|    dp = dp->next;
  406|    513|  }
  407|  1.98k|  if (strcmp(hp->word, dp->word) == 0) {
  ------------------
  |  Branch (407:7): [True: 427, False: 1.55k]
  ------------------
  408|       |    // remove hidden onlyupcase homonym
  409|    427|    if (!onlyupcase) {
  ------------------
  |  Branch (409:9): [True: 287, False: 140]
  ------------------
  410|    287|      if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) {
  ------------------
  |  |   99|     53|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 53, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (410:11): [True: 53, False: 234]
  |  Branch (410:11): [True: 53, False: 234]
  ------------------
  411|     53|        release_flags(dp->astr, dp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     53|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  412|     53|        dp->astr = hp->astr;
  413|     53|        dp->alen = hp->alen;
  414|     53|        dp->var &= ~H_OPT_OWNFLAGS;
  ------------------
  |  |   51|     53|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  415|     53|        dp->var |= (hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     53|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  416|     53|        arena_free(hp);
  417|     53|        delete desc_copy;
  418|     53|        delete word_copy;
  419|     53|        return 0;
  420|    234|      } else if (!dp->astr && dp->alen == 0 &&
  ------------------
  |  Branch (420:18): [True: 234, False: 0]
  |  Branch (420:31): [True: 234, False: 0]
  ------------------
  421|    234|                 !hp->astr && hp->alen == 0) {
  ------------------
  |  Branch (421:18): [True: 225, False: 9]
  |  Branch (421:31): [True: 225, False: 0]
  ------------------
  422|       |        // word already exists with no flags, skip duplicate
  423|    225|        release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|    225|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  424|    225|        arena_free(hp);
  425|    225|        delete desc_copy;
  426|    225|        delete word_copy;
  427|    225|        return 0;
  428|    225|      } else {
  429|      9|        dp->next_homonym = hp;
  430|      9|      }
  431|    287|    } else {
  432|    140|      upcasehomonym = true;
  433|    140|    }
  434|    427|  }
  435|  1.70k|  if (!upcasehomonym) {
  ------------------
  |  Branch (435:7): [True: 1.56k, False: 141]
  ------------------
  436|  1.56k|    dp->next = hp;
  437|  1.56k|  } else {
  438|       |    // remove hidden onlyupcase homonym
  439|    141|    release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|    141|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  440|    141|    arena_free(hp);
  441|    141|  }
  442|       |
  443|  1.70k|  delete desc_copy;
  444|  1.70k|  delete word_copy;
  445|  1.70k|  return 0;
  446|  1.98k|}
_ZN7HashMgr27add_hidden_capitalized_wordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPtiPS7_i:
  453|  5.91k|                                         int captype) {
  454|  5.91k|  if (flags == nullptr)
  ------------------
  |  Branch (454:7): [True: 5.77k, False: 136]
  ------------------
  455|  5.77k|    flagslen = 0;
  456|       |
  457|       |  // add inner capitalized forms to handle the following allcap forms:
  458|       |  // Mixed caps: OpenOffice.org -> OPENOFFICE.ORG
  459|       |  // Allcaps with suffixes: CIA's -> CIA'S
  460|  5.91k|  if (((captype == HUHCAP) || (captype == HUHINITCAP) ||
  ------------------
  |  |   95|  5.91k|#define HUHCAP 3
  ------------------
                if (((captype == HUHCAP) || (captype == HUHINITCAP) ||
  ------------------
  |  |   96|  5.62k|#define HUHINITCAP 4
  ------------------
  |  Branch (460:8): [True: 287, False: 5.62k]
  |  Branch (460:31): [True: 2.30k, False: 3.31k]
  ------------------
  461|  3.31k|       ((captype == ALLCAP) && (flagslen != 0))) &&
  ------------------
  |  |   94|  3.31k|#define ALLCAP 2
  ------------------
  |  Branch (461:9): [True: 215, False: 3.10k]
  |  Branch (461:32): [True: 9, False: 206]
  ------------------
  462|  2.60k|      !((flagslen != 0) && TESTAFF(flags, forbiddenword, flagslen))) {
  ------------------
  |  |   99|     54|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 54]
  |  |  ------------------
  ------------------
  |  Branch (462:9): [True: 54, False: 2.55k]
  ------------------
  463|  2.60k|    auto flags2 = (unsigned short*)arena_alloc((flagslen + 1) * sizeof(unsigned short),
  464|  2.60k|                                                alignof(unsigned short));
  465|  2.60k|    flags2[flagslen] = ONLYUPCASEFLAG;
  ------------------
  |  |  128|  2.60k|#define ONLYUPCASEFLAG 65511
  ------------------
  466|  2.60k|    if (flagslen) {
  ------------------
  |  Branch (466:9): [True: 54, False: 2.55k]
  ------------------
  467|     54|      memcpy(flags2, flags, flagslen * sizeof(unsigned short));
  468|     54|      std::sort(flags2, flags2 + flagslen + 1);
  469|     54|    }
  470|  2.60k|    if (utf8) {
  ------------------
  |  Branch (470:9): [True: 441, False: 2.16k]
  ------------------
  471|    441|      std::string st;
  472|    441|      std::vector<w_char> w;
  473|    441|      u8_u16(w, word);
  474|    441|      mkallsmall_utf(w, langnum);
  475|    441|      mkinitcap_utf(w, langnum);
  476|    441|      u16_u8(st, w);
  477|    441|      return add_word(st, wcl, flags2, flagslen + 1, dp, true, INITCAP, false);
  ------------------
  |  |   93|    441|#define INITCAP 1
  ------------------
  478|  2.16k|    } else {
  479|  2.16k|      std::string new_word(word);
  480|  2.16k|      mkallsmall(new_word, csconv);
  481|  2.16k|      mkinitcap(new_word, csconv);
  482|  2.16k|      int ret = add_word(new_word, wcl, flags2, flagslen + 1, dp, true, INITCAP, false);
  ------------------
  |  |   93|  2.16k|#define INITCAP 1
  ------------------
  483|  2.16k|      return ret;
  484|  2.16k|    }
  485|  2.60k|  }
  486|  3.30k|  return 0;
  487|  5.91k|}
_ZN7HashMgr20get_clen_and_captypeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiRNS0_6vectorI6w_charNS4_ISB_EEEE:
  490|  5.91k|int HashMgr::get_clen_and_captype(const std::string& word, int* captype, std::vector<w_char> &workbuf) {
  491|  5.91k|  int len;
  492|  5.91k|  if (utf8) {
  ------------------
  |  Branch (492:7): [True: 2.79k, False: 3.11k]
  ------------------
  493|  2.79k|    len = u8_u16(workbuf, word);
  494|  2.79k|    *captype = get_captype_utf8(workbuf, langnum);
  495|  3.11k|  } else {
  496|  3.11k|    len = word.size();
  497|  3.11k|    *captype = get_captype(word, csconv);
  498|  3.11k|  }
  499|  5.91k|  return len;
  500|  5.91k|}
_ZN7HashMgr20get_clen_and_captypeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPi:
  502|  5.75k|int HashMgr::get_clen_and_captype(const std::string& word, int* captype) {
  503|  5.75k|  std::vector<w_char> workbuf;
  504|  5.75k|  return get_clen_and_captype(word, captype, workbuf);
  505|  5.75k|}
_ZN7HashMgr21remove_forbidden_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  528|  8.03k|void HashMgr::remove_forbidden_flag(const std::string& word) {
  529|  8.03k|  struct hentry* dp = lookup(word.c_str(), word.size());
  530|  8.03k|  if (!dp)
  ------------------
  |  Branch (530:7): [True: 7.53k, False: 493]
  ------------------
  531|  7.53k|    return;
  532|  1.02k|  while (dp) {
  ------------------
  |  Branch (532:10): [True: 529, False: 493]
  ------------------
  533|    529|    if (dp->astr && TESTAFF(dp->astr, forbiddenword, dp->alen)) {
  ------------------
  |  |   99|     79|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 79]
  |  |  ------------------
  ------------------
  |  Branch (533:9): [True: 79, False: 450]
  ------------------
  534|      0|      if (dp->alen == 1) {
  ------------------
  |  Branch (534:11): [True: 0, False: 0]
  ------------------
  535|      0|        release_flags(dp->astr, dp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|      0|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  536|      0|        dp->astr = nullptr;
  537|      0|        dp->alen = 0;
  538|      0|        dp->var &= ~H_OPT_OWNFLAGS;
  ------------------
  |  |   51|      0|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  539|      0|      } else {
  540|      0|        auto newflags = new unsigned short[dp->alen - 1];
  541|      0|        int j = 0;
  542|      0|        for (int i = 0; i < dp->alen; i++) {
  ------------------
  |  Branch (542:25): [True: 0, False: 0]
  ------------------
  543|      0|          if (dp->astr[i] != forbiddenword)
  ------------------
  |  Branch (543:15): [True: 0, False: 0]
  ------------------
  544|      0|            newflags[j++] = dp->astr[i];
  545|      0|        }
  546|      0|        release_flags(dp->astr, dp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|      0|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  547|      0|        dp->astr = newflags;
  548|      0|        dp->alen = (short)j;
  549|      0|        dp->var |= H_OPT_OWNFLAGS;
  ------------------
  |  |   51|      0|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  550|      0|      }
  551|      0|    }
  552|    529|    dp = dp->next_homonym;
  553|    529|  }
  554|    493|}
_ZN7HashMgr3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  557|  5.69k|int HashMgr::add(const std::string& word) {
  558|  5.69k|  remove_forbidden_flag(word);
  559|  5.69k|  int captype, al = 0;
  560|  5.69k|  unsigned short* flags = nullptr;
  561|  5.69k|  int wcl = get_clen_and_captype(word, &captype);
  562|  5.69k|  if (add_word(word, wcl, flags, al, nullptr, false, captype, true))
  ------------------
  |  Branch (562:7): [True: 0, False: 5.69k]
  ------------------
  563|      0|    return 1;
  564|  5.69k|  return add_hidden_capitalized_word(word, wcl, flags, al, nullptr, captype);
  565|  5.69k|}
_ZN7HashMgr14add_with_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
  578|  2.33k|int HashMgr::add_with_affix(const std::string& word, const std::string& example) {
  579|       |  // detect captype and modify word length for UTF-8 encoding
  580|  2.33k|  struct hentry* dp = lookup(example.c_str(), example.size());
  581|  2.33k|  remove_forbidden_flag(word);
  582|  2.33k|  if (dp && dp->astr) {
  ------------------
  |  Branch (582:7): [True: 253, False: 2.08k]
  |  Branch (582:13): [True: 54, False: 199]
  ------------------
  583|     54|    int captype;
  584|     54|    int wcl = get_clen_and_captype(word, &captype);
  585|     54|    auto flags = new unsigned short[dp->alen];
  586|     54|    memcpy(flags, dp->astr, dp->alen * sizeof(unsigned short));
  587|     54|    if (add_word(word, wcl, flags, dp->alen, nullptr, false, captype, true))
  ------------------
  |  Branch (587:9): [True: 0, False: 54]
  ------------------
  588|      0|      return 1;
  589|     54|    return add_hidden_capitalized_word(word, wcl, flags, dp->alen, nullptr, captype);
  590|     54|  }
  591|  2.28k|  return 1;
  592|  2.33k|}
_ZNK7HashMgr14walk_hashtableERiP6hentry:
  596|  2.18M|struct hentry* HashMgr::walk_hashtable(int& col, struct hentry* hp) const {
  597|  2.18M|  if (hp && hp->next != nullptr)
  ------------------
  |  Branch (597:7): [True: 2.12M, False: 62.2k]
  |  Branch (597:13): [True: 190k, False: 1.93M]
  ------------------
  598|   190k|    return hp->next;
  599|  62.9M|  for (col++; col < (int)tableptr.size(); ++col) {
  ------------------
  |  Branch (599:15): [True: 62.8M, False: 62.2k]
  ------------------
  600|  62.8M|    if (tableptr[col])
  ------------------
  |  Branch (600:9): [True: 1.93M, False: 60.9M]
  ------------------
  601|  1.93M|      return tableptr[col];
  602|  62.8M|  }
  603|       |  // null at end and reset to start
  604|  62.2k|  col = -1;
  605|  62.2k|  return nullptr;
  606|  1.99M|}
_ZN7HashMgr11load_tablesEPKcS1_:
  609|     38|int HashMgr::load_tables(const char* tpath, const char* key) {
  610|       |  // open dictionary file
  611|     38|  FileMgr* dict = new FileMgr(tpath, key);
  612|       |
  613|       |  // first read the first line of file to get hash table size
  614|     38|  std::string ts;
  615|     38|  if (!dict->getline(ts)) {
  ------------------
  |  Branch (615:7): [True: 0, False: 38]
  ------------------
  616|      0|    fprintf(stderr, "error: empty dic file %s\n", tpath);
  617|      0|    delete dict;
  618|      0|    return 2;
  619|      0|  }
  620|     38|  mychomp(ts);
  621|       |
  622|       |  /* remove byte order mark */
  623|     38|  if (ts.compare(0, 3, "\xEF\xBB\xBF", 3) == 0) {
  ------------------
  |  Branch (623:7): [True: 0, False: 38]
  ------------------
  624|      0|    ts.erase(0, 3);
  625|      0|  }
  626|       |
  627|     38|  int tablesize = atoi(ts.c_str());
  628|       |
  629|     38|  const int nExtra = 5 + USERWORD;
  ------------------
  |  |   57|     38|#define USERWORD 1000
  ------------------
  630|       |#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  631|       |  // covers full-form uncompressed dictionaries (~7M for uk_UA expanded)
  632|       |  const int max_allowed = 10000000;
  633|       |#else
  634|     38|  const int max_allowed = (10000 - 1 - nExtra) / int(sizeof(struct hentry*));
  635|     38|#endif
  636|       |
  637|     38|  if (tablesize <= 0 || tablesize >= max_allowed) {
  ------------------
  |  Branch (637:7): [True: 0, False: 38]
  |  Branch (637:25): [True: 0, False: 38]
  ------------------
  638|      0|    fprintf(stderr,
  639|      0|            "error: %s: line 1: missing or bad word count in the dic file\n",
  640|      0|            tpath);
  641|      0|    delete dict;
  642|      0|    return 4;
  643|      0|  }
  644|     38|  tablesize += nExtra;
  645|     38|  if ((tablesize & 1) == 0)
  ------------------
  |  Branch (645:7): [True: 18, False: 20]
  ------------------
  646|     18|    tablesize++;
  647|       |
  648|       |  // allocate the hash table
  649|     38|  tableptr.resize(tablesize, nullptr);
  650|       |
  651|       |  // loop through all words on much list and add to hash
  652|       |  // table and create word and affix strings
  653|       |
  654|     38|  std::vector<w_char> workbuf;
  655|       |
  656|     38|  int nLineCount(0);
  657|    198|  while (dict->getline(ts)) {
  ------------------
  |  Branch (657:10): [True: 160, False: 38]
  ------------------
  658|    160|    ++nLineCount;
  659|    160|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  660|       |    // limit words loaded to avoid O(n^2) hash chain walk timeout
  661|    160|    if (nLineCount >= tablesize)
  ------------------
  |  Branch (661:9): [True: 0, False: 160]
  ------------------
  662|      0|      break;
  663|    160|#endif
  664|    160|    mychomp(ts);
  665|       |    // split each line into word and morphological description
  666|    160|    size_t dp_pos = 0;
  667|    160|    while ((dp_pos = ts.find(':', dp_pos)) != std::string::npos) {
  ------------------
  |  Branch (667:12): [True: 4, False: 156]
  ------------------
  668|      4|      if ((dp_pos > 3) && (ts[dp_pos - 3] == ' ' || ts[dp_pos - 3] == '\t')) {
  ------------------
  |  Branch (668:11): [True: 4, False: 0]
  |  Branch (668:28): [True: 0, False: 4]
  |  Branch (668:53): [True: 4, False: 0]
  ------------------
  669|      4|        for (dp_pos -= 3; dp_pos > 0 && (ts[dp_pos-1] == ' ' || ts[dp_pos-1] == '\t'); --dp_pos)
  ------------------
  |  Branch (669:27): [True: 4, False: 0]
  |  Branch (669:42): [True: 0, False: 4]
  |  Branch (669:65): [True: 0, False: 4]
  ------------------
  670|      0|          ;
  671|      4|        if (dp_pos == 0) {  // missing word
  ------------------
  |  Branch (671:13): [True: 0, False: 4]
  ------------------
  672|      0|          dp_pos = std::string::npos;
  673|      4|        } else {
  674|      4|          ++dp_pos;
  675|      4|        }
  676|      4|        break;
  677|      4|      }
  678|      0|      ++dp_pos;
  679|      0|    }
  680|       |
  681|       |    // tabulator is the old morphological field separator
  682|    160|    size_t dp2_pos = ts.find('\t');
  683|    160|    if (dp2_pos != std::string::npos && (dp_pos == std::string::npos || dp2_pos < dp_pos)) {
  ------------------
  |  Branch (683:9): [True: 4, False: 156]
  |  Branch (683:42): [True: 0, False: 4]
  |  Branch (683:73): [True: 4, False: 0]
  ------------------
  684|      4|      dp_pos = dp2_pos + 1;
  685|      4|    }
  686|       |
  687|    160|    std::string dp;
  688|    160|    if (dp_pos != std::string::npos) {
  ------------------
  |  Branch (688:9): [True: 4, False: 156]
  ------------------
  689|      4|      dp.assign(ts.substr(dp_pos));
  690|      4|      ts.resize(dp_pos - 1);
  691|      4|    }
  692|       |
  693|       |    // split each line into word and affix char strings
  694|       |    // "\/" signs slash in words (not affix separator)
  695|       |    // "/" at beginning of the line is word character (not affix separator)
  696|    160|    size_t ap_pos = ts.find('/');
  697|    160|    while (ap_pos != std::string::npos) {
  ------------------
  |  Branch (697:12): [True: 82, False: 78]
  ------------------
  698|     82|      if (ap_pos == 0) {
  ------------------
  |  Branch (698:11): [True: 0, False: 82]
  ------------------
  699|      0|        ++ap_pos;
  700|      0|        ap_pos = ts.find('/', ap_pos);
  701|      0|        continue;
  702|     82|      } else if (ts[ap_pos - 1] != '\\')
  ------------------
  |  Branch (702:18): [True: 82, False: 0]
  ------------------
  703|     82|        break;
  704|       |      // replace "\/" with "/"
  705|      0|      ts.erase(ap_pos - 1, 1);
  706|      0|      ap_pos = ts.find('/', ap_pos);
  707|      0|    }
  708|       |
  709|    160|    unsigned short* flags;
  710|    160|    int al;
  711|    160|    if (ap_pos != std::string::npos && ap_pos != ts.size()) {
  ------------------
  |  Branch (711:9): [True: 82, False: 78]
  |  Branch (711:40): [True: 82, False: 0]
  ------------------
  712|     82|      std::string ap(ts.substr(ap_pos + 1));
  713|     82|      ts.resize(ap_pos);
  714|     82|      if (!aliasf.empty()) {
  ------------------
  |  Branch (714:11): [True: 2, False: 80]
  ------------------
  715|      2|        int index = atoi(ap.c_str());
  716|      2|        al = get_aliasf(index, &flags, dict);
  717|      2|        if (!al) {
  ------------------
  |  Branch (717:13): [True: 0, False: 2]
  ------------------
  718|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad flag vector alias\n",
  719|      0|                           dict->getlinenum());
  720|      0|        }
  721|     80|      } else {
  722|     80|        al = decode_flags(&flags, ap, dict, /* arena = */ true);
  723|     80|        if (al == -1) {
  ------------------
  |  Branch (723:13): [True: 0, False: 80]
  ------------------
  724|      0|          HUNSPELL_WARNING(stderr, "Can't allocate memory.\n");
  725|      0|          delete dict;
  726|      0|          return 6;
  727|      0|        }
  728|     80|        std::sort(flags, flags + al);
  729|     80|      }
  730|     82|    } else {
  731|     78|      al = 0;
  732|     78|      flags = nullptr;
  733|     78|    }
  734|       |
  735|    160|    int captype;
  736|    160|    int wcl = get_clen_and_captype(ts, &captype, workbuf);
  737|    160|    const std::string* dp_str = dp.empty() ? nullptr : &dp;
  ------------------
  |  Branch (737:33): [True: 156, False: 4]
  ------------------
  738|       |    // add the word and its index plus its capitalized form optionally
  739|       |    // flags are arena-allocated, so own_aff must be false
  740|    160|    bool own = false;
  741|    160|    if (add_word(ts, wcl, flags, al, dp_str, false, captype, own) ||
  ------------------
  |  Branch (741:9): [True: 0, False: 160]
  ------------------
  742|    160|        add_hidden_capitalized_word(ts, wcl, flags, al, dp_str, captype)) {
  ------------------
  |  Branch (742:9): [True: 0, False: 160]
  ------------------
  743|      0|      delete dict;
  744|      0|      return 5;
  745|      0|    }
  746|    160|  }
  747|       |
  748|     38|  int ret(0);
  749|       |
  750|       |  // reject ludicrous tablesizes
  751|     38|  if (tablesize > 8192 + nExtra && tablesize > nLineCount * 10 + nExtra) {
  ------------------
  |  Branch (751:7): [True: 0, False: 38]
  |  Branch (751:36): [True: 0, False: 0]
  ------------------
  752|      0|    HUNSPELL_WARNING(stderr, ".dic initial approximate word count line value of %d is too large for %d lines\n", tablesize, nLineCount);
  753|      0|    ret = 3;
  754|      0|  }
  755|       |
  756|     38|  delete dict;
  757|     38|  return ret;
  758|     38|}
_ZNK7HashMgr4hashEPKcm:
  762|   556M|int HashMgr::hash(const char* word, size_t len) const {
  763|   556M|  unsigned long hv = 0;
  764|   556M|  size_t i = 0;
  765|  2.74G|  while (i < 4 && i < len)
  ------------------
  |  Branch (765:10): [True: 2.21G, False: 530M]
  |  Branch (765:19): [True: 2.19G, False: 26.1M]
  ------------------
  766|  2.19G|    hv = (hv << 8) | word[i++];
  767|  11.2G|  while (i < len) {
  ------------------
  |  Branch (767:10): [True: 10.6G, False: 556M]
  ------------------
  768|  10.6G|    ROTATE(hv, ROTATE_LEN);
  ------------------
  |  |   44|  10.6G|  (v) = ((v) << (q)) | (((v) >> (32 - q)) & ((1 << (q)) - 1));
  ------------------
  769|  10.6G|    hv ^= word[i++];
  770|  10.6G|  }
  771|   556M|  return (unsigned long)hv % tableptr.size();
  772|   556M|}
_ZNK7HashMgr12decode_flagsEPPtRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEP7FileMgr:
  774|     16|int HashMgr::decode_flags(unsigned short** result, const std::string& flags, FileMgr* af) const {
  775|     16|  return decode_flags(result, flags, af, /* arena = */ false);
  776|     16|}
_ZNK7HashMgr12decode_flagsEPPtRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEP7FileMgrb:
  778|    100|int HashMgr::decode_flags(unsigned short** result, const std::string& flags, FileMgr* af, bool use_arena) const {
  779|    100|  auto alloc = [&](int n) -> unsigned short* {
  780|    100|    return use_arena ? (unsigned short*)this->arena_alloc(n * sizeof(unsigned short),
  781|    100|                                                          alignof(unsigned short))
  782|    100|                     : new unsigned short[n];
  783|    100|  };
  784|    100|  int len;
  785|    100|  if (flags.empty()) {
  ------------------
  |  Branch (785:7): [True: 0, False: 100]
  ------------------
  786|      0|    *result = nullptr;
  787|      0|    return 0;
  788|      0|  }
  789|    100|  switch (flag_mode) {
  790|      0|    case FLAG_LONG: {  // two-character flags (1x2yZz -> 1x 2y Zz)
  ------------------
  |  Branch (790:5): [True: 0, False: 100]
  ------------------
  791|      0|      len = flags.size();
  792|      0|      if ((len & 1) == 1 && af != nullptr)
  ------------------
  |  Branch (792:11): [True: 0, False: 0]
  |  Branch (792:29): [True: 0, False: 0]
  ------------------
  793|      0|        HUNSPELL_WARNING(stderr, "error: line %d: bad flagvector\n",
  794|      0|                         af->getlinenum());
  795|      0|      len >>= 1;
  796|      0|      *result = alloc(len);
  797|      0|      for (int i = 0; i < len; i++) {
  ------------------
  |  Branch (797:23): [True: 0, False: 0]
  ------------------
  798|      0|        unsigned short flag = ((unsigned short)((unsigned char)flags[i << 1]) << 8) |
  799|      0|                              ((unsigned short)((unsigned char)flags[(i << 1) | 1]));
  800|       |
  801|      0|        (*result)[i] = flag;
  802|      0|      }
  803|      0|      break;
  804|      0|    }
  805|      0|    case FLAG_NUM: {  // decimal numbers separated by comma (4521,23,233 -> 4521
  ------------------
  |  Branch (805:5): [True: 0, False: 100]
  ------------------
  806|       |                      // 23 233)
  807|      0|      len = int(1 + std::count_if(flags.begin(), flags.end(), [](char c) { return c == ','; }));
  808|      0|      *result = alloc(len);
  809|      0|      unsigned short* dest = *result;
  810|      0|      const char* src = flags.c_str();
  811|      0|      for (size_t p = 0; p < flags.size(); ++p) {
  ------------------
  |  Branch (811:26): [True: 0, False: 0]
  ------------------
  812|      0|        if (flags[p] == ',') {
  ------------------
  |  Branch (812:13): [True: 0, False: 0]
  ------------------
  813|      0|          int i = atoi(src);
  814|      0|          if ((i > std::numeric_limits<unsigned short>::max() || i < 0) && af != nullptr) {
  ------------------
  |  Branch (814:16): [True: 0, False: 0]
  |  Branch (814:66): [True: 0, False: 0]
  |  Branch (814:76): [True: 0, False: 0]
  ------------------
  815|      0|            HUNSPELL_WARNING(
  816|      0|                stderr, "error: line %d: flag id %d is out of range\n",
  817|      0|                af->getlinenum(), i);
  818|      0|             i = 0;
  819|      0|          }
  820|      0|          *dest = (unsigned short)i;
  821|      0|          if (*dest == 0 && af != nullptr)
  ------------------
  |  Branch (821:15): [True: 0, False: 0]
  |  Branch (821:29): [True: 0, False: 0]
  ------------------
  822|      0|            HUNSPELL_WARNING(stderr, "error: line %d: 0 is wrong flag id\n",
  823|      0|                             af->getlinenum());
  824|      0|          src = flags.c_str() + p + 1;
  825|      0|          dest++;
  826|      0|        }
  827|      0|      }
  828|      0|      int i = atoi(src);
  829|      0|      if ((i > std::numeric_limits<unsigned short>::max() || i < 0) && af) {
  ------------------
  |  Branch (829:12): [True: 0, False: 0]
  |  Branch (829:62): [True: 0, False: 0]
  |  Branch (829:72): [True: 0, False: 0]
  ------------------
  830|      0|        HUNSPELL_WARNING(stderr,
  831|      0|                         "error: line %d: flag id %d is out of range\n",
  832|      0|                         af->getlinenum(), i);
  833|      0|        i = 0;
  834|      0|      }
  835|      0|      *dest = (unsigned short)i;
  836|      0|      if (*dest == 0 && af)
  ------------------
  |  Branch (836:11): [True: 0, False: 0]
  |  Branch (836:25): [True: 0, False: 0]
  ------------------
  837|      0|        HUNSPELL_WARNING(stderr, "error: line %d: 0 is wrong flag id\n",
  838|      0|                         af->getlinenum());
  839|      0|      break;
  840|      0|    }
  841|      0|    case FLAG_UNI: {  // UTF-8 characters
  ------------------
  |  Branch (841:5): [True: 0, False: 100]
  ------------------
  842|      0|      std::vector<w_char> w;
  843|      0|      u8_u16(w, flags);
  844|      0|      len = w.size();
  845|      0|      *result = alloc(len);
  846|      0|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  847|      0|      memcpy(*result, w.data(), len * sizeof(unsigned short));
  848|       |#else
  849|       |      unsigned short* dest = *result;
  850|       |      for (const w_char wc : w) {
  851|       |        *dest = (unsigned short)wc;
  852|       |        dest++;
  853|       |      }
  854|       |#endif
  855|      0|      break;
  856|      0|    }
  857|    100|    default: {  // Ispell's one-character flags (erfg -> e r f g)
  ------------------
  |  Branch (857:5): [True: 100, False: 0]
  ------------------
  858|    100|      len = flags.size();
  859|    100|      *result = alloc(len);
  860|    100|      unsigned short* dest = *result;
  861|    118|      for (const char flag : flags) {
  ------------------
  |  Branch (861:28): [True: 118, False: 100]
  ------------------
  862|    118|        *dest = (unsigned char)flag;
  863|    118|        dest++;
  864|    118|      }
  865|    100|    }
  866|    100|  }
  867|    100|  return len;
  868|    100|}
_ZNK7HashMgr11decode_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  944|     92|unsigned short HashMgr::decode_flag(const std::string& f) const {
  945|     92|  unsigned short s = 0;
  946|     92|  int i;
  947|     92|  switch (flag_mode) {
  948|      0|    case FLAG_LONG:
  ------------------
  |  Branch (948:5): [True: 0, False: 92]
  ------------------
  949|      0|      if (f.size() >= 2)
  ------------------
  |  Branch (949:11): [True: 0, False: 0]
  ------------------
  950|      0|        s = ((unsigned short)((unsigned char)f[0]) << 8) | ((unsigned short)((unsigned char)f[1]));
  951|      0|      break;
  952|      0|    case FLAG_NUM:
  ------------------
  |  Branch (952:5): [True: 0, False: 92]
  ------------------
  953|      0|      i = atoi(f.c_str());
  954|      0|      if (i > std::numeric_limits<unsigned short>::max() || i < 0) {
  ------------------
  |  Branch (954:11): [True: 0, False: 0]
  |  Branch (954:61): [True: 0, False: 0]
  ------------------
  955|      0|        HUNSPELL_WARNING(stderr, "error: flag id %d is out of range\n", i);
  956|      0|        i = 0;
  957|      0|      }
  958|      0|      s = (unsigned short)i;
  959|      0|      break;
  960|      0|    case FLAG_UNI: {
  ------------------
  |  Branch (960:5): [True: 0, False: 92]
  ------------------
  961|      0|      std::vector<w_char> w;
  962|      0|      u8_u16(w, f);
  963|      0|      if (!w.empty())
  ------------------
  |  Branch (963:11): [True: 0, False: 0]
  ------------------
  964|      0|        s = (unsigned short)w[0];
  965|      0|      break;
  966|      0|    }
  967|     92|    default:
  ------------------
  |  Branch (967:5): [True: 92, False: 0]
  ------------------
  968|     92|      if (!f.empty())
  ------------------
  |  Branch (968:11): [True: 92, False: 0]
  ------------------
  969|     92|        s = (unsigned char)f[0];
  970|     92|  }
  971|     92|  if (s == 0)
  ------------------
  |  Branch (971:7): [True: 0, False: 92]
  ------------------
  972|      0|    HUNSPELL_WARNING(stderr, "error: 0 is wrong flag id\n");
  973|     92|  return s;
  974|     92|}
_ZN7HashMgr11load_configEPKcS1_:
 1010|     38|int HashMgr::load_config(const char* affpath, const char* key) {
 1011|     38|  int firstline = 1;
 1012|       |
 1013|       |  // open the affix file
 1014|     38|  FileMgr* afflst = new FileMgr(affpath, key);
 1015|       |
 1016|       |  // read in each line ignoring any that do not
 1017|       |  // start with a known line type indicator
 1018|       |
 1019|     38|  std::string line;
 1020|    922|  while (afflst->getline(line)) {
  ------------------
  |  Branch (1020:10): [True: 886, False: 36]
  ------------------
 1021|    886|    mychomp(line);
 1022|       |
 1023|       |    /* remove byte order mark */
 1024|    886|    if (firstline) {
  ------------------
  |  Branch (1024:9): [True: 38, False: 848]
  ------------------
 1025|     38|      firstline = 0;
 1026|     38|      if (line.compare(0, 3, "\xEF\xBB\xBF", 3) == 0) {
  ------------------
  |  Branch (1026:11): [True: 0, False: 38]
  ------------------
 1027|      0|        line.erase(0, 3);
 1028|      0|      }
 1029|     38|    }
 1030|       |
 1031|       |    /* parse in the try string */
 1032|    886|    if ((line.compare(0, 4, "FLAG", 4) == 0) && line.size() > 4 && isspace(line[4])) {
  ------------------
  |  Branch (1032:9): [True: 0, False: 886]
  |  Branch (1032:49): [True: 0, False: 0]
  |  Branch (1032:68): [True: 0, False: 0]
  ------------------
 1033|      0|      if (flag_mode != FLAG_CHAR) {
  ------------------
  |  Branch (1033:11): [True: 0, False: 0]
  ------------------
 1034|      0|        HUNSPELL_WARNING(stderr,
 1035|      0|                         "error: line %d: multiple definitions of the FLAG "
 1036|      0|                         "affix file parameter\n",
 1037|      0|                         afflst->getlinenum());
 1038|      0|      }
 1039|      0|      if (line.find("long") != std::string::npos)
  ------------------
  |  Branch (1039:11): [True: 0, False: 0]
  ------------------
 1040|      0|        flag_mode = FLAG_LONG;
 1041|      0|      if (line.find("num") != std::string::npos)
  ------------------
  |  Branch (1041:11): [True: 0, False: 0]
  ------------------
 1042|      0|        flag_mode = FLAG_NUM;
 1043|      0|      if (line.find("UTF-8") != std::string::npos)
  ------------------
  |  Branch (1043:11): [True: 0, False: 0]
  ------------------
 1044|      0|        flag_mode = FLAG_UNI;
 1045|      0|      if (flag_mode == FLAG_CHAR) {
  ------------------
  |  Branch (1045:11): [True: 0, False: 0]
  ------------------
 1046|      0|        HUNSPELL_WARNING(
 1047|      0|            stderr,
 1048|      0|            "error: line %d: FLAG needs `num', `long' or `UTF-8' parameter\n",
 1049|      0|            afflst->getlinenum());
 1050|      0|      }
 1051|      0|    }
 1052|       |
 1053|    886|    if (line.compare(0, 13, "FORBIDDENWORD", 13) == 0) {
  ------------------
  |  Branch (1053:9): [True: 2, False: 884]
  ------------------
 1054|      2|      std::string st;
 1055|      2|      if (!parse_string(line, st, afflst->getlinenum())) {
  ------------------
  |  Branch (1055:11): [True: 0, False: 2]
  ------------------
 1056|      0|        delete afflst;
 1057|      0|        return 1;
 1058|      0|      }
 1059|      2|      forbiddenword = decode_flag(st);
 1060|      2|    }
 1061|       |
 1062|    886|    if (line.compare(0, 3, "SET", 3) == 0) {
  ------------------
  |  Branch (1062:9): [True: 18, False: 868]
  ------------------
 1063|     18|      if (!parse_string(line, enc, afflst->getlinenum())) {
  ------------------
  |  Branch (1063:11): [True: 0, False: 18]
  ------------------
 1064|      0|        delete afflst;
 1065|      0|        return 1;
 1066|      0|      }
 1067|     18|      if (enc == "UTF-8") {
  ------------------
  |  Branch (1067:11): [True: 18, False: 0]
  ------------------
 1068|     18|        utf8 = 1;
 1069|     18|      } else
 1070|      0|        csconv = get_current_cs(enc);
 1071|     18|    }
 1072|       |
 1073|    886|    if (line.compare(0, 4, "LANG", 4) == 0) {
  ------------------
  |  Branch (1073:9): [True: 2, False: 884]
  ------------------
 1074|      2|      if (!parse_string(line, lang, afflst->getlinenum())) {
  ------------------
  |  Branch (1074:11): [True: 0, False: 2]
  ------------------
 1075|      0|        delete afflst;
 1076|      0|        return 1;
 1077|      0|      }
 1078|      2|      langnum = get_lang_num(lang);
 1079|      2|    }
 1080|       |
 1081|       |    /* parse in the ignored characters (for example, Arabic optional diacritics
 1082|       |     * characters */
 1083|    886|    if (line.compare(0, 6, "IGNORE", 6) == 0) {
  ------------------
  |  Branch (1083:9): [True: 4, False: 882]
  ------------------
 1084|      4|      if (!parse_array(line, ignorechars, ignorechars_utf16,
  ------------------
  |  Branch (1084:11): [True: 0, False: 4]
  ------------------
 1085|      4|                       utf8, afflst->getlinenum())) {
 1086|      0|        delete afflst;
 1087|      0|        return 1;
 1088|      0|      }
 1089|      4|    }
 1090|       |
 1091|    886|    if ((line.compare(0, 2, "AF", 2) == 0) && line.size() > 2 && isspace(line[2])) {
  ------------------
  |  Branch (1091:9): [True: 2, False: 884]
  |  Branch (1091:47): [True: 2, False: 0]
  |  Branch (1091:66): [True: 2, False: 0]
  ------------------
 1092|      2|      if (!parse_aliasf(line, afflst)) {
  ------------------
  |  Branch (1092:11): [True: 0, False: 2]
  ------------------
 1093|      0|        delete afflst;
 1094|      0|        return 1;
 1095|      0|      }
 1096|      2|    }
 1097|       |
 1098|    886|    if ((line.compare(0, 2, "AM", 2) == 0) && line.size() > 2 && isspace(line[2])) {
  ------------------
  |  Branch (1098:9): [True: 0, False: 886]
  |  Branch (1098:47): [True: 0, False: 0]
  |  Branch (1098:66): [True: 0, False: 0]
  ------------------
 1099|      0|      if (!parse_aliasm(line, afflst)) {
  ------------------
  |  Branch (1099:11): [True: 0, False: 0]
  ------------------
 1100|      0|        delete afflst;
 1101|      0|        return 1;
 1102|      0|      }
 1103|      0|    }
 1104|       |
 1105|    886|    if (line.compare(0, 15, "COMPLEXPREFIXES", 15) == 0)
  ------------------
  |  Branch (1105:9): [True: 2, False: 884]
  ------------------
 1106|      2|      complexprefixes = 1;
 1107|       |
 1108|       |    /* parse in the typical fault correcting table */
 1109|    886|    if (line.compare(0, 3, "REP", 3) == 0) {
  ------------------
  |  Branch (1109:9): [True: 6, False: 880]
  ------------------
 1110|      6|      if (!parse_reptable(line, afflst)) {
  ------------------
  |  Branch (1110:11): [True: 0, False: 6]
  ------------------
 1111|      0|        delete afflst;
 1112|      0|        return 1;
 1113|      0|      }
 1114|      6|    }
 1115|       |
 1116|       |    // don't check the full affix file, yet
 1117|    886|    if (((line.compare(0, 3, "SFX", 3) == 0) ||
  ------------------
  |  Branch (1117:10): [True: 42, False: 844]
  ------------------
 1118|    844|         (line.compare(0, 3, "PFX", 3) == 0)) &&
  ------------------
  |  Branch (1118:10): [True: 24, False: 820]
  ------------------
 1119|     66|            line.size() > 3 && isspace(line[3]) &&
  ------------------
  |  Branch (1119:13): [True: 66, False: 0]
  |  Branch (1119:32): [True: 66, False: 0]
  ------------------
 1120|     66|            !reptable.empty()) // (REP table is in the end of Afrikaans aff file)
  ------------------
  |  Branch (1120:13): [True: 2, False: 64]
  ------------------
 1121|      2|      break;
 1122|    886|  }
 1123|       |
 1124|     38|  delete afflst;
 1125|     38|  return 0;
 1126|     38|}
_ZN7HashMgr12parse_aliasfERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 1129|      2|bool HashMgr::parse_aliasf(const std::string& line, FileMgr* af) {
 1130|      2|  if (!aliasf.empty()) {
  ------------------
  |  Branch (1130:7): [True: 0, False: 2]
  ------------------
 1131|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 1132|      0|                     af->getlinenum());
 1133|      0|    return false;
 1134|      0|  }
 1135|      2|  int i = 0, np = 0, numaliasf = 0;
 1136|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 1137|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (1137:10): [True: 4, False: 2]
  ------------------
 1138|      4|    switch (i) {
 1139|      2|      case 0: {
  ------------------
  |  Branch (1139:7): [True: 2, False: 2]
  ------------------
 1140|      2|        np++;
 1141|      2|        break;
 1142|      0|      }
 1143|      2|      case 1: {
  ------------------
  |  Branch (1143:7): [True: 2, False: 2]
  ------------------
 1144|      2|        numaliasf = atoi(std::string(start_piece, iter).c_str());
 1145|      2|        if (numaliasf < 1) {
  ------------------
  |  Branch (1145:13): [True: 0, False: 2]
  ------------------
 1146|      0|          aliasf.clear();
 1147|      0|          aliasflen.clear();
 1148|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 1149|      0|                           af->getlinenum());
 1150|      0|          return false;
 1151|      0|        }
 1152|      2|        aliasf.reserve(std::min(numaliasf, 16384));
 1153|      2|        aliasflen.reserve(std::min(numaliasf, 16384));
 1154|      2|        np++;
 1155|      2|        break;
 1156|      2|      }
 1157|      0|      default:
  ------------------
  |  Branch (1157:7): [True: 0, False: 4]
  ------------------
 1158|      0|        break;
 1159|      4|    }
 1160|      4|    ++i;
 1161|      4|    start_piece = mystrsep(line, iter);
 1162|      4|  }
 1163|      2|  if (np != 2) {
  ------------------
  |  Branch (1163:7): [True: 0, False: 2]
  ------------------
 1164|      0|    aliasf.clear();
 1165|      0|    aliasflen.clear();
 1166|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 1167|      0|                     af->getlinenum());
 1168|      0|    return false;
 1169|      0|  }
 1170|       |
 1171|       |  /* now parse the numaliasf lines to read in the remainder of the table */
 1172|      6|  for (int j = 0; j < numaliasf; ++j) {
  ------------------
  |  Branch (1172:19): [True: 4, False: 2]
  ------------------
 1173|      4|    std::string nl;
 1174|      4|    unsigned short* alias = nullptr;
 1175|      4|    unsigned aliaslen = 0;
 1176|      4|    i = 0;
 1177|      4|    if (af->getline(nl)) {
  ------------------
  |  Branch (1177:9): [True: 4, False: 0]
  ------------------
 1178|      4|      mychomp(nl);
 1179|      4|      iter = nl.begin();
 1180|      4|      start_piece = mystrsep(nl, iter);
 1181|      4|      bool errored = false;
 1182|     12|      while (!errored && start_piece != nl.end()) {
  ------------------
  |  Branch (1182:14): [True: 12, False: 0]
  |  Branch (1182:14): [True: 8, False: 4]
  |  Branch (1182:26): [True: 8, False: 4]
  ------------------
 1183|      8|        switch (i) {
 1184|      4|          case 0: {
  ------------------
  |  Branch (1184:11): [True: 4, False: 4]
  ------------------
 1185|      4|            if (nl.compare(start_piece - nl.begin(), 2, "AF", 2) != 0) {
  ------------------
  |  Branch (1185:17): [True: 0, False: 4]
  ------------------
 1186|      0|              errored = true;
 1187|      0|              break;
 1188|      0|            }
 1189|      4|            break;
 1190|      4|          }
 1191|      4|          case 1: {
  ------------------
  |  Branch (1191:11): [True: 4, False: 4]
  ------------------
 1192|      4|            std::string piece(start_piece, iter);
 1193|      4|            aliaslen =
 1194|      4|                (unsigned short)decode_flags(&alias, piece, af, /* arena = */ true);
 1195|      4|            std::sort(alias, alias + aliaslen);
 1196|      4|            break;
 1197|      4|          }
 1198|      0|          default:
  ------------------
  |  Branch (1198:11): [True: 0, False: 8]
  ------------------
 1199|      0|            break;
 1200|      8|        }
 1201|      8|        ++i;
 1202|      8|        start_piece = mystrsep(nl, iter);
 1203|      8|      }
 1204|      4|    }
 1205|      4|    if (!alias) {
  ------------------
  |  Branch (1205:9): [True: 0, False: 4]
  ------------------
 1206|      0|      for (int k = 0; k < j; ++k) {
  ------------------
  |  Branch (1206:23): [True: 0, False: 0]
  ------------------
 1207|      0|        arena_free(aliasf[k]);
 1208|      0|      }
 1209|      0|      aliasf.clear();
 1210|      0|      aliasflen.clear();
 1211|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 1212|      0|                       af->getlinenum());
 1213|      0|      return false;
 1214|      0|    }
 1215|       |
 1216|      4|    aliasf.push_back(alias);
 1217|      4|    aliasflen.push_back(aliaslen);
 1218|      4|  }
 1219|      2|  return true;
 1220|      2|}
_ZNK7HashMgr9is_aliasfEv:
 1222|     44|int HashMgr::is_aliasf() const {
 1223|     44|  return !aliasf.empty();
 1224|     44|}
_ZNK7HashMgr10get_aliasfEiPPtP7FileMgr:
 1226|      4|int HashMgr::get_aliasf(int index, unsigned short** fvec, FileMgr* af) const {
 1227|      4|  if (index > 0 && static_cast<size_t>(index) <= aliasflen.size()) {
  ------------------
  |  Branch (1227:7): [True: 4, False: 0]
  |  Branch (1227:20): [True: 4, False: 0]
  ------------------
 1228|      4|    *fvec = aliasf[index - 1];
 1229|      4|    return aliasflen[index - 1];
 1230|      4|  }
 1231|      0|  HUNSPELL_WARNING(stderr, "error: line %d: bad flag alias index: %d\n",
 1232|      0|                   af->getlinenum(), index);
 1233|      0|  *fvec = nullptr;
 1234|      0|  return 0;
 1235|      4|}
_ZNK7HashMgr9is_aliasmEv:
 1333|     32|int HashMgr::is_aliasm() const {
 1334|     32|  return !aliasm.empty();
 1335|     32|}
_ZN7HashMgr14parse_reptableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 1345|      6|bool HashMgr::parse_reptable(const std::string& line, FileMgr* af) {
 1346|      6|  if (!reptable.empty()) {
  ------------------
  |  Branch (1346:7): [True: 0, False: 6]
  ------------------
 1347|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 1348|      0|                     af->getlinenum());
 1349|      0|    return false;
 1350|      0|  }
 1351|      6|  int numrep = -1, i = 0, np = 0;
 1352|      6|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 1353|     18|  while (start_piece != line.end()) {
  ------------------
  |  Branch (1353:10): [True: 12, False: 6]
  ------------------
 1354|     12|    switch (i) {
 1355|      6|      case 0: {
  ------------------
  |  Branch (1355:7): [True: 6, False: 6]
  ------------------
 1356|      6|        np++;
 1357|      6|        break;
 1358|      0|      }
 1359|      6|      case 1: {
  ------------------
  |  Branch (1359:7): [True: 6, False: 6]
  ------------------
 1360|      6|        numrep = atoi(std::string(start_piece, iter).c_str());
 1361|      6|        if (numrep < 1) {
  ------------------
  |  Branch (1361:13): [True: 0, False: 6]
  ------------------
 1362|      0|          HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n",
 1363|      0|                           af->getlinenum());
 1364|      0|          return false;
 1365|      0|        }
 1366|      6|        reptable.reserve(std::min(numrep, 16384));
 1367|      6|        np++;
 1368|      6|        break;
 1369|      6|      }
 1370|      0|      default:
  ------------------
  |  Branch (1370:7): [True: 0, False: 12]
  ------------------
 1371|      0|        break;
 1372|     12|    }
 1373|     12|    ++i;
 1374|     12|    start_piece = mystrsep(line, iter);
 1375|     12|  }
 1376|      6|  if (np != 2) {
  ------------------
  |  Branch (1376:7): [True: 0, False: 6]
  ------------------
 1377|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 1378|      0|                     af->getlinenum());
 1379|      0|    return false;
 1380|      0|  }
 1381|       |
 1382|       |  /* now parse the numrep lines to read in the remainder of the table */
 1383|     12|  for (int j = 0; j < numrep; ++j) {
  ------------------
  |  Branch (1383:19): [True: 6, False: 6]
  ------------------
 1384|      6|    std::string nl;
 1385|      6|    reptable.emplace_back();
 1386|      6|    int type = 0;
 1387|      6|    if (af->getline(nl)) {
  ------------------
  |  Branch (1387:9): [True: 6, False: 0]
  ------------------
 1388|      6|      mychomp(nl);
 1389|      6|      iter = nl.begin();
 1390|      6|      i = 0;
 1391|      6|      start_piece = mystrsep(nl, iter);
 1392|      6|      bool errored = false;
 1393|     24|      while (!errored && start_piece != nl.end()) {
  ------------------
  |  Branch (1393:14): [True: 24, False: 0]
  |  Branch (1393:14): [True: 18, False: 6]
  |  Branch (1393:26): [True: 18, False: 6]
  ------------------
 1394|     18|        switch (i) {
 1395|      6|          case 0: {
  ------------------
  |  Branch (1395:11): [True: 6, False: 12]
  ------------------
 1396|      6|            if (nl.compare(start_piece - nl.begin(), 3, "REP", 3) != 0) {
  ------------------
  |  Branch (1396:17): [True: 0, False: 6]
  ------------------
 1397|      0|              errored = true;
 1398|      0|              break;
 1399|      0|            }
 1400|      6|            break;
 1401|      6|          }
 1402|      6|          case 1: {
  ------------------
  |  Branch (1402:11): [True: 6, False: 12]
  ------------------
 1403|      6|            if (*start_piece == '^')
  ------------------
  |  Branch (1403:17): [True: 0, False: 6]
  ------------------
 1404|      0|              type = 1;
 1405|      6|            reptable.back().pattern.assign(start_piece + type, iter);
 1406|      6|            mystrrep(reptable.back().pattern, "_", " ");
 1407|      6|            if (!reptable.back().pattern.empty() && reptable.back().pattern[reptable.back().pattern.size() - 1] == '$') {
  ------------------
  |  Branch (1407:17): [True: 6, False: 0]
  |  Branch (1407:53): [True: 0, False: 6]
  ------------------
 1408|      0|              type += 2;
 1409|      0|              reptable.back().pattern.resize(reptable.back().pattern.size() - 1);
 1410|      0|            }
 1411|      6|            break;
 1412|      6|          }
 1413|      6|          case 2: {
  ------------------
  |  Branch (1413:11): [True: 6, False: 12]
  ------------------
 1414|      6|            reptable.back().outstrings[type].assign(start_piece, iter);
 1415|      6|            mystrrep(reptable.back().outstrings[type], "_", " ");
 1416|      6|            break;
 1417|      6|          }
 1418|      0|          default:
  ------------------
  |  Branch (1418:11): [True: 0, False: 18]
  ------------------
 1419|      0|            break;
 1420|     18|        }
 1421|     18|        ++i;
 1422|     18|        start_piece = mystrsep(nl, iter);
 1423|     18|      }
 1424|      6|    }
 1425|      6|    if (reptable.back().pattern.empty() || reptable.back().outstrings[type].empty()) {
  ------------------
  |  Branch (1425:9): [True: 0, False: 6]
  |  Branch (1425:44): [True: 0, False: 6]
  ------------------
 1426|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 1427|      0|                       af->getlinenum());
 1428|      0|      reptable.clear();
 1429|      0|      return false;
 1430|      0|    }
 1431|      6|  }
 1432|      6|  return true;
 1433|      6|}
_ZNK7HashMgr12get_reptableEv:
 1436|   380k|const std::vector<replentry>& HashMgr::get_reptable() const {
 1437|   380k|  return reptable;
 1438|   380k|}
_ZNK7HashMgr11arena_allocEmm:
 1440|  11.2k|void* HashMgr::arena_alloc(size_t num_bytes, size_t alignment) const {
 1441|       |  // Fixed-size 64KB chunks: small enough to avoid significant waste on small
 1442|       |  // dictionaries, large enough to amortize per-chunk malloc overhead on large
 1443|       |  // ones. make_unique throws std::bad_alloc on OOM.
 1444|  11.2k|  static const size_t MIN_CHUNK_SIZE = 65536;
 1445|  11.2k|  static const size_t MAX_ALIGNMENT = alignof(max_align_t);
 1446|       |  // Chunk sizes are rounded up to MAX_ALIGNMENT below; with this invariant,
 1447|       |  // any alignment that divides MAX_ALIGNMENT keeps aligned_offset within bounds.
 1448|  11.2k|  assert(alignment > 0 && alignment <= MAX_ALIGNMENT);
  ------------------
  |  Branch (1448:3): [True: 11.2k, False: 0]
  |  Branch (1448:3): [True: 11.2k, False: 0]
  |  Branch (1448:3): [True: 11.2k, False: 0]
  ------------------
 1449|       |  // Pad the offset up to the requested alignment before placing this allocation.
 1450|       |  // make_unique returns memory aligned for any scalar, so chunk-start is fine.
 1451|  11.2k|  size_t aligned_offset = (current_chunk_offset + alignment - 1) & ~(alignment - 1);
 1452|  11.2k|  if (arena.empty() || current_chunk_size - aligned_offset < num_bytes) {
  ------------------
  |  Branch (1452:7): [True: 38, False: 11.1k]
  |  Branch (1452:24): [True: 66, False: 11.0k]
  ------------------
 1453|       |    // Round the new chunk's size up to a multiple of MAX_ALIGNMENT so that an
 1454|       |    // oversized num_bytes (>= MIN_CHUNK_SIZE) cannot leave a non-aligned
 1455|       |    // current_chunk_size that would later cause aligned_offset to overshoot.
 1456|       |    // Allocate before mutating current_chunk_size so a throwing make_unique
 1457|       |    // leaves the HashMgr in a consistent state.
 1458|    104|    size_t new_size = std::max(MIN_CHUNK_SIZE, num_bytes);
 1459|    104|    new_size = (new_size + MAX_ALIGNMENT - 1) & ~(MAX_ALIGNMENT - 1);
 1460|    104|    arena.push_back(std::make_unique<uint8_t[]>(new_size));
 1461|    104|    current_chunk_size = new_size;
 1462|    104|    aligned_offset = 0;
 1463|    104|  }
 1464|       |
 1465|  11.2k|  uint8_t* ptr = &arena.back()[aligned_offset];
 1466|  11.2k|  current_chunk_offset = aligned_offset + num_bytes;
 1467|  11.2k|  ++outstanding_arena_allocations;
 1468|  11.2k|  return ptr;
 1469|  11.2k|}
_ZNK7HashMgr10arena_freeEPv:
 1471|    436|void HashMgr::arena_free(void*) const {
 1472|       |  // The arena vector owns all allocations and frees them in bulk at HashMgr
 1473|       |  // destruction, so this is a no-op for the memory itself. The counter is a
 1474|       |  // memory-safety check: more arena_free calls than arena_alloc calls would
 1475|       |  // indicate a double-free or use-after-free in Hunspell. Abort hard rather
 1476|       |  // than silently desynchronize tracking, even in release builds.
 1477|    436|  if (outstanding_arena_allocations == 0) {
  ------------------
  |  Branch (1477:7): [True: 0, False: 436]
  ------------------
 1478|      0|    std::abort();
 1479|      0|  }
 1480|    436|  --outstanding_arena_allocations;
 1481|    436|}
hashmgr.cxx:_ZZNK7HashMgr12decode_flagsEPPtRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEP7FileMgrbENK3$_0clEi:
  779|    100|  auto alloc = [&](int n) -> unsigned short* {
  780|    100|    return use_arena ? (unsigned short*)this->arena_alloc(n * sizeof(unsigned short),
  ------------------
  |  Branch (780:12): [True: 84, False: 16]
  ------------------
  781|     84|                                                          alignof(unsigned short))
  782|    100|                     : new unsigned short[n];
  783|    100|  };

_ZN12HunspellImplC2EPKcS1_S1_:
  191|     38|  : affixpath(affpath) {
  192|     38|  csconv = nullptr;
  193|     38|  utf8 = 0;
  194|     38|  complexprefixes = 0;
  195|       |
  196|       |  /* first set up the hash manager */
  197|     38|  m_HMgrs.push_back(std::make_unique<HashMgr>(dpath, affpath, key));
  198|       |
  199|       |  /* next set up the affix manager */
  200|       |  /* it needs access to the hash manager lookup methods */
  201|     38|  pAMgr = std::make_unique<AffixMgr>(affpath, m_HMgrs, key);
  202|       |
  203|       |  /* get the preferred try string and the dictionary */
  204|       |  /* encoding from the Affix Manager for that dictionary */
  205|     38|  std::string try_string = pAMgr->get_try_string();
  206|     38|  encoding = pAMgr->get_encoding();
  207|     38|  langnum = pAMgr->get_langnum();
  208|     38|  utf8 = pAMgr->get_utf8();
  209|     38|  if (!utf8)
  ------------------
  |  Branch (209:7): [True: 20, False: 18]
  ------------------
  210|     20|    csconv = get_current_cs(encoding);
  211|     38|  complexprefixes = pAMgr->get_complexprefixes();
  212|     38|  wordbreak = pAMgr->get_breaktable();
  213|       |
  214|       |  /* and finally set up the suggestion manager */
  215|     38|  pSMgr = std::make_unique<SuggestMgr>(try_string, MAXSUGGESTION, pAMgr.get());
  ------------------
  |  |   83|     38|#define MAXSUGGESTION 15
  ------------------
  216|     38|}
_ZN12HunspellImpl12clean_ignoreERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
  235|  30.8M|                                const std::string& src) {
  236|  30.8M|  dest.clear();
  237|  30.8M|  dest.assign(src);
  238|  30.8M|  const char* ignoredchars = pAMgr ? pAMgr->get_ignore() : nullptr;
  ------------------
  |  Branch (238:30): [True: 30.8M, False: 0]
  ------------------
  239|  30.8M|  if (ignoredchars != nullptr) {
  ------------------
  |  Branch (239:7): [True: 3.08M, False: 27.7M]
  ------------------
  240|  3.08M|    if (utf8) {
  ------------------
  |  Branch (240:9): [True: 684k, False: 2.40M]
  ------------------
  241|   684k|      const std::vector<w_char>& ignoredchars_utf16 =
  242|   684k|          pAMgr->get_ignore_utf16();
  243|   684k|      remove_ignored_chars_utf(dest, ignoredchars_utf16);
  244|  2.40M|    } else {
  245|  2.40M|      remove_ignored_chars(dest, ignoredchars);
  246|  2.40M|    }
  247|  3.08M|  }
  248|  30.8M|}
_ZN12HunspellImpl10cleanword2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEERKS6_PiPm:
  262|  14.3M|                         size_t* pabbrev) {
  263|  14.3M|  dest.clear();
  264|  14.3M|  dest_utf.clear();
  265|       |
  266|       |  // remove IGNORE characters from the string
  267|  14.3M|  std::string w2;
  268|  14.3M|  clean_ignore(w2, src);
  269|       |
  270|  14.3M|  const char* q = w2.c_str();
  271|  14.3M|  int nl = (int)w2.size();
  272|       |
  273|       |  // first skip over any leading blanks
  274|  14.5M|  while (*q == ' ') {
  ------------------
  |  Branch (274:10): [True: 205k, False: 14.3M]
  ------------------
  275|   205k|    ++q;
  276|   205k|    nl--;
  277|   205k|  }
  278|       |
  279|       |  // now strip off any trailing periods (recording their presence)
  280|  14.3M|  *pabbrev = 0;
  281|       |
  282|  16.5M|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (282:10): [True: 16.0M, False: 462k]
  |  Branch (282:22): [True: 2.16M, False: 13.8M]
  ------------------
  283|  2.16M|    nl--;
  284|  2.16M|    (*pabbrev)++;
  285|  2.16M|  }
  286|       |
  287|       |  // if no characters are left it can't be capitalized
  288|  14.3M|  if (nl <= 0) {
  ------------------
  |  Branch (288:7): [True: 462k, False: 13.8M]
  ------------------
  289|   462k|    *pcaptype = NOCAP;
  ------------------
  |  |   92|   462k|#define NOCAP 0
  ------------------
  290|   462k|    return 0;
  291|   462k|  }
  292|       |
  293|  13.8M|  dest.append(q, nl);
  294|  13.8M|  nl = dest.size();
  295|  13.8M|  if (utf8) {
  ------------------
  |  Branch (295:7): [True: 2.76M, False: 11.1M]
  ------------------
  296|  2.76M|    u8_u16(dest_utf, dest);
  297|  2.76M|    *pcaptype = get_captype_utf8(dest_utf, langnum);
  298|  11.1M|  } else {
  299|  11.1M|    *pcaptype = get_captype(dest, csconv);
  300|  11.1M|  }
  301|  13.8M|  return nl;
  302|  14.3M|}
_ZN12HunspellImpl9cleanwordERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_PiSA_:
  307|  6.10k|                        int* pabbrev) {
  308|  6.10k|  dest.clear();
  309|  6.10k|  const unsigned char* q = (const unsigned char*)src.c_str();
  310|  6.10k|  int firstcap = 0, nl = (int)src.size();
  311|       |
  312|       |  // first skip over any leading blanks
  313|  9.93k|  while (*q == ' ') {
  ------------------
  |  Branch (313:10): [True: 3.83k, False: 6.10k]
  ------------------
  314|  3.83k|    ++q;
  315|  3.83k|    nl--;
  316|  3.83k|  }
  317|       |
  318|       |  // now strip off any trailing periods (recording their presence)
  319|  6.10k|  *pabbrev = 0;
  320|       |
  321|  18.1k|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (321:10): [True: 17.9k, False: 190]
  |  Branch (321:22): [True: 12.0k, False: 5.91k]
  ------------------
  322|  12.0k|    nl--;
  323|  12.0k|    (*pabbrev)++;
  324|  12.0k|  }
  325|       |
  326|       |  // if no characters are left it can't be capitalized
  327|  6.10k|  if (nl <= 0) {
  ------------------
  |  Branch (327:7): [True: 190, False: 5.91k]
  ------------------
  328|    190|    *pcaptype = NOCAP;
  ------------------
  |  |   92|    190|#define NOCAP 0
  ------------------
  329|    190|    return;
  330|    190|  }
  331|       |
  332|       |  // now determine the capitalization type of the first nl letters
  333|  5.91k|  int ncap = 0;
  334|  5.91k|  int nneutral = 0;
  335|  5.91k|  int nc = 0;
  336|       |
  337|  5.91k|  if (!utf8) {
  ------------------
  |  Branch (337:7): [True: 3.13k, False: 2.77k]
  ------------------
  338|   660k|    while (nl > 0) {
  ------------------
  |  Branch (338:12): [True: 657k, False: 3.13k]
  ------------------
  339|   657k|      nc++;
  340|   657k|      if (csconv[(*q)].ccase)
  ------------------
  |  Branch (340:11): [True: 563k, False: 94.0k]
  ------------------
  341|   563k|        ncap++;
  342|   657k|      if (csconv[(*q)].cupper == csconv[(*q)].clower)
  ------------------
  |  Branch (342:11): [True: 84.9k, False: 572k]
  ------------------
  343|  84.9k|        nneutral++;
  344|   657k|      dest.push_back(*q++);
  345|   657k|      nl--;
  346|   657k|    }
  347|       |    // remember to terminate the destination string
  348|  3.13k|    firstcap = csconv[static_cast<unsigned char>(dest[0])].ccase;
  349|  3.13k|  } else {
  350|  2.77k|    std::vector<w_char> t;
  351|  2.77k|    u8_u16(t, src);
  352|   169k|    for (auto& wc : t) {
  ------------------
  |  Branch (352:19): [True: 169k, False: 2.77k]
  ------------------
  353|   169k|      const auto idx = (unsigned short)wc;
  354|   169k|      const auto low = unicodetolower(idx, langnum);
  355|   169k|      if (idx != low)
  ------------------
  |  Branch (355:11): [True: 107k, False: 61.9k]
  ------------------
  356|   107k|        ncap++;
  357|   169k|      if (unicodetoupper(idx, langnum) == low)
  ------------------
  |  Branch (357:11): [True: 58.8k, False: 110k]
  ------------------
  358|  58.8k|        nneutral++;
  359|   169k|    }
  360|  2.77k|    u16_u8(dest, t);
  361|  2.77k|    if (ncap) {
  ------------------
  |  Branch (361:9): [True: 2.00k, False: 766]
  ------------------
  362|  2.00k|      const auto idx = (unsigned short)t[0];
  363|  2.00k|      firstcap = (idx != unicodetolower(idx, langnum));
  364|  2.00k|    }
  365|  2.77k|  }
  366|       |
  367|       |  // now finally set the captype
  368|  5.91k|  if (ncap == 0) {
  ------------------
  |  Branch (368:7): [True: 1.48k, False: 4.42k]
  ------------------
  369|  1.48k|    *pcaptype = NOCAP;
  ------------------
  |  |   92|  1.48k|#define NOCAP 0
  ------------------
  370|  4.42k|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (370:14): [True: 2.60k, False: 1.81k]
  |  Branch (370:29): [True: 1.91k, False: 693]
  ------------------
  371|  1.91k|    *pcaptype = INITCAP;
  ------------------
  |  |   93|  1.91k|#define INITCAP 1
  ------------------
  372|  2.50k|  } else if ((ncap == nc) || ((ncap + nneutral) == nc)) {
  ------------------
  |  Branch (372:14): [True: 90, False: 2.41k]
  |  Branch (372:30): [True: 769, False: 1.64k]
  ------------------
  373|    859|    *pcaptype = ALLCAP;
  ------------------
  |  |   94|    859|#define ALLCAP 2
  ------------------
  374|  1.64k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (374:14): [True: 986, False: 663]
  |  Branch (374:28): [True: 845, False: 141]
  ------------------
  375|    845|    *pcaptype = HUHINITCAP;
  ------------------
  |  |   96|    845|#define HUHINITCAP 4
  ------------------
  376|    845|  } else {
  377|    804|    *pcaptype = HUHCAP;
  ------------------
  |  |   95|    804|#define HUHCAP 3
  ------------------
  378|    804|  }
  379|  5.91k|}
_ZN12HunspellImpl8mkallcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  381|  2.80k|void HunspellImpl::mkallcap(std::string& u8) {
  382|  2.80k|  if (utf8) {
  ------------------
  |  Branch (382:7): [True: 1.34k, False: 1.46k]
  ------------------
  383|  1.34k|    std::vector<w_char> u16;
  384|  1.34k|    u8_u16(u16, u8);
  385|  1.34k|    ::mkallcap_utf(u16, langnum);
  386|  1.34k|    u16_u8(u8, u16);
  387|  1.46k|  } else {
  388|  1.46k|    ::mkallcap(u8, csconv);
  389|  1.46k|  }
  390|  2.80k|}
_ZN12HunspellImpl11mkallsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
  392|  1.36M|int HunspellImpl::mkallsmall2(std::string& u8, std::vector<w_char>& u16) {
  393|  1.36M|  if (utf8) {
  ------------------
  |  Branch (393:7): [True: 271k, False: 1.08M]
  ------------------
  394|   271k|    ::mkallsmall_utf(u16, langnum);
  395|   271k|    u16_u8(u8, u16);
  396|  1.08M|  } else {
  397|  1.08M|    ::mkallsmall(u8, csconv);
  398|  1.08M|  }
  399|  1.36M|  return u8.size();
  400|  1.36M|}
_ZN12HunspellImpl11is_keepcaseEPK6hentry:
  438|  32.0k|int HunspellImpl::is_keepcase(const hentry* rv) {
  439|  32.0k|  return pAMgr && rv->astr && pAMgr->get_keepcase() &&
  ------------------
  |  Branch (439:10): [True: 32.0k, False: 0]
  |  Branch (439:19): [True: 693, False: 31.3k]
  |  Branch (439:31): [True: 57, False: 636]
  ------------------
  440|     57|         TESTAFF(rv->astr, pAMgr->get_keepcase(), rv->alen);
  ------------------
  |  |   99|  32.1k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 33, False: 24]
  |  |  ------------------
  ------------------
  441|  32.0k|}
_ZN12HunspellImpl10insert_sugERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_:
  444|  16.4k|void HunspellImpl::insert_sug(std::vector<std::string>& slst, const std::string& word) {
  445|  16.4k|  slst.insert(slst.begin(), word);
  446|  16.4k|}
_ZN12HunspellImpl5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  450|  14.6M|                         std::chrono::steady_clock::time_point suggest_start) {
  451|       |  // something very broken if spell ends up calling itself with the same word
  452|  14.6M|  if (std::find(candidate_stack.begin(), candidate_stack.end(), word) != candidate_stack.end())
  ------------------
  |  Branch (452:7): [True: 0, False: 14.6M]
  ------------------
  453|      0|    return false;
  454|       |
  455|  14.6M|  if (candidate_stack.size() >= MAXBREAKDEPTH)
  ------------------
  |  |   87|  14.6M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (455:7): [True: 0, False: 14.6M]
  ------------------
  456|      0|    return false;
  457|       |
  458|  14.6M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  14.6M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (458:7): [True: 0, False: 14.6M]
  ------------------
  459|      0|    return false;
  460|       |
  461|  14.6M|  candidate_stack.push_back(word);
  462|  14.6M|  bool r = spell_internal(word, candidate_stack, info, root, suggest_start);
  463|  14.6M|  candidate_stack.pop_back();
  464|       |
  465|  14.6M|  if (r && root) {
  ------------------
  |  Branch (465:7): [True: 2.76M, False: 11.9M]
  |  Branch (465:12): [True: 0, False: 2.76M]
  ------------------
  466|       |    // output conversion
  467|      0|    RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (467:19): [True: 0, False: 0]
  ------------------
  468|      0|    if (rl) {
  ------------------
  |  Branch (468:9): [True: 0, False: 0]
  ------------------
  469|      0|      std::string wspace;
  470|      0|      if (rl->conv(*root, wspace)) {
  ------------------
  |  Branch (470:11): [True: 0, False: 0]
  ------------------
  471|      0|        *root = std::move(wspace);
  472|      0|      }
  473|      0|    }
  474|      0|  }
  475|  14.6M|  return r;
  476|  14.6M|}
_ZN12HunspellImpl14spell_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  480|  14.6M|                                  std::chrono::steady_clock::time_point suggest_start) {
  481|  14.6M|  struct hentry* rv = nullptr;
  482|       |
  483|  14.6M|  int info2 = 0;
  484|  14.6M|  if (!info)
  ------------------
  |  Branch (484:7): [True: 14.6M, False: 101]
  ------------------
  485|  14.6M|    info = &info2;
  486|    101|  else
  487|    101|    *info = 0;
  488|       |
  489|       |  // Hunspell supports XML input of the simplified API (see manual)
  490|  14.6M|  if (word == SPELL_XML)
  ------------------
  |  |   80|  14.6M|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (490:7): [True: 399k, False: 14.2M]
  ------------------
  491|   399k|    return true;
  492|  14.2M|  if (utf8) {
  ------------------
  |  Branch (492:7): [True: 2.82M, False: 11.4M]
  ------------------
  493|  2.82M|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   86|  2.82M|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  2.82M|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (493:9): [True: 4.16k, False: 2.81M]
  ------------------
  494|  4.16k|      return false;
  495|  11.4M|  } else {
  496|  11.4M|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  11.4M|#define MAXWORDLEN 100
  ------------------
  |  Branch (496:9): [True: 7.12k, False: 11.4M]
  ------------------
  497|  7.12k|      return false;
  498|  11.4M|  }
  499|  14.2M|  int captype = NOCAP;
  ------------------
  |  |   92|  14.2M|#define NOCAP 0
  ------------------
  500|  14.2M|  size_t abbv = 0;
  501|  14.2M|  size_t wl = 0;
  502|       |
  503|  14.2M|  std::string scw;
  504|  14.2M|  std::vector<w_char> sunicw;
  505|       |
  506|       |  // input conversion
  507|  14.2M|  RepList* rl = pAMgr ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (507:17): [True: 14.2M, False: 0]
  ------------------
  508|  14.2M|  {
  509|  14.2M|    std::string wspace;
  510|       |
  511|  14.2M|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (511:23): [True: 413k, False: 13.8M]
  ------------------
  512|  14.2M|    if (convstatus) {
  ------------------
  |  Branch (512:9): [True: 0, False: 14.2M]
  ------------------
  513|       |      // the input conversion can grow the word without limit, so hold the
  514|       |      // converted word to the same maximum length as the raw word
  515|      0|      if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   86|      0|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                    if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   90|      0|#define MAXWORDLEN 100
  ------------------
  |  Branch (515:11): [True: 0, False: 0]
  |  Branch (515:11): [True: 0, False: 0]
  ------------------
  516|      0|        return false;
  517|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
  518|      0|    } else
  519|  14.2M|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
  520|  14.2M|  }
  521|       |
  522|  14.2M|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  523|  14.2M|    if (wl > 32768)
  ------------------
  |  Branch (523:9): [True: 0, False: 14.2M]
  ------------------
  524|      0|      return false;
  525|  14.2M|#endif
  526|       |
  527|       |#ifdef MOZILLA_CLIENT
  528|       |  // accept the abbreviated words without dots
  529|       |  // workaround for the incomplete tokenization of Mozilla
  530|       |  abbv = 1;
  531|       |#endif
  532|       |
  533|  14.2M|  if (wl == 0 || m_HMgrs.empty())
  ------------------
  |  Branch (533:7): [True: 462k, False: 13.8M]
  |  Branch (533:18): [True: 0, False: 13.8M]
  ------------------
  534|   462k|    return true;
  535|  13.8M|  if (root)
  ------------------
  |  Branch (535:7): [True: 0, False: 13.8M]
  ------------------
  536|      0|    root->clear();
  537|       |
  538|       |  // allow numbers with dots, dashes and commas (but forbid double separators:
  539|       |  // "..", "--" etc.). Besides the ASCII digits, accept the Arabic-Indic and
  540|       |  // Extended Arabic-Indic (Persian) digit ranges so those numbers are passed
  541|       |  // over the same way ASCII numbers are.
  542|  13.8M|  enum { NBEGIN, NNUM, NSEP };
  543|  13.8M|  int nstate = NBEGIN;
  544|  13.8M|  size_t i;
  545|  13.8M|  size_t n = utf8 ? sunicw.size() : wl;
  ------------------
  |  Branch (545:14): [True: 2.72M, False: 11.0M]
  ------------------
  546|       |
  547|  23.6M|  for (i = 0; (i < n); i++) {
  ------------------
  |  Branch (547:15): [True: 22.8M, False: 846k]
  ------------------
  548|  22.8M|    unsigned short c = utf8 ? static_cast<unsigned short>(sunicw[i]) : static_cast<unsigned char>(scw[i]);
  ------------------
  |  Branch (548:24): [True: 5.13M, False: 17.6M]
  ------------------
  549|  22.8M|    if ((c >= '0' && c <= '9') || (c >= 0x0660 && c <= 0x0669) ||  // Arabic-Indic digits
  ------------------
  |  Branch (549:10): [True: 15.5M, False: 7.28M]
  |  Branch (549:22): [True: 9.24M, False: 6.29M]
  |  Branch (549:36): [True: 235k, False: 13.3M]
  |  Branch (549:51): [True: 0, False: 235k]
  ------------------
  550|  13.5M|        (c >= 0x06F0 && c <= 0x06F9)) {                            // Extended Arabic-Indic (Persian) digits
  ------------------
  |  Branch (550:10): [True: 235k, False: 13.3M]
  |  Branch (550:25): [True: 0, False: 235k]
  ------------------
  551|  9.24M|      nstate = NNUM;
  552|  13.5M|    } else if ((c == ',') || (c == '.') || (c == '-')) {
  ------------------
  |  Branch (552:16): [True: 42.1k, False: 13.5M]
  |  Branch (552:30): [True: 1.37M, False: 12.1M]
  |  Branch (552:44): [True: 2.45M, False: 9.70M]
  ------------------
  553|  3.87M|      if ((nstate == NSEP) || (i == 0))
  ------------------
  |  Branch (553:11): [True: 123k, False: 3.75M]
  |  Branch (553:31): [True: 3.13M, False: 617k]
  ------------------
  554|  3.25M|        break;
  555|   617k|      nstate = NSEP;
  556|   617k|    } else
  557|  9.70M|      break;
  558|  22.8M|  }
  559|  13.8M|  if ((i == n) && (nstate == NNUM))
  ------------------
  |  Branch (559:7): [True: 846k, False: 12.9M]
  |  Branch (559:19): [True: 645k, False: 201k]
  ------------------
  560|   645k|    return true;
  561|       |
  562|  13.1M|  switch (captype) {
  ------------------
  |  Branch (562:11): [True: 13.1M, False: 0]
  ------------------
  563|  1.14M|    case HUHCAP:
  ------------------
  |  |   95|  1.14M|#define HUHCAP 3
  ------------------
  |  Branch (563:5): [True: 1.14M, False: 12.0M]
  ------------------
  564|       |    /* FALLTHROUGH */
  565|  1.35M|    case HUHINITCAP:
  ------------------
  |  |   96|  1.35M|#define HUHINITCAP 4
  ------------------
  |  Branch (565:5): [True: 213k, False: 12.9M]
  ------------------
  566|  1.35M|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   83|  1.35M|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  567|       |    /* FALLTHROUGH */
  568|  12.3M|    case NOCAP:
  ------------------
  |  |   92|  12.3M|#define NOCAP 0
  ------------------
  |  Branch (568:5): [True: 10.9M, False: 2.21M]
  ------------------
  569|  12.3M|      rv = checkword(scw, info, root, suggest_start);
  570|  12.3M|      if ((abbv) && !(rv)) {
  ------------------
  |  Branch (570:11): [True: 1.31M, False: 10.9M]
  |  Branch (570:21): [True: 1.30M, False: 9.30k]
  ------------------
  571|  1.30M|        std::string u8buffer(scw);
  572|  1.30M|        u8buffer.push_back('.');
  573|  1.30M|        rv = checkword(u8buffer, info, root, suggest_start);
  574|  1.30M|      }
  575|       |      // A stem with an inner capital, capitalised at the start of a sentence
  576|       |      // (uLinda written ULinda), is found by lowering only the first letter.
  577|  12.3M|      if (!rv && captype == HUHINITCAP) {
  ------------------
  |  |   96|  12.2M|#define HUHINITCAP 4
  ------------------
  |  Branch (577:11): [True: 12.2M, False: 49.7k]
  |  Branch (577:18): [True: 209k, False: 12.0M]
  ------------------
  578|   209k|        std::string u8buffer(scw);
  579|   209k|        std::vector<w_char> u16buffer(sunicw);
  580|   209k|        mkinitsmall2(u8buffer, u16buffer);
  581|   209k|        rv = checkword(u8buffer, info, root, suggest_start);
  582|   209k|        if (rv && is_keepcase(rv))
  ------------------
  |  Branch (582:13): [True: 21, False: 209k]
  |  Branch (582:19): [True: 0, False: 21]
  ------------------
  583|      0|          rv = nullptr;
  584|   209k|      }
  585|  12.3M|      break;
  586|   320k|    case ALLCAP: {
  ------------------
  |  |   94|   320k|#define ALLCAP 2
  ------------------
  |  Branch (586:5): [True: 320k, False: 12.8M]
  ------------------
  587|   320k|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   83|   320k|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  588|   320k|      rv = checkword(scw, info, root, suggest_start);
  589|   320k|      if (rv)
  ------------------
  |  Branch (589:11): [True: 100, False: 319k]
  ------------------
  590|    100|        break;
  591|   319k|      if (abbv) {
  ------------------
  |  Branch (591:11): [True: 67.7k, False: 252k]
  ------------------
  592|  67.7k|        std::string u8buffer(scw);
  593|  67.7k|        u8buffer.push_back('.');
  594|  67.7k|        rv = checkword(u8buffer, info, root, suggest_start);
  595|  67.7k|        if (rv)
  ------------------
  |  Branch (595:13): [True: 0, False: 67.7k]
  ------------------
  596|      0|          break;
  597|  67.7k|      }
  598|       |      // Spec. prefix handling for Catalan, French, Italian:
  599|       |      // prefixes separated by apostrophe (SANT'ELIA -> Sant'+Elia).
  600|   319k|      size_t apos = pAMgr ? scw.find('\'') : std::string::npos;
  ------------------
  |  Branch (600:21): [True: 319k, False: 0]
  ------------------
  601|   319k|      if (apos != std::string::npos) {
  ------------------
  |  Branch (601:11): [True: 86.1k, False: 233k]
  ------------------
  602|  86.1k|        mkallsmall2(scw, sunicw);
  603|       |        //conversion may result in string with different len to pre-mkallsmall2
  604|       |        //so re-scan
  605|  86.1k|        if (apos != std::string::npos && apos < scw.size() - 1) {
  ------------------
  |  Branch (605:13): [True: 86.1k, False: 0]
  |  Branch (605:42): [True: 80.4k, False: 5.76k]
  ------------------
  606|  80.4k|          std::string part1 = scw.substr(0, apos + 1), part2 = scw.substr(apos + 1);
  607|  80.4k|          if (utf8) {
  ------------------
  |  Branch (607:15): [True: 20.9k, False: 59.4k]
  ------------------
  608|  20.9k|            std::vector<w_char> part1u, part2u;
  609|  20.9k|            u8_u16(part1u, part1);
  610|  20.9k|            u8_u16(part2u, part2);
  611|  20.9k|            mkinitcap2(part2, part2u);
  612|  20.9k|            scw = part1 + part2;
  613|  20.9k|            sunicw = std::move(part1u);
  614|  20.9k|            sunicw.insert(sunicw.end(), part2u.begin(), part2u.end());
  615|  20.9k|            rv = checkword(scw, info, root, suggest_start);
  616|  20.9k|            if (rv)
  ------------------
  |  Branch (616:17): [True: 0, False: 20.9k]
  ------------------
  617|      0|              break;
  618|  59.4k|          } else {
  619|  59.4k|            mkinitcap2(part2, sunicw);
  620|  59.4k|            scw = part1 + part2;
  621|  59.4k|            rv = checkword(scw, info, root, suggest_start);
  622|  59.4k|            if (rv)
  ------------------
  |  Branch (622:17): [True: 1, False: 59.4k]
  ------------------
  623|      1|              break;
  624|  59.4k|          }
  625|  80.4k|          mkinitcap2(scw, sunicw);
  626|  80.4k|          rv = checkword(scw, info, root, suggest_start);
  627|  80.4k|          if (rv)
  ------------------
  |  Branch (627:15): [True: 0, False: 80.4k]
  ------------------
  628|      0|            break;
  629|  80.4k|        }
  630|  86.1k|      }
  631|   319k|      if (pAMgr && pAMgr->get_checksharps() && scw.find("SS") != std::string::npos) {
  ------------------
  |  Branch (631:11): [True: 319k, False: 0]
  |  Branch (631:20): [True: 0, False: 319k]
  |  Branch (631:48): [True: 0, False: 0]
  ------------------
  632|       |
  633|      0|        mkallsmall2(scw, sunicw);
  634|      0|        std::string u8buffer(scw);
  635|      0|        rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  636|      0|        if (!rv) {
  ------------------
  |  Branch (636:13): [True: 0, False: 0]
  ------------------
  637|      0|          mkinitcap2(scw, sunicw);
  638|      0|          rv = spellsharps(scw, 0, 0, 0, info, root, suggest_start);
  639|      0|        }
  640|      0|        if ((abbv) && !(rv)) {
  ------------------
  |  Branch (640:13): [True: 0, False: 0]
  |  Branch (640:23): [True: 0, False: 0]
  ------------------
  641|      0|          u8buffer.push_back('.');
  642|      0|          rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  643|      0|          if (!rv) {
  ------------------
  |  Branch (643:15): [True: 0, False: 0]
  ------------------
  644|      0|            u8buffer = std::string(scw);
  645|      0|            u8buffer.push_back('.');
  646|      0|            rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  647|      0|          }
  648|      0|        }
  649|      0|        if (rv)
  ------------------
  |  Branch (649:13): [True: 0, False: 0]
  ------------------
  650|      0|          break;
  651|      0|      }
  652|   319k|    }
  653|       |      /* FALLTHROUGH */
  654|   857k|    case INITCAP: {
  ------------------
  |  |   93|   857k|#define INITCAP 1
  ------------------
  |  Branch (654:5): [True: 537k, False: 12.6M]
  ------------------
  655|       |      // handle special capitalization of dotted I
  656|   857k|      bool Idot = (utf8 && (unsigned char) scw[0] == 0xc4 && (unsigned char) scw[1] == 0xb0);
  ------------------
  |  Branch (656:20): [True: 143k, False: 714k]
  |  Branch (656:28): [True: 0, False: 143k]
  |  Branch (656:62): [True: 0, False: 0]
  ------------------
  657|   857k|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   83|   857k|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  658|   857k|      if (captype == ALLCAP) {
  ------------------
  |  |   94|   857k|#define ALLCAP 2
  ------------------
  |  Branch (658:11): [True: 319k, False: 537k]
  ------------------
  659|   319k|          mkallsmall2(scw, sunicw);
  660|   319k|          mkinitcap2(scw, sunicw);
  661|   319k|          if (Idot)
  ------------------
  |  Branch (661:15): [True: 0, False: 319k]
  ------------------
  662|      0|             scw.replace(0, 1, "\xc4\xb0");
  663|   319k|      }
  664|   857k|      if (captype == INITCAP)
  ------------------
  |  |   93|   857k|#define INITCAP 1
  ------------------
  |  Branch (664:11): [True: 537k, False: 319k]
  ------------------
  665|   537k|        *info |= SPELL_INITCAP;
  ------------------
  |  |   82|   537k|#define SPELL_INITCAP (1 << 4)
  ------------------
  666|   857k|      rv = checkword(scw, info, root, suggest_start);
  667|   857k|      if (captype == INITCAP)
  ------------------
  |  |   93|   857k|#define INITCAP 1
  ------------------
  |  Branch (667:11): [True: 537k, False: 319k]
  ------------------
  668|   537k|        *info &= ~SPELL_INITCAP;
  ------------------
  |  |   82|   537k|#define SPELL_INITCAP (1 << 4)
  ------------------
  669|       |      // forbid bad capitalization
  670|       |      // (for example, ijs -> Ijs instead of IJs in Dutch)
  671|       |      // use explicit forms in dic: Ijs/F (F = FORBIDDENWORD flag)
  672|   857k|      if (*info & SPELL_FORBIDDEN) {
  ------------------
  |  |   79|   857k|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (672:11): [True: 0, False: 857k]
  ------------------
  673|      0|        rv = nullptr;
  674|      0|        break;
  675|      0|      }
  676|   857k|      if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   94|     16|#define ALLCAP 2
  ------------------
  |  Branch (676:11): [True: 17.4k, False: 840k]
  |  Branch (676:17): [True: 16, False: 17.4k]
  |  Branch (676:36): [True: 0, False: 16]
  ------------------
  677|      0|        rv = nullptr;
  678|   857k|      if (rv || (Idot && langnum != LANG_az && langnum != LANG_tr && langnum != LANG_crh))
  ------------------
  |  Branch (678:11): [True: 17.4k, False: 840k]
  |  Branch (678:18): [True: 0, False: 840k]
  |  Branch (678:26): [True: 0, False: 0]
  |  Branch (678:48): [True: 0, False: 0]
  |  Branch (678:70): [True: 0, False: 0]
  ------------------
  679|  17.4k|        break;
  680|       |
  681|   840k|      mkallsmall2(scw, sunicw);
  682|   840k|      std::string u8buffer(scw);
  683|   840k|      mkinitcap2(scw, sunicw);
  684|       |
  685|   840k|      rv = checkword(u8buffer, info, root, suggest_start);
  686|   840k|      if (abbv && !rv) {
  ------------------
  |  Branch (686:11): [True: 215k, False: 624k]
  |  Branch (686:19): [True: 210k, False: 4.41k]
  ------------------
  687|   210k|        u8buffer.push_back('.');
  688|   210k|        rv = checkword(u8buffer, info, root, suggest_start);
  689|   210k|        if (!rv) {
  ------------------
  |  Branch (689:13): [True: 210k, False: 0]
  ------------------
  690|   210k|          u8buffer = scw;
  691|   210k|          u8buffer.push_back('.');
  692|   210k|          if (captype == INITCAP)
  ------------------
  |  |   93|   210k|#define INITCAP 1
  ------------------
  |  Branch (692:15): [True: 143k, False: 67.7k]
  ------------------
  693|   143k|            *info |= SPELL_INITCAP;
  ------------------
  |  |   82|   143k|#define SPELL_INITCAP (1 << 4)
  ------------------
  694|   210k|          rv = checkword(u8buffer, info, root, suggest_start);
  695|   210k|          if (captype == INITCAP)
  ------------------
  |  |   93|   210k|#define INITCAP 1
  ------------------
  |  Branch (695:15): [True: 143k, False: 67.7k]
  ------------------
  696|   143k|            *info &= ~SPELL_INITCAP;
  ------------------
  |  |   82|   143k|#define SPELL_INITCAP (1 << 4)
  ------------------
  697|   210k|          if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   94|     13|#define ALLCAP 2
  ------------------
  |  Branch (697:15): [True: 13, False: 210k]
  |  Branch (697:21): [True: 13, False: 0]
  |  Branch (697:40): [True: 3, False: 10]
  ------------------
  698|      3|            rv = nullptr;
  699|   210k|          break;
  700|   210k|        }
  701|   210k|      }
  702|   629k|      if (rv && is_keepcase(rv) &&
  ------------------
  |  Branch (702:11): [True: 14.5k, False: 614k]
  |  Branch (702:17): [True: 4, False: 14.5k]
  ------------------
  703|      4|          ((captype == ALLCAP) ||
  ------------------
  |  |   94|      4|#define ALLCAP 2
  ------------------
  |  Branch (703:12): [True: 0, False: 4]
  ------------------
  704|       |           // if CHECKSHARPS: KEEPCASE words with \xDF  are allowed
  705|       |           // in INITCAP form, too.
  706|      4|           !(pAMgr->get_checksharps() &&
  ------------------
  |  Branch (706:14): [True: 0, False: 4]
  ------------------
  707|      0|             ((utf8 && u8buffer.find("\xC3\x9F") != std::string::npos) ||
  ------------------
  |  Branch (707:16): [True: 0, False: 0]
  |  Branch (707:24): [True: 0, False: 0]
  ------------------
  708|      0|              (!utf8 && u8buffer.find('\xDF') != std::string::npos)))))
  ------------------
  |  Branch (708:16): [True: 0, False: 0]
  |  Branch (708:25): [True: 0, False: 0]
  ------------------
  709|      4|        rv = nullptr;
  710|   629k|      break;
  711|   840k|    }
  712|  13.1M|  }
  713|       |
  714|  13.1M|  if (rv) {
  ------------------
  |  Branch (714:7): [True: 81.8k, False: 13.0M]
  ------------------
  715|  81.8k|    if (pAMgr && pAMgr->get_warn() && rv->astr &&
  ------------------
  |  Branch (715:9): [True: 81.8k, False: 0]
  |  Branch (715:9): [True: 7, False: 81.8k]
  |  Branch (715:18): [True: 5.90k, False: 75.9k]
  |  Branch (715:39): [True: 31, False: 5.87k]
  ------------------
  716|     31|        TESTAFF(rv->astr, pAMgr->get_warn(), rv->alen)) {
  ------------------
  |  |   99|     31|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 7, False: 24]
  |  |  ------------------
  ------------------
  717|      7|      *info |= SPELL_WARN;
  ------------------
  |  |   84|      7|#define SPELL_WARN (1 << 6)
  ------------------
  718|      7|      if (pAMgr->get_forbidwarn())
  ------------------
  |  Branch (718:11): [True: 0, False: 7]
  ------------------
  719|      0|        return false;
  720|      7|      return true;
  721|      7|    }
  722|  81.8k|    return true;
  723|  81.8k|  }
  724|       |
  725|       |  // recursive breaking at break points
  726|  13.0M|  if (!wordbreak.empty() && !(*info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   79|  13.0M|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (726:7): [True: 13.0M, False: 0]
  |  Branch (726:29): [True: 13.0M, False: 0]
  ------------------
  727|       |
  728|  13.0M|    int nbr = 0;
  729|  13.0M|    wl = scw.size();
  730|       |
  731|       |    // calculate break points for recursion limit
  732|  39.1M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (732:18): [True: 39.1M, False: 13.0M]
  ------------------
  733|  39.1M|      size_t pos = 0;
  734|  53.3M|      while ((pos = scw.find(j, pos)) != std::string::npos) {
  ------------------
  |  Branch (734:14): [True: 14.1M, False: 39.1M]
  ------------------
  735|  14.1M|        ++nbr;
  736|  14.1M|        pos += j.size();
  737|  14.1M|      }
  738|  39.1M|    }
  739|  13.0M|    if (nbr >= MAXBREAKDEPTH)
  ------------------
  |  |   87|  13.0M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (739:9): [True: 7.26k, False: 13.0M]
  ------------------
  740|  7.26k|      return false;
  741|       |
  742|       |    // check boundary patterns (^begin and end$)
  743|  39.0M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (743:18): [True: 39.0M, False: 11.9M]
  ------------------
  744|  39.0M|      size_t plen = j.size();
  745|  39.0M|      if (plen == 1 || plen > wl)
  ------------------
  |  Branch (745:11): [True: 13.0M, False: 25.9M]
  |  Branch (745:24): [True: 3.25M, False: 22.7M]
  ------------------
  746|  16.3M|        continue;
  747|       |
  748|  22.7M|      if (j[0] == '^' && scw.compare(0, plen - 1, j, 1, plen - 1) == 0 &&
  ------------------
  |  Branch (748:11): [True: 11.3M, False: 11.3M]
  |  Branch (748:11): [True: 95.1k, False: 22.6M]
  |  Branch (748:26): [True: 1.02M, False: 10.3M]
  ------------------
  749|  1.02M|          spell(scw.substr(plen - 1), candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (749:11): [True: 95.1k, False: 934k]
  ------------------
  750|  95.1k|        *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|  95.1k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  751|  95.1k|        return true;
  752|  95.1k|      }
  753|       |
  754|  22.6M|      if (j[plen - 1] == '$' &&
  ------------------
  |  Branch (754:11): [True: 11.3M, False: 11.3M]
  ------------------
  755|  11.3M|          scw.compare(wl - plen + 1, plen - 1, j, 0, plen - 1) == 0) {
  ------------------
  |  Branch (755:11): [True: 4.17M, False: 7.12M]
  ------------------
  756|  4.17M|        std::string suffix(scw.substr(wl - plen + 1));
  757|  4.17M|        scw.resize(wl - plen + 1);
  758|  4.17M|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (758:13): [True: 1.01M, False: 3.16M]
  ------------------
  759|  1.01M|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|  1.01M|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  760|  1.01M|          return true;
  761|  1.01M|        }
  762|  3.16M|        scw.append(suffix);
  763|  3.16M|      }
  764|  22.6M|    }
  765|       |
  766|       |    // other patterns
  767|  35.7M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (767:18): [True: 35.7M, False: 11.9M]
  ------------------
  768|  35.7M|      size_t plen = j.size();
  769|  35.7M|      size_t found = scw.find(j);
  770|  35.7M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (770:11): [True: 33.9M, False: 1.80M]
  |  Branch (770:26): [True: 3.88M, False: 30.0M]
  ------------------
  771|  3.88M|        size_t found2 = scw.find(j, found + 1);
  772|       |        // try to break at the second occurance
  773|       |        // to recognize dictionary words with wordbreak
  774|  3.88M|        if (found2 > 0 && (found2 < wl - plen))
  ------------------
  |  Branch (774:13): [True: 3.88M, False: 0]
  |  Branch (774:27): [True: 1.50M, False: 2.37M]
  ------------------
  775|  1.50M|            found = found2;
  776|  3.88M|        std::string substring(scw.substr(found + plen));
  777|  3.88M|        if (!spell(substring, candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (777:13): [True: 3.02M, False: 861k]
  ------------------
  778|  3.02M|          continue;
  779|   861k|        std::string suffix(scw.substr(found));
  780|   861k|        scw.resize(found);
  781|       |        // examine 2 sides of the break point
  782|   861k|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (782:13): [True: 62.3k, False: 798k]
  ------------------
  783|  62.3k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|  62.3k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  784|  62.3k|          return true;
  785|  62.3k|        }
  786|   798k|        scw.append(suffix);
  787|       |
  788|       |        // LANG_hu: spec. dash rule
  789|   798k|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (789:13): [True: 506, False: 798k]
  |  Branch (789:35): [True: 506, False: 0]
  ------------------
  790|    506|          suffix = scw.substr(found + 1);
  791|    506|          scw.resize(found + 1);
  792|    506|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (792:15): [True: 0, False: 506]
  ------------------
  793|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  794|      0|            return true;  // check the first part with dash
  795|      0|          }
  796|    506|          scw.append(suffix);
  797|    506|        }
  798|       |        // end of LANG specific region
  799|   798k|      }
  800|  35.7M|    }
  801|       |
  802|       |    // other patterns (break at first break point)
  803|  35.6M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (803:18): [True: 35.6M, False: 11.8M]
  ------------------
  804|  35.6M|      size_t plen = j.size(), found = scw.find(j);
  805|  35.6M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (805:11): [True: 33.8M, False: 1.80M]
  |  Branch (805:26): [True: 3.81M, False: 30.0M]
  ------------------
  806|  3.81M|        if (!spell(scw.substr(found + plen), candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (806:13): [True: 3.15M, False: 661k]
  ------------------
  807|  3.15M|          continue;
  808|   661k|        std::string suffix(scw.substr(found));
  809|   661k|        scw.resize(found);
  810|       |        // examine 2 sides of the break point
  811|   661k|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (811:13): [True: 5.04k, False: 656k]
  ------------------
  812|  5.04k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|  5.04k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  813|  5.04k|          return true;
  814|  5.04k|        }
  815|   656k|        scw.append(suffix);
  816|       |
  817|       |        // LANG_hu: spec. dash rule
  818|   656k|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (818:13): [True: 299, False: 656k]
  |  Branch (818:35): [True: 299, False: 0]
  ------------------
  819|    299|          suffix = scw.substr(found + 1);
  820|    299|          scw.resize(found + 1);
  821|    299|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (821:15): [True: 0, False: 299]
  ------------------
  822|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  823|      0|            return true;  // check the first part with dash
  824|      0|          }
  825|    299|          scw.append(suffix);
  826|    299|        }
  827|       |        // end of LANG specific region
  828|   656k|      }
  829|  35.6M|    }
  830|  11.9M|  }
  831|       |
  832|  11.8M|  return false;
  833|  13.0M|}
_ZN12HunspellImpl9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_NS0_6chrono10time_pointINSB_12steady_clockENSB_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  836|  16.5M|                                       std::chrono::steady_clock::time_point suggest_start) {
  837|       |  // check overall suggest time limit
  838|  16.5M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  16.5M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (838:7): [True: 0, False: 16.5M]
  ------------------
  839|      0|    return nullptr;
  840|       |
  841|  16.5M|  std::string word;
  842|       |
  843|       |  // remove IGNORE characters from the string
  844|  16.5M|  clean_ignore(word, w);
  845|       |
  846|  16.5M|  if (word.empty())
  ------------------
  |  Branch (846:7): [True: 142, False: 16.5M]
  ------------------
  847|    142|    return nullptr;
  848|       |
  849|       |  // word reversing wrapper for complex prefixes
  850|  16.5M|  if (complexprefixes) {
  ------------------
  |  Branch (850:7): [True: 994k, False: 15.5M]
  ------------------
  851|   994k|    if (utf8)
  ------------------
  |  Branch (851:9): [True: 0, False: 994k]
  ------------------
  852|      0|      reverseword_utf(word);
  853|   994k|    else
  854|   994k|      reverseword(word);
  855|   994k|  }
  856|       |
  857|  16.5M|  int len = word.size();
  858|       |
  859|       |  // look word in hash table
  860|  16.5M|  struct hentry* he = nullptr;
  861|  33.0M|  for (size_t i = 0; (i < m_HMgrs.size()) && !he; ++i) {
  ------------------
  |  Branch (861:22): [True: 16.5M, False: 16.5M]
  |  Branch (861:46): [True: 16.5M, False: 0]
  ------------------
  862|  16.5M|    he = m_HMgrs[i]->lookup(word.c_str(), word.size());
  863|       |
  864|       |    // check forbidden and onlyincompound words
  865|  16.5M|    if ((he) && (he->astr) && (pAMgr) &&
  ------------------
  |  Branch (865:9): [True: 81.9k, False: 16.4M]
  |  Branch (865:9): [True: 0, False: 16.5M]
  |  Branch (865:17): [True: 812, False: 81.1k]
  |  Branch (865:31): [True: 812, False: 0]
  ------------------
  866|    812|        TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) {
  ------------------
  |  |   99|    812|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 812]
  |  |  ------------------
  ------------------
  867|      0|      if (info)
  ------------------
  |  Branch (867:11): [True: 0, False: 0]
  ------------------
  868|      0|        *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   79|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  869|       |      // LANG_hu section: set dash information for suggestions
  870|      0|      if (langnum == LANG_hu) {
  ------------------
  |  Branch (870:11): [True: 0, False: 0]
  ------------------
  871|      0|        if (pAMgr->get_compoundflag() &&
  ------------------
  |  Branch (871:13): [True: 0, False: 0]
  |  Branch (871:13): [True: 0, False: 0]
  ------------------
  872|      0|            TESTAFF(he->astr, pAMgr->get_compoundflag(), he->alen)) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  873|      0|          if (info)
  ------------------
  |  Branch (873:15): [True: 0, False: 0]
  ------------------
  874|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  875|      0|        }
  876|      0|      }
  877|      0|      return nullptr;
  878|      0|    }
  879|       |
  880|       |    // he = next not needaffix, onlyincompound homonym or onlyupcase word
  881|  16.5M|    while (he && (he->astr) && pAMgr &&
  ------------------
  |  Branch (881:12): [True: 81.9k, False: 16.4M]
  |  Branch (881:12): [True: 85, False: 16.5M]
  |  Branch (881:18): [True: 812, False: 81.1k]
  |  Branch (881:32): [True: 812, False: 0]
  ------------------
  882|    812|           ((pAMgr->get_needaffix() &&
  ------------------
  |  Branch (882:14): [True: 46, False: 766]
  ------------------
  883|     46|             TESTAFF(he->astr, pAMgr->get_needaffix(), he->alen)) ||
  ------------------
  |  |   99|     46|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 46]
  |  |  ------------------
  ------------------
  884|    812|            (pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (884:14): [True: 0, False: 812]
  ------------------
  885|      0|             TESTAFF(he->astr, pAMgr->get_onlyincompound(), he->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  886|    812|            (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   82|    812|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (886:14): [True: 812, False: 0]
  |  Branch (886:22): [True: 111, False: 701]
  ------------------
  887|    111|             TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen))))
  ------------------
  |  |   99|    111|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 85, False: 26]
  |  |  ------------------
  ------------------
  888|     85|      he = he->next_homonym;
  889|  16.5M|  }
  890|       |
  891|       |  // check with affixes
  892|  16.5M|  if (!he && pAMgr) {
  ------------------
  |  Branch (892:7): [True: 16.4M, False: 81.8k]
  |  Branch (892:14): [True: 16.4M, False: 0]
  ------------------
  893|       |    // try stripping off affixes
  894|  16.4M|    AffixScratch scratch;
  895|       |    // For an initial-capital query, make affix_check skip an all-uppercase-only
  896|       |    // stem and keep looking, so a valid mixed-case match behind it is found.
  897|  16.4M|    FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   95|  16.4M|#define FLAG unsigned short
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   82|  16.4M|#define SPELL_INITCAP (1 << 4)
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |  128|   665k|#define ONLYUPCASEFLAG 65511
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   96|  32.1M|#define FLAG_NULL 0x00
  ------------------
  |  Branch (897:23): [True: 16.4M, False: 0]
  |  Branch (897:31): [True: 665k, False: 15.7M]
  ------------------
  898|  16.4M|    he = pAMgr->affix_check(word, 0, len, scratch, 0, IN_CPD_NOT, avoidflag);
  ------------------
  |  |   72|  16.4M|#define IN_CPD_NOT 0
  ------------------
  899|       |
  900|       |    // check compound restriction and onlyupcase
  901|  16.4M|    if (he && he->astr &&
  ------------------
  |  Branch (901:9): [True: 0, False: 16.4M]
  |  Branch (901:9): [True: 0, False: 16.4M]
  |  Branch (901:15): [True: 0, False: 0]
  ------------------
  902|      0|        ((pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (902:11): [True: 0, False: 0]
  ------------------
  903|      0|          TESTAFF(he->astr, pAMgr->get_onlyincompound(), he->alen)) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  904|      0|         (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   82|      0|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (904:11): [True: 0, False: 0]
  |  Branch (904:19): [True: 0, False: 0]
  ------------------
  905|      0|          TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen)))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  906|      0|      he = nullptr;
  907|      0|    }
  908|       |
  909|  16.4M|    if (he) {
  ------------------
  |  Branch (909:9): [True: 0, False: 16.4M]
  ------------------
  910|      0|      if ((he->astr) && (pAMgr) &&
  ------------------
  |  Branch (910:11): [True: 0, False: 0]
  |  Branch (910:11): [True: 0, False: 0]
  |  Branch (910:25): [True: 0, False: 0]
  ------------------
  911|      0|          TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  912|      0|        if (info)
  ------------------
  |  Branch (912:13): [True: 0, False: 0]
  ------------------
  913|      0|          *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   79|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  914|      0|        return nullptr;
  915|      0|      }
  916|      0|      if (root) {
  ------------------
  |  Branch (916:11): [True: 0, False: 0]
  ------------------
  917|      0|        root->assign(he->word);
  918|      0|        if (complexprefixes) {
  ------------------
  |  Branch (918:13): [True: 0, False: 0]
  ------------------
  919|      0|          if (utf8)
  ------------------
  |  Branch (919:15): [True: 0, False: 0]
  ------------------
  920|      0|            reverseword_utf(*root);
  921|      0|          else
  922|      0|            reverseword(*root);
  923|      0|        }
  924|      0|      }
  925|       |      // try check compound word
  926|  16.4M|    } else if (pAMgr->get_compound()) {
  ------------------
  |  Branch (926:16): [True: 4.17M, False: 12.2M]
  ------------------
  927|  4.17M|      struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
  928|       |
  929|       |      // first allow only 2 words in the compound
  930|  4.17M|      int setinfo = SPELL_COMPOUND_2;
  ------------------
  |  |   85|  4.17M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  931|  4.17M|      if (info)
  ------------------
  |  Branch (931:11): [True: 4.17M, False: 0]
  ------------------
  932|  4.17M|        setinfo |= *info;
  933|  4.17M|      he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, &setinfo, scratch);
  934|  4.17M|      if (info)
  ------------------
  |  Branch (934:11): [True: 4.17M, False: 0]
  ------------------
  935|  4.17M|        *info = setinfo & ~SPELL_COMPOUND_2;
  ------------------
  |  |   85|  4.17M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  936|       |      // if not 2-word compoud word, try with 3 or more words
  937|       |      // (only if original info didn't forbid it)
  938|  4.17M|      if (!he && info && !(*info & SPELL_COMPOUND_2)) {
  ------------------
  |  |   85|  4.17M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (938:11): [True: 4.17M, False: 0]
  |  Branch (938:18): [True: 4.17M, False: 0]
  |  Branch (938:26): [True: 4.17M, False: 0]
  ------------------
  939|  4.17M|        *info &= ~SPELL_COMPOUND_2;
  ------------------
  |  |   85|  4.17M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  940|  4.17M|        he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, info, scratch);
  941|       |        // accept the compound with 3 or more words only if it is
  942|       |        // - not a dictionary word with a typo and
  943|       |        // - not two words written separately,
  944|       |        // - or if it's an arbitrary number accepted by compound rules (e.g. 999%)
  945|  4.17M|        if (he && !isdigit(word[0]))
  ------------------
  |  Branch (945:13): [True: 0, False: 4.17M]
  |  Branch (945:19): [True: 0, False: 0]
  ------------------
  946|      0|        {
  947|      0|          std::vector<std::string> slst;
  948|      0|          if (pSMgr->suggest(slst, word, nullptr, /*test_simplesug=*/true))
  ------------------
  |  Branch (948:15): [True: 0, False: 0]
  ------------------
  949|      0|            he = nullptr;
  950|      0|        }
  951|  4.17M|      }
  952|       |
  953|       |      // LANG_hu section: `moving rule' with last dash
  954|  4.17M|      if ((!he) && (langnum == LANG_hu) && (word[len - 1] == '-')) {
  ------------------
  |  Branch (954:11): [True: 4.17M, False: 0]
  |  Branch (954:20): [True: 34.6k, False: 4.13M]
  |  Branch (954:44): [True: 13.1k, False: 21.5k]
  ------------------
  955|  13.1k|        std::string dup(word, 0, len - 1);
  956|  13.1k|        he = pAMgr->compound_check(dup, -5, 0, 100, 0, nullptr, (hentry**)&rwords, 1, 0, info, scratch);
  957|  13.1k|      }
  958|       |      // end of LANG specific region
  959|  4.17M|      if (he) {
  ------------------
  |  Branch (959:11): [True: 0, False: 4.17M]
  ------------------
  960|      0|        if (root) {
  ------------------
  |  Branch (960:13): [True: 0, False: 0]
  ------------------
  961|      0|          root->assign(he->word);
  962|      0|          if (complexprefixes) {
  ------------------
  |  Branch (962:15): [True: 0, False: 0]
  ------------------
  963|      0|            if (utf8)
  ------------------
  |  Branch (963:17): [True: 0, False: 0]
  ------------------
  964|      0|              reverseword_utf(*root);
  965|      0|            else
  966|      0|              reverseword(*root);
  967|      0|          }
  968|      0|        }
  969|      0|        if (info)
  ------------------
  |  Branch (969:13): [True: 0, False: 0]
  ------------------
  970|      0|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  971|      0|      }
  972|  4.17M|    }
  973|  16.4M|  }
  974|       |
  975|  16.5M|  return he;
  976|  16.5M|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEENS0_6chrono10time_pointINSD_12steady_clockENSD_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  984|  93.5k|std::vector<std::string> HunspellImpl::suggest(const std::string& word, std::vector<std::string>& suggest_candidate_stack, std::chrono::steady_clock::time_point suggest_start) {
  985|       |
  986|  93.5k|  if (suggest_candidate_stack.size() > MAX_CANDIDATE_STACK_DEPTH || // apply a fairly arbitrary depth limit
  ------------------
  |  |  979|   187k|#define MAX_CANDIDATE_STACK_DEPTH 512
  ------------------
  |  Branch (986:7): [True: 0, False: 93.5k]
  |  Branch (986:7): [True: 0, False: 93.5k]
  ------------------
  987|       |      // something very broken if suggest ends up calling itself with the same word
  988|  93.5k|      std::find(suggest_candidate_stack.begin(), suggest_candidate_stack.end(), word) != suggest_candidate_stack.end()) {
  ------------------
  |  Branch (988:7): [True: 0, False: 93.5k]
  ------------------
  989|      0|    return { };
  990|      0|  }
  991|       |
  992|  93.5k|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  93.5k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (992:7): [True: 0, False: 93.5k]
  ------------------
  993|      0|    return { };
  994|       |
  995|  93.5k|  bool capwords;
  996|  93.5k|  size_t abbv;
  997|  93.5k|  int captype;
  998|  93.5k|  std::vector<std::string> spell_candidate_stack;
  999|  93.5k|  suggest_candidate_stack.push_back(word);
 1000|  93.5k|  std::vector<std::string> slst = suggest_internal(word, spell_candidate_stack, suggest_candidate_stack,
 1001|  93.5k|                                                   capwords, abbv, captype, suggest_start);
 1002|  93.5k|  suggest_candidate_stack.pop_back();
 1003|       |  // word reversing wrapper for complex prefixes
 1004|  93.5k|  if (complexprefixes) {
  ------------------
  |  Branch (1004:7): [True: 4.82k, False: 88.6k]
  ------------------
 1005|  4.82k|    for (auto& j : slst) {
  ------------------
  |  Branch (1005:18): [True: 2.24k, False: 4.82k]
  ------------------
 1006|  2.24k|      if (utf8)
  ------------------
  |  Branch (1006:11): [True: 0, False: 2.24k]
  ------------------
 1007|      0|        reverseword_utf(j);
 1008|  2.24k|      else
 1009|  2.24k|        reverseword(j);
 1010|  2.24k|    }
 1011|  4.82k|  }
 1012|       |
 1013|       |  // capitalize
 1014|  93.5k|  if (capwords) {
  ------------------
  |  Branch (1014:7): [True: 26.3k, False: 67.1k]
  ------------------
 1015|  26.3k|    for (auto& j : slst) {
  ------------------
  |  Branch (1015:18): [True: 18.0k, False: 26.3k]
  ------------------
 1016|  18.0k|      std::string capitalized(j);
 1017|  18.0k|      mkinitcap(capitalized);
 1018|  18.0k|      if (capitalized == word)
  ------------------
  |  Branch (1018:11): [True: 7, False: 18.0k]
  ------------------
 1019|      7|        continue;  // capitalizing would just reproduce the misspelled word
 1020|  18.0k|      j = std::move(capitalized);
 1021|  18.0k|    }
 1022|  26.3k|  }
 1023|       |
 1024|       |  // expand suggestions with dot(s)
 1025|  93.5k|  if (abbv && pAMgr && pAMgr->get_sugswithdots() && word.size() >= abbv) {
  ------------------
  |  Branch (1025:7): [True: 3.70k, False: 89.8k]
  |  Branch (1025:15): [True: 3.70k, False: 0]
  |  Branch (1025:24): [True: 0, False: 3.70k]
  |  Branch (1025:53): [True: 0, False: 0]
  ------------------
 1026|      0|    for (auto& j : slst) {
  ------------------
  |  Branch (1026:18): [True: 0, False: 0]
  ------------------
 1027|      0|      j.append(word.substr(word.size() - abbv));
 1028|      0|    }
 1029|      0|  }
 1030|       |
 1031|       |  // remove bad capitalized and forbidden forms
 1032|  93.5k|  if (pAMgr && (pAMgr->get_keepcase() || pAMgr->get_forbiddenword())) {
  ------------------
  |  Branch (1032:7): [True: 93.5k, False: 0]
  |  Branch (1032:17): [True: 4.86k, False: 88.6k]
  |  Branch (1032:42): [True: 88.6k, False: 0]
  ------------------
 1033|  93.5k|    switch (captype) {
  ------------------
  |  Branch (1033:13): [True: 49.7k, False: 43.8k]
  ------------------
 1034|  12.4k|      case INITCAP:
  ------------------
  |  |   93|  12.4k|#define INITCAP 1
  ------------------
  |  Branch (1034:7): [True: 12.4k, False: 81.1k]
  ------------------
 1035|  22.1k|      case ALLCAP:
  ------------------
  |  |   94|  22.1k|#define ALLCAP 2
  ------------------
  |  Branch (1035:7): [True: 9.70k, False: 83.8k]
  ------------------
 1036|  35.7k|      case HUHCAP:
  ------------------
  |  |   95|  35.7k|#define HUHCAP 3
  ------------------
  |  Branch (1036:7): [True: 13.6k, False: 79.8k]
  ------------------
 1037|  49.7k|      case HUHINITCAP: {
  ------------------
  |  |   96|  49.7k|#define HUHINITCAP 4
  ------------------
  |  Branch (1037:7): [True: 13.9k, False: 79.5k]
  ------------------
 1038|  49.7k|        size_t l = 0;
 1039|  82.3k|        for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1039:28): [True: 32.6k, False: 49.7k]
  ------------------
 1040|       |          // A space-containing suggestion can be an "insert a space" split
 1041|       |          // whose parts each spell on their own, so it is good when every
 1042|       |          // part spells even though the whole string does not.
 1043|  32.6k|          bool bad = !spell(slst[j], spell_candidate_stack, nullptr, nullptr, suggest_start);
 1044|  32.6k|          if (bad && slst[j].find(' ') != std::string::npos) {
  ------------------
  |  Branch (1044:15): [True: 16.6k, False: 15.9k]
  |  Branch (1044:22): [True: 7.45k, False: 9.22k]
  ------------------
 1045|  7.45k|            bad = false;
 1046|  15.9k|            for (size_t start = 0; start <= slst[j].size(); ) {
  ------------------
  |  Branch (1046:36): [True: 15.9k, False: 0]
  ------------------
 1047|  15.9k|              size_t sp = slst[j].find(' ', start);
 1048|  15.9k|              size_t end = (sp == std::string::npos) ? slst[j].size() : sp;
  ------------------
  |  Branch (1048:28): [True: 2.34k, False: 13.5k]
  ------------------
 1049|  15.9k|              std::string part = slst[j].substr(start, end - start);
 1050|  15.9k|              if (!part.empty() &&
  ------------------
  |  Branch (1050:19): [True: 10.4k, False: 5.46k]
  ------------------
 1051|  10.4k|                  !spell(part, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1051:19): [True: 6.27k, False: 4.17k]
  ------------------
 1052|  6.27k|                bad = true;
 1053|  6.27k|                break;
 1054|  6.27k|              }
 1055|  9.64k|              if (sp == std::string::npos)
  ------------------
  |  Branch (1055:19): [True: 1.17k, False: 8.46k]
  ------------------
 1056|  1.17k|                break;
 1057|  8.46k|              start = sp + 1;
 1058|  8.46k|            }
 1059|  7.45k|          }
 1060|  32.6k|          if (bad) {
  ------------------
  |  Branch (1060:15): [True: 15.5k, False: 17.0k]
  ------------------
 1061|  15.5k|            std::string s;
 1062|  15.5k|            std::vector<w_char> w;
 1063|  15.5k|            if (utf8) {
  ------------------
  |  Branch (1063:17): [True: 6.46k, False: 9.04k]
  ------------------
 1064|  6.46k|              u8_u16(w, slst[j]);
 1065|  9.04k|            } else {
 1066|  9.04k|              s = slst[j];
 1067|  9.04k|            }
 1068|  15.5k|            mkallsmall2(s, w);
 1069|  15.5k|            if (spell(s, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1069:17): [True: 18, False: 15.4k]
  ------------------
 1070|     18|              slst[l] = std::move(s);
 1071|     18|              ++l;
 1072|  15.4k|            } else {
 1073|  15.4k|              mkinitcap2(s, w);
 1074|  15.4k|              if (spell(s, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1074:19): [True: 62, False: 15.4k]
  ------------------
 1075|     62|                slst[l] = std::move(s);
 1076|     62|                ++l;
 1077|     62|              }
 1078|  15.4k|            }
 1079|  17.0k|          } else {
 1080|  17.0k|            slst[l] = slst[j];
 1081|  17.0k|            ++l;
 1082|  17.0k|          }
 1083|  32.6k|        }
 1084|  49.7k|        slst.resize(l);
 1085|  49.7k|      }
 1086|  93.5k|    }
 1087|  93.5k|  }
 1088|       |
 1089|       |  // remove duplications
 1090|  93.5k|  size_t l = 0;
 1091|   113k|  for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1091:22): [True: 19.8k, False: 93.5k]
  ------------------
 1092|  19.8k|    slst[l] = slst[j];
 1093|  30.4k|    for (size_t k = 0; k < l; ++k) {
  ------------------
  |  Branch (1093:24): [True: 11.5k, False: 18.9k]
  ------------------
 1094|  11.5k|      if (slst[k] == slst[j]) {
  ------------------
  |  Branch (1094:11): [True: 835, False: 10.6k]
  ------------------
 1095|    835|        --l;
 1096|    835|        break;
 1097|    835|      }
 1098|  11.5k|    }
 1099|  19.8k|    ++l;
 1100|  19.8k|  }
 1101|  93.5k|  slst.resize(l);
 1102|       |
 1103|       |  // output conversion
 1104|  93.5k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1104:17): [True: 93.5k, False: 0]
  ------------------
 1105|  93.5k|  if (rl) {
  ------------------
  |  Branch (1105:7): [True: 5.03k, False: 88.4k]
  ------------------
 1106|  5.03k|    size_t l = 0;
 1107|  5.85k|    for (size_t i = 0; i < slst.size(); ++i) {
  ------------------
  |  Branch (1107:24): [True: 825, False: 5.03k]
  ------------------
 1108|    825|      std::string wspace;
 1109|    825|      if (rl->conv(slst[i], wspace)) {
  ------------------
  |  Branch (1109:11): [True: 220, False: 605]
  ------------------
 1110|    220|        slst[i] = std::move(wspace);
 1111|    220|      }
 1112|       |      // gh#1002: OCONV can map a generated form back to the input word
 1113|       |      // (e.g. "románórum" -> "romanórum" when the user typed "romanórum"),
 1114|       |      // leaving the misspelled word as its own suggestion.
 1115|    825|      if (slst[i] == word)
  ------------------
  |  Branch (1115:11): [True: 0, False: 825]
  ------------------
 1116|      0|        continue;
 1117|    825|      if (l != i)
  ------------------
  |  Branch (1117:11): [True: 0, False: 825]
  ------------------
 1118|      0|        slst[l] = std::move(slst[i]);
 1119|    825|      ++l;
 1120|    825|    }
 1121|  5.03k|    slst.resize(l);
 1122|  5.03k|  }
 1123|  93.5k|  return slst;
 1124|  93.5k|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1126|  64.0k|std::vector<std::string> HunspellImpl::suggest(const std::string& word) {
 1127|  64.0k|  std::vector<std::string> suggest_candidate_stack;
 1128|  64.0k|  auto suggest_start = std::chrono::steady_clock::now();
 1129|  64.0k|  return suggest(word, suggest_candidate_stack, suggest_start);
 1130|  64.0k|}
_ZN12HunspellImpl16suggest_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEESC_RbRmRiNS0_6chrono10time_pointINSG_12steady_clockENSG_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1136|  93.5k|        std::chrono::steady_clock::time_point suggest_start) {
 1137|  93.5k|  captype = NOCAP;
  ------------------
  |  |   92|  93.5k|#define NOCAP 0
  ------------------
 1138|  93.5k|  abbv = 0;
 1139|  93.5k|  capwords = false;
 1140|       |
 1141|  93.5k|  std::vector<std::string> slst;
 1142|       |
 1143|  93.5k|  int onlycmpdsug = 0;
 1144|  93.5k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1144:7): [True: 0, False: 93.5k]
  |  Branch (1144:17): [True: 0, False: 93.5k]
  ------------------
 1145|      0|    return slst;
 1146|       |
 1147|       |  // process XML input of the simplified API (see manual)
 1148|  93.5k|  if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  93.5k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  93.5k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  93.5k|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (1148:7): [True: 23.1k, False: 70.3k]
  ------------------
 1149|  23.1k|    if (word.size() > MAXSPELLMLLEN)
  ------------------
  |  |   87|  23.1k|#define MAXSPELLMLLEN 8192
  ------------------
  |  Branch (1149:9): [True: 589, False: 22.5k]
  ------------------
 1150|    589|      return slst;
 1151|  22.5k|    return spellml(word);
 1152|  23.1k|  }
 1153|  70.3k|  if (utf8) {
  ------------------
  |  Branch (1153:7): [True: 34.0k, False: 36.3k]
  ------------------
 1154|  34.0k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   86|  34.0k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  34.0k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1154:9): [True: 126, False: 33.8k]
  ------------------
 1155|    126|      return slst;
 1156|  36.3k|  } else {
 1157|  36.3k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  36.3k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1157:9): [True: 160, False: 36.2k]
  ------------------
 1158|    160|      return slst;
 1159|  36.3k|  }
 1160|  70.1k|  size_t wl = 0;
 1161|       |
 1162|  70.1k|  std::string scw;
 1163|  70.1k|  std::vector<w_char> sunicw;
 1164|       |
 1165|       |  // input conversion
 1166|  70.1k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1166:17): [True: 70.1k, False: 0]
  ------------------
 1167|  70.1k|  {
 1168|  70.1k|    std::string wspace;
 1169|       |
 1170|  70.1k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1170:23): [True: 3.80k, False: 66.3k]
  ------------------
 1171|  70.1k|    if (convstatus) {
  ------------------
  |  Branch (1171:9): [True: 0, False: 70.1k]
  ------------------
 1172|       |      // the input conversion can grow the word without limit, so hold the
 1173|       |      // converted word to the same maximum length as the raw word
 1174|      0|      if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   86|      0|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                    if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   90|      0|#define MAXWORDLEN 100
  ------------------
  |  Branch (1174:11): [True: 0, False: 0]
  |  Branch (1174:11): [True: 0, False: 0]
  ------------------
 1175|      0|        return slst;
 1176|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1177|      0|    } else
 1178|  70.1k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1179|       |
 1180|  70.1k|    if (wl == 0)
  ------------------
  |  Branch (1180:9): [True: 0, False: 70.1k]
  ------------------
 1181|      0|      return slst;
 1182|       |
 1183|  70.1k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1184|  70.1k|    if (wl > 32768)
  ------------------
  |  Branch (1184:9): [True: 0, False: 70.1k]
  ------------------
 1185|      0|      return slst;
 1186|  70.1k|#endif
 1187|  70.1k|  }
 1188|       |
 1189|  70.1k|  bool good = false;
 1190|       |
 1191|       |  // check capitalized form for FORCEUCASE
 1192|  70.1k|  if (pAMgr && captype == NOCAP && pAMgr->get_forceucase()) {
  ------------------
  |  |   92|   140k|#define NOCAP 0
  ------------------
  |  Branch (1192:7): [True: 70.1k, False: 0]
  |  Branch (1192:16): [True: 20.4k, False: 49.7k]
  |  Branch (1192:36): [True: 0, False: 20.4k]
  ------------------
 1193|      0|    int info = SPELL_ORIGCAP;
  ------------------
  |  |   83|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
 1194|      0|    if (checkword(scw, &info, nullptr, suggest_start)) {
  ------------------
  |  Branch (1194:9): [True: 0, False: 0]
  ------------------
 1195|      0|      std::string form(std::move(scw));
 1196|      0|      mkinitcap(form);
 1197|      0|      slst.push_back(std::move(form));
 1198|      0|      return slst;
 1199|      0|    }
 1200|      0|  }
 1201|       |
 1202|  70.1k|  switch (captype) {
  ------------------
  |  Branch (1202:11): [True: 70.1k, False: 0]
  ------------------
 1203|  20.4k|    case NOCAP: {
  ------------------
  |  |   92|  20.4k|#define NOCAP 0
  ------------------
  |  Branch (1203:5): [True: 20.4k, False: 49.7k]
  ------------------
 1204|  20.4k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1205|  20.4k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  20.4k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1205:11): [True: 0, False: 20.4k]
  ------------------
 1206|      0|          return slst;
 1207|  20.4k|      if (abbv) {
  ------------------
  |  Branch (1207:11): [True: 1.77k, False: 18.6k]
  ------------------
 1208|  1.77k|        std::string wspace(scw);
 1209|  1.77k|        wspace.push_back('.');
 1210|  1.77k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1211|  1.77k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  1.77k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1211:13): [True: 0, False: 1.77k]
  ------------------
 1212|      0|            return slst;
 1213|  1.77k|      }
 1214|  20.4k|      break;
 1215|  20.4k|    }
 1216|       |
 1217|  20.4k|    case INITCAP: {
  ------------------
  |  |   93|  12.4k|#define INITCAP 1
  ------------------
  |  Branch (1217:5): [True: 12.4k, False: 57.7k]
  ------------------
 1218|  12.4k|      capwords = true;
 1219|  12.4k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1220|  12.4k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  12.4k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1220:11): [True: 0, False: 12.4k]
  ------------------
 1221|      0|          return slst;
 1222|  12.4k|      std::string wspace(scw);
 1223|  12.4k|      mkallsmall2(wspace, sunicw);
 1224|  12.4k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1225|  12.4k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  12.4k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1225:11): [True: 0, False: 12.4k]
  ------------------
 1226|      0|          return slst;
 1227|  12.4k|      break;
 1228|  12.4k|    }
 1229|  13.9k|    case HUHINITCAP:
  ------------------
  |  |   96|  13.9k|#define HUHINITCAP 4
  ------------------
  |  Branch (1229:5): [True: 13.9k, False: 56.1k]
  ------------------
 1230|  13.9k|      capwords = true;
 1231|       |      /* FALLTHROUGH */
 1232|  27.5k|    case HUHCAP: {
  ------------------
  |  |   95|  27.5k|#define HUHCAP 3
  ------------------
  |  Branch (1232:5): [True: 13.6k, False: 56.4k]
  ------------------
 1233|  27.5k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1234|  27.5k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  27.5k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1234:11): [True: 0, False: 27.5k]
  ------------------
 1235|      0|          return slst;
 1236|       |      // something.The -> something. The
 1237|  27.5k|      size_t dot_pos = scw.find('.');
 1238|  27.5k|      if (dot_pos != std::string::npos) {
  ------------------
  |  Branch (1238:11): [True: 9.27k, False: 18.3k]
  ------------------
 1239|  9.27k|        std::string postdot = scw.substr(dot_pos + 1);
 1240|  9.27k|        int captype_;
 1241|  9.27k|        if (utf8) {
  ------------------
  |  Branch (1241:13): [True: 2.17k, False: 7.10k]
  ------------------
 1242|  2.17k|          std::vector<w_char> postdotu;
 1243|  2.17k|          u8_u16(postdotu, postdot);
 1244|  2.17k|          captype_ = get_captype_utf8(postdotu, langnum);
 1245|  7.10k|        } else {
 1246|  7.10k|          captype_ = get_captype(postdot, csconv);
 1247|  7.10k|        }
 1248|  9.27k|        if (captype_ == INITCAP) {
  ------------------
  |  |   93|  9.27k|#define INITCAP 1
  ------------------
  |  Branch (1248:13): [True: 3.97k, False: 5.30k]
  ------------------
 1249|  3.97k|          std::string str(scw);
 1250|  3.97k|          str.insert(dot_pos + 1, 1, ' ');
 1251|  3.97k|          insert_sug(slst, str);
 1252|  3.97k|        }
 1253|  9.27k|      }
 1254|       |
 1255|  27.5k|      std::string wspace;
 1256|       |
 1257|  27.5k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   96|  27.5k|#define HUHINITCAP 4
  ------------------
  |  Branch (1257:11): [True: 13.9k, False: 13.6k]
  ------------------
 1258|       |        // TheOpenOffice.org -> The OpenOffice.org
 1259|  13.9k|        wspace = scw;
 1260|  13.9k|        mkinitsmall2(wspace, sunicw);
 1261|  13.9k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1262|  13.9k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  13.9k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1262:13): [True: 0, False: 13.9k]
  ------------------
 1263|      0|            return slst;
 1264|  13.9k|      }
 1265|  27.5k|      wspace = scw;
 1266|  27.5k|      mkallsmall2(wspace, sunicw);
 1267|  27.5k|      if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1267:11): [True: 1.27k, False: 26.3k]
  ------------------
 1268|  1.27k|        insert_sug(slst, wspace);
 1269|  27.5k|      size_t prevns = slst.size();
 1270|  27.5k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1271|  27.5k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  27.5k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1271:11): [True: 2, False: 27.5k]
  ------------------
 1272|      2|          return slst;
 1273|  27.5k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   96|  27.5k|#define HUHINITCAP 4
  ------------------
  |  Branch (1273:11): [True: 13.9k, False: 13.6k]
  ------------------
 1274|  13.9k|        mkinitcap2(wspace, sunicw);
 1275|  13.9k|        if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1275:13): [True: 378, False: 13.5k]
  ------------------
 1276|    378|          insert_sug(slst, wspace);
 1277|  13.9k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1278|  13.9k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  13.9k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1278:13): [True: 0, False: 13.9k]
  ------------------
 1279|      0|            return slst;
 1280|  13.9k|      }
 1281|       |      // aNew -> "a New" (instead of "a new")
 1282|  28.5k|      for (size_t j = prevns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1282:31): [True: 989, False: 27.5k]
  ------------------
 1283|    989|        const char* space = strchr(slst[j].c_str(), ' ');
 1284|    989|        if (space) {
  ------------------
  |  Branch (1284:13): [True: 429, False: 560]
  ------------------
 1285|    429|          size_t slen = strlen(space + 1);
 1286|       |          // different case after space (need capitalisation)
 1287|    429|          if ((slen < wl) && strcmp(scw.c_str() + wl - slen, space + 1) != 0) {
  ------------------
  |  Branch (1287:15): [True: 429, False: 0]
  |  Branch (1287:30): [True: 394, False: 35]
  ------------------
 1288|    394|            std::string first(slst[j].c_str(), space + 1);
 1289|    394|            std::string second(space + 1);
 1290|    394|            std::vector<w_char> w;
 1291|    394|            if (utf8)
  ------------------
  |  Branch (1291:17): [True: 116, False: 278]
  ------------------
 1292|    116|              u8_u16(w, second);
 1293|    394|            mkinitcap2(second, w);
 1294|       |            // set as first suggestion
 1295|    394|            slst.erase(slst.begin() + j);
 1296|    394|            slst.insert(slst.begin(), first + second);
 1297|    394|          }
 1298|    429|        }
 1299|    989|      }
 1300|  27.5k|      break;
 1301|  27.5k|    }
 1302|       |
 1303|  9.70k|    case ALLCAP: {
  ------------------
  |  |   94|  9.70k|#define ALLCAP 2
  ------------------
  |  Branch (1303:5): [True: 9.70k, False: 60.4k]
  ------------------
 1304|  9.70k|      std::string wspace(scw);
 1305|  9.70k|      mkallsmall2(wspace, sunicw);
 1306|  9.70k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1307|  9.70k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  9.70k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1307:11): [True: 0, False: 9.70k]
  ------------------
 1308|      0|          return slst;
 1309|  9.70k|      if (pAMgr && pAMgr->get_keepcase() && spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1309:11): [True: 9.70k, False: 0]
  |  Branch (1309:20): [True: 431, False: 9.27k]
  |  Branch (1309:45): [True: 0, False: 431]
  ------------------
 1310|      0|        insert_sug(slst, wspace);
 1311|  9.70k|      mkinitcap2(wspace, sunicw);
 1312|  9.70k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1313|  9.70k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  9.70k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1313:11): [True: 0, False: 9.70k]
  ------------------
 1314|      0|          return slst;
 1315|  9.70k|      for (auto& j : slst) {
  ------------------
  |  Branch (1315:20): [True: 674, False: 9.70k]
  ------------------
 1316|    674|        mkallcap(j);
 1317|    674|        if (pAMgr && pAMgr->get_checksharps()) {
  ------------------
  |  Branch (1317:13): [True: 674, False: 0]
  |  Branch (1317:22): [True: 0, False: 674]
  ------------------
 1318|      0|          if (utf8) {
  ------------------
  |  Branch (1318:15): [True: 0, False: 0]
  ------------------
 1319|      0|            mystrrep(j, "\xC3\x9F", "SS");
 1320|      0|          } else {
 1321|      0|            mystrrep(j, "\xDF", "SS");
 1322|      0|          }
 1323|      0|        }
 1324|    674|      }
 1325|  9.70k|      break;
 1326|  9.70k|    }
 1327|  70.1k|  }
 1328|       |
 1329|       |  // LANG_hu section: replace '-' with ' ' in Hungarian
 1330|  70.1k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1330:7): [True: 3.85k, False: 66.2k]
  ------------------
 1331|  3.85k|    for (auto& j : slst) {
  ------------------
  |  Branch (1331:18): [True: 339, False: 3.85k]
  ------------------
 1332|    339|      size_t pos = j.find('-');
 1333|    339|      if (pos != std::string::npos) {
  ------------------
  |  Branch (1333:11): [True: 101, False: 238]
  ------------------
 1334|    101|        int info = 0;
 1335|    101|        std::string w(j.substr(0, pos));
 1336|    101|        w.append(j.substr(pos + 1));
 1337|    101|        (void)spell(w, spell_candidate_stack, &info, nullptr, suggest_start);
 1338|    101|        if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   78|    101|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
                      if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   79|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (1338:13): [True: 0, False: 101]
  |  Branch (1338:40): [True: 0, False: 0]
  ------------------
 1339|      0|          j[pos] = ' ';
 1340|      0|        } else
 1341|    101|          j[pos] = '-';
 1342|    101|      }
 1343|    339|    }
 1344|  3.85k|  }
 1345|       |  // END OF LANG_hu section
 1346|       |  // try ngram approach since found nothing good suggestion
 1347|  70.1k|  if (!good && pAMgr && (slst.empty() || onlycmpdsug) && (pAMgr->get_maxngramsugs() != 0)) {
  ------------------
  |  Branch (1347:7): [True: 70.0k, False: 58]
  |  Branch (1347:16): [True: 70.0k, False: 0]
  |  Branch (1347:26): [True: 61.6k, False: 8.38k]
  |  Branch (1347:42): [True: 8.19k, False: 190]
  |  Branch (1347:58): [True: 62.2k, False: 7.59k]
  ------------------
 1348|  62.2k|    switch (captype) {
  ------------------
  |  Branch (1348:13): [True: 62.2k, False: 0]
  ------------------
 1349|  17.3k|      case NOCAP: {
  ------------------
  |  |   92|  17.3k|#define NOCAP 0
  ------------------
  |  Branch (1349:7): [True: 17.3k, False: 44.9k]
  ------------------
 1350|  17.3k|        pSMgr->ngsuggest(slst, scw.c_str(), m_HMgrs, NOCAP);
  ------------------
  |  |   92|  17.3k|#define NOCAP 0
  ------------------
 1351|  17.3k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  17.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1351:13): [True: 0, False: 17.3k]
  ------------------
 1352|      0|            return slst;
 1353|  17.3k|        break;
 1354|  17.3k|      }
 1355|       |      /* FALLTHROUGH */
 1356|  17.3k|      case HUHINITCAP:
  ------------------
  |  |   96|  13.2k|#define HUHINITCAP 4
  ------------------
  |  Branch (1356:7): [True: 13.2k, False: 49.0k]
  ------------------
 1357|  13.2k|        capwords = true;
 1358|       |      /* FALLTHROUGH */
 1359|  25.8k|      case HUHCAP: {
  ------------------
  |  |   95|  25.8k|#define HUHCAP 3
  ------------------
  |  Branch (1359:7): [True: 12.6k, False: 49.6k]
  ------------------
 1360|  25.8k|        std::string wspace(scw);
 1361|  25.8k|        mkallsmall2(wspace, sunicw);
 1362|  25.8k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, HUHCAP);
  ------------------
  |  |   95|  25.8k|#define HUHCAP 3
  ------------------
 1363|  25.8k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  25.8k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1363:13): [True: 0, False: 25.8k]
  ------------------
 1364|      0|            return slst;
 1365|  25.8k|        break;
 1366|  25.8k|      }
 1367|  25.8k|      case INITCAP: {
  ------------------
  |  |   93|  10.5k|#define INITCAP 1
  ------------------
  |  Branch (1367:7): [True: 10.5k, False: 51.7k]
  ------------------
 1368|  10.5k|        capwords = true;
 1369|  10.5k|        std::string wspace(scw);
 1370|  10.5k|        mkallsmall2(wspace, sunicw);
 1371|  10.5k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, INITCAP);
  ------------------
  |  |   93|  10.5k|#define INITCAP 1
  ------------------
 1372|  10.5k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  10.5k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1372:13): [True: 0, False: 10.5k]
  ------------------
 1373|      0|            return slst;
 1374|  10.5k|        break;
 1375|  10.5k|      }
 1376|  10.5k|      case ALLCAP: {
  ------------------
  |  |   94|  8.49k|#define ALLCAP 2
  ------------------
  |  Branch (1376:7): [True: 8.49k, False: 53.7k]
  ------------------
 1377|  8.49k|        std::string wspace(scw);
 1378|  8.49k|        mkallsmall2(wspace, sunicw);
 1379|  8.49k|        size_t oldns = slst.size();
 1380|  8.49k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, ALLCAP);
  ------------------
  |  |   94|  8.49k|#define ALLCAP 2
  ------------------
 1381|  8.49k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  8.49k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1381:13): [True: 0, False: 8.49k]
  ------------------
 1382|      0|            return slst;
 1383|  10.6k|        for (size_t j = oldns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1383:32): [True: 2.13k, False: 8.49k]
  ------------------
 1384|  2.13k|          mkallcap(slst[j]);
 1385|  2.13k|        }
 1386|  8.49k|        break;
 1387|  8.49k|      }
 1388|  62.2k|    }
 1389|  62.2k|  }
 1390|       |
 1391|       |  // try dash suggestion (Afo-American -> Afro-American)
 1392|       |  // Note: LibreOffice was modified to treat dashes as word
 1393|       |  // characters to check "scot-free" etc. word forms, but
 1394|       |  // we need to handle suggestions for "Afo-American", etc.,
 1395|       |  // while "Afro-American" is missing from the dictionary.
 1396|       |  // TODO avoid possible overgeneration
 1397|  70.1k|  size_t dash_pos = scw.find('-');
 1398|  70.1k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1398:7): [True: 34.4k, False: 35.6k]
  ------------------
 1399|  34.4k|    int nodashsug = 1;
 1400|  42.8k|    for (size_t j = 0; j < slst.size() && nodashsug == 1; ++j) {
  ------------------
  |  Branch (1400:24): [True: 8.95k, False: 33.8k]
  |  Branch (1400:43): [True: 8.39k, False: 565]
  ------------------
 1401|  8.39k|      if (slst[j].find('-') != std::string::npos)
  ------------------
  |  Branch (1401:11): [True: 4.37k, False: 4.01k]
  ------------------
 1402|  4.37k|        nodashsug = 0;
 1403|  8.39k|    }
 1404|       |
 1405|  34.4k|    size_t prev_pos = 0;
 1406|  34.4k|    bool last = false;
 1407|       |
 1408|   107k|    while (!good && nodashsug && !last) {
  ------------------
  |  Branch (1408:12): [True: 107k, False: 28]
  |  Branch (1408:21): [True: 74.0k, False: 33.8k]
  |  Branch (1408:34): [True: 73.4k, False: 583]
  ------------------
 1409|  73.4k|      if (dash_pos == scw.size())
  ------------------
  |  Branch (1409:11): [True: 5.57k, False: 67.9k]
  ------------------
 1410|  5.57k|        last = true;
 1411|  73.4k|      std::string chunk = scw.substr(prev_pos, dash_pos - prev_pos);
 1412|  73.4k|      if (chunk != word && !spell(chunk, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1412:11): [True: 73.4k, False: 0]
  |  Branch (1412:28): [True: 29.4k, False: 44.0k]
  ------------------
 1413|  29.4k|        std::vector<std::string> nlst = suggest(chunk, suggest_candidate_stack, suggest_start);
 1414|  29.4k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  29.4k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1414:13): [True: 1, False: 29.4k]
  ------------------
 1415|      1|            return slst;
 1416|  40.2k|        for (auto j = nlst.rbegin(); j != nlst.rend(); ++j) {
  ------------------
  |  Branch (1416:38): [True: 10.8k, False: 29.4k]
  ------------------
 1417|  10.8k|          std::string wspace = scw.substr(0, prev_pos);
 1418|  10.8k|          wspace.append(*j);
 1419|  10.8k|          if (!last) {
  ------------------
  |  Branch (1419:15): [True: 9.23k, False: 1.59k]
  ------------------
 1420|  9.23k|            wspace.append("-");
 1421|  9.23k|            wspace.append(scw.substr(dash_pos + 1));
 1422|  9.23k|          }
 1423|  10.8k|          int info = 0;
 1424|  10.8k|          if (pAMgr && pAMgr->get_forbiddenword())
  ------------------
  |  Branch (1424:15): [True: 10.8k, False: 0]
  |  Branch (1424:24): [True: 10.8k, False: 0]
  ------------------
 1425|  10.8k|            checkword(wspace, &info, nullptr, suggest_start);
 1426|  10.8k|          if (!(info & SPELL_FORBIDDEN))
  ------------------
  |  |   79|  10.8k|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (1426:15): [True: 10.8k, False: 0]
  ------------------
 1427|  10.8k|            insert_sug(slst, wspace);
 1428|  10.8k|        }
 1429|  29.4k|        nodashsug = 0;
 1430|  29.4k|      }
 1431|  73.4k|      if (!last) {
  ------------------
  |  Branch (1431:11): [True: 67.9k, False: 5.57k]
  ------------------
 1432|  67.9k|        prev_pos = dash_pos + 1;
 1433|  67.9k|        dash_pos = scw.find('-', prev_pos);
 1434|  67.9k|      }
 1435|  73.4k|      if (dash_pos == std::string::npos)
  ------------------
  |  Branch (1435:11): [True: 12.6k, False: 60.8k]
  ------------------
 1436|  12.6k|        dash_pos = scw.size();
 1437|  73.4k|    }
 1438|  34.4k|  }
 1439|  70.1k|  return slst;
 1440|  70.1k|}
_ZN12HunspellImpl4stemERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
 1446|  1.14k|std::vector<std::string> HunspellImpl::stem(const std::vector<std::string>& desc) {
 1447|  1.14k|  std::vector<std::string> slst;
 1448|       |
 1449|  1.14k|  std::string result2;
 1450|  1.14k|  if (desc.empty())
  ------------------
  |  Branch (1450:7): [True: 1.04k, False: 99]
  ------------------
 1451|  1.04k|    return slst;
 1452|    109|  for (const auto& i : desc) {
  ------------------
  |  Branch (1452:22): [True: 109, False: 99]
  ------------------
 1453|    109|    std::string result;
 1454|       |
 1455|       |    // add compound word parts (except the last one)
 1456|    109|    std::string tok(i, append_compound_parts(i, result));
 1457|    109|    size_t alt = 0;
 1458|    109|    while ((alt = tok.find(" | ", alt)) != std::string::npos) {
  ------------------
  |  Branch (1458:12): [True: 0, False: 109]
  ------------------
 1459|      0|      tok[alt + 1] = MSEP_ALT;
  ------------------
  |  |  123|      0|#define MSEP_ALT '\v'
  ------------------
 1460|      0|    }
 1461|    109|    std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  123|    109|#define MSEP_ALT '\v'
  ------------------
 1462|    109|    for (auto& k : pl) {
  ------------------
  |  Branch (1462:18): [True: 109, False: 109]
  ------------------
 1463|       |      // add derivational suffixes
 1464|    109|      if (k.find(MORPH_DERI_SFX) != std::string::npos) {
  ------------------
  |  |  109|    109|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (1464:11): [True: 0, False: 109]
  ------------------
 1465|       |        // remove inflectional suffixes
 1466|      0|        const size_t is = k.find(MORPH_INFL_SFX);
  ------------------
  |  |  110|      0|#define MORPH_INFL_SFX "is:"
  ------------------
 1467|      0|        if (is != std::string::npos)
  ------------------
  |  Branch (1467:13): [True: 0, False: 0]
  ------------------
 1468|      0|          k.resize(is);
 1469|      0|        std::vector<std::string> singlepl;
 1470|      0|        singlepl.push_back(k);
 1471|      0|        std::string sg = pSMgr->suggest_gen(singlepl, k);
 1472|      0|        if (!sg.empty()) {
  ------------------
  |  Branch (1472:13): [True: 0, False: 0]
  ------------------
 1473|      0|          std::vector<std::string> gen = line_tok(sg, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1474|      0|          for (auto& j : gen) {
  ------------------
  |  Branch (1474:24): [True: 0, False: 0]
  ------------------
 1475|      0|            result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1476|      0|            result2.append(result);
 1477|      0|            result2.append(j);
 1478|      0|          }
 1479|      0|        }
 1480|    109|      } else {
 1481|    109|        result2.push_back(MSEP_REC);
  ------------------
  |  |  122|    109|#define MSEP_REC '\n'
  ------------------
 1482|    109|        result2.append(result);
 1483|    109|        if (k.find(MORPH_SURF_PFX) != std::string::npos) {
  ------------------
  |  |  112|    109|#define MORPH_SURF_PFX "sp:"
  ------------------
  |  Branch (1483:13): [True: 0, False: 109]
  ------------------
 1484|      0|          std::string field;
 1485|      0|          copy_field(field, k, MORPH_SURF_PFX);
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
 1486|      0|          result2.append(field);
 1487|      0|        }
 1488|    109|        std::string field;
 1489|    109|        copy_field(field, k, MORPH_STEM);
  ------------------
  |  |  103|    109|#define MORPH_STEM "st:"
  ------------------
 1490|    109|        result2.append(field);
 1491|    109|      }
 1492|    109|    }
 1493|    109|  }
 1494|     99|  slst = line_tok(result2, MSEP_REC);
  ------------------
  |  |  122|     99|#define MSEP_REC '\n'
  ------------------
 1495|     99|  uniqlist(slst);
 1496|     99|  return slst;
 1497|  1.14k|}
_ZN12HunspellImpl4stemERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1499|  1.14k|std::vector<std::string> HunspellImpl::stem(const std::string& word) {
 1500|  1.14k|  return stem(analyze(word));
 1501|  1.14k|}
_ZN12HunspellImpl9mkinitcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1511|  18.0k|void HunspellImpl::mkinitcap(std::string& u8) {
 1512|  18.0k|  if (utf8) {
  ------------------
  |  Branch (1512:7): [True: 5.79k, False: 12.2k]
  ------------------
 1513|  5.79k|    std::vector<w_char> u16;
 1514|  5.79k|    u8_u16(u16, u8);
 1515|  5.79k|    ::mkinitcap_utf(u16, langnum);
 1516|  5.79k|    u16_u8(u8, u16);
 1517|  12.2k|  } else {
 1518|  12.2k|    ::mkinitcap(u8, csconv);
 1519|  12.2k|  }
 1520|  18.0k|}
_ZN12HunspellImpl10mkinitcap2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1522|  1.36M|int HunspellImpl::mkinitcap2(std::string& u8, std::vector<w_char>& u16) {
 1523|  1.36M|  if (utf8) {
  ------------------
  |  Branch (1523:7): [True: 262k, False: 1.10M]
  ------------------
 1524|   262k|    ::mkinitcap_utf(u16, langnum);
 1525|   262k|    u16_u8(u8, u16);
 1526|  1.10M|  } else {
 1527|  1.10M|    ::mkinitcap(u8, csconv);
 1528|  1.10M|  }
 1529|  1.36M|  return u8.size();
 1530|  1.36M|}
_ZN12HunspellImpl12mkinitsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1532|   223k|int HunspellImpl::mkinitsmall2(std::string& u8, std::vector<w_char>& u16) {
 1533|   223k|  if (utf8) {
  ------------------
  |  Branch (1533:7): [True: 44.6k, False: 179k]
  ------------------
 1534|  44.6k|    ::mkinitsmall_utf(u16, langnum);
 1535|  44.6k|    u16_u8(u8, u16);
 1536|   179k|  } else {
 1537|   179k|    ::mkinitsmall(u8, csconv);
 1538|   179k|  }
 1539|   223k|  return u8.size();
 1540|   223k|}
_ZN12HunspellImpl3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1542|  5.69k|int HunspellImpl::add(const std::string& word) {
 1543|  5.69k|  if (!m_HMgrs.empty())
  ------------------
  |  Branch (1543:7): [True: 5.69k, False: 0]
  ------------------
 1544|  5.69k|    return m_HMgrs[0]->add(word);
 1545|      0|  return 0;
 1546|  5.69k|}
_ZN12HunspellImpl14add_with_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 1554|  2.33k|int HunspellImpl::add_with_affix(const std::string& word, const std::string& example) {
 1555|  2.33k|  if (!m_HMgrs.empty())
  ------------------
  |  Branch (1555:7): [True: 2.33k, False: 0]
  ------------------
 1556|  2.33k|    return m_HMgrs[0]->add_with_affix(word, example);
 1557|      0|  return 0;
 1558|  2.33k|}
_ZN12HunspellImpl10cat_resultERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
 1577|   433k|void HunspellImpl::cat_result(std::string& result, const std::string& st) {
 1578|   433k|  if (!st.empty()) {
  ------------------
  |  Branch (1578:7): [True: 2.82k, False: 431k]
  ------------------
 1579|  2.82k|    if (!result.empty())
  ------------------
  |  Branch (1579:9): [True: 0, False: 2.82k]
  ------------------
 1580|      0|      result.append("\n");
 1581|  2.82k|    result.append(st);
 1582|  2.82k|  }
 1583|   433k|}
_ZN12HunspellImpl7analyzeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1585|  7.98k|std::vector<std::string> HunspellImpl::analyze(const std::string& word) {
 1586|  7.98k|  std::vector<std::string> slst = analyze_internal(word);
 1587|       |  // output conversion
 1588|  7.98k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1588:17): [True: 7.98k, False: 0]
  ------------------
 1589|  7.98k|  if (rl) {
  ------------------
  |  Branch (1589:7): [True: 416, False: 7.56k]
  ------------------
 1590|       |    // the output conversion can multiply the length of every line, so hold the
 1591|       |    // converted analysis to the same ceiling as the raw analysis
 1592|    416|    size_t total = 0;
 1593|    416|    size_t i = 0;
 1594|    515|    for (; i < slst.size(); ++i) {
  ------------------
  |  Branch (1594:12): [True: 99, False: 416]
  ------------------
 1595|     99|      std::string wspace;
 1596|     99|      if (rl->conv(slst[i], wspace)) {
  ------------------
  |  Branch (1596:11): [True: 2, False: 97]
  ------------------
 1597|      2|        slst[i] = std::move(wspace);
 1598|      2|      }
 1599|     99|      total += slst[i].size();
 1600|     99|      if (total > MAXMORPHRESULT) {
  ------------------
  |  |  111|     99|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1600:11): [True: 0, False: 99]
  ------------------
 1601|      0|        ++i;
 1602|      0|        break;
 1603|      0|      }
 1604|     99|    }
 1605|    416|    slst.resize(i);
 1606|    416|  }
 1607|  7.98k|  return slst;
 1608|  7.98k|}
_ZN12HunspellImpl16analyze_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1610|  7.98k|std::vector<std::string> HunspellImpl::analyze_internal(const std::string& word) {
 1611|  7.98k|  std::vector<std::string> candidate_stack, slst;
 1612|  7.98k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1612:7): [True: 0, False: 7.98k]
  |  Branch (1612:17): [True: 0, False: 7.98k]
  ------------------
 1613|      0|    return slst;
 1614|  7.98k|  if (utf8) {
  ------------------
  |  Branch (1614:7): [True: 3.75k, False: 4.22k]
  ------------------
 1615|  3.75k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   86|  3.75k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  3.75k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1615:9): [True: 342, False: 3.41k]
  ------------------
 1616|    342|      return slst;
 1617|  4.22k|  } else {
 1618|  4.22k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  4.22k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1618:9): [True: 570, False: 3.65k]
  ------------------
 1619|    570|      return slst;
 1620|  4.22k|  }
 1621|  7.06k|  int captype = NOCAP;
  ------------------
  |  |   92|  7.06k|#define NOCAP 0
  ------------------
 1622|  7.06k|  size_t abbv = 0;
 1623|  7.06k|  size_t wl = 0;
 1624|       |
 1625|  7.06k|  std::string scw;
 1626|  7.06k|  std::vector<w_char> sunicw;
 1627|       |
 1628|       |  // input conversion
 1629|  7.06k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1629:17): [True: 7.06k, False: 0]
  ------------------
 1630|  7.06k|  {
 1631|  7.06k|    std::string wspace;
 1632|       |
 1633|  7.06k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1633:23): [True: 378, False: 6.69k]
  ------------------
 1634|  7.06k|    if (convstatus) {
  ------------------
  |  Branch (1634:9): [True: 0, False: 7.06k]
  ------------------
 1635|       |      // the input conversion can grow the word without limit, so hold the
 1636|       |      // converted word to the same maximum length as the raw word
 1637|      0|      if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   86|      0|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                    if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   90|      0|#define MAXWORDLEN 100
  ------------------
  |  Branch (1637:11): [True: 0, False: 0]
  |  Branch (1637:11): [True: 0, False: 0]
  ------------------
 1638|      0|        return slst;
 1639|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1640|      0|    } else
 1641|  7.06k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1642|       |
 1643|  7.06k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1644|  7.06k|    if (wl > 32768)
  ------------------
  |  Branch (1644:9): [True: 0, False: 7.06k]
  ------------------
 1645|      0|      return slst;
 1646|  7.06k|#endif
 1647|  7.06k|  }
 1648|       |
 1649|  7.06k|  if (wl == 0) {
  ------------------
  |  Branch (1649:7): [True: 450, False: 6.61k]
  ------------------
 1650|    450|    if (abbv) {
  ------------------
  |  Branch (1650:9): [True: 266, False: 184]
  ------------------
 1651|    266|      scw.clear();
 1652|  4.61k|      for (wl = 0; wl < abbv; wl++)
  ------------------
  |  Branch (1652:20): [True: 4.35k, False: 266]
  ------------------
 1653|  4.35k|        scw.push_back('.');
 1654|    266|      abbv = 0;
 1655|    266|    } else
 1656|    184|      return slst;
 1657|    450|  }
 1658|       |
 1659|  6.88k|  std::string result;
 1660|       |
 1661|  6.88k|  auto suggest_start = std::chrono::steady_clock::now();
 1662|       |
 1663|  6.88k|  size_t n = 0;
 1664|       |  // test numbers
 1665|       |  // LANG_hu section: set dash information for suggestions
 1666|  6.88k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1666:7): [True: 369, False: 6.51k]
  ------------------
 1667|    369|    size_t n2 = 0;
 1668|    369|    size_t n3 = 0;
 1669|       |
 1670|    498|    while ((n < wl) && (((scw[n] <= '9') && (scw[n] >= '0')) ||
  ------------------
  |  Branch (1670:12): [True: 478, False: 20]
  |  Branch (1670:26): [True: 270, False: 208]
  |  Branch (1670:45): [True: 129, False: 141]
  ------------------
 1671|    349|                        (((scw[n] == '.') || (scw[n] == ',')) && (n > 0)))) {
  ------------------
  |  Branch (1671:27): [True: 23, False: 326]
  |  Branch (1671:46): [True: 0, False: 326]
  |  Branch (1671:66): [True: 0, False: 23]
  ------------------
 1672|    129|      n++;
 1673|    129|      if ((scw[n] == '.') || (scw[n] == ',')) {
  ------------------
  |  Branch (1673:11): [True: 0, False: 129]
  |  Branch (1673:30): [True: 0, False: 129]
  ------------------
 1674|      0|        if (((n2 == 0) && (n > 3)) ||
  ------------------
  |  Branch (1674:14): [True: 0, False: 0]
  |  Branch (1674:27): [True: 0, False: 0]
  ------------------
 1675|      0|            ((n2 > 0) && ((scw[n - 1] == '.') || (scw[n - 1] == ','))))
  ------------------
  |  Branch (1675:14): [True: 0, False: 0]
  |  Branch (1675:27): [True: 0, False: 0]
  |  Branch (1675:50): [True: 0, False: 0]
  ------------------
 1676|      0|          break;
 1677|      0|        n2++;
 1678|      0|        n3 = n;
 1679|      0|      }
 1680|    129|    }
 1681|       |
 1682|    369|    if ((n == wl) && (n3 > 0) && (n - n3 > 3))
  ------------------
  |  Branch (1682:9): [True: 20, False: 349]
  |  Branch (1682:22): [True: 0, False: 20]
  |  Branch (1682:34): [True: 0, False: 0]
  ------------------
 1683|      0|      return slst;
 1684|    369|    if ((n == wl) || ((n > 0) && ((scw[n] == '%') || (scw[n] == '\xB0')) && checkword(scw.substr(n), nullptr, nullptr, suggest_start))) {
  ------------------
  |  Branch (1684:9): [True: 20, False: 349]
  |  Branch (1684:9): [True: 20, False: 349]
  |  Branch (1684:23): [True: 6, False: 343]
  |  Branch (1684:35): [True: 0, False: 6]
  |  Branch (1684:54): [True: 0, False: 6]
  |  Branch (1684:77): [True: 0, False: 0]
  ------------------
 1685|     20|      result.append(scw);
 1686|     20|      result.resize(n - 1);
 1687|     20|      if (n == wl)
  ------------------
  |  Branch (1687:11): [True: 20, False: 0]
  ------------------
 1688|     20|        cat_result(result, pSMgr->suggest_morph(scw.substr(n - 1)));
 1689|      0|      else {
 1690|      0|        std::string chunk = scw.substr(n - 1, 1);
 1691|      0|        cat_result(result, pSMgr->suggest_morph(chunk));
 1692|      0|        result.push_back('+');  // XXX SPEC. MORPHCODE
 1693|      0|        cat_result(result, pSMgr->suggest_morph(scw.substr(n)));
 1694|      0|      }
 1695|     20|      return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|     20|#define MSEP_REC '\n'
  ------------------
 1696|     20|    }
 1697|    369|  }
 1698|       |  // END OF LANG_hu section
 1699|       |
 1700|  6.86k|  switch (captype) {
  ------------------
  |  Branch (1700:11): [True: 6.86k, False: 0]
  ------------------
 1701|    241|    case HUHCAP:
  ------------------
  |  |   95|    241|#define HUHCAP 3
  ------------------
  |  Branch (1701:5): [True: 241, False: 6.62k]
  ------------------
 1702|    609|    case HUHINITCAP:
  ------------------
  |  |   96|    609|#define HUHINITCAP 4
  ------------------
  |  Branch (1702:5): [True: 368, False: 6.49k]
  ------------------
 1703|  2.66k|    case NOCAP: {
  ------------------
  |  |   92|  2.66k|#define NOCAP 0
  ------------------
  |  Branch (1703:5): [True: 2.05k, False: 4.81k]
  ------------------
 1704|  2.66k|      cat_result(result, pSMgr->suggest_morph(scw));
 1705|  2.66k|      if (abbv) {
  ------------------
  |  Branch (1705:11): [True: 273, False: 2.39k]
  ------------------
 1706|    273|        std::string u8buffer(scw);
 1707|    273|        u8buffer.push_back('.');
 1708|    273|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1709|    273|      }
 1710|  2.66k|      break;
 1711|    609|    }
 1712|  2.33k|    case INITCAP: {
  ------------------
  |  |   93|  2.33k|#define INITCAP 1
  ------------------
  |  Branch (1712:5): [True: 2.33k, False: 4.52k]
  ------------------
 1713|  2.33k|      mkallsmall2(scw, sunicw);
 1714|  2.33k|      std::string u8buffer(scw);
 1715|  2.33k|      mkinitcap2(scw, sunicw);
 1716|  2.33k|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1717|  2.33k|      cat_result(result, pSMgr->suggest_morph(scw));
 1718|  2.33k|      if (abbv) {
  ------------------
  |  Branch (1718:11): [True: 219, False: 2.12k]
  ------------------
 1719|    219|        u8buffer.push_back('.');
 1720|    219|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1721|       |
 1722|    219|        u8buffer = scw;
 1723|    219|        u8buffer.push_back('.');
 1724|       |
 1725|    219|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1726|    219|      }
 1727|  2.33k|      break;
 1728|    609|    }
 1729|  1.86k|    case ALLCAP: {
  ------------------
  |  |   94|  1.86k|#define ALLCAP 2
  ------------------
  |  Branch (1729:5): [True: 1.86k, False: 5.00k]
  ------------------
 1730|  1.86k|      cat_result(result, pSMgr->suggest_morph(scw));
 1731|  1.86k|      if (abbv) {
  ------------------
  |  Branch (1731:11): [True: 186, False: 1.67k]
  ------------------
 1732|    186|        std::string u8buffer(scw);
 1733|    186|        u8buffer.push_back('.');
 1734|    186|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1735|    186|      }
 1736|  1.86k|      mkallsmall2(scw, sunicw);
 1737|  1.86k|      std::string u8buffer(scw);
 1738|  1.86k|      mkinitcap2(scw, sunicw);
 1739|       |
 1740|  1.86k|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1741|  1.86k|      cat_result(result, pSMgr->suggest_morph(scw));
 1742|  1.86k|      if (abbv) {
  ------------------
  |  Branch (1742:11): [True: 186, False: 1.67k]
  ------------------
 1743|    186|        u8buffer.push_back('.');
 1744|    186|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1745|       |
 1746|    186|        u8buffer = scw;
 1747|    186|        u8buffer.push_back('.');
 1748|       |
 1749|    186|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1750|    186|      }
 1751|  1.86k|      break;
 1752|    609|    }
 1753|  6.86k|  }
 1754|       |
 1755|  6.86k|  if (!result.empty()) {
  ------------------
  |  Branch (1755:7): [True: 2.81k, False: 4.05k]
  ------------------
 1756|       |    // word reversing wrapper for complex prefixes
 1757|  2.81k|    if (complexprefixes) {
  ------------------
  |  Branch (1757:9): [True: 190, False: 2.62k]
  ------------------
 1758|    190|      if (utf8)
  ------------------
  |  Branch (1758:11): [True: 0, False: 190]
  ------------------
 1759|      0|        reverseword_utf(result);
 1760|    190|      else
 1761|    190|        reverseword(result);
 1762|    190|    }
 1763|  2.81k|    return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|  2.81k|#define MSEP_REC '\n'
  ------------------
 1764|  2.81k|  }
 1765|       |
 1766|       |  // compound word with dash (HU) I18n
 1767|       |  // LANG_hu section: set dash information for suggestions
 1768|       |
 1769|  4.05k|  size_t dash_pos = langnum == LANG_hu ? scw.find('-') : std::string::npos;
  ------------------
  |  Branch (1769:21): [True: 262, False: 3.79k]
  ------------------
 1770|  4.05k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1770:7): [True: 17, False: 4.03k]
  ------------------
 1771|     17|    int nresult = 0;
 1772|       |
 1773|     17|    std::string part1 = scw.substr(0, dash_pos), part2 = scw.substr(dash_pos + 1);
 1774|       |
 1775|       |    // examine 2 sides of the dash
 1776|     17|    if (part2.empty()) {  // base word ending with dash
  ------------------
  |  Branch (1776:9): [True: 6, False: 11]
  ------------------
 1777|      6|      if (spell(part1, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1777:11): [True: 1, False: 5]
  ------------------
 1778|      1|        std::string p = pSMgr->suggest_morph(part1);
 1779|      1|        if (!p.empty()) {
  ------------------
  |  Branch (1779:13): [True: 0, False: 1]
  ------------------
 1780|      0|          slst = line_tok(p, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1781|      0|          return slst;
 1782|      0|        }
 1783|      1|      }
 1784|     11|    } else if (part2.size() == 1 && part2[0] == 'e') {  // XXX (HU) -e hat.
  ------------------
  |  Branch (1784:16): [True: 2, False: 9]
  |  Branch (1784:37): [True: 0, False: 2]
  ------------------
 1785|      0|      if (spell(part1, candidate_stack, nullptr, nullptr, suggest_start) &&
  ------------------
  |  Branch (1785:11): [True: 0, False: 0]
  |  Branch (1785:11): [True: 0, False: 0]
  ------------------
 1786|      0|          (spell("-e", candidate_stack, nullptr, nullptr, suggest_start))) {
  ------------------
  |  Branch (1786:11): [True: 0, False: 0]
  ------------------
 1787|      0|        std::string st = pSMgr->suggest_morph(part1);
 1788|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1788:13): [True: 0, False: 0]
  ------------------
 1789|      0|          result.append(st);
 1790|      0|        }
 1791|      0|        result.push_back('+');  // XXX spec. separator in MORPHCODE
 1792|      0|        st = pSMgr->suggest_morph("-e");
 1793|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1793:13): [True: 0, False: 0]
  ------------------
 1794|      0|          result.append(st);
 1795|      0|        }
 1796|      0|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1797|      0|      }
 1798|     11|    } else {
 1799|       |      // first word ending with dash: word- XXX ???
 1800|     11|      part1.push_back(' ');
 1801|     11|      nresult = spell(part1, candidate_stack, nullptr, nullptr, suggest_start);
 1802|     11|      part1.erase(part1.size() - 1);
 1803|     11|      if (nresult && spell(part2, candidate_stack, nullptr, nullptr, suggest_start) &&
  ------------------
  |  Branch (1803:11): [True: 1, False: 10]
  |  Branch (1803:22): [True: 1, False: 0]
  ------------------
 1804|      1|          ((part2.size() > 1) || ((part2[0] > '0') && (part2[0] < '9')))) {
  ------------------
  |  Branch (1804:12): [True: 0, False: 1]
  |  Branch (1804:35): [True: 1, False: 0]
  |  Branch (1804:55): [True: 1, False: 0]
  ------------------
 1805|      1|        std::string st = pSMgr->suggest_morph(part1);
 1806|      1|        if (!st.empty()) {
  ------------------
  |  Branch (1806:13): [True: 0, False: 1]
  ------------------
 1807|      0|          result.append(st);
 1808|      0|          result.push_back('+');  // XXX spec. separator in MORPHCODE
 1809|      0|        }
 1810|      1|        st = pSMgr->suggest_morph(part2);
 1811|      1|        if (!st.empty()) {
  ------------------
  |  Branch (1811:13): [True: 0, False: 1]
  ------------------
 1812|      0|          result.append(st);
 1813|      0|        }
 1814|      1|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      1|#define MSEP_REC '\n'
  ------------------
 1815|      1|      }
 1816|     11|    }
 1817|       |    // affixed number in correct word
 1818|     16|    if (nresult && (dash_pos > 0) &&
  ------------------
  |  Branch (1818:9): [True: 0, False: 16]
  |  Branch (1818:20): [True: 0, False: 0]
  ------------------
 1819|      0|        (((scw[dash_pos - 1] <= '9') && (scw[dash_pos - 1] >= '0')) ||
  ------------------
  |  Branch (1819:11): [True: 0, False: 0]
  |  Branch (1819:41): [True: 0, False: 0]
  ------------------
 1820|      0|         (scw[dash_pos - 1] == '.'))) {
  ------------------
  |  Branch (1820:10): [True: 0, False: 0]
  ------------------
 1821|      0|      n = 1;
 1822|      0|      if (scw[dash_pos - n] == '.')
  ------------------
  |  Branch (1822:11): [True: 0, False: 0]
  ------------------
 1823|      0|        n++;
 1824|       |      // search first not a number character to left from dash
 1825|      0|      while ((dash_pos >= n) && ((scw[dash_pos - n] == '0') || (n < 3)) &&
  ------------------
  |  Branch (1825:14): [True: 0, False: 0]
  |  Branch (1825:34): [True: 0, False: 0]
  |  Branch (1825:64): [True: 0, False: 0]
  ------------------
 1826|      0|             (n < 6)) {
  ------------------
  |  Branch (1826:14): [True: 0, False: 0]
  ------------------
 1827|      0|        n++;
 1828|      0|      }
 1829|      0|      if (dash_pos < n)
  ------------------
  |  Branch (1829:11): [True: 0, False: 0]
  ------------------
 1830|      0|        n--;
 1831|       |      // numbers: valami1000000-hoz
 1832|       |      // examine 100000-hoz, 10000-hoz 1000-hoz, 10-hoz,
 1833|       |      // 56-hoz, 6-hoz
 1834|      0|      for (; n >= 1; n--) {
  ------------------
  |  Branch (1834:14): [True: 0, False: 0]
  ------------------
 1835|      0|        if (scw[dash_pos - n] < '0' || scw[dash_pos - n] > '9') {
  ------------------
  |  Branch (1835:13): [True: 0, False: 0]
  |  Branch (1835:40): [True: 0, False: 0]
  ------------------
 1836|      0|            continue;
 1837|      0|        }
 1838|      0|        std::string chunk = scw.substr(dash_pos - n);
 1839|      0|        if (checkword(chunk, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1839:13): [True: 0, False: 0]
  ------------------
 1840|      0|          result.append(chunk);
 1841|      0|          std::string st = pSMgr->suggest_morph(chunk);
 1842|      0|          if (!st.empty()) {
  ------------------
  |  Branch (1842:15): [True: 0, False: 0]
  ------------------
 1843|      0|            result.append(st);
 1844|      0|          }
 1845|      0|          return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1846|      0|        }
 1847|      0|      }
 1848|      0|    }
 1849|     16|  }
 1850|  4.05k|  return slst;
 1851|  4.05k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS0_6vectorIS6_NS4_IS6_EEEE:
 1853|  6.51k|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::vector<std::string>& pl) {
 1854|  6.51k|  std::vector<std::string> slst;
 1855|  6.51k|  if (!pSMgr || pl.empty())
  ------------------
  |  Branch (1855:7): [True: 0, False: 6.51k]
  |  Branch (1855:17): [True: 417, False: 6.10k]
  ------------------
 1856|    417|    return slst;
 1857|  6.10k|  std::vector<std::string> pl2 = analyze(word);
 1858|  6.10k|  int captype = NOCAP, abbv = 0;
  ------------------
  |  |   92|  6.10k|#define NOCAP 0
  ------------------
 1859|  6.10k|  std::string cw;
 1860|  6.10k|  cleanword(cw, word, &captype, &abbv);
 1861|  6.10k|  std::string result;
 1862|       |
 1863|  6.10k|  auto suggest_start = std::chrono::steady_clock::now();
 1864|   419k|  for (const auto& i : pl) {
  ------------------
  |  Branch (1864:22): [True: 419k, False: 6.10k]
  ------------------
 1865|   419k|    cat_result(result, pSMgr->suggest_gen(pl2, i, suggest_start));
 1866|   419k|  }
 1867|       |
 1868|  6.10k|  if (!result.empty()) {
  ------------------
  |  Branch (1868:7): [True: 0, False: 6.10k]
  ------------------
 1869|       |    // allcap
 1870|      0|    if (captype == ALLCAP)
  ------------------
  |  |   94|      0|#define ALLCAP 2
  ------------------
  |  Branch (1870:9): [True: 0, False: 0]
  ------------------
 1871|      0|      mkallcap(result);
 1872|       |
 1873|       |    // line split
 1874|      0|    slst = line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1875|       |
 1876|       |    // capitalize
 1877|      0|    if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   93|      0|#define INITCAP 1
  ------------------
                  if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   96|      0|#define HUHINITCAP 4
  ------------------
  |  Branch (1877:9): [True: 0, False: 0]
  |  Branch (1877:31): [True: 0, False: 0]
  ------------------
 1878|      0|      for (auto& str : slst) {
  ------------------
  |  Branch (1878:22): [True: 0, False: 0]
  ------------------
 1879|      0|        mkinitcap(str);
 1880|      0|      }
 1881|      0|    }
 1882|       |
 1883|       |    // temporary filtering of prefix related errors (eg.
 1884|       |    // generate("undrinkable", "eats") --> "undrinkables" and "*undrinks")
 1885|      0|    auto it = slst.begin();
 1886|      0|    while (it != slst.end()) {
  ------------------
  |  Branch (1886:12): [True: 0, False: 0]
  ------------------
 1887|      0|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|      0|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1887:11): [True: 0, False: 0]
  ------------------
 1888|      0|        break;
 1889|      0|      std::vector<std::string> candidate_stack;
 1890|      0|      if (!spell(*it, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1890:11): [True: 0, False: 0]
  ------------------
 1891|      0|        it = slst.erase(it);
 1892|      0|      } else  {
 1893|      0|        ++it;
 1894|      0|      }
 1895|      0|    }
 1896|      0|  }
 1897|  6.10k|  return slst;
 1898|  6.51k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 1900|    589|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::string& pattern) {
 1901|    589|  std::vector<std::string> pl = analyze(pattern);
 1902|    589|  std::vector<std::string> slst = generate(word, pl);
 1903|    589|  uniqlist(slst);
 1904|    589|  return slst;
 1905|    589|}
_ZN12HunspellImpl11get_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEm:
 1908|   515k|std::string HunspellImpl::get_xml_par(const std::string& in_par, std::string::size_type pos) {
 1909|   515k|  std::string dest;
 1910|   515k|  if (pos == std::string::npos)
  ------------------
  |  Branch (1910:7): [True: 6.91k, False: 508k]
  ------------------
 1911|  6.91k|    return dest;
 1912|   508k|  const char* par = in_par.c_str() + pos;
 1913|   508k|  char end = *par;
 1914|   508k|  if (end == '>')
  ------------------
  |  Branch (1914:7): [True: 505k, False: 3.24k]
  ------------------
 1915|   505k|    end = '<';
 1916|  3.24k|  else if (end != '\'' && end != '"')
  ------------------
  |  Branch (1916:12): [True: 2.48k, False: 760]
  |  Branch (1916:27): [True: 1.21k, False: 1.27k]
  ------------------
 1917|  1.21k|    return dest;  // bad XML
 1918|  10.8M|  for (par++; *par != '\0' && *par != end; ++par) {
  ------------------
  |  Branch (1918:15): [True: 10.8M, False: 30.7k]
  |  Branch (1918:31): [True: 10.3M, False: 476k]
  ------------------
 1919|  10.3M|    dest.push_back(*par);
 1920|  10.3M|  }
 1921|   507k|  mystrrep(dest, "&lt;", "<");
 1922|   507k|  mystrrep(dest, "&amp;", "&");
 1923|   507k|  return dest;
 1924|   508k|}
_ZN12HunspellImpl11get_xml_posERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 1940|  73.2k|std::string::size_type HunspellImpl::get_xml_pos(const std::string& s, std::string::size_type pos, const char* attr) {
 1941|  73.2k|  if (pos == std::string::npos)
  ------------------
  |  Branch (1941:7): [True: 0, False: 73.2k]
  ------------------
 1942|      0|    return std::string::npos;
 1943|       |
 1944|  73.2k|  std::string::size_type endpos = s.find('>', pos);
 1945|  73.2k|  if (attr == nullptr)
  ------------------
  |  Branch (1945:7): [True: 0, False: 73.2k]
  ------------------
 1946|      0|    return endpos;
 1947|   220k|  while (true) {
  ------------------
  |  Branch (1947:10): [True: 220k, Folded]
  ------------------
 1948|   220k|    pos = s.find(attr, pos);
 1949|   220k|    if (pos == std::string::npos || pos >= endpos)
  ------------------
  |  Branch (1949:9): [True: 4.02k, False: 216k]
  |  Branch (1949:37): [True: 1.67k, False: 214k]
  ------------------
 1950|  5.70k|      return std::string::npos;
 1951|   214k|    if (pos == 0 || s[pos - 1] == ' ' || s[pos - 1] == '\n')
  ------------------
  |  Branch (1951:9): [True: 0, False: 214k]
  |  Branch (1951:21): [True: 1.82k, False: 212k]
  |  Branch (1951:42): [True: 65.6k, False: 147k]
  ------------------
 1952|  67.5k|      break;
 1953|   147k|    pos += strlen(attr);
 1954|   147k|  }
 1955|  67.5k|  return pos + strlen(attr);
 1956|  73.2k|}
_ZN12HunspellImpl13check_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKcSA_:
 1960|  73.2k|                                const char* value) {
 1961|  73.2k|  const std::string cw = get_xml_par(q, get_xml_pos(q, pos, attr));
 1962|  73.2k|  return cw == value ? 1 : 0;
  ------------------
  |  Branch (1962:10): [True: 18.1k, False: 55.1k]
  ------------------
 1963|  73.2k|}
_ZN12HunspellImpl12get_xml_listERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 1965|  6.85k|std::vector<std::string> HunspellImpl::get_xml_list(const std::string& list, std::string::size_type pos, const char* tag) {
 1966|  6.85k|  std::vector<std::string> slst;
 1967|  6.85k|  if (pos == std::string::npos)
  ------------------
  |  Branch (1967:7): [True: 38, False: 6.82k]
  ------------------
 1968|     38|    return slst;
 1969|   426k|  while (true) {
  ------------------
  |  Branch (1969:10): [True: 426k, Folded]
  ------------------
 1970|   426k|    pos = list.find(tag, pos);
 1971|   426k|    if (pos == std::string::npos)
  ------------------
  |  Branch (1971:9): [True: 5.49k, False: 420k]
  ------------------
 1972|  5.49k|        break;
 1973|   420k|    std::string cw = get_xml_par(list, pos + strlen(tag) - 1);
 1974|   420k|    if (cw.empty()) {
  ------------------
  |  Branch (1974:9): [True: 1.33k, False: 419k]
  ------------------
 1975|  1.33k|      break;
 1976|  1.33k|    }
 1977|   419k|    slst.push_back(std::move(cw));
 1978|   419k|    ++pos;
 1979|   419k|  }
 1980|  6.82k|  return slst;
 1981|  6.85k|}
_ZN12HunspellImpl7spellmlERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1983|  22.5k|std::vector<std::string> HunspellImpl::spellml(const std::string& in_word) {
 1984|  22.5k|  std::vector<std::string> slst;
 1985|       |
 1986|  22.5k|  std::string::size_type qpos = in_word.find("<query");
 1987|  22.5k|  if (qpos == std::string::npos)
  ------------------
  |  Branch (1987:7): [True: 519, False: 22.0k]
  ------------------
 1988|    519|    return slst;  // bad XML input
 1989|       |
 1990|  22.0k|  std::string::size_type q2pos = in_word.find('>', qpos);
 1991|  22.0k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (1991:7): [True: 190, False: 21.8k]
  ------------------
 1992|    190|    return slst;  // bad XML input
 1993|       |
 1994|  21.8k|  q2pos = in_word.find("<word", q2pos);
 1995|  21.8k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (1995:7): [True: 342, False: 21.4k]
  ------------------
 1996|    342|    return slst;  // bad XML input
 1997|       |
 1998|  21.4k|  if (check_xml_par(in_word, qpos, "type=", "analyze")) {
  ------------------
  |  Branch (1998:7): [True: 551, False: 20.9k]
  ------------------
 1999|    551|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2000|    551|    if (!cw.empty())
  ------------------
  |  Branch (2000:9): [True: 152, False: 399]
  ------------------
 2001|    152|      slst = analyze(cw);
 2002|    551|    if (slst.empty())
  ------------------
  |  Branch (2002:9): [True: 531, False: 20]
  ------------------
 2003|    531|      return slst;
 2004|       |    // convert the result to <code><a>ana1</a><a>ana2</a></code> format
 2005|     20|    std::string r;
 2006|     20|    r.append("<code>");
 2007|     20|    for (auto entry : slst) {
  ------------------
  |  Branch (2007:21): [True: 20, False: 20]
  ------------------
 2008|     20|      r.append("<a>");
 2009|       |
 2010|     20|      mystrrep(entry, "\t", " ");
 2011|     20|      mystrrep(entry, "&", "&amp;");
 2012|     20|      mystrrep(entry, "<", "&lt;");
 2013|     20|      r.append(entry);
 2014|       |
 2015|     20|      r.append("</a>");
 2016|     20|    }
 2017|     20|    r.append("</code>");
 2018|     20|    slst.clear();
 2019|     20|    slst.push_back(std::move(r));
 2020|     20|    return slst;
 2021|  20.9k|  } else if (check_xml_par(in_word, qpos, "type=", "stem")) {
  ------------------
  |  Branch (2021:14): [True: 1.63k, False: 19.2k]
  ------------------
 2022|  1.63k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2023|  1.63k|    if (!cw.empty())
  ------------------
  |  Branch (2023:9): [True: 1.14k, False: 494]
  ------------------
 2024|  1.14k|      return stem(cw);
 2025|  19.2k|  } else if (check_xml_par(in_word, qpos, "type=", "generate")) {
  ------------------
  |  Branch (2025:14): [True: 7.80k, False: 11.4k]
  ------------------
 2026|  7.80k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2027|  7.80k|    if (cw.empty())
  ------------------
  |  Branch (2027:9): [True: 152, False: 7.65k]
  ------------------
 2028|    152|      return slst;
 2029|  7.65k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 2030|  7.65k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (2030:9): [True: 684, False: 6.97k]
  ------------------
 2031|    684|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2032|    684|      if (!cw2.empty()) {
  ------------------
  |  Branch (2032:11): [True: 589, False: 95]
  ------------------
 2033|    589|        return generate(cw, cw2);
 2034|    589|      }
 2035|  6.97k|    } else {
 2036|  6.97k|      q2pos = in_word.find("<code", q2pos + 1);
 2037|  6.97k|      if (q2pos != std::string::npos) {
  ------------------
  |  Branch (2037:11): [True: 6.85k, False: 114]
  ------------------
 2038|  6.85k|        std::vector<std::string> slst2 = get_xml_list(in_word, in_word.find('>', q2pos), "<a>");
 2039|  6.85k|        if (!slst2.empty()) {
  ------------------
  |  Branch (2039:13): [True: 5.92k, False: 931]
  ------------------
 2040|  5.92k|          slst = generate(cw, slst2);
 2041|  5.92k|          uniqlist(slst);
 2042|  5.92k|          return slst;
 2043|  5.92k|        }
 2044|  6.85k|      }
 2045|  6.97k|    }
 2046|  11.4k|  } else if (check_xml_par(in_word, qpos, "type=", "add")) {
  ------------------
  |  Branch (2046:14): [True: 8.10k, False: 3.38k]
  ------------------
 2047|  8.10k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2048|  8.10k|    if (cw.empty())
  ------------------
  |  Branch (2048:9): [True: 76, False: 8.03k]
  ------------------
 2049|     76|      return slst;
 2050|  8.03k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 2051|  8.03k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (2051:9): [True: 2.63k, False: 5.39k]
  ------------------
 2052|  2.63k|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2053|  2.63k|      if (!cw2.empty()) {
  ------------------
  |  Branch (2053:11): [True: 2.33k, False: 303]
  ------------------
 2054|  2.33k|        add_with_affix(cw, cw2);
 2055|  2.33k|      } else {
 2056|    303|        add(cw);
 2057|    303|      }
 2058|  5.39k|    } else {
 2059|  5.39k|        add(cw);
 2060|  5.39k|    }
 2061|  8.03k|  }
 2062|  13.0k|  return slst;
 2063|  21.4k|}
_ZN8HunspellC2EPKcS1_S1_:
 2213|     38|  : m_Impl(new HunspellImpl(affpath, dpath, key)) {
 2214|     38|}
_ZN8Hunspell5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_:
 2225|  64.6k|bool Hunspell::spell(const std::string& word, int* info, std::string* root) {
 2226|  64.6k|  std::vector<std::string> candidate_stack;
 2227|  64.6k|  return m_Impl->spell(word, candidate_stack, info, root,
 2228|  64.6k|                       std::chrono::steady_clock::now());
 2229|  64.6k|}
_ZN8Hunspell7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 2231|  64.0k|std::vector<std::string> Hunspell::suggest(const std::string& word) {
 2232|  64.0k|  return m_Impl->suggest(word);
 2233|  64.0k|}

_Z16init_phonet_hashR10phonetable:
   38|      2|void init_phonet_hash(phonetable& parms) {
   39|      2|  memset(parms.hash, 0xff, HASHSIZE * sizeof(int));
  ------------------
  |  |   33|      2|#define HASHSIZE 256
  ------------------
   40|       |
   41|    212|  for (int i = 0; parms.rules[i][0] != '\0'; i += 2) {
  ------------------
  |  Branch (41:19): [True: 210, False: 2]
  ------------------
   42|       |    /**  set hash value  **/
   43|    210|    int k = (unsigned char)parms.rules[i][0];
   44|       |
   45|    210|    if (parms.hash[k] < 0) {
  ------------------
  |  Branch (45:9): [True: 54, False: 156]
  ------------------
   46|     54|      parms.hash[k] = i;
   47|     54|    }
   48|    210|  }
   49|      2|}
_Z6phonetRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEER10phonetable:
   69|  10.5k|std::string phonet(const std::string& inword, phonetable& parms) {
   70|       |
   71|  10.5k|  int i, k = 0, p, z, k0, n0, p0 = -333;
   72|  10.5k|  char c;
   73|  10.5k|  using uchar = unsigned char;
   74|       |
   75|  10.5k|  size_t len = inword.size();
   76|  10.5k|  if (len > MAXPHONETUTF8LEN)
  ------------------
  |  |   35|  10.5k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.5k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
  |  Branch (76:7): [True: 0, False: 10.5k]
  ------------------
   77|      0|    return {};
   78|  10.5k|  char word[MAXPHONETUTF8LEN + 1];
   79|  10.5k|  strncpy(word, inword.c_str(), MAXPHONETUTF8LEN);
  ------------------
  |  |   35|  10.5k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.5k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   80|  10.5k|  word[MAXPHONETUTF8LEN] = '\0';
  ------------------
  |  |   35|  10.5k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.5k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   81|       |
   82|  10.5k|  std::string target;
   83|       |  /**  check word  **/
   84|  10.5k|  i = z = 0;
   85|  95.8k|  while ((c = word[i]) != '\0') {
  ------------------
  |  Branch (85:10): [True: 85.2k, False: 10.5k]
  ------------------
   86|  85.2k|    int n = parms.hash[(uchar)c];
   87|  85.2k|    int z0 = 0;
   88|       |
   89|  85.2k|    if (n >= 0 && !parms.rules[n].empty()) {
  ------------------
  |  Branch (89:9): [True: 26.1k, False: 59.1k]
  |  Branch (89:19): [True: 26.1k, False: 0]
  ------------------
   90|       |      /**  check all rules for the same letter  **/
   91|  70.4k|      while (parms.rules[n][0] == c) {
  ------------------
  |  Branch (91:14): [True: 67.9k, False: 2.45k]
  ------------------
   92|       |        /**  check whole string  **/
   93|  67.9k|        k = 1; /** number of found letters  **/
   94|  67.9k|        p = 5; /** default priority  **/
   95|  67.9k|        const char*s = parms.rules[n].c_str();
   96|  67.9k|        s++; /**  important for (see below)  "*(s-1)"  **/
   97|       |
   98|  70.1k|        while (*s != '\0' && word[i + k] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (98:16): [True: 48.8k, False: 21.3k]
  |  Branch (98:30): [True: 2.27k, False: 46.5k]
  |  Branch (98:51): [True: 2.27k, False: 0]
  |  Branch (98:82): [True: 2.23k, False: 40]
  ------------------
   99|  2.23k|          k++;
  100|  2.23k|          s++;
  101|  2.23k|        }
  102|  67.9k|        if (*s == '(') {
  ------------------
  |  Branch (102:13): [True: 5.35k, False: 62.5k]
  ------------------
  103|       |          /**  check letters in "(..)"  **/
  104|  5.35k|          if (myisalpha(word[i + k])  // ...could be implied?
  ------------------
  |  Branch (104:15): [True: 3.92k, False: 1.43k]
  ------------------
  105|  3.92k|              && strchr(s + 1, word[i + k]) != nullptr) {
  ------------------
  |  Branch (105:18): [True: 462, False: 3.45k]
  ------------------
  106|    462|            k++;
  107|  2.18k|            while (*s && *s != ')')
  ------------------
  |  Branch (107:20): [True: 2.18k, False: 0]
  |  Branch (107:26): [True: 1.71k, False: 462]
  ------------------
  108|  1.71k|              s++;
  109|    462|            if (*s == ')')
  ------------------
  |  Branch (109:17): [True: 462, False: 0]
  ------------------
  110|    462|              s++;
  111|    462|          }
  112|  5.35k|        }
  113|  67.9k|        p0 = (int)*s;
  114|  67.9k|        k0 = k;
  115|  69.3k|        while (*s == '-' && k > 1) {
  ------------------
  |  Branch (115:16): [True: 1.42k, False: 67.9k]
  |  Branch (115:29): [True: 1.42k, False: 0]
  ------------------
  116|  1.42k|          k--;
  117|  1.42k|          s++;
  118|  1.42k|        }
  119|  67.9k|        if (*s == '<')
  ------------------
  |  Branch (119:13): [True: 100, False: 67.8k]
  ------------------
  120|    100|          s++;
  121|  67.9k|        if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (121:13): [True: 0, False: 67.9k]
  ------------------
  122|       |          /**  determine priority  **/
  123|      0|          p = *s - '0';
  124|      0|          s++;
  125|      0|        }
  126|  67.9k|        if (*s == '^' && *(s + 1) == '^')
  ------------------
  |  Branch (126:13): [True: 3.49k, False: 64.4k]
  |  Branch (126:26): [True: 0, False: 3.49k]
  ------------------
  127|      0|          s++;
  128|       |
  129|  67.9k|        if (*s == '\0' || (*s == '^' && (i == 0 || !myisalpha(word[i - 1])) &&
  ------------------
  |  Branch (129:13): [True: 23.0k, False: 44.9k]
  |  Branch (129:28): [True: 3.49k, False: 41.4k]
  |  Branch (129:42): [True: 124, False: 3.37k]
  |  Branch (129:52): [True: 865, False: 2.51k]
  ------------------
  130|    989|                           (*(s + 1) != '$' || (!myisalpha(word[i + k0])))) ||
  ------------------
  |  Branch (130:29): [True: 989, False: 0]
  |  Branch (130:48): [True: 0, False: 0]
  ------------------
  131|  43.9k|            (*s == '$' && i > 0 && myisalpha(word[i - 1]) &&
  ------------------
  |  Branch (131:14): [True: 0, False: 43.9k]
  |  Branch (131:27): [True: 0, False: 0]
  |  Branch (131:36): [True: 0, False: 0]
  ------------------
  132|  23.9k|             (!myisalpha(word[i + k0])))) {
  ------------------
  |  Branch (132:14): [True: 0, False: 0]
  ------------------
  133|       |          /**  search for followup rules, if:     **/
  134|       |          /**  parms.followup and k > 1  and  NO '-' in searchstring **/
  135|  23.9k|          char c0 = word[i + k - 1];
  136|  23.9k|          n0 = parms.hash[(uchar)c0];
  137|       |
  138|       |          //            if (parms.followup  &&  k > 1  &&  n0 >= 0
  139|  23.9k|          if (k > 1 && n0 >= 0 && p0 != (int)'-' && word[i + k] != '\0' && !parms.rules[n0].empty()) {
  ------------------
  |  Branch (139:15): [True: 672, False: 23.3k]
  |  Branch (139:24): [True: 672, False: 0]
  |  Branch (139:35): [True: 648, False: 24]
  |  Branch (139:53): [True: 586, False: 62]
  |  Branch (139:76): [True: 586, False: 0]
  ------------------
  140|       |            /**  test follow-up rule for "word[i+k]"  **/
  141|  1.72k|            while (parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (141:20): [True: 1.47k, False: 246]
  ------------------
  142|       |              /**  check whole string  **/
  143|  1.47k|              k0 = k;
  144|  1.47k|              p0 = 5;
  145|  1.47k|              s = parms.rules[n0].c_str();
  146|  1.47k|              s++;
  147|  1.81k|              while (*s != '\0' && word[i + k0] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (147:22): [True: 1.23k, False: 585]
  |  Branch (147:36): [True: 340, False: 893]
  |  Branch (147:58): [True: 340, False: 0]
  |  Branch (147:89): [True: 340, False: 0]
  ------------------
  148|    340|                k0++;
  149|    340|                s++;
  150|    340|              }
  151|  1.47k|              if (*s == '(') {
  ------------------
  |  Branch (151:19): [True: 0, False: 1.47k]
  ------------------
  152|       |                /**  check letters  **/
  153|      0|                if (myisalpha(word[i + k0]) && strchr(s + 1, word[i + k0]) != nullptr) {
  ------------------
  |  Branch (153:21): [True: 0, False: 0]
  |  Branch (153:48): [True: 0, False: 0]
  ------------------
  154|      0|                  k0++;
  155|      0|                  while (*s != ')' && *s != '\0')
  ------------------
  |  Branch (155:26): [True: 0, False: 0]
  |  Branch (155:39): [True: 0, False: 0]
  ------------------
  156|      0|                    s++;
  157|      0|                  if (*s == ')')
  ------------------
  |  Branch (157:23): [True: 0, False: 0]
  ------------------
  158|      0|                    s++;
  159|      0|                }
  160|      0|              }
  161|  1.47k|              while (*s == '-') {
  ------------------
  |  Branch (161:22): [True: 1, False: 1.47k]
  ------------------
  162|       |                /**  "k0" gets NOT reduced   **/
  163|       |                /**  because "if (k0 == k)"  **/
  164|      1|                s++;
  165|      1|              }
  166|  1.47k|              if (*s == '<')
  ------------------
  |  Branch (166:19): [True: 0, False: 1.47k]
  ------------------
  167|      0|                s++;
  168|  1.47k|              if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (168:19): [True: 0, False: 1.47k]
  ------------------
  169|      0|                p0 = *s - '0';
  170|      0|                s++;
  171|      0|              }
  172|       |
  173|  1.47k|              if (*s == '\0'
  ------------------
  |  Branch (173:19): [True: 586, False: 892]
  ------------------
  174|       |                  /**  *s == '^' cuts  **/
  175|    892|                  || (*s == '$' && !myisalpha(word[i + k0]))) {
  ------------------
  |  Branch (175:23): [True: 0, False: 892]
  |  Branch (175:36): [True: 0, False: 0]
  ------------------
  176|    586|                if (k0 == k) {
  ------------------
  |  Branch (176:21): [True: 246, False: 340]
  ------------------
  177|       |                  /**  this is just a piece of the string  **/
  178|    246|                  n0 += 2;
  179|    246|                  continue;
  180|    246|                }
  181|       |
  182|    340|                if (p0 < p) {
  ------------------
  |  Branch (182:21): [True: 0, False: 340]
  ------------------
  183|       |                  /**  priority too low  **/
  184|      0|                  n0 += 2;
  185|      0|                  continue;
  186|      0|                }
  187|       |                /**  rule fits; stop search  **/
  188|    340|                break;
  189|    340|              }
  190|    892|              n0 += 2;
  191|    892|            } /**  End of "while (parms.rules[n0][0] == c0)"  **/
  192|       |
  193|    586|            if (p0 >= p && parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (193:17): [True: 586, False: 0]
  |  Branch (193:28): [True: 340, False: 246]
  ------------------
  194|    340|              n += 2;
  195|    340|              continue;
  196|    340|            }
  197|    586|          } /** end of follow-up stuff **/
  198|       |
  199|       |          /**  replace string  **/
  200|  23.6k|          s = parms.rules[n + 1].c_str();
  201|  23.6k|          p0 = (!parms.rules[n].empty() && strchr(parms.rules[n].c_str() + 1, '<') != nullptr) ? 1 : 0;
  ------------------
  |  Branch (201:17): [True: 23.6k, False: 0]
  |  Branch (201:44): [True: 100, False: 23.5k]
  ------------------
  202|  23.6k|          if (p0 == 1 && z == 0) {
  ------------------
  |  Branch (202:15): [True: 100, False: 23.5k]
  |  Branch (202:26): [True: 100, False: 0]
  ------------------
  203|       |            /**  rule with '<' is used  **/
  204|    100|            if (!target.empty() && *s != '\0' &&
  ------------------
  |  Branch (204:17): [True: 79, False: 21]
  |  Branch (204:36): [True: 79, False: 0]
  ------------------
  205|     79|                (target[target.size()-1] == c || target[target.size()-1] == *s)) {
  ------------------
  |  Branch (205:18): [True: 0, False: 79]
  |  Branch (205:50): [True: 0, False: 79]
  ------------------
  206|      0|              target.erase(target.size() - 1);
  207|      0|            }
  208|    100|            z0 = 1;
  209|    100|            z = 1;
  210|    100|            k0 = 0;
  211|    200|            while (*s != '\0' && word[i + k0] != '\0') {
  ------------------
  |  Branch (211:20): [True: 100, False: 100]
  |  Branch (211:34): [True: 100, False: 0]
  ------------------
  212|    100|              word[i + k0] = *s;
  213|    100|              k0++;
  214|    100|              s++;
  215|    100|            }
  216|    100|            if (k > k0)
  ------------------
  |  Branch (216:17): [True: 0, False: 100]
  ------------------
  217|      0|              strmove(&word[0] + i + k0, &word[0] + i + k);
  218|       |
  219|       |            /**  new "actual letter"  **/
  220|    100|            c = word[i];
  221|  23.5k|          } else { /** no '<' rule used **/
  222|  23.5k|            i += k - 1;
  223|  23.5k|            z = 0;
  224|  23.9k|            while (*s != '\0' && *(s + 1) != '\0' && target.size() < len) {
  ------------------
  |  Branch (224:20): [True: 22.5k, False: 1.46k]
  |  Branch (224:34): [True: 490, False: 22.0k]
  |  Branch (224:54): [True: 405, False: 85]
  ------------------
  225|    405|              if (target.empty() || target[target.size()-1] != *s) {
  ------------------
  |  Branch (225:19): [True: 12, False: 393]
  |  Branch (225:37): [True: 147, False: 246]
  ------------------
  226|    159|                target.push_back(*s);
  227|    159|              }
  228|    405|              s++;
  229|    405|            }
  230|       |            /**  new "actual letter"  **/
  231|  23.5k|            c = *s;
  232|  23.5k|            if (!parms.rules[n].empty() && strstr(parms.rules[n].c_str() + 1, "^^") != nullptr) {
  ------------------
  |  Branch (232:17): [True: 23.5k, False: 0]
  |  Branch (232:44): [True: 0, False: 23.5k]
  ------------------
  233|      0|              if (c != '\0') {
  ------------------
  |  Branch (233:19): [True: 0, False: 0]
  ------------------
  234|      0|                target.push_back(c);
  235|      0|              }
  236|      0|              strmove(&word[0], &word[0] + i + 1);
  237|      0|              i = 0;
  238|      0|              z0 = 1;
  239|      0|            }
  240|  23.5k|          }
  241|  23.6k|          break;
  242|  23.9k|        } /** end of follow-up stuff **/
  243|  43.9k|        n += 2;
  244|  43.9k|      } /**  end of while (parms.rules[n][0] == c)  **/
  245|  26.1k|    }   /**  end of if (n >= 0)  **/
  246|  85.2k|    if (z0 == 0) {
  ------------------
  |  Branch (246:9): [True: 85.1k, False: 100]
  ------------------
  247|  85.1k|      if (k && !p0 && target.size() < len && c != '\0') {
  ------------------
  |  Branch (247:11): [True: 26.0k, False: 59.1k]
  |  Branch (247:16): [True: 23.5k, False: 2.45k]
  |  Branch (247:23): [True: 23.4k, False: 105]
  |  Branch (247:46): [True: 21.9k, False: 1.46k]
  ------------------
  248|       |        /**  condense only double letters  **/
  249|  21.9k|        target.push_back(c);
  250|       |        /// printf("\n setting \n");
  251|  21.9k|      }
  252|       |
  253|  85.1k|      i++;
  254|  85.1k|      z = 0;
  255|  85.1k|      k = 0;
  256|  85.1k|    }
  257|  85.2k|  } /**  end of   while ((c = word[i]) != '\0')  **/
  258|       |
  259|  10.5k|  return target;
  260|  10.5k|} /**  end of function "phonet"  **/
phonet.cxx:_ZL9myisalphac:
   59|  8.72k|static int myisalpha(char ch) {
   60|  8.72k|  if ((unsigned char)ch < 128)
  ------------------
  |  Branch (60:7): [True: 8.04k, False: 681]
  ------------------
   61|  8.04k|    return isalpha(ch);
   62|    681|  return 1;
   63|  8.72k|}

_ZN7RepListC2Ei:
   79|      4|RepList::RepList(int n) {
   80|      4|  dat.reserve(std::min(n, 16384));
   81|      4|  can_use_trie = true;
   82|      4|}
_ZN7RepList4findEPKcm:
   90|     22|int RepList::find(const char* word, size_t max_len) {
   91|     22|  int p1 = 0;
   92|     22|  int p2 = dat.size() - 1;
   93|     22|  int ret = -1;
   94|     58|  while (p1 <= p2) {
  ------------------
  |  Branch (94:10): [True: 36, False: 22]
  ------------------
   95|     36|    int m = ((unsigned)p1 + (unsigned)p2) >> 1;
   96|     36|    const std::string& pattern = dat[m]->pattern;
   97|       |    // compare only as far as max_len, so a caller can restrict the search to
   98|       |    // patterns no longer than a given length
   99|     36|    size_t cmplen = pattern.size() < max_len ? pattern.size() : max_len;
  ------------------
  |  Branch (99:21): [True: 6, False: 30]
  ------------------
  100|     36|    int c = strncmp(word, pattern.c_str(), cmplen);
  101|     36|    if (c < 0)
  ------------------
  |  Branch (101:9): [True: 12, False: 24]
  ------------------
  102|     12|      p2 = m - 1;
  103|     24|    else if (c > 0)
  ------------------
  |  Branch (103:14): [True: 24, False: 0]
  ------------------
  104|     24|      p1 = m + 1;
  105|      0|    else if (pattern.size() <= max_len) {  // a prefix within the limit
  ------------------
  |  Branch (105:14): [True: 0, False: 0]
  ------------------
  106|      0|      ret = m;                             // scan right for a longer match
  107|      0|      p1 = m + 1;
  108|      0|    } else {
  109|       |      // pattern shares the capped prefix but is too long; any shorter
  110|       |      // candidate sorts earlier
  111|      0|      p2 = m - 1;
  112|      0|    }
  113|     36|  }
  114|     22|  return ret;
  115|     22|}
_ZN7RepList3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
  126|     22|int RepList::add(const std::string& in_pat1, const std::string& pat2) {
  127|     22|  if (in_pat1.empty() || pat2.empty()) {
  ------------------
  |  Branch (127:7): [True: 0, False: 22]
  |  Branch (127:26): [True: 0, False: 22]
  ------------------
  128|      0|    return 1;
  129|      0|  }
  130|       |
  131|       |  // analyse word context
  132|     22|  int type = 0;
  133|     22|  std::string pat1(in_pat1);
  134|     22|  if (pat1[0] == '_') {
  ------------------
  |  Branch (134:7): [True: 0, False: 22]
  ------------------
  135|      0|    pat1.erase(0, 1);
  136|      0|    type = 1;
  137|      0|  }
  138|     22|  if (!pat1.empty() && pat1[pat1.size() - 1] == '_') {
  ------------------
  |  Branch (138:7): [True: 22, False: 0]
  |  Branch (138:24): [True: 0, False: 22]
  ------------------
  139|      0|    type = type + 2;
  140|      0|    pat1.erase(pat1.size() - 1);
  141|      0|  }
  142|     22|  mystrrep(pat1, "_", " ");
  143|       |
  144|       |  // The trie does unanchored whole-string replacement only. Anchored entries
  145|       |  // (a leading or trailing _) depend on the match position within the word,
  146|       |  // which the trie does not model, so fall back to the linear scan once one is
  147|       |  // seen. Feed the trie the same _-to-space normalised strings the linear path
  148|       |  // stores, otherwise the two paths would disagree on output.
  149|     22|  if (type == 0 && can_use_trie) {
  ------------------
  |  Branch (149:7): [True: 22, False: 0]
  |  Branch (149:20): [True: 22, False: 0]
  ------------------
  150|     22|    std::string out(pat2);
  151|     22|    mystrrep(out, "_", " ");
  152|     22|    trie.add(pat1, out);
  153|     22|  } else {
  154|      0|    can_use_trie = false;
  155|      0|  }
  156|       |
  157|       |  // find existing entry
  158|     22|  int m = find(pat1.c_str(), pat1.size());
  159|     22|  if (m >= 0 && dat[m]->pattern == pat1) {
  ------------------
  |  Branch (159:7): [True: 0, False: 22]
  |  Branch (159:17): [True: 0, False: 0]
  ------------------
  160|       |    // since already used
  161|      0|    dat[m]->outstrings[type] = pat2;
  162|      0|    mystrrep(dat[m]->outstrings[type], "_", " ");
  163|      0|    return 0;
  164|      0|  }
  165|       |
  166|       |  // make a new entry if none exists
  167|     22|  replentry* r = new replentry;
  168|     22|  r->pattern = std::move(pat1);
  169|     22|  r->outstrings[type] = pat2;
  170|     22|  mystrrep(r->outstrings[type], "_", " ");
  171|     22|  dat.push_back(r);
  172|       |  // sort to the right place in the list
  173|     22|  size_t i;
  174|     36|  for (i = dat.size() - 1; i > 0; --i) {
  ------------------
  |  Branch (174:28): [True: 30, False: 6]
  ------------------
  175|     30|    if (strcmp(r->pattern.c_str(), dat[i - 1]->pattern.c_str()) < 0) {
  ------------------
  |  Branch (175:9): [True: 14, False: 16]
  ------------------
  176|     14|      dat[i] = dat[i - 1];
  177|     14|    } else
  178|     16|      break;
  179|     30|  }
  180|     22|  dat[i] = r;
  181|     22|  return 0;
  182|     22|}
_ZN7RepList4convERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERS6_:
  184|   418k|bool RepList::conv(const std::string& in_word, std::string& dest) {
  185|       |  // get_status guards against a trie that overflowed its index type while
  186|       |  // building, in which case the linear scan below is the correct fallback.
  187|   418k|  if (can_use_trie && trie.get_status())
  ------------------
  |  Branch (187:7): [True: 418k, False: 0]
  |  Branch (187:23): [True: 418k, False: 0]
  ------------------
  188|   418k|    return trie.transcode(in_word, dest) != TranscodeResult::None;
  189|       |
  190|      0|  dest.clear();
  191|       |
  192|      0|  const size_t wordlen = in_word.size();
  193|      0|  const char* word = in_word.c_str();
  194|       |
  195|      0|  bool change = false;
  196|      0|  for (size_t i = 0; i < wordlen; ++i) {
  ------------------
  |  Branch (196:22): [True: 0, False: 0]
  ------------------
  197|      0|    int n = -1;
  198|      0|    std::string l;
  199|       |
  200|       |    // Find the longest matching pattern whose replacement actually applies.
  201|       |    // The longest match may be rejected, for example an end-anchored key that
  202|       |    // is not at the end of the word, in which case retry with strictly shorter
  203|       |    // patterns so a shorter match can still apply.
  204|      0|    for (size_t max_len = wordlen - i; max_len > 0;) {
  ------------------
  |  Branch (204:40): [True: 0, False: 0]
  ------------------
  205|      0|      int m = find(word + i, max_len);
  206|      0|      if (m < 0)
  ------------------
  |  Branch (206:11): [True: 0, False: 0]
  ------------------
  207|      0|        break;
  208|      0|      l = replace(wordlen - i, m, i == 0);
  209|      0|      if (!l.empty()) {
  ------------------
  |  Branch (209:11): [True: 0, False: 0]
  ------------------
  210|      0|        n = m;
  211|      0|        break;
  212|      0|      }
  213|      0|      size_t plen = dat[m]->pattern.size();
  214|      0|      if (plen == 0)
  ------------------
  |  Branch (214:11): [True: 0, False: 0]
  ------------------
  215|      0|        break;
  216|      0|      max_len = plen - 1;
  217|      0|    }
  218|       |
  219|      0|    if (n < 0) {
  ------------------
  |  Branch (219:9): [True: 0, False: 0]
  ------------------
  220|      0|      dest.push_back(word[i]);
  221|      0|      continue;
  222|      0|    }
  223|       |
  224|      0|    dest.append(l);
  225|      0|    if (!dat[n]->pattern.empty()) {
  ------------------
  |  Branch (225:9): [True: 0, False: 0]
  ------------------
  226|      0|      i += dat[n]->pattern.size() - 1;
  227|      0|    }
  228|      0|    change = true;
  229|      0|  }
  230|       |
  231|      0|  return change;
  232|   418k|}
_ZNK7RepList24check_against_breaktableERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
  234|      2|bool RepList::check_against_breaktable(const std::vector<std::string>& breaktable) const {
  235|      8|  for (const auto i : dat) {
  ------------------
  |  Branch (235:21): [True: 8, False: 2]
  ------------------
  236|     32|    for (auto& outstring : i->outstrings) {
  ------------------
  |  Branch (236:26): [True: 32, False: 8]
  ------------------
  237|     96|      for (const auto& str : breaktable) {
  ------------------
  |  Branch (237:28): [True: 96, False: 32]
  ------------------
  238|     96|        if (outstring.find(str) != std::string::npos) {
  ------------------
  |  Branch (238:13): [True: 0, False: 96]
  ------------------
  239|      0|          return false;
  240|      0|        }
  241|     96|      }
  242|     32|    }
  243|      8|  }
  244|       |
  245|      2|  return true;
  246|      2|}

_ZN4TrieItLb1EEC2Ev:
  161|      4|    Trie() : status_ok(true) {
  162|       |        // Initialize the root node (Index 0)
  163|      4|        nodes.emplace_back();
  164|      4|        sub_info_arena.push_back(0xFFFFFFFF);
  165|      4|    }
_ZN4TrieItLb1EE3addERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_:
  167|     22|    void add(const std::string& key, const std::string& value) {
  168|     22|        if (!status_ok) return;
  ------------------
  |  Branch (168:13): [True: 0, False: 22]
  ------------------
  169|       |
  170|       |        // Size rules diagnostics for our 32-bit (24/8) packing format
  171|     22|        if (value.size() > 255) { status_ok = false; return; }
  ------------------
  |  Branch (171:13): [True: 0, False: 22]
  ------------------
  172|     22|        size_t offset = char_arena.size();
  173|     22|        if (offset > 0xFFFFFF) { status_ok = false; return; }
  ------------------
  |  Branch (173:13): [True: 0, False: 22]
  ------------------
  174|       |
  175|       |        // Append to the flat char arena
  176|     22|        char_arena.insert(char_arena.end(), value.begin(), value.end());
  177|     22|        uint32_t sub_val = (static_cast<uint32_t>(offset) << 8) | static_cast<uint8_t>(value.size());
  178|       |
  179|     22|        size_t curr_idx = 0;
  180|       |        
  181|       |        // Traverse the key, adding nodes as necessary
  182|     56|        for (size_t i = 0; i < key.size(); ++i) {
  ------------------
  |  Branch (182:28): [True: 34, False: 22]
  ------------------
  183|     34|            uint8_t byte = static_cast<uint8_t>(key[i]);
  184|       |            
  185|     34|            if (UseNibbles) {
  ------------------
  |  Branch (185:17): [True: 34, Folded]
  ------------------
  186|       |                // Loop unrolling: Process the High Nibble, then the Low Nibble
  187|     34|                curr_idx = advance_or_create(curr_idx, (byte >> 4) & 0x0F);
  188|     34|                if (!status_ok) return;
  ------------------
  |  Branch (188:21): [True: 0, False: 34]
  ------------------
  189|     34|                curr_idx = advance_or_create(curr_idx, byte & 0x0F);
  190|     34|                if (!status_ok) return;
  ------------------
  |  Branch (190:21): [True: 0, False: 34]
  ------------------
  191|     34|            } else {
  192|       |                // Process as a single 8-bit lookup
  193|      0|                curr_idx = advance_or_create(curr_idx, byte);
  194|      0|                if (!status_ok) return;
  ------------------
  |  Branch (194:21): [True: 0, False: 0]
  ------------------
  195|      0|            }
  196|     34|        }
  197|       |        // Mark the leaf node with the packed substitution metadata
  198|     22|        sub_info_arena[curr_idx] = sub_val;
  199|     22|    }
_ZN4TrieItLb1EE17advance_or_createEmh:
  138|     68|    size_t advance_or_create(size_t curr_idx, uint8_t symbol) {
  139|     68|        IndexType rel_idx = nodes[curr_idx].children[symbol];
  140|     68|        if (rel_idx == 0) {
  ------------------
  |  Branch (140:13): [True: 38, False: 30]
  ------------------
  141|     38|            size_t new_idx = nodes.size();
  142|     38|            size_t diff = new_idx - curr_idx;
  143|       |            
  144|       |            // Diagnostics: Halt execution if the trie outgrows the integer type
  145|     38|            if (diff > std::numeric_limits<IndexType>::max()) {
  ------------------
  |  Branch (145:17): [True: 0, False: 38]
  ------------------
  146|      0|                status_ok = false;
  147|      0|                return 0;
  148|      0|            }
  149|       |            
  150|     38|            nodes[curr_idx].children[symbol] = static_cast<IndexType>(diff);
  151|       |            
  152|       |            // emplace_back constructs the object directly in the vector's memory
  153|     38|            nodes.emplace_back(); 
  154|     38|            sub_info_arena.push_back(0xFFFFFFFF); // 0xFFFFFFFF = No substitution mapped here
  155|     38|            return new_idx;
  156|     38|        }
  157|     30|        return curr_idx + rel_idx;
  158|     68|    }
_ZNK4TrieItLb1EE10get_statusEv:
  275|   418k|    bool get_status() const { return status_ok; }
_ZNK4TrieItLb1EE9transcodeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_:
  205|   418k|    TranscodeResult transcode(const std::string& src, std::string& dst) const {
  206|       |        // Halt and return None if the trie is in an invalid memory state
  207|   418k|        if (!status_ok || src.empty()) return TranscodeResult::None;
  ------------------
  |  Branch (207:13): [True: 0, False: 418k]
  |  Branch (207:27): [True: 1.98k, False: 416k]
  ------------------
  208|       |        
  209|   416k|        dst.clear();
  210|   416k|        dst.reserve(src.size()); 
  211|       |        
  212|       |        // State trackers for the 3-way outcome
  213|   416k|        bool any_substituted = false;
  214|   416k|        bool any_copied = false;
  215|       |        
  216|   416k|        size_t i = 0;
  217|       |        
  218|  4.38M|        while (i < src.size()) {
  ------------------
  |  Branch (218:16): [True: 3.97M, False: 416k]
  ------------------
  219|  3.97M|            size_t curr_idx = 0;
  220|  3.97M|            size_t match_len = 0;
  221|  3.97M|            uint32_t best_sub = 0xFFFFFFFF;
  222|       |
  223|  3.97M|            size_t j = i;
  224|       |            
  225|       |            // Greedily traverse the trie to find the longest matching sequence
  226|  3.97M|            while (j < src.size()) {
  ------------------
  |  Branch (226:20): [True: 3.97M, False: 165]
  ------------------
  227|  3.97M|                uint8_t byte = static_cast<uint8_t>(src[j]);
  228|       |                
  229|  3.97M|                if (UseNibbles) {
  ------------------
  |  Branch (229:21): [True: 3.97M, Folded]
  ------------------
  230|  3.97M|                    IndexType r1 = nodes[curr_idx].children[(byte >> 4) & 0x0F];
  231|  3.97M|                    if (r1 == 0) break;
  ------------------
  |  Branch (231:25): [True: 3.93M, False: 37.1k]
  ------------------
  232|  37.1k|                    curr_idx += r1;
  233|       |
  234|  37.1k|                    IndexType r2 = nodes[curr_idx].children[byte & 0x0F];
  235|  37.1k|                    if (r2 == 0) break;
  ------------------
  |  Branch (235:25): [True: 36.5k, False: 623]
  ------------------
  236|    623|                    curr_idx += r2;
  237|    623|                } else {
  238|      0|                    IndexType r = nodes[curr_idx].children[byte];
  239|      0|                    if (r == 0) break;
  ------------------
  |  Branch (239:25): [True: 0, False: 0]
  ------------------
  240|      0|                    curr_idx += r;
  241|      0|                }
  242|       |                
  243|    623|                ++j;
  244|       |                
  245|       |                // Track the deepest valid match found during traversal
  246|    623|                if (sub_info_arena[curr_idx] != 0xFFFFFFFF) {
  ------------------
  |  Branch (246:21): [True: 338, False: 285]
  ------------------
  247|    338|                    best_sub = sub_info_arena[curr_idx];
  248|    338|                    match_len = j - i;
  249|    338|                }
  250|    623|            }
  251|       |
  252|  3.97M|            if (best_sub != 0xFFFFFFFF) {
  ------------------
  |  Branch (252:17): [True: 338, False: 3.97M]
  ------------------
  253|       |                // Decode the 24-bit offset and 8-bit size, append directly from arena
  254|    338|                dst.append(&char_arena[best_sub >> 8], best_sub & 0xFF);
  255|    338|                i += match_len;
  256|    338|                any_substituted = true; // State update: Substitution occurred
  257|  3.97M|            } else {
  258|       |                // Fallback: copy unmapped character directly to output
  259|  3.97M|                dst.push_back(src[i]);
  260|  3.97M|                ++i;
  261|  3.97M|                any_copied = true; // State update: Verbatim copy occurred
  262|  3.97M|            }
  263|  3.97M|        }
  264|       |        
  265|       |        // ALGORITHM: Outcome Evaluation
  266|   416k|        if (any_substituted && any_copied) {
  ------------------
  |  Branch (266:13): [True: 222, False: 415k]
  |  Branch (266:32): [True: 217, False: 5]
  ------------------
  267|    217|            return TranscodeResult::Partial;
  268|   415k|        } else if (any_substituted) {
  ------------------
  |  Branch (268:20): [True: 5, False: 415k]
  ------------------
  269|      5|            return TranscodeResult::All;
  270|      5|        }
  271|       |        
  272|   415k|        return TranscodeResult::None;
  273|   416k|    }

_ZN10SuggestMgrC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEjP8AffixMgr:
   87|     38|SuggestMgr::SuggestMgr(const std::string& tryme, unsigned int maxn, AffixMgr* aptr) {
   88|       |  // register affix manager and check in string of chars to
   89|       |  // try when building candidate suggestions
   90|     38|  pAMgr = aptr;
   91|       |
   92|     38|  csconv = nullptr;
   93|       |
   94|     38|  ckeyl = 0;
   95|       |
   96|     38|  ctryl = 0;
   97|       |
   98|     38|  utf8 = 0;
   99|     38|  langnum = 0;
  100|     38|  complexprefixes = 0;
  101|       |
  102|     38|  maxSug = maxn;
  103|     38|  nosplitsugs = 0;
  104|     38|  maxngramsugs = MAXNGRAMSUGS;
  ------------------
  |  |   77|     38|#define MAXNGRAMSUGS 4
  ------------------
  105|     38|  maxcpdsugs = MAXCOMPOUNDSUGS;
  ------------------
  |  |   79|     38|#define MAXCOMPOUNDSUGS 3
  ------------------
  106|       |
  107|     38|  if (pAMgr) {
  ------------------
  |  Branch (107:7): [True: 38, False: 0]
  ------------------
  108|     38|    langnum = pAMgr->get_langnum();
  109|     38|    ckey = pAMgr->get_key_string();
  110|     38|    nosplitsugs = pAMgr->get_nosplitsugs();
  111|     38|    if (pAMgr->get_maxngramsugs() >= 0)
  ------------------
  |  Branch (111:9): [True: 4, False: 34]
  ------------------
  112|      4|      maxngramsugs = pAMgr->get_maxngramsugs();
  113|     38|    utf8 = pAMgr->get_utf8();
  114|     38|    if (pAMgr->get_maxcpdsugs() >= 0)
  ------------------
  |  Branch (114:9): [True: 0, False: 38]
  ------------------
  115|      0|      maxcpdsugs = pAMgr->get_maxcpdsugs();
  116|     38|    if (!utf8) {
  ------------------
  |  Branch (116:9): [True: 20, False: 18]
  ------------------
  117|     20|      csconv = get_current_cs(pAMgr->get_encoding());
  118|     20|    }
  119|     38|    complexprefixes = pAMgr->get_complexprefixes();
  120|     38|  }
  121|       |
  122|     38|  if (!ckey.empty()) {
  ------------------
  |  Branch (122:7): [True: 38, False: 0]
  ------------------
  123|     38|    if (utf8) {
  ------------------
  |  Branch (123:9): [True: 18, False: 20]
  ------------------
  124|     18|      int len = u8_u16(ckey_utf, ckey);
  125|     18|      if (len != -1) {
  ------------------
  |  Branch (125:11): [True: 18, False: 0]
  ------------------
  126|     18|        ckeyl = len;
  127|     18|      }
  128|     20|    } else {
  129|     20|      ckeyl = ckey.size();
  130|     20|    }
  131|     38|  }
  132|       |
  133|     38|  ctry = tryme;
  134|     38|  if (!ctry.empty()) {
  ------------------
  |  Branch (134:7): [True: 2, False: 36]
  ------------------
  135|      2|    if (utf8) {
  ------------------
  |  Branch (135:9): [True: 2, False: 0]
  ------------------
  136|      2|      int len = u8_u16(ctry_utf, ctry);
  137|      2|      if (len != -1) {
  ------------------
  |  Branch (137:11): [True: 2, False: 0]
  ------------------
  138|      2|        ctryl = len;
  139|      2|      }
  140|      2|    } else {
  141|      0|      ctryl = ctry.size();
  142|      0|    }
  143|      2|  }
  144|       |
  145|       |  // language with possible dash usage
  146|       |  // (latin letters or dash in TRY characters)
  147|     38|  lang_with_dash_usage = ctry.find('-') != std::string::npos ||
  ------------------
  |  Branch (147:26): [True: 0, False: 38]
  ------------------
  148|     38|                         ctry.find('a') != std::string::npos;
  ------------------
  |  Branch (148:26): [True: 0, False: 38]
  ------------------
  149|     38|}
_ZN10SuggestMgr7testsugERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iPiPNS0_6chrono10time_pointINSE_12steady_clockENSE_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEERi:
  166|  83.3M|                        int& info) {
  167|  83.3M|  if (wlst.size() == maxSug)
  ------------------
  |  Branch (167:7): [True: 0, False: 83.3M]
  ------------------
  168|      0|    return;
  169|       |
  170|  83.3M|  const int cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (170:20): [True: 27.1k, False: 83.3M]
  ------------------
  171|       |
  172|  83.3M|  if (cwrd) {
  ------------------
  |  Branch (172:7): [True: 83.3M, False: 27.1k]
  ------------------
  173|  83.3M|    if (int result = checkword(candidate, cpdsuggest, timer, timelimit)) {
  ------------------
  |  Branch (173:13): [True: 2.62k, False: 83.3M]
  ------------------
  174|       |      // compound word in the dictionary
  175|  2.62k|      if (cpdsuggest == 0 && result >= 2)
  ------------------
  |  Branch (175:11): [True: 2.62k, False: 0]
  |  Branch (175:30): [True: 1, False: 2.62k]
  ------------------
  176|      1|          info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      1|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  177|  2.62k|      wlst.push_back(candidate);
  178|  2.62k|    }
  179|  83.3M|  }
  180|  83.3M|}
_ZN10SuggestMgr7suggestERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_Pib:
  190|   149k|                        int* onlycompoundsug, bool test_simplesug) {
  191|   149k|  int nocompoundtwowords = 0; // no second or third loops, see below
  192|   149k|  std::vector<w_char> word_utf;
  193|   149k|  size_t nsugorig = slst.size(), oldSug = 0;
  194|   149k|  std::string w2;
  195|   149k|  bool good_suggestion = false;
  196|       |
  197|       |  // word reversing wrapper for complex prefixes
  198|   149k|  if (complexprefixes) {
  ------------------
  |  Branch (198:7): [True: 8.67k, False: 140k]
  ------------------
  199|  8.67k|    w2.assign(w);
  200|  8.67k|    if (utf8)
  ------------------
  |  Branch (200:9): [True: 0, False: 8.67k]
  ------------------
  201|      0|      reverseword_utf(w2);
  202|  8.67k|    else
  203|  8.67k|      reverseword(w2);
  204|  8.67k|  }
  205|       |
  206|   149k|  const std::string& word = complexprefixes ? w2 : w;
  ------------------
  |  Branch (206:29): [True: 8.67k, False: 140k]
  ------------------
  207|       |
  208|   149k|  suggest_start = std::chrono::steady_clock::now();
  209|       |
  210|   149k|  if (utf8) {
  ------------------
  |  Branch (210:7): [True: 62.2k, False: 87.2k]
  ------------------
  211|  62.2k|    int wl = u8_u16(word_utf, word);
  212|  62.2k|    if (wl == -1) {
  ------------------
  |  Branch (212:9): [True: 9.90k, False: 52.3k]
  ------------------
  213|  9.90k|      return false;
  214|  9.90k|    }
  215|  62.2k|  }
  216|       |
  217|       |  // three loops:
  218|       |  // - the first without compounding,
  219|       |  // - the second one with 2-word compounding,
  220|       |  // - the third one with 3-or-more-word compounding
  221|       |  // Run second and third loops only if:
  222|       |  // - no ~good suggestion in the first loop
  223|       |  // - not for testing compound words with 3 or more words (test_simplesug == false)
  224|   139k|  int info = 0;
  225|   557k|  for (int cpdsuggest = 0; cpdsuggest < 3 && nocompoundtwowords == 0; cpdsuggest++) {
  ------------------
  |  Branch (225:28): [True: 418k, False: 139k]
  |  Branch (225:46): [True: 418k, False: 200]
  ------------------
  226|       |
  227|       |    // limit compound suggestion
  228|   418k|    if (cpdsuggest > 0)
  ------------------
  |  Branch (228:9): [True: 278k, False: 139k]
  ------------------
  229|   278k|      oldSug = slst.size();
  230|       |
  231|       |    // suggestions for an uppercase word (html -> HTML)
  232|   418k|    if (slst.size() < maxSug) {
  ------------------
  |  Branch (232:9): [True: 418k, False: 16]
  ------------------
  233|   418k|      size_t i = slst.size();
  234|   418k|      if (utf8)
  ------------------
  |  Branch (234:11): [True: 156k, False: 261k]
  ------------------
  235|   156k|        capchars_utf(slst, word_utf, cpdsuggest, info);
  236|   261k|      else
  237|   261k|        capchars(slst, word, cpdsuggest, info);
  238|   418k|      if (slst.size() > i)
  ------------------
  |  Branch (238:11): [True: 199, False: 417k]
  ------------------
  239|    199|        good_suggestion = true;
  240|   418k|    }
  241|       |
  242|       |    // perhaps we made a typical fault of spelling
  243|   418k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (243:9): [True: 418k, False: 16]
  |  Branch (243:36): [True: 139k, False: 278k]
  |  Branch (243:51): [True: 278k, False: 0]
  ------------------
  244|   418k|      size_t i = slst.size();
  245|   418k|      replchars(slst, word, cpdsuggest, info);
  246|   418k|      if (slst.size() > i) {
  ------------------
  |  Branch (246:11): [True: 0, False: 418k]
  ------------------
  247|      0|        good_suggestion = true;
  248|      0|        if (info & SPELL_BEST_SUG)
  ------------------
  |  |   86|      0|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  |  Branch (248:13): [True: 0, False: 0]
  ------------------
  249|      0|          return true;
  250|      0|      }
  251|   418k|    }
  252|   418k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   418k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (252:9): [True: 0, False: 418k]
  ------------------
  253|      0|      return good_suggestion;
  254|   418k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (254:9): [True: 0, False: 418k]
  |  Branch (254:27): [True: 0, False: 0]
  ------------------
  255|      0|      return true;
  256|       |
  257|       |    // perhaps we made chose the wrong char from a related set
  258|   418k|    if ((slst.size() < maxSug) &&
  ------------------
  |  Branch (258:9): [True: 418k, False: 16]
  ------------------
  259|   418k|        (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (259:10): [True: 139k, False: 278k]
  |  Branch (259:25): [True: 278k, False: 0]
  ------------------
  260|   418k|      mapchars(slst, word, cpdsuggest, info);
  261|   418k|    }
  262|   418k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   418k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (262:9): [True: 10, False: 418k]
  ------------------
  263|     10|      return good_suggestion;
  264|   418k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (264:9): [True: 0, False: 418k]
  |  Branch (264:27): [True: 0, False: 0]
  ------------------
  265|      0|      return true;
  266|       |
  267|       |    // only suggest compound words when no other ~good suggestion
  268|   418k|    if ((cpdsuggest == 0) && (slst.size() > nsugorig))
  ------------------
  |  Branch (268:9): [True: 139k, False: 278k]
  |  Branch (268:30): [True: 199, False: 139k]
  ------------------
  269|    199|      nocompoundtwowords = 1;
  270|       |
  271|       |    // did we swap the order of chars by mistake
  272|   418k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (272:9): [True: 418k, False: 16]
  |  Branch (272:36): [True: 139k, False: 278k]
  |  Branch (272:51): [True: 278k, False: 0]
  ------------------
  273|   418k|      if (utf8)
  ------------------
  |  Branch (273:11): [True: 156k, False: 261k]
  ------------------
  274|   156k|        swapchar_utf(slst, word_utf, cpdsuggest, info);
  275|   261k|      else
  276|   261k|        swapchar(slst, word, cpdsuggest, info);
  277|   418k|    }
  278|   418k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   418k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (278:9): [True: 0, False: 418k]
  ------------------
  279|      0|      return good_suggestion;
  280|   418k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (280:9): [True: 0, False: 418k]
  |  Branch (280:27): [True: 0, False: 0]
  ------------------
  281|      0|      return true;
  282|       |
  283|       |    // did we swap the order of non adjacent chars by mistake
  284|   418k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (284:9): [True: 418k, False: 16]
  |  Branch (284:36): [True: 139k, False: 278k]
  |  Branch (284:51): [True: 278k, False: 0]
  ------------------
  285|   418k|      if (utf8)
  ------------------
  |  Branch (285:11): [True: 156k, False: 261k]
  ------------------
  286|   156k|        longswapchar_utf(slst, word_utf, cpdsuggest, info);
  287|   261k|      else
  288|   261k|        longswapchar(slst, word, cpdsuggest, info);
  289|   418k|    }
  290|   418k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   418k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (290:9): [True: 0, False: 418k]
  ------------------
  291|      0|      return good_suggestion;
  292|   418k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (292:9): [True: 0, False: 418k]
  |  Branch (292:27): [True: 0, False: 0]
  ------------------
  293|      0|      return true;
  294|       |
  295|       |    // did we just hit the wrong key in place of a good char (case and keyboard)
  296|   418k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (296:9): [True: 418k, False: 16]
  |  Branch (296:36): [True: 139k, False: 278k]
  |  Branch (296:51): [True: 278k, False: 0]
  ------------------
  297|   418k|      if (utf8)
  ------------------
  |  Branch (297:11): [True: 156k, False: 261k]
  ------------------
  298|   156k|        badcharkey_utf(slst, word_utf, cpdsuggest, info);
  299|   261k|      else
  300|   261k|        badcharkey(slst, word, cpdsuggest, info);
  301|   418k|    }
  302|   418k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   418k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (302:9): [True: 0, False: 418k]
  ------------------
  303|      0|      return good_suggestion;
  304|   418k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (304:9): [True: 0, False: 418k]
  |  Branch (304:27): [True: 0, False: 0]
  ------------------
  305|      0|      return true;
  306|       |
  307|       |    // did we add a char that should not be there
  308|   418k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (308:9): [True: 418k, False: 16]
  |  Branch (308:36): [True: 139k, False: 278k]
  |  Branch (308:51): [True: 278k, False: 0]
  ------------------
  309|   418k|      if (utf8)
  ------------------
  |  Branch (309:11): [True: 156k, False: 261k]
  ------------------
  310|   156k|        extrachar_utf(slst, word_utf, cpdsuggest, info);
  311|   261k|      else
  312|   261k|        extrachar(slst, word, cpdsuggest, info);
  313|   418k|    }
  314|   418k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   418k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (314:9): [True: 0, False: 418k]
  ------------------
  315|      0|      return good_suggestion;
  316|   418k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (316:9): [True: 0, False: 418k]
  |  Branch (316:27): [True: 0, False: 0]
  ------------------
  317|      0|      return true;
  318|       |
  319|       |    // did we forgot a char
  320|   418k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (320:9): [True: 418k, False: 16]
  |  Branch (320:36): [True: 139k, False: 278k]
  |  Branch (320:51): [True: 278k, False: 0]
  ------------------
  321|   418k|      if (utf8)
  ------------------
  |  Branch (321:11): [True: 156k, False: 261k]
  ------------------
  322|   156k|        forgotchar_utf(slst, word_utf, cpdsuggest, info);
  323|   261k|      else
  324|   261k|        forgotchar(slst, word, cpdsuggest, info);
  325|   418k|    }
  326|   418k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   418k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (326:9): [True: 0, False: 418k]
  ------------------
  327|      0|      return good_suggestion;
  328|   418k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (328:9): [True: 0, False: 418k]
  |  Branch (328:27): [True: 0, False: 0]
  ------------------
  329|      0|      return true;
  330|       |
  331|       |    // did we move a char
  332|   418k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (332:9): [True: 418k, False: 16]
  |  Branch (332:36): [True: 139k, False: 278k]
  |  Branch (332:51): [True: 278k, False: 0]
  ------------------
  333|   418k|      if (utf8)
  ------------------
  |  Branch (333:11): [True: 156k, False: 261k]
  ------------------
  334|   156k|        movechar_utf(slst, word_utf, cpdsuggest, info);
  335|   261k|      else
  336|   261k|        movechar(slst, word, cpdsuggest, info);
  337|   418k|    }
  338|   418k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   418k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (338:9): [True: 0, False: 418k]
  ------------------
  339|      0|      return good_suggestion;
  340|   418k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (340:9): [True: 0, False: 418k]
  |  Branch (340:27): [True: 0, False: 0]
  ------------------
  341|      0|      return true;
  342|       |
  343|       |    // did we just hit the wrong key in place of a good char
  344|   418k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (344:9): [True: 418k, False: 16]
  |  Branch (344:36): [True: 139k, False: 278k]
  |  Branch (344:51): [True: 278k, False: 0]
  ------------------
  345|   418k|      if (utf8)
  ------------------
  |  Branch (345:11): [True: 156k, False: 261k]
  ------------------
  346|   156k|        badchar_utf(slst, word_utf, cpdsuggest, info);
  347|   261k|      else
  348|   261k|        badchar(slst, word, cpdsuggest, info);
  349|   418k|    }
  350|   418k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   418k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (350:9): [True: 0, False: 418k]
  ------------------
  351|      0|      return good_suggestion;
  352|   418k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (352:9): [True: 0, False: 418k]
  |  Branch (352:27): [True: 0, False: 0]
  ------------------
  353|      0|      return true;
  354|       |
  355|       |    // did we double two characters
  356|   418k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (356:9): [True: 418k, False: 16]
  |  Branch (356:36): [True: 139k, False: 278k]
  |  Branch (356:51): [True: 278k, False: 0]
  ------------------
  357|   418k|      if (utf8)
  ------------------
  |  Branch (357:11): [True: 156k, False: 261k]
  ------------------
  358|   156k|        doubletwochars_utf(slst, word_utf, cpdsuggest, info);
  359|   261k|      else
  360|   261k|        doubletwochars(slst, word, cpdsuggest, info);
  361|   418k|    }
  362|   418k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   418k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (362:9): [True: 0, False: 418k]
  ------------------
  363|      0|      return good_suggestion;
  364|   418k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (364:9): [True: 0, False: 418k]
  |  Branch (364:27): [True: 0, False: 0]
  ------------------
  365|      0|      return true;
  366|       |
  367|       |    // perhaps we forgot to hit space and two words ran together
  368|       |    // (dictionary word pairs have top priority here, so
  369|       |    // we always suggest them, in despite of nosplitsugs, and
  370|       |    // drop compound word and other suggestions)
  371|   418k|    if (!cpdsuggest || (!nosplitsugs && slst.size() < oldSug + maxcpdsugs)) {
  ------------------
  |  Branch (371:9): [True: 139k, False: 278k]
  |  Branch (371:25): [True: 278k, False: 0]
  |  Branch (371:41): [True: 278k, False: 0]
  ------------------
  372|   418k|      good_suggestion = twowords(slst, word, cpdsuggest, good_suggestion, info);
  373|       |
  374|   418k|      if (info & SPELL_BEST_SUG)
  ------------------
  |  |   86|   418k|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  |  Branch (374:11): [True: 135, False: 417k]
  ------------------
  375|    135|        return true;
  376|   418k|    }
  377|   417k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   417k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (377:9): [True: 0, False: 417k]
  ------------------
  378|      0|      return good_suggestion;
  379|       |
  380|       |    // testing returns after the first loop
  381|   417k|    if (test_simplesug)
  ------------------
  |  Branch (381:9): [True: 0, False: 417k]
  ------------------
  382|      0|      return slst.size() > 0;
  383|       |
  384|       |    // don't need third loop, if the second loop was successful or
  385|       |    // the first loop found a dictionary-based compound word
  386|       |    // (we don't need more, likely worse and false 3-or-more-word compound words)
  387|   417k|    if (cpdsuggest == 1 && (slst.size() > oldSug || (info & SPELL_COMPOUND)))
  ------------------
  |  |   78|   139k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  |  Branch (387:9): [True: 139k, False: 278k]
  |  Branch (387:29): [True: 0, False: 139k]
  |  Branch (387:53): [True: 1, False: 139k]
  ------------------
  388|      1|       nocompoundtwowords = 1;
  389|       |
  390|   417k|  }  // repeating ``for'' statement compounding support
  391|       |
  392|   139k|  if (!nocompoundtwowords && (!slst.empty()) && onlycompoundsug)
  ------------------
  |  Branch (392:7): [True: 139k, False: 200]
  |  Branch (392:30): [True: 16.0k, False: 123k]
  |  Branch (392:49): [True: 16.0k, False: 0]
  ------------------
  393|  16.0k|    *onlycompoundsug = 1;
  394|       |
  395|   139k|  return good_suggestion;
  396|   139k|}
_ZN10SuggestMgr12capchars_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  401|   156k|                              int cpdsuggest, int& info) {
  402|   156k|  std::vector<w_char> candidate_utf(word);
  403|   156k|  mkallcap_utf(candidate_utf, langnum);
  404|   156k|  std::string candidate;
  405|   156k|  u16_u8(candidate, candidate_utf);
  406|   156k|  testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  407|   156k|}
_ZN10SuggestMgr8capcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  412|   261k|                          int cpdsuggest, int& info) {
  413|   261k|  std::string candidate(word);
  414|   261k|  mkallcap(candidate, csconv);
  415|   261k|  testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  416|   261k|}
_ZN10SuggestMgr8mapcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  421|   418k|                         int cpdsuggest, int& info) {
  422|   418k|  std::string candidate;
  423|   418k|  std::chrono::steady_clock::time_point timelimit;
  424|   418k|  int timer;
  425|       |
  426|   418k|  if (word.size() < 2 || !pAMgr)
  ------------------
  |  Branch (426:7): [True: 37.6k, False: 380k]
  |  Branch (426:26): [True: 0, False: 380k]
  ------------------
  427|  37.6k|    return wlst.size();
  428|       |
  429|   380k|  const std::vector<mapentry>& maptable = pAMgr->get_maptable();
  430|   380k|  if (maptable.empty())
  ------------------
  |  Branch (430:7): [True: 365k, False: 15.3k]
  ------------------
  431|   365k|    return wlst.size();
  432|       |
  433|  15.3k|  timelimit = std::chrono::steady_clock::now();
  434|  15.3k|  timer = MINTIMER;
  ------------------
  |  |  107|  15.3k|#define MINTIMER 100
  ------------------
  435|  15.3k|  return map_related(word, candidate, 0, wlst, cpdsuggest,
  436|  15.3k|                     maptable, &timer, &timelimit, 0, info);
  437|   380k|}
_ZN10SuggestMgr11map_relatedERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERS6_mRNS0_6vectorIS6_NS4_IS6_EEEEiRKNSA_ISC_NS4_ISC_EEEEPiPNS0_6chrono10time_pointINSJ_12steady_clockENSJ_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEEiRi:
  447|  6.87M|                            int depth, int& info) {
  448|  6.87M|  if (word.size() == wn) {
  ------------------
  |  Branch (448:7): [True: 2.58M, False: 4.28M]
  ------------------
  449|  2.58M|    if (candidate == word)
  ------------------
  |  Branch (449:9): [True: 15.3k, False: 2.56M]
  ------------------
  450|  15.3k|      return wlst.size();
  451|  2.56M|    const int cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (451:22): [True: 0, False: 2.56M]
  ------------------
  452|  2.56M|    if ((cwrd) && checkword(candidate, cpdsuggest, timer, timelimit)) {
  ------------------
  |  Branch (452:9): [True: 2.56M, False: 0]
  |  Branch (452:19): [True: 0, False: 2.56M]
  ------------------
  453|      0|      if (wlst.size() < maxSug) {
  ------------------
  |  Branch (453:11): [True: 0, False: 0]
  ------------------
  454|      0|        wlst.push_back(candidate);
  455|      0|      }
  456|      0|    }
  457|  2.56M|    return wlst.size();
  458|  2.58M|  }
  459|       |
  460|  4.28M|  if (depth > 0x3F00) {
  ------------------
  |  Branch (460:7): [True: 0, False: 4.28M]
  ------------------
  461|      0|    *timer = 0;
  462|      0|    return wlst.size();
  463|      0|  }
  464|       |
  465|  4.28M|  int in_map = 0;
  466|  17.1M|  for (size_t j = 0; j < maptable.size(); ++j) {
  ------------------
  |  Branch (466:22): [True: 12.8M, False: 4.28M]
  ------------------
  467|  47.1M|    for (size_t k = 0; k < maptable[j].size(); ++k) {
  ------------------
  |  Branch (467:24): [True: 34.2M, False: 12.8M]
  ------------------
  468|  34.2M|      size_t len = maptable[j][k].size();
  469|  34.2M|      if (len && word.compare(wn, len, maptable[j][k]) == 0) {
  ------------------
  |  Branch (469:11): [True: 34.2M, False: 0]
  |  Branch (469:18): [True: 1.28M, False: 33.0M]
  ------------------
  470|  1.28M|        in_map = 1;
  471|  1.28M|        size_t cn = candidate.size();
  472|  5.14M|        for (size_t l = 0; l < maptable[j].size(); ++l) {
  ------------------
  |  Branch (472:28): [True: 3.85M, False: 1.28M]
  ------------------
  473|  3.85M|          candidate.resize(cn);
  474|  3.85M|          candidate.append(maptable[j][l]);
  475|  3.85M|          map_related(word, candidate, wn + len, wlst,
  476|  3.85M|                           cpdsuggest, maptable, timer, timelimit, depth + 1, info);
  477|  3.85M|          if (!(*timer))
  ------------------
  |  Branch (477:15): [True: 962, False: 3.85M]
  ------------------
  478|    962|            return wlst.size();
  479|  3.85M|          if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS) {
  ------------------
  |  |  105|  3.85M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (479:15): [True: 10, False: 3.85M]
  ------------------
  480|     10|            *timer = 0;
  481|     10|            return wlst.size();
  482|     10|          }
  483|  3.85M|        }
  484|  1.28M|      }
  485|  34.2M|    }
  486|  12.8M|  }
  487|  4.28M|  if (!in_map) {
  ------------------
  |  Branch (487:7): [True: 3.00M, False: 1.28M]
  ------------------
  488|  3.00M|    candidate.push_back(word[wn]);
  489|  3.00M|    map_related(word, candidate, wn + 1, wlst, cpdsuggest,
  490|  3.00M|                maptable, timer, timelimit, depth + 1, info);
  491|  3.00M|  }
  492|  4.28M|  return wlst.size();
  493|  4.28M|}
_ZN10SuggestMgr9replcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  499|   418k|                          int cpdsuggest, int& info) {
  500|   418k|  std::string candidate;
  501|   418k|  int wl = word.size();
  502|   418k|  if (wl < 2 || !pAMgr)
  ------------------
  |  Branch (502:7): [True: 37.6k, False: 380k]
  |  Branch (502:17): [True: 0, False: 380k]
  ------------------
  503|  37.6k|    return wlst.size();
  504|   380k|  const std::vector<replentry>& reptable = pAMgr->get_reptable();
  505|   380k|  auto replchars_start = std::chrono::steady_clock::now();
  506|   380k|  for (const auto& entry : reptable) {
  ------------------
  |  Branch (506:26): [True: 78.6k, False: 380k]
  ------------------
  507|  78.6k|    size_t r = 0;
  508|       |    // search every occurence of the pattern in the word
  509|  79.5k|    while ((r = word.find(entry.pattern, r)) != std::string::npos) {
  ------------------
  |  Branch (509:12): [True: 924, False: 78.6k]
  ------------------
  510|    924|      if (std::chrono::steady_clock::now() - replchars_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|    924|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (510:11): [True: 0, False: 924]
  ------------------
  511|      0|        return wlst.size();
  512|    924|      int type = (r == 0) ? 1 : 0;
  ------------------
  |  Branch (512:18): [True: 0, False: 924]
  ------------------
  513|    924|      if (r + entry.pattern.size() == word.size())
  ------------------
  |  Branch (513:11): [True: 0, False: 924]
  ------------------
  514|      0|        type += 2;
  515|    924|      while (type && entry.outstrings[type].empty())
  ------------------
  |  Branch (515:14): [True: 0, False: 924]
  |  Branch (515:22): [True: 0, False: 0]
  ------------------
  516|      0|        type = (type == 2 && r != 0) ? 0 : type - 1;
  ------------------
  |  Branch (516:17): [True: 0, False: 0]
  |  Branch (516:30): [True: 0, False: 0]
  ------------------
  517|    924|      const std::string&out = entry.outstrings[type];
  518|    924|      if (out.empty()) {
  ------------------
  |  Branch (518:11): [True: 0, False: 924]
  ------------------
  519|      0|        ++r;
  520|      0|        continue;
  521|      0|      }
  522|    924|      candidate.assign(word, 0, r);
  523|    924|      candidate.append(entry.outstrings[type]);
  524|    924|      candidate.append(word, r + entry.pattern.size(), std::string::npos);
  525|    924|      size_t sp = candidate.find(' ');
  526|    924|      size_t oldns = wlst.size();
  527|    924|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  528|    924|      if (oldns < wlst.size()) {
  ------------------
  |  Branch (528:11): [True: 0, False: 924]
  ------------------
  529|       |        // REP suggestions are the best, don't search other type of suggestions
  530|      0|        info |= SPELL_BEST_SUG;
  ------------------
  |  |   86|      0|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  531|      0|      }
  532|       |
  533|       |      // check REP suggestions with space
  534|    924|      if (sp != std::string::npos) {
  ------------------
  |  Branch (534:11): [True: 240, False: 684]
  ------------------
  535|    240|        size_t prev = 0;
  536|    480|        while (sp != std::string::npos) {
  ------------------
  |  Branch (536:16): [True: 240, False: 240]
  ------------------
  537|    240|          std::string prev_chunk = candidate.substr(prev, sp - prev);
  538|    240|          if (checkword(prev_chunk, 0, nullptr, nullptr)) {
  ------------------
  |  Branch (538:15): [True: 0, False: 240]
  ------------------
  539|      0|            oldns = wlst.size();
  540|      0|            std::string post_chunk = candidate.substr(sp + 1);
  541|      0|            testsug(wlst, post_chunk, cpdsuggest, nullptr, nullptr, info);
  542|      0|            if (oldns < wlst.size()) {
  ------------------
  |  Branch (542:17): [True: 0, False: 0]
  ------------------
  543|      0|              wlst[wlst.size() - 1] = candidate;
  544|      0|            }
  545|      0|          }
  546|    240|          prev = sp + 1;
  547|    240|          sp = candidate.find(' ', prev);
  548|    240|        }
  549|    240|      }
  550|    924|      r++;  // search for the next letter
  551|    924|    }
  552|  78.6k|  }
  553|   380k|  return wlst.size();
  554|   380k|}
_ZN10SuggestMgr14doubletwocharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  563|   261k|                               int cpdsuggest, int& info) {
  564|   261k|  size_t wl = word.size();
  565|   261k|  if (wl < 5 || !pAMgr)
  ------------------
  |  Branch (565:7): [True: 57.2k, False: 204k]
  |  Branch (565:17): [True: 0, False: 204k]
  ------------------
  566|  57.2k|    return wlst.size();
  567|       |
  568|   204k|  int state = 0;
  569|  5.01M|  for (size_t i = 2; i < wl; ++i) {
  ------------------
  |  Branch (569:22): [True: 4.81M, False: 204k]
  ------------------
  570|  4.81M|    if (word[i] == word[i - 2]) {
  ------------------
  |  Branch (570:9): [True: 1.23M, False: 3.57M]
  ------------------
  571|  1.23M|      state++;
  572|  1.23M|      if (state == 3 || (state == 2 && i >= 4)) {
  ------------------
  |  Branch (572:11): [True: 6.60k, False: 1.23M]
  |  Branch (572:26): [True: 446k, False: 784k]
  |  Branch (572:40): [True: 437k, False: 9.06k]
  ------------------
  573|   444k|        auto word_iter = word.begin();
  574|   444k|        std::string candidate(word_iter, word_iter + i - 1);
  575|   444k|        candidate.insert(candidate.end(), word_iter + i + 1, word.end());
  576|   444k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  577|   444k|        state = 0;
  578|   444k|      }
  579|  3.57M|    } else {
  580|  3.57M|      state = 0;
  581|  3.57M|    }
  582|  4.81M|  }
  583|   204k|  return wlst.size();
  584|   261k|}
_ZN10SuggestMgr18doubletwochars_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  593|   156k|                                   int cpdsuggest, int& info) {
  594|   156k|  size_t wl = word.size();
  595|   156k|  int state = 0;
  596|   156k|  if (wl < 5 || !pAMgr)
  ------------------
  |  Branch (596:7): [True: 57.5k, False: 99.2k]
  |  Branch (596:17): [True: 0, False: 99.2k]
  ------------------
  597|  57.5k|    return wlst.size();
  598|  1.63M|  for (size_t i = 2; i < wl; ++i) {
  ------------------
  |  Branch (598:22): [True: 1.53M, False: 99.2k]
  ------------------
  599|  1.53M|    if (word[i] == word[i - 2]) {
  ------------------
  |  Branch (599:9): [True: 471k, False: 1.06M]
  ------------------
  600|   471k|      state++;
  601|   471k|      if (state == 3 || (state == 2 && i >= 4)) {
  ------------------
  |  Branch (601:11): [True: 3.91k, False: 467k]
  |  Branch (601:26): [True: 165k, False: 301k]
  |  Branch (601:40): [True: 160k, False: 5.67k]
  ------------------
  602|   164k|        auto word_iter = word.begin();
  603|   164k|        std::vector<w_char> candidate_utf(word_iter, word_iter + i - 1);
  604|   164k|        candidate_utf.insert(candidate_utf.end(), word_iter + i + 1, word.end());
  605|   164k|        std::string candidate;
  606|   164k|        u16_u8(candidate, candidate_utf);
  607|   164k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  608|   164k|        state = 0;
  609|   164k|      }
  610|  1.06M|    } else {
  611|  1.06M|      state = 0;
  612|  1.06M|    }
  613|  1.53M|  }
  614|  99.2k|  return wlst.size();
  615|   156k|}
_ZN10SuggestMgr10badcharkeyERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  621|   261k|                           int cpdsuggest, int& info) {
  622|   261k|  std::string candidate(word);
  623|       |
  624|       |  // swap out each char one by one and try uppercase and neighbor
  625|       |  // keyboard chars in its place to see if that makes a good word
  626|  5.61M|  for (size_t i = 0, wl = candidate.size(); i < wl; ++i) {
  ------------------
  |  Branch (626:45): [True: 5.35M, False: 261k]
  ------------------
  627|  5.35M|    char tmpc = candidate[i];
  628|       |    // check with uppercase letters
  629|  5.35M|    candidate[i] = csconv[((unsigned char)tmpc)].cupper;
  630|  5.35M|    if (tmpc != candidate[i]) {
  ------------------
  |  Branch (630:9): [True: 1.35M, False: 4.00M]
  ------------------
  631|  1.35M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  632|  1.35M|      candidate[i] = tmpc;
  633|  1.35M|    }
  634|       |    // check neighbor characters in keyboard string
  635|  5.35M|    if (ckey.empty())
  ------------------
  |  Branch (635:9): [True: 0, False: 5.35M]
  ------------------
  636|      0|      continue;
  637|  5.35M|    size_t loc = 0;
  638|   139M|    while ((loc < ckeyl) && ckey[loc] != tmpc)
  ------------------
  |  Branch (638:12): [True: 135M, False: 4.42M]
  |  Branch (638:29): [True: 134M, False: 924k]
  ------------------
  639|   134M|      ++loc;
  640|  6.32M|    while (loc < ckeyl) {
  ------------------
  |  Branch (640:12): [True: 966k, False: 5.35M]
  ------------------
  641|       |      // a long keyboard string can hold many neighbours for this
  642|       |      // character, so give up once the overall time budget is spent
  643|   966k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   966k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (643:11): [True: 0, False: 966k]
  ------------------
  644|      0|        return wlst.size();
  645|   966k|      if ((loc > 0) && ckey[loc - 1] != '|') {
  ------------------
  |  Branch (645:11): [True: 807k, False: 158k]
  |  Branch (645:24): [True: 772k, False: 35.4k]
  ------------------
  646|   772k|        candidate[i] = ckey[loc - 1];
  647|   772k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  648|   772k|      }
  649|   966k|      if (((loc + 1) < ckeyl) && (ckey[loc + 1] != '|')) {
  ------------------
  |  Branch (649:11): [True: 878k, False: 88.0k]
  |  Branch (649:34): [True: 816k, False: 61.7k]
  ------------------
  650|   816k|        candidate[i] = ckey[loc + 1];
  651|   816k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  652|   816k|      }
  653|  15.5M|      do {
  654|  15.5M|        loc++;
  655|  15.5M|      } while ((loc < ckeyl) && ckey[loc] != tmpc);
  ------------------
  |  Branch (655:16): [True: 14.6M, False: 924k]
  |  Branch (655:33): [True: 14.6M, False: 42.1k]
  ------------------
  656|   966k|    }
  657|  5.35M|    candidate[i] = tmpc;
  658|  5.35M|  }
  659|   261k|  return wlst.size();
  660|   261k|}
_ZN10SuggestMgr14badcharkey_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  666|   156k|                               int cpdsuggest, int& info) {
  667|   156k|  std::string candidate;
  668|   156k|  std::vector<w_char> candidate_utf(word);
  669|       |  // swap out each char one by one and try all the tryme
  670|       |  // chars in its place to see if that makes a good word
  671|  2.03M|  for (size_t i = 0, wl = word.size(); i < wl; ++i) {
  ------------------
  |  Branch (671:40): [True: 1.88M, False: 156k]
  ------------------
  672|  1.88M|    w_char tmpc = candidate_utf[i];
  673|       |    // check with uppercase letters
  674|  1.88M|    candidate_utf[i] = upper_utf(candidate_utf[i], 1);
  675|  1.88M|    if (tmpc != candidate_utf[i]) {
  ------------------
  |  Branch (675:9): [True: 447k, False: 1.43M]
  ------------------
  676|   447k|      u16_u8(candidate, candidate_utf);
  677|   447k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  678|   447k|      candidate_utf[i] = tmpc;
  679|   447k|    }
  680|       |    // check neighbor characters in keyboard string
  681|  1.88M|    if (ckey_utf.empty())
  ------------------
  |  Branch (681:9): [True: 0, False: 1.88M]
  ------------------
  682|      0|      continue;
  683|  1.88M|    size_t loc = 0;
  684|  46.4M|    while ((loc < ckeyl) && ckey_utf[loc] != tmpc)
  ------------------
  |  Branch (684:12): [True: 45.0M, False: 1.42M]
  |  Branch (684:29): [True: 44.6M, False: 460k]
  ------------------
  685|  44.6M|      ++loc;
  686|  2.35M|    while (loc < ckeyl) {
  ------------------
  |  Branch (686:12): [True: 475k, False: 1.88M]
  ------------------
  687|       |      // a long keyboard string can hold many neighbours for this
  688|       |      // character, so give up once the overall time budget is spent
  689|   475k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   475k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (689:11): [True: 0, False: 475k]
  ------------------
  690|      0|        return wlst.size();
  691|   475k|      if ((loc > 0) && ckey_utf[loc - 1] != W_VLINE) {
  ------------------
  |  Branch (691:11): [True: 377k, False: 98.4k]
  |  Branch (691:24): [True: 377k, False: 0]
  ------------------
  692|   377k|        candidate_utf[i] = ckey_utf[loc - 1];
  693|   377k|        u16_u8(candidate, candidate_utf);
  694|   377k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  695|   377k|      }
  696|   475k|      if (((loc + 1) < ckeyl) && (ckey_utf[loc + 1] != W_VLINE)) {
  ------------------
  |  Branch (696:11): [True: 435k, False: 40.2k]
  |  Branch (696:34): [True: 435k, False: 0]
  ------------------
  697|   435k|        candidate_utf[i] = ckey_utf[loc + 1];
  698|   435k|        u16_u8(candidate, candidate_utf);
  699|   435k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  700|   435k|      }
  701|  8.05M|      do {
  702|  8.05M|        loc++;
  703|  8.05M|      } while ((loc < ckeyl) && ckey_utf[loc] != tmpc);
  ------------------
  |  Branch (703:16): [True: 7.59M, False: 460k]
  |  Branch (703:33): [True: 7.57M, False: 15.1k]
  ------------------
  704|   475k|    }
  705|  1.88M|    candidate_utf[i] = tmpc;
  706|  1.88M|  }
  707|   156k|  return wlst.size();
  708|   156k|}
_ZN10SuggestMgr7badcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  713|   261k|                               int cpdsuggest, int& info) {
  714|   261k|  std::string candidate(word);
  715|   261k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  716|   261k|  int timer = MINTIMER;
  ------------------
  |  |  107|   261k|#define MINTIMER 100
  ------------------
  717|       |  // swap out each char one by one and try all the tryme
  718|       |  // chars in its place to see if that makes a good word
  719|   261k|  for (size_t j = 0; j < ctryl; ++j) {
  ------------------
  |  Branch (719:22): [True: 0, False: 261k]
  ------------------
  720|      0|    for (auto aI = candidate.rbegin(), aEnd = candidate.rend(); aI != aEnd; ++aI) {
  ------------------
  |  Branch (720:65): [True: 0, False: 0]
  ------------------
  721|      0|      char tmpc = *aI;
  722|      0|      if (ctry[j] == tmpc)
  ------------------
  |  Branch (722:11): [True: 0, False: 0]
  ------------------
  723|      0|        continue;
  724|      0|      *aI = ctry[j];
  725|      0|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  726|      0|      if (!timer)
  ------------------
  |  Branch (726:11): [True: 0, False: 0]
  ------------------
  727|      0|        return wlst.size();
  728|      0|      *aI = tmpc;
  729|      0|    }
  730|      0|  }
  731|   261k|  return wlst.size();
  732|   261k|}
_ZN10SuggestMgr11badchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  737|   156k|                            int cpdsuggest, int& info) {
  738|   156k|  std::vector<w_char> candidate_utf(word);
  739|   156k|  std::string candidate;
  740|   156k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  741|   156k|  int timer = MINTIMER;
  ------------------
  |  |  107|   156k|#define MINTIMER 100
  ------------------
  742|       |  // swap out each char one by one and try all the tryme
  743|       |  // chars in its place to see if that makes a good word
  744|   175k|  for (size_t j = 0; j < ctryl; ++j) {
  ------------------
  |  Branch (744:22): [True: 18.3k, False: 156k]
  ------------------
  745|   239k|    for (auto aI = candidate_utf.rbegin(), aEnd = candidate_utf.rend(); aI != aEnd; ++aI) {
  ------------------
  |  Branch (745:73): [True: 221k, False: 18.3k]
  ------------------
  746|   221k|      w_char tmpc = *aI;
  747|   221k|      if (tmpc == ctry_utf[j])
  ------------------
  |  Branch (747:11): [True: 0, False: 221k]
  ------------------
  748|      0|        continue;
  749|   221k|      *aI = ctry_utf[j];
  750|   221k|      u16_u8(candidate, candidate_utf);
  751|   221k|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  752|   221k|      if (!timer)
  ------------------
  |  Branch (752:11): [True: 0, False: 221k]
  ------------------
  753|      0|        return wlst.size();
  754|   221k|      *aI = tmpc;
  755|   221k|    }
  756|  18.3k|  }
  757|   156k|  return wlst.size();
  758|   156k|}
_ZN10SuggestMgr13extrachar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  763|   156k|                              int cpdsuggest, int& info) {
  764|   156k|  std::vector<w_char> candidate_utf(word);
  765|   156k|  if (candidate_utf.size() < 2)
  ------------------
  |  Branch (765:7): [True: 17.4k, False: 139k]
  ------------------
  766|  17.4k|    return wlst.size();
  767|       |  // try omitting one char of word at a time
  768|  2.00M|  for (size_t i = 0; i < candidate_utf.size(); ++i) {
  ------------------
  |  Branch (768:22): [True: 1.86M, False: 139k]
  ------------------
  769|  1.86M|    size_t index = candidate_utf.size() - 1 - i;
  770|  1.86M|    w_char tmpc = candidate_utf[index];
  771|  1.86M|    candidate_utf.erase(candidate_utf.begin() + index);
  772|  1.86M|    std::string candidate;
  773|  1.86M|    u16_u8(candidate, candidate_utf);
  774|  1.86M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  775|  1.86M|    candidate_utf.insert(candidate_utf.begin() + index, tmpc);
  776|  1.86M|  }
  777|   139k|  return wlst.size();
  778|   156k|}
_ZN10SuggestMgr9extracharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  783|   261k|                          int cpdsuggest, int& info) {
  784|   261k|  std::string candidate(word);
  785|   261k|  if (candidate.size() < 2)
  ------------------
  |  Branch (785:7): [True: 20.7k, False: 240k]
  ------------------
  786|  20.7k|    return wlst.size();
  787|       |  // try omitting one char of word at a time
  788|  5.57M|  for (size_t i = 0; i < candidate.size(); ++i) {
  ------------------
  |  Branch (788:22): [True: 5.33M, False: 240k]
  ------------------
  789|  5.33M|    size_t index = candidate.size() - 1 - i;
  790|  5.33M|    char tmpc = candidate[index];
  791|  5.33M|    candidate.erase(candidate.begin() + index);
  792|  5.33M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  793|  5.33M|    candidate.insert(candidate.begin() + index, tmpc);
  794|  5.33M|  }
  795|   240k|  return wlst.size();
  796|   261k|}
_ZN10SuggestMgr10forgotcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  801|   261k|                           int cpdsuggest, int& info) {
  802|   261k|  std::string candidate(word);
  803|   261k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  804|   261k|  int timer = MINTIMER;
  ------------------
  |  |  107|   261k|#define MINTIMER 100
  ------------------
  805|       |
  806|       |  // try inserting a tryme character before every letter (and the null
  807|       |  // terminator)
  808|   261k|  for (size_t k = 0; k < ctryl; ++k) {
  ------------------
  |  Branch (808:22): [True: 0, False: 261k]
  ------------------
  809|      0|    for (size_t i = 0; i <= candidate.size(); ++i) {
  ------------------
  |  Branch (809:24): [True: 0, False: 0]
  ------------------
  810|      0|      size_t index = candidate.size() - i;
  811|      0|      candidate.insert(candidate.begin() + index, ctry[k]);
  812|      0|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  813|      0|      if (!timer)
  ------------------
  |  Branch (813:11): [True: 0, False: 0]
  ------------------
  814|      0|        return wlst.size();
  815|      0|      candidate.erase(candidate.begin() + index);
  816|      0|    }
  817|      0|  }
  818|   261k|  return wlst.size();
  819|   261k|}
_ZN10SuggestMgr14forgotchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  824|   156k|                               int cpdsuggest, int& info) {
  825|   156k|  std::vector<w_char> candidate_utf(word);
  826|   156k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  827|   156k|  int timer = MINTIMER;
  ------------------
  |  |  107|   156k|#define MINTIMER 100
  ------------------
  828|       |
  829|       |  // try inserting a tryme character at the end of the word and before every
  830|       |  // letter
  831|   175k|  for (size_t k = 0; k < ctryl; ++k) {
  ------------------
  |  Branch (831:22): [True: 18.3k, False: 156k]
  ------------------
  832|   258k|    for (size_t i = 0; i <= candidate_utf.size(); ++i) {
  ------------------
  |  Branch (832:24): [True: 239k, False: 18.3k]
  ------------------
  833|   239k|      size_t index = candidate_utf.size() - i;
  834|   239k|      candidate_utf.insert(candidate_utf.begin() + index, ctry_utf[k]);
  835|   239k|      std::string candidate;
  836|   239k|      u16_u8(candidate, candidate_utf);
  837|   239k|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  838|   239k|      if (!timer)
  ------------------
  |  Branch (838:11): [True: 0, False: 239k]
  ------------------
  839|      0|        return wlst.size();
  840|   239k|      candidate_utf.erase(candidate_utf.begin() + index);
  841|   239k|    }
  842|  18.3k|  }
  843|   156k|  return wlst.size();
  844|   156k|}
_ZN10SuggestMgr8twowordsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_ibRi:
  854|   418k|                         bool good, int& info) {
  855|   418k|  int c2, forbidden = 0, cwrd, wl = word.size();
  856|   418k|  if (wl < 3)
  ------------------
  |  Branch (856:7): [True: 58.8k, False: 359k]
  ------------------
  857|  58.8k|    return false;
  858|       |
  859|   359k|  if (langnum == LANG_hu)
  ------------------
  |  Branch (859:7): [True: 14.5k, False: 344k]
  ------------------
  860|  14.5k|    forbidden = check_forbidden(word);
  861|       |
  862|   359k|  char* candidate = new char[wl + 2];
  863|   359k|  memcpy(candidate + 1, word.data(), wl);
  864|   359k|  candidate[wl + 1] = 0;
  865|       |
  866|       |  // split the string into two pieces after every char
  867|       |  // if both pieces are good words make them a suggestion
  868|  4.76M|  for (char* p = candidate + 1; p[1] != '\0'; p++) {
  ------------------
  |  Branch (868:33): [True: 4.43M, False: 323k]
  ------------------
  869|  4.43M|    p[-1] = *p;
  870|       |    // go to end of the UTF-8 character
  871|  4.68M|    while (utf8 && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (871:12): [True: 1.50M, False: 3.17M]
  |  Branch (871:20): [True: 245k, False: 1.26M]
  ------------------
  872|   245k|      *p = p[1];
  873|   245k|      p++;
  874|   245k|    }
  875|  4.43M|    if (utf8 && p[1] == '\0')
  ------------------
  |  Branch (875:9): [True: 1.26M, False: 3.17M]
  |  Branch (875:17): [True: 35.2k, False: 1.22M]
  ------------------
  876|  35.2k|      break;  // last UTF-8 character
  877|       |
  878|       |    // Suggest only word pairs, if they are listed in the dictionary.
  879|       |    // For example, adding "a lot" to the English dic file will
  880|       |    // result only "alot" -> "a lot" suggestion instead of
  881|       |    // "alto, slot, alt, lot, allot, aloft, aloe, clot, plot, blot, a lot".
  882|       |    // Note: using "ph:alot" keeps the other suggestions:
  883|       |    // a lot ph:alot
  884|       |    // alot -> a lot, alto, slot...
  885|  4.40M|    *p = ' ';
  886|  4.40M|    if (!cpdsuggest && checkword(candidate, cpdsuggest, nullptr, nullptr)) {
  ------------------
  |  Branch (886:9): [True: 1.46M, False: 2.93M]
  |  Branch (886:9): [True: 1.21k, False: 4.40M]
  |  Branch (886:24): [True: 1.21k, False: 1.46M]
  ------------------
  887|       |      // best solution
  888|  1.21k|      info |= SPELL_BEST_SUG;
  ------------------
  |  |   86|  1.21k|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  889|       |
  890|       |      // remove not word pair suggestions
  891|  1.21k|      if (!good) {
  ------------------
  |  Branch (891:11): [True: 135, False: 1.07k]
  ------------------
  892|    135|        good = true;
  893|    135|        wlst.clear();
  894|    135|      }
  895|       |
  896|  1.21k|      wlst.insert(wlst.begin(), candidate);
  897|  1.21k|    }
  898|       |
  899|       |    // word pairs with dash?
  900|  4.40M|    if (lang_with_dash_usage) {
  ------------------
  |  Branch (900:9): [True: 0, False: 4.40M]
  ------------------
  901|      0|      *p = '-';
  902|       |
  903|      0|      if (!cpdsuggest && checkword(candidate, cpdsuggest, nullptr, nullptr)) {
  ------------------
  |  Branch (903:11): [True: 0, False: 0]
  |  Branch (903:11): [True: 0, False: 0]
  |  Branch (903:26): [True: 0, False: 0]
  ------------------
  904|       |        // best solution
  905|      0|        info |= SPELL_BEST_SUG;
  ------------------
  |  |   86|      0|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  906|       |
  907|       |        // remove not word pair suggestions
  908|      0|        if (!good) {
  ------------------
  |  Branch (908:13): [True: 0, False: 0]
  ------------------
  909|      0|          good = true;
  910|      0|          wlst.clear();
  911|      0|        }
  912|      0|        wlst.insert(wlst.begin(), candidate);
  913|      0|      }
  914|      0|    }
  915|       |
  916|  4.40M|    if (wlst.size() < maxSug && !nosplitsugs && !good) {
  ------------------
  |  Branch (916:9): [True: 4.40M, False: 353]
  |  Branch (916:33): [True: 4.40M, False: 0]
  |  Branch (916:49): [True: 4.40M, False: 860]
  ------------------
  917|  4.40M|      *p = '\0';
  918|  4.40M|      int c1 = checkword(candidate, cpdsuggest, nullptr, nullptr);
  919|  4.40M|      if (c1) {
  ------------------
  |  Branch (919:11): [True: 38.5k, False: 4.36M]
  ------------------
  920|  38.5k|        c2 = checkword((p + 1), cpdsuggest, nullptr, nullptr);
  921|  38.5k|        if (c2) {
  ------------------
  |  Branch (921:13): [True: 1.10k, False: 37.4k]
  ------------------
  922|       |          // spec. Hungarian code (TODO need a better compound word support)
  923|  1.10k|          if ((langnum == LANG_hu) && !forbidden &&
  ------------------
  |  Branch (923:15): [True: 26, False: 1.08k]
  |  Branch (923:39): [True: 26, False: 0]
  ------------------
  924|       |              // if 3 repeating letter, use - instead of space
  925|     26|              (((p[-1] == p[1]) &&
  ------------------
  |  Branch (925:17): [True: 16, False: 10]
  ------------------
  926|     16|              (((p > candidate + 1) && (p[-1] == p[-2])) || (p[-1] == p[2]))) ||
  ------------------
  |  Branch (926:17): [True: 0, False: 16]
  |  Branch (926:40): [True: 0, False: 0]
  |  Branch (926:61): [True: 0, False: 16]
  ------------------
  927|       |              // or multiple compounding, with more, than 6 syllables
  928|     26|              ((c1 == 3) && (c2 >= 2))))
  ------------------
  |  Branch (928:16): [True: 0, False: 26]
  |  Branch (928:29): [True: 0, False: 0]
  ------------------
  929|      0|            *p = '-';
  930|  1.10k|          else
  931|  1.10k|            *p = ' ';
  932|       |
  933|  1.10k|          cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (933:18): [True: 17, False: 1.09k]
  ------------------
  934|       |
  935|  1.10k|          if (cwrd && (wlst.size() < maxSug))
  ------------------
  |  Branch (935:15): [True: 1.09k, False: 17]
  |  Branch (935:23): [True: 1.09k, False: 0]
  ------------------
  936|  1.09k|              wlst.emplace_back(candidate);
  937|       |
  938|       |          // add two word suggestion with dash, depending on the language
  939|       |          // Note that cwrd doesn't modified for REP twoword sugg.
  940|  1.10k|          if ( !nosplitsugs && lang_with_dash_usage &&
  ------------------
  |  Branch (940:16): [True: 1.10k, False: 0]
  |  Branch (940:32): [True: 0, False: 1.10k]
  ------------------
  941|      0|              mystrlen(p + 1) > 1 && mystrlen(candidate) - mystrlen(p) > 1) {
  ------------------
  |  Branch (941:15): [True: 0, False: 0]
  |  Branch (941:38): [True: 0, False: 0]
  ------------------
  942|      0|            *p = '-';
  943|      0|            for (auto& k : wlst) {
  ------------------
  |  Branch (943:26): [True: 0, False: 0]
  ------------------
  944|      0|              if (k == candidate) {
  ------------------
  |  Branch (944:19): [True: 0, False: 0]
  ------------------
  945|      0|                cwrd = 0;
  946|      0|                break;
  947|      0|              }
  948|      0|            }
  949|       |
  950|      0|            if ((wlst.size() < maxSug) && cwrd)
  ------------------
  |  Branch (950:17): [True: 0, False: 0]
  |  Branch (950:43): [True: 0, False: 0]
  ------------------
  951|      0|              wlst.emplace_back(candidate);
  952|      0|          }
  953|  1.10k|        }
  954|  38.5k|      }
  955|  4.40M|    }
  956|  4.40M|  }
  957|   359k|  delete[] candidate;
  958|   359k|  return good;
  959|   418k|}
_ZN10SuggestMgr8swapcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  964|   261k|                         int cpdsuggest, int& info) {
  965|   261k|  if (word.size() < 2)
  ------------------
  |  Branch (965:7): [True: 20.7k, False: 240k]
  ------------------
  966|  20.7k|    return wlst.size();
  967|       |
  968|   240k|  std::string candidate(word);
  969|       |
  970|       |  // try swapping adjacent chars one by one
  971|  5.33M|  for (size_t i = 0; i < candidate.size() - 1; ++i) {
  ------------------
  |  Branch (971:22): [True: 5.09M, False: 240k]
  ------------------
  972|  5.09M|    std::swap(candidate[i], candidate[i+1]);
  973|  5.09M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  974|  5.09M|    std::swap(candidate[i], candidate[i+1]);
  975|  5.09M|  }
  976|       |
  977|       |  // try double swaps for short words
  978|       |  // ahev -> have, owudl -> would
  979|   240k|  if (candidate.size() == 4 || candidate.size() == 5) {
  ------------------
  |  Branch (979:7): [True: 14.0k, False: 226k]
  |  Branch (979:32): [True: 10.0k, False: 216k]
  ------------------
  980|  24.0k|    candidate[0] = word[1];
  981|  24.0k|    candidate[1] = word[0];
  982|  24.0k|    candidate[2] = word[2];
  983|  24.0k|    candidate[candidate.size() - 2] = word[candidate.size() - 1];
  984|  24.0k|    candidate[candidate.size() - 1] = word[candidate.size() - 2];
  985|  24.0k|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  986|  24.0k|    if (candidate.size() == 5) {
  ------------------
  |  Branch (986:9): [True: 10.0k, False: 14.0k]
  ------------------
  987|  10.0k|      candidate[0] = word[0];
  988|  10.0k|      candidate[1] = word[2];
  989|  10.0k|      candidate[2] = word[1];
  990|  10.0k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  991|  10.0k|    }
  992|  24.0k|  }
  993|       |
  994|   240k|  return wlst.size();
  995|   261k|}
_ZN10SuggestMgr12swapchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1000|   156k|                             int cpdsuggest, int& info) {
 1001|   156k|  if (word.size() < 2)
  ------------------
  |  Branch (1001:7): [True: 17.4k, False: 139k]
  ------------------
 1002|  17.4k|    return wlst.size();
 1003|       |
 1004|   139k|  std::vector<w_char> candidate_utf(word);
 1005|       |
 1006|   139k|  std::string candidate;
 1007|       |  // try swapping adjacent chars one by one
 1008|  1.86M|  for (size_t i = 0; i < candidate_utf.size() - 1; ++i) {
  ------------------
  |  Branch (1008:22): [True: 1.72M, False: 139k]
  ------------------
 1009|  1.72M|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|  1.72M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (1009:9): [True: 0, False: 1.72M]
  ------------------
 1010|      0|      return wlst.size();
 1011|  1.72M|    std::swap(candidate_utf[i], candidate_utf[i+1]);
 1012|  1.72M|    u16_u8(candidate, candidate_utf);
 1013|  1.72M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1014|  1.72M|    std::swap(candidate_utf[i], candidate_utf[i+1]);
 1015|  1.72M|  }
 1016|       |
 1017|       |  // try double swaps for short words
 1018|       |  // ahev -> have, owudl -> would, suodn -> sound
 1019|   139k|  if (candidate_utf.size() == 4 || candidate_utf.size() == 5) {
  ------------------
  |  Branch (1019:7): [True: 19.1k, False: 120k]
  |  Branch (1019:36): [True: 9.35k, False: 110k]
  ------------------
 1020|  28.5k|    candidate_utf[0] = word[1];
 1021|  28.5k|    candidate_utf[1] = word[0];
 1022|  28.5k|    candidate_utf[2] = word[2];
 1023|  28.5k|    candidate_utf[candidate_utf.size() - 2] = word[candidate_utf.size() - 1];
 1024|  28.5k|    candidate_utf[candidate_utf.size() - 1] = word[candidate_utf.size() - 2];
 1025|  28.5k|    u16_u8(candidate, candidate_utf);
 1026|  28.5k|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1027|  28.5k|    if (candidate_utf.size() == 5) {
  ------------------
  |  Branch (1027:9): [True: 9.35k, False: 19.1k]
  ------------------
 1028|  9.35k|      candidate_utf[0] = word[0];
 1029|  9.35k|      candidate_utf[1] = word[2];
 1030|  9.35k|      candidate_utf[2] = word[1];
 1031|  9.35k|      u16_u8(candidate, candidate_utf);
 1032|  9.35k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1033|  9.35k|    }
 1034|  28.5k|  }
 1035|   139k|  return wlst.size();
 1036|   139k|}
_ZN10SuggestMgr12longswapcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
 1041|   261k|                             int cpdsuggest, int& info) {
 1042|   261k|  std::string candidate(word);
 1043|       |  // try swapping not adjacent chars one by one
 1044|  5.61M|  for (auto p = candidate.begin(); p < candidate.end(); ++p) {
  ------------------
  |  Branch (1044:36): [True: 5.35M, False: 261k]
  ------------------
 1045|   196M|    for (auto q = candidate.begin(); q < candidate.end(); ++q) {
  ------------------
  |  Branch (1045:38): [True: 190M, False: 5.35M]
  ------------------
 1046|   190M|      const auto distance = std::abs(std::distance(q, p));
 1047|   190M|      if (distance > 1 && distance <= MAX_CHAR_DISTANCE && *p != *q) {
  ------------------
  |  |   84|   366M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1047:11): [True: 175M, False: 15.5M]
  |  Branch (1047:27): [True: 27.7M, False: 147M]
  |  Branch (1047:60): [True: 20.9M, False: 6.82M]
  ------------------
 1048|  20.9M|        std::swap(*p, *q);
 1049|  20.9M|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1050|  20.9M|        std::swap(*p, *q);
 1051|  20.9M|      }
 1052|   190M|    }
 1053|  5.35M|  }
 1054|   261k|  return wlst.size();
 1055|   261k|}
_ZN10SuggestMgr16longswapchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1060|   156k|                                 int cpdsuggest, int& info) {
 1061|   156k|  std::vector<w_char> candidate_utf(word);
 1062|       |  // try swapping not adjacent chars
 1063|  2.03M|  for (auto p = candidate_utf.begin(); p < candidate_utf.end(); ++p) {
  ------------------
  |  Branch (1063:40): [True: 1.88M, False: 156k]
  ------------------
 1064|  50.7M|    for (auto q = candidate_utf.begin(); q < candidate_utf.end(); ++q) {
  ------------------
  |  Branch (1064:42): [True: 48.8M, False: 1.88M]
  ------------------
 1065|  48.8M|      const auto distance = std::abs(std::distance(q, p));
 1066|  48.8M|      if (distance > 1 && distance <= MAX_CHAR_DISTANCE && *p != *q) {
  ------------------
  |  |   84|  92.4M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1066:11): [True: 43.5M, False: 5.32M]
  |  Branch (1066:27): [True: 8.76M, False: 34.7M]
  |  Branch (1066:60): [True: 6.13M, False: 2.62M]
  ------------------
 1067|  6.13M|        std::swap(*p, *q);
 1068|  6.13M|        std::string candidate;
 1069|  6.13M|        u16_u8(candidate, candidate_utf);
 1070|  6.13M|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1071|  6.13M|        std::swap(*p, *q);
 1072|  6.13M|      }
 1073|  48.8M|    }
 1074|  1.88M|  }
 1075|   156k|  return wlst.size();
 1076|   156k|}
_ZN10SuggestMgr8movecharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
 1081|   261k|                         int cpdsuggest, int& info) {
 1082|   261k|  if (word.size() < 2)
  ------------------
  |  Branch (1082:7): [True: 20.7k, False: 240k]
  ------------------
 1083|  20.7k|    return wlst.size();
 1084|       |
 1085|   240k|  std::string candidate(word);
 1086|       |
 1087|       |  // try moving a char
 1088|  5.57M|  for (auto p = candidate.begin(); p < candidate.end(); ++p) {
  ------------------
  |  Branch (1088:36): [True: 5.33M, False: 240k]
  ------------------
 1089|  24.3M|    for (auto q = p + 1; q < candidate.end() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  23.1M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1089:26): [True: 23.1M, False: 1.13M]
  |  Branch (1089:26): [True: 18.9M, False: 5.33M]
  |  Branch (1089:49): [True: 18.9M, False: 4.20M]
  ------------------
 1090|  18.9M|      std::swap(*q, *(q - 1));
 1091|  18.9M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1091:11): [True: 5.09M, False: 13.8M]
  ------------------
 1092|  5.09M|        continue;  // omit swap char
 1093|  13.8M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1094|  13.8M|    }
 1095|  5.33M|    const auto word_iter = word.begin();
 1096|  5.33M|    std::copy_n(word_iter, candidate.size(), candidate.begin());
 1097|  5.33M|  }
 1098|       |
 1099|  5.33M|  for (auto p = candidate.rbegin(), pEnd = candidate.rend() - 1; p != pEnd; ++p) {
  ------------------
  |  Branch (1099:66): [True: 5.09M, False: 240k]
  ------------------
 1100|  24.0M|    for (auto q = p + 1, qEnd = candidate.rend(); q != qEnd && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  23.1M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1100:51): [True: 23.1M, False: 890k]
  |  Branch (1100:64): [True: 18.9M, False: 4.20M]
  ------------------
 1101|  18.9M|      std::swap(*q, *(q - 1));
 1102|  18.9M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1102:11): [True: 5.09M, False: 13.8M]
  ------------------
 1103|  5.09M|        continue;  // omit swap char
 1104|  13.8M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1105|  13.8M|    }
 1106|  5.09M|    const auto word_iter = word.begin();
 1107|  5.09M|    std::copy_n(word_iter, candidate.size(), candidate.begin());
 1108|  5.09M|  }
 1109|       |
 1110|   240k|  return wlst.size();
 1111|   261k|}
_ZN10SuggestMgr12movechar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1116|   156k|                             int cpdsuggest, int& info) {
 1117|   156k|  if (word.size() < 2)
  ------------------
  |  Branch (1117:7): [True: 17.4k, False: 139k]
  ------------------
 1118|  17.4k|    return wlst.size();
 1119|       |
 1120|   139k|  std::vector<w_char> candidate_utf(word);
 1121|       |
 1122|       |  // try moving a char
 1123|  2.00M|  for (auto p = candidate_utf.begin(); p < candidate_utf.end(); ++p) {
  ------------------
  |  Branch (1123:40): [True: 1.86M, False: 139k]
  ------------------
 1124|  7.97M|    for (auto q = p + 1; q < candidate_utf.end() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  7.34M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1124:26): [True: 7.34M, False: 623k]
  |  Branch (1124:26): [True: 6.10M, False: 1.86M]
  |  Branch (1124:53): [True: 6.10M, False: 1.24M]
  ------------------
 1125|  6.10M|      std::swap(*q, *(q - 1));
 1126|  6.10M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1126:11): [True: 1.72M, False: 4.38M]
  ------------------
 1127|  1.72M|        continue;  // omit swap char
 1128|  4.38M|      std::string candidate;
 1129|  4.38M|      u16_u8(candidate, candidate_utf);
 1130|  4.38M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1131|  4.38M|    }
 1132|  1.86M|    const auto word_iter = word.begin();
 1133|  1.86M|    std::copy_n(word_iter, candidate_utf.size(), candidate_utf.begin());
 1134|  1.86M|  }
 1135|       |
 1136|  2.00M|  for (auto p = candidate_utf.rbegin(); p < candidate_utf.rend(); ++p) {
  ------------------
  |  Branch (1136:41): [True: 1.86M, False: 139k]
  ------------------
 1137|  7.97M|    for (auto q = p + 1; q < candidate_utf.rend() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  7.34M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1137:26): [True: 7.34M, False: 623k]
  |  Branch (1137:26): [True: 6.10M, False: 1.86M]
  |  Branch (1137:54): [True: 6.10M, False: 1.24M]
  ------------------
 1138|  6.10M|      std::swap(*q, *(q - 1));
 1139|  6.10M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1139:11): [True: 1.72M, False: 4.38M]
  ------------------
 1140|  1.72M|        continue;  // omit swap char
 1141|  4.38M|      std::string candidate;
 1142|  4.38M|      u16_u8(candidate, candidate_utf);
 1143|  4.38M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1144|  4.38M|    }
 1145|  1.86M|    const auto word_iter = word.begin();
 1146|  1.86M|    std::copy_n(word_iter, candidate_utf.size(), candidate_utf.begin());
 1147|  1.86M|  }
 1148|       |
 1149|   139k|  return wlst.size();
 1150|   156k|}
_ZN10SuggestMgr9ngsuggestERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEEPKcRKNS1_INS0_10unique_ptrI7HashMgrNS0_14default_deleteISE_EEEENS5_ISH_EEEEi:
 1185|  62.2k|                          int captype) {
 1186|  62.2k|  int lval, sc, lp, lpphon, nonbmp = 0;
 1187|       |
 1188|       |  // exhaustively search through all root words
 1189|       |  // keeping track of the MAX_ROOTS most similar root words
 1190|  62.2k|  struct hentry* roots[MAX_ROOTS];
 1191|  62.2k|  char* rootsphon[MAX_ROOTS];
 1192|  62.2k|  int scores[MAX_ROOTS];
 1193|  62.2k|  int scoresphon[MAX_ROOTS];
 1194|  6.28M|  for (int i = 0; i < MAX_ROOTS; i++) {
  ------------------
  |  |   74|  6.28M|#define MAX_ROOTS 100
  ------------------
  |  Branch (1194:19): [True: 6.22M, False: 62.2k]
  ------------------
 1195|  6.22M|    roots[i] = nullptr;
 1196|  6.22M|    scores[i] = -100 * i;
 1197|  6.22M|    rootsphon[i] = nullptr;
 1198|  6.22M|    scoresphon[i] = -100 * i;
 1199|  6.22M|  }
 1200|  62.2k|  bool has_roots = false;
 1201|  62.2k|  bool has_rootsphon = false;
 1202|  62.2k|  lp = MAX_ROOTS - 1;
  ------------------
  |  |   74|  62.2k|#define MAX_ROOTS 100
  ------------------
 1203|  62.2k|  lpphon = MAX_ROOTS - 1;
  ------------------
  |  |   74|  62.2k|#define MAX_ROOTS 100
  ------------------
 1204|  62.2k|  int low = NGRAM_LOWERING;
  ------------------
  |  |   83|  62.2k|#define NGRAM_LOWERING (1 << 2)
  ------------------
 1205|       |
 1206|  62.2k|  std::string w2;
 1207|  62.2k|  const char* word = w;
 1208|       |
 1209|  62.2k|  int nc;
 1210|       |  // word reversing wrapper for complex prefixes
 1211|  62.2k|  if (complexprefixes) {
  ------------------
  |  Branch (1211:7): [True: 3.52k, False: 58.7k]
  ------------------
 1212|  3.52k|    w2.assign(w);
 1213|  3.52k|    if (utf8)
  ------------------
  |  Branch (1213:9): [True: 0, False: 3.52k]
  ------------------
 1214|      0|      reverseword_utf(w2);
 1215|  3.52k|    else
 1216|  3.52k|      reverseword(w2);
 1217|  3.52k|    word = w2.c_str();
 1218|  3.52k|    nc = (int)w2.size();
 1219|  58.7k|  } else {
 1220|  58.7k|    nc = (int)strlen(word);
 1221|  58.7k|  }
 1222|       |
 1223|  62.2k|  std::vector<w_char> u8;
 1224|  62.2k|  int n = (utf8) ? u8_u16(u8, word) : nc;
  ------------------
  |  Branch (1224:11): [True: 26.1k, False: 36.0k]
  ------------------
 1225|       |
 1226|       |  // set character based ngram suggestion for words with non-BMP Unicode
 1227|       |  // characters
 1228|  62.2k|  const struct cs_info* origconv = csconv;
 1229|  62.2k|  if (n == -1) {
  ------------------
  |  Branch (1229:7): [True: 2.00k, False: 60.2k]
  ------------------
 1230|  2.00k|    utf8 = 0;  // XXX not state-free
 1231|  2.00k|    if (!csconv)
  ------------------
  |  Branch (1231:9): [True: 2.00k, False: 0]
  ------------------
 1232|  2.00k|      csconv = get_current_cs("iso88591"); // XXX not state-free
 1233|  2.00k|    n = nc;
 1234|  2.00k|    nonbmp = 1;
 1235|  2.00k|    low = 0;
 1236|  2.00k|  }
 1237|  62.2k|  ngsuggest_guard restore_state(nonbmp, origconv, &utf8, &csconv);
 1238|  62.2k|  int max_word_len = (utf8) ? MAXWORDUTF8LEN : MAXWORDLEN;
  ------------------
  |  |   85|  24.1k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  24.1k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                int max_word_len = (utf8) ? MAXWORDUTF8LEN : MAXWORDLEN;
  ------------------
  |  |   90|  38.0k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1238:22): [True: 24.1k, False: 38.0k]
  ------------------
 1239|       |  // ofz#59067 a replist entry can generate a very long word, abandon
 1240|       |  // ngram if that odd-edge case arises
 1241|  62.2k|  if (n > max_word_len * 4)
  ------------------
  |  Branch (1241:7): [True: 0, False: 62.2k]
  ------------------
 1242|      0|      return;
 1243|       |
 1244|  62.2k|  struct hentry* hp = nullptr;
 1245|  62.2k|  int col = -1;
 1246|  62.2k|  phonetable* ph = (pAMgr) ? pAMgr->get_phonetable() : nullptr;
  ------------------
  |  Branch (1246:20): [True: 62.2k, False: 0]
  ------------------
 1247|  62.2k|  std::string target;
 1248|  62.2k|  std::string candidate;
 1249|  62.2k|  std::vector<w_char> w_candidate;
 1250|  62.2k|  if (ph) {
  ------------------
  |  Branch (1250:7): [True: 3.54k, False: 58.7k]
  ------------------
 1251|  3.54k|    if (utf8) {
  ------------------
  |  Branch (1251:9): [True: 0, False: 3.54k]
  ------------------
 1252|      0|      u8_u16(w_candidate, word);
 1253|      0|      mkallcap_utf(w_candidate, langnum);
 1254|      0|      u16_u8(candidate, w_candidate);
 1255|  3.54k|    } else {
 1256|  3.54k|      candidate.assign(word);
 1257|  3.54k|      if (!nonbmp)
  ------------------
  |  Branch (1257:11): [True: 3.54k, False: 0]
  ------------------
 1258|  3.54k|        mkallcap(candidate, csconv);
 1259|  3.54k|    }
 1260|  3.54k|    target = phonet(candidate, *ph);  // XXX phonet() is 8-bit (nc, not n)
 1261|  3.54k|  }
 1262|       |
 1263|  62.2k|  FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL;
  ------------------
  |  |   95|  62.2k|#define FLAG unsigned short
  ------------------
                FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL;
  ------------------
  |  |   96|  62.2k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1263:24): [True: 62.2k, False: 0]
  ------------------
 1264|  62.2k|  FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL;
  ------------------
  |  |   95|  62.2k|#define FLAG unsigned short
  ------------------
                FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL;
  ------------------
  |  |   96|  62.2k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1264:20): [True: 62.2k, False: 0]
  ------------------
 1265|  62.2k|  FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL;
  ------------------
  |  |   95|  62.2k|#define FLAG unsigned short
  ------------------
                FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL;
  ------------------
  |  |   96|  62.2k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1265:25): [True: 62.2k, False: 0]
  ------------------
 1266|  62.2k|  FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL;
  ------------------
  |  |   95|  62.2k|#define FLAG unsigned short
  ------------------
                FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL;
  ------------------
  |  |   96|  62.2k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1266:25): [True: 62.2k, False: 0]
  ------------------
 1267|       |
 1268|  62.2k|  std::vector<w_char> w_word, w_target;
 1269|  62.2k|  if (utf8) {
  ------------------
  |  Branch (1269:7): [True: 24.1k, False: 38.0k]
  ------------------
 1270|  24.1k|    u8_u16(w_word, word);
 1271|  24.1k|    u8_u16(w_target, target);
 1272|  24.1k|  }
 1273|       |
 1274|  62.2k|  std::string f;
 1275|  62.2k|  std::vector<w_char> w_f;
 1276|       |
 1277|  62.2k|  for (const auto& i : rHMgr) {
  ------------------
  |  Branch (1277:22): [True: 62.2k, False: 62.2k]
  ------------------
 1278|  2.18M|    while (nullptr != (hp = i->walk_hashtable(col, hp))) {
  ------------------
  |  Branch (1278:12): [True: 2.12M, False: 62.2k]
  ------------------
 1279|       |      // skip exceptions
 1280|  2.12M|      if (
 1281|       |           // skip it, if the word length different by 5 or
 1282|       |           // more characters (to avoid strange suggestions)
 1283|       |           // (except Unicode characters over BMP)
 1284|  2.12M|           (((abs(n - hp->clen) > 4) && !nonbmp)) ||
  ------------------
  |  Branch (1284:12): [True: 1.54M, False: 576k]
  |  Branch (1284:14): [True: 1.43M, False: 686k]
  |  Branch (1284:41): [True: 1.37M, False: 66.5k]
  ------------------
 1285|       |           // don't suggest capitalized dictionary words for
 1286|       |           // lower case misspellings in ngram suggestions, except
 1287|       |           // - PHONE usage, or
 1288|       |           // - in the case of German, where not only proper
 1289|       |           //   nouns are capitalized, or
 1290|       |           // - the capitalized word has special pronunciation
 1291|   753k|           ((captype == NOCAP) && (hp->var & H_OPT_INITCAP) &&
  ------------------
  |  |   92|   753k|#define NOCAP 0
  ------------------
                         ((captype == NOCAP) && (hp->var & H_OPT_INITCAP) &&
  ------------------
  |  |   50|   194k|#define H_OPT_INITCAP (1 << 3)  // is dictionary word capitalized?
  ------------------
  |  Branch (1291:13): [True: 194k, False: 558k]
  |  Branch (1291:35): [True: 90.0k, False: 104k]
  ------------------
 1292|  90.0k|              !ph && (langnum != LANG_de) && !(hp->var & H_OPT_PHON)) ||
  ------------------
  |  |   49|  88.2k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  |  Branch (1292:15): [True: 88.2k, False: 1.75k]
  |  Branch (1292:22): [True: 88.2k, False: 0]
  |  Branch (1292:46): [True: 88.2k, False: 0]
  ------------------
 1293|       |           // or it has one of the following special flags
 1294|   664k|           ((hp->astr) && (pAMgr) &&
  ------------------
  |  Branch (1294:13): [True: 184k, False: 479k]
  |  Branch (1294:27): [True: 184k, False: 0]
  ------------------
 1295|   184k|             (TESTAFF(hp->astr, forbiddenword, hp->alen) ||
  ------------------
  |  |   99|   369k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 2.15k, False: 182k]
  |  |  ------------------
  ------------------
 1296|   182k|             TESTAFF(hp->astr, ONLYUPCASEFLAG, hp->alen) ||
  ------------------
  |  |   99|   367k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 85.7k, False: 97.0k]
  |  |  ------------------
  ------------------
 1297|  97.0k|             TESTAFF(hp->astr, nosuggest, hp->alen) ||
  ------------------
  |  |   99|   282k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 97.0k]
  |  |  ------------------
  ------------------
 1298|  97.0k|             TESTAFF(hp->astr, nongramsuggest, hp->alen) ||
  ------------------
  |  |   99|   282k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 97.0k]
  |  |  ------------------
  ------------------
 1299|  97.0k|             TESTAFF(hp->astr, onlyincompound, hp->alen)))
  ------------------
  |  |   99|  97.0k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 97.0k]
  |  |  ------------------
  ------------------
 1300|  2.12M|         )
 1301|  1.54M|        continue;
 1302|       |
 1303|   576k|      if (utf8) {
  ------------------
  |  Branch (1303:11): [True: 253k, False: 323k]
  ------------------
 1304|   253k|        u8_u16(w_f, HENTRY_WORD(hp));
  ------------------
  |  |   54|   253k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1305|       |
 1306|   253k|        int leftcommon = leftcommonsubstring(w_word, w_f);
 1307|   253k|        if (low) {
  ------------------
  |  Branch (1307:13): [True: 253k, False: 0]
  ------------------
 1308|       |          // lowering dictionary word
 1309|   253k|          mkallsmall_utf(w_f, langnum);
 1310|   253k|        }
 1311|   253k|        sc = ngram(3, w_word, w_f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|   253k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1312|   323k|      } else {
 1313|   323k|        f.assign(HENTRY_WORD(hp));
  ------------------
  |  |   54|   323k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1314|       |
 1315|   323k|        int leftcommon = leftcommonsubstring(word, f.c_str());
 1316|   323k|        if (low) {
  ------------------
  |  Branch (1316:13): [True: 295k, False: 27.8k]
  ------------------
 1317|       |          // lowering dictionary word
 1318|   295k|          mkallsmall(f, csconv);
 1319|   295k|        }
 1320|   323k|        sc = ngram(3, word, f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|   323k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1321|   323k|      }
 1322|       |
 1323|       |      // check special pronunciation
 1324|   576k|      f.clear();
 1325|   576k|      if ((hp->var & H_OPT_PHON) &&
  ------------------
  |  |   49|   576k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  |  Branch (1325:11): [True: 859, False: 576k]
  |  Branch (1325:11): [True: 859, False: 576k]
  ------------------
 1326|    859|          copy_field(f, HENTRY_DATA(hp), MORPH_PHON)) {
  ------------------
  |  |  114|    859|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (1326:11): [True: 859, False: 0]
  ------------------
 1327|    859|        int sc2;
 1328|    859|        if (utf8) {
  ------------------
  |  Branch (1328:13): [True: 0, False: 859]
  ------------------
 1329|      0|          u8_u16(w_f, f);
 1330|       |
 1331|      0|          int leftcommon = leftcommonsubstring(w_word, w_f);
 1332|      0|          if (low) {
  ------------------
  |  Branch (1332:15): [True: 0, False: 0]
  ------------------
 1333|       |            // lowering dictionary word
 1334|      0|            mkallsmall_utf(w_f, langnum);
 1335|      0|          }
 1336|      0|          sc2 = ngram(3, w_word, w_f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|      0|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1337|    859|        } else {
 1338|    859|          int leftcommon = leftcommonsubstring(word, f.c_str());
 1339|    859|          if (low) {
  ------------------
  |  Branch (1339:15): [True: 859, False: 0]
  ------------------
 1340|       |            // lowering dictionary word
 1341|    859|            mkallsmall(f, csconv);
 1342|    859|          }
 1343|    859|          sc2 = ngram(3, word, f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|    859|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1344|    859|        }
 1345|    859|        if (sc2 > sc)
  ------------------
  |  Branch (1345:13): [True: 452, False: 407]
  ------------------
 1346|    452|          sc = sc2;
 1347|    859|      }
 1348|       |
 1349|   576k|      int scphon = -20000;
 1350|   576k|      if (ph && (sc > 2) && (abs(n - (int)hp->clen) <= 3)) {
  ------------------
  |  Branch (1350:11): [True: 34.7k, False: 542k]
  |  Branch (1350:17): [True: 8.28k, False: 26.4k]
  |  Branch (1350:29): [True: 6.97k, False: 1.30k]
  ------------------
 1351|  6.97k|        if (utf8) {
  ------------------
  |  Branch (1351:13): [True: 0, False: 6.97k]
  ------------------
 1352|      0|          u8_u16(w_candidate, HENTRY_WORD(hp));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1353|      0|          mkallcap_utf(w_candidate, langnum);
 1354|      0|          u16_u8(candidate, w_candidate);
 1355|  6.97k|        } else {
 1356|  6.97k|          candidate = HENTRY_WORD(hp);
  ------------------
  |  |   54|  6.97k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1357|  6.97k|          mkallcap(candidate, csconv);
 1358|  6.97k|        }
 1359|  6.97k|        f = phonet(candidate, *ph);
 1360|  6.97k|        if (utf8) {
  ------------------
  |  Branch (1360:13): [True: 0, False: 6.97k]
  ------------------
 1361|      0|          u8_u16(w_f, f);
 1362|      0|          scphon = 2 * ngram(3, w_target, w_f,
 1363|      0|                             NGRAM_LONGER_WORSE);
  ------------------
  |  |   81|      0|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1364|  6.97k|        } else {
 1365|  6.97k|          scphon = 2 * ngram(3, target, f,
 1366|  6.97k|                             NGRAM_LONGER_WORSE);
  ------------------
  |  |   81|  6.97k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1367|  6.97k|        }
 1368|  6.97k|      }
 1369|       |
 1370|   576k|      if (sc > scores[lp]) {
  ------------------
  |  Branch (1370:11): [True: 576k, False: 0]
  ------------------
 1371|   576k|        scores[lp] = sc;
 1372|   576k|        roots[lp] = hp;
 1373|   576k|        has_roots = true;
 1374|   576k|        lval = sc;
 1375|  58.2M|        for (int j = 0; j < MAX_ROOTS; j++)
  ------------------
  |  |   74|  58.2M|#define MAX_ROOTS 100
  ------------------
  |  Branch (1375:25): [True: 57.6M, False: 576k]
  ------------------
 1376|  57.6M|          if (scores[j] < lval) {
  ------------------
  |  Branch (1376:15): [True: 48.3M, False: 9.31M]
  ------------------
 1377|  48.3M|            lp = j;
 1378|  48.3M|            lval = scores[j];
 1379|  48.3M|          }
 1380|   576k|      }
 1381|       |
 1382|   576k|      if (scphon > scoresphon[lpphon]) {
  ------------------
  |  Branch (1382:11): [True: 6.97k, False: 570k]
  ------------------
 1383|  6.97k|        scoresphon[lpphon] = scphon;
 1384|  6.97k|        rootsphon[lpphon] = HENTRY_WORD(hp);
  ------------------
  |  |   54|  6.97k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1385|  6.97k|        has_rootsphon = true;
 1386|  6.97k|        lval = scphon;
 1387|   704k|        for (int j = 0; j < MAX_ROOTS; j++)
  ------------------
  |  |   74|   704k|#define MAX_ROOTS 100
  ------------------
  |  Branch (1387:25): [True: 697k, False: 6.97k]
  ------------------
 1388|   697k|          if (scoresphon[j] < lval) {
  ------------------
  |  Branch (1388:15): [True: 612k, False: 84.7k]
  ------------------
 1389|   612k|            lpphon = j;
 1390|   612k|            lval = scoresphon[j];
 1391|   612k|          }
 1392|  6.97k|      }
 1393|   576k|    }
 1394|  62.2k|  }
 1395|       |
 1396|  62.2k|  if (!has_roots && !has_rootsphon) {
  ------------------
  |  Branch (1396:7): [True: 14.2k, False: 47.9k]
  |  Branch (1396:21): [True: 14.2k, False: 0]
  ------------------
 1397|       |    // with no roots there will be no guesses and no point running
 1398|       |    // ngram
 1399|  14.2k|    return;
 1400|  14.2k|  }
 1401|       |
 1402|       |  // find minimum threshold for a passable suggestion
 1403|       |  // mangle original word three differnt ways
 1404|       |  // and score them to generate a minimum acceptable score
 1405|  47.9k|  std::vector<w_char> w_mw;
 1406|  47.9k|  int thresh = 0;
 1407|   191k|  for (int sp = 1; sp < 4; sp++) {
  ------------------
  |  Branch (1407:20): [True: 143k, False: 47.9k]
  ------------------
 1408|   143k|    if (utf8) {
  ------------------
  |  Branch (1408:9): [True: 59.2k, False: 84.7k]
  ------------------
 1409|  59.2k|      w_mw = w_word;
 1410|   112k|      for (int k = sp; k < n; k += 4) {
  ------------------
  |  Branch (1410:24): [True: 53.0k, False: 59.2k]
  ------------------
 1411|  53.0k|        w_mw[k].l = '*';
 1412|  53.0k|        w_mw[k].h = 0;
 1413|  53.0k|      }
 1414|       |
 1415|  59.2k|      if (low) {
  ------------------
  |  Branch (1415:11): [True: 59.2k, False: 0]
  ------------------
 1416|       |        // lowering dictionary word
 1417|  59.2k|        mkallsmall_utf(w_mw, langnum);
 1418|  59.2k|      }
 1419|       |
 1420|  59.2k|      thresh += ngram(n, w_word, w_mw, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  59.2k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1421|  84.7k|    } else {
 1422|  84.7k|      std::string mw = word;
 1423|   203k|      for (int k = sp; k < n; k += 4)
  ------------------
  |  Branch (1423:24): [True: 118k, False: 84.7k]
  ------------------
 1424|   118k|        mw[k] = '*';
 1425|       |
 1426|  84.7k|      if (low) {
  ------------------
  |  Branch (1426:11): [True: 78.7k, False: 6.01k]
  ------------------
 1427|       |        // lowering dictionary word
 1428|  78.7k|        mkallsmall(mw, csconv);
 1429|  78.7k|      }
 1430|       |
 1431|  84.7k|      thresh += ngram(n, word, mw, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  84.7k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1432|  84.7k|    }
 1433|   143k|  }
 1434|  47.9k|  thresh = thresh / 3;
 1435|  47.9k|  thresh--;
 1436|       |
 1437|       |  // now expand affixes on each of these root words and
 1438|       |  // and use length adjusted ngram scores to select
 1439|       |  // possible suggestions
 1440|  47.9k|  char* guess[MAX_GUESS];
 1441|  47.9k|  char* guessorig[MAX_GUESS];
 1442|  47.9k|  int gscore[MAX_GUESS];
 1443|  9.64M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.64M|#define MAX_GUESS 200
  ------------------
  |  Branch (1443:19): [True: 9.59M, False: 47.9k]
  ------------------
 1444|  9.59M|    guess[i] = nullptr;
 1445|  9.59M|    guessorig[i] = nullptr;
 1446|  9.59M|    gscore[i] = -100 * i;
 1447|  9.59M|  }
 1448|       |
 1449|  47.9k|  lp = MAX_GUESS - 1;
  ------------------
  |  |   76|  47.9k|#define MAX_GUESS 200
  ------------------
 1450|       |
 1451|  47.9k|  std::vector<guessword> glst(MAX_WORDS);
  ------------------
  |  |   75|  47.9k|#define MAX_WORDS 100
  ------------------
 1452|       |
 1453|  4.79M|  for (auto& root : roots) {
  ------------------
  |  Branch (1453:19): [True: 4.79M, False: 47.9k]
  ------------------
 1454|  4.79M|    if (root) {
  ------------------
  |  Branch (1454:9): [True: 576k, False: 4.22M]
  ------------------
 1455|   576k|      struct hentry* rp = root;
 1456|       |
 1457|   576k|      f.clear();
 1458|   576k|      const char* field = nullptr;
 1459|   576k|      if ((rp->var & H_OPT_PHON) && copy_field(f, HENTRY_DATA(rp), MORPH_PHON))
  ------------------
  |  |   49|   576k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
                    if ((rp->var & H_OPT_PHON) && copy_field(f, HENTRY_DATA(rp), MORPH_PHON))
  ------------------
  |  |  114|    859|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (1459:11): [True: 859, False: 576k]
  |  Branch (1459:11): [True: 859, False: 576k]
  |  Branch (1459:37): [True: 859, False: 0]
  ------------------
 1460|    859|          field = f.c_str();
 1461|   576k|      int nw = pAMgr->expand_rootword(
 1462|   576k|          glst.data(), MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word,
  ------------------
  |  |   75|   576k|#define MAX_WORDS 100
  ------------------
                        glst.data(), MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word,
  ------------------
  |  |   54|   576k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1463|   576k|          nc, field);
 1464|       |
 1465|  1.15M|      for (int k = 0; k < nw; k++) {
  ------------------
  |  Branch (1465:23): [True: 575k, False: 576k]
  ------------------
 1466|   575k|        if (utf8) {
  ------------------
  |  Branch (1466:13): [True: 253k, False: 322k]
  ------------------
 1467|   253k|          u8_u16(w_f, glst[k].word);
 1468|       |
 1469|   253k|          int leftcommon = leftcommonsubstring(w_word, w_f);
 1470|   253k|          if (low) {
  ------------------
  |  Branch (1470:15): [True: 253k, False: 0]
  ------------------
 1471|       |            // lowering dictionary word
 1472|   253k|            mkallsmall_utf(w_f, langnum);
 1473|   253k|          }
 1474|       |
 1475|   253k|          sc = ngram(n, w_word, w_f, NGRAM_ANY_MISMATCH) + leftcommon;
  ------------------
  |  |   82|   253k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1476|   322k|        } else {
 1477|   322k|          f = glst[k].word;
 1478|       |
 1479|   322k|          int leftcommon = leftcommonsubstring(word, f.c_str());
 1480|   322k|          if (low) {
  ------------------
  |  Branch (1480:15): [True: 294k, False: 27.8k]
  ------------------
 1481|       |            // lowering dictionary word
 1482|   294k|            mkallsmall(f, csconv);
 1483|   294k|          }
 1484|       |
 1485|   322k|          sc = ngram(n, word, f, NGRAM_ANY_MISMATCH) + leftcommon;
  ------------------
  |  |   82|   322k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1486|   322k|        }
 1487|       |
 1488|   575k|        if (sc > thresh) {
  ------------------
  |  Branch (1488:13): [True: 103k, False: 471k]
  ------------------
 1489|   103k|          if (sc > gscore[lp]) {
  ------------------
  |  Branch (1489:15): [True: 103k, False: 0]
  ------------------
 1490|   103k|            if (guess[lp]) {
  ------------------
  |  Branch (1490:17): [True: 0, False: 103k]
  ------------------
 1491|      0|              delete[] guess[lp];
 1492|      0|              if (guessorig[lp]) {
  ------------------
  |  Branch (1492:19): [True: 0, False: 0]
  ------------------
 1493|      0|                delete[] guessorig[lp];
 1494|      0|                guessorig[lp] = nullptr;
 1495|      0|              }
 1496|      0|            }
 1497|   103k|            gscore[lp] = sc;
 1498|   103k|            guess[lp] = glst[k].word;
 1499|   103k|            guessorig[lp] = glst[k].orig;
 1500|   103k|            lval = sc;
 1501|  20.8M|            for (int j = 0; j < MAX_GUESS; j++)
  ------------------
  |  |   76|  20.8M|#define MAX_GUESS 200
  ------------------
  |  Branch (1501:29): [True: 20.7M, False: 103k]
  ------------------
 1502|  20.7M|              if (gscore[j] < lval) {
  ------------------
  |  Branch (1502:19): [True: 19.7M, False: 952k]
  ------------------
 1503|  19.7M|                lp = j;
 1504|  19.7M|                lval = gscore[j];
 1505|  19.7M|              }
 1506|   103k|          } else {
 1507|      0|            delete[] glst[k].word;
 1508|      0|            delete[] glst[k].orig;
 1509|      0|          }
 1510|   471k|        } else {
 1511|   471k|          delete[] glst[k].word;
 1512|   471k|          delete[] glst[k].orig;
 1513|   471k|        }
 1514|   575k|      }
 1515|   576k|    }
 1516|  4.79M|  }
 1517|  47.9k|  glst.clear();
 1518|       |
 1519|       |  // now we are done generating guesses
 1520|       |  // sort in order of decreasing score
 1521|       |
 1522|  47.9k|  bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS);
  ------------------
  |  |   76|  47.9k|#define MAX_GUESS 200
  ------------------
 1523|  47.9k|  if (ph)
  ------------------
  |  Branch (1523:7): [True: 2.82k, False: 45.1k]
  ------------------
 1524|  2.82k|    bubblesort(&rootsphon[0], nullptr, &scoresphon[0], MAX_ROOTS);
  ------------------
  |  |   74|  2.82k|#define MAX_ROOTS 100
  ------------------
 1525|       |
 1526|       |  // weight suggestions with a similarity index, based on
 1527|       |  // the longest common subsequent algorithm and resort
 1528|       |
 1529|  47.9k|  int is_swap = 0;
 1530|  47.9k|  int re = 0;
 1531|  47.9k|  double fact = 1.0;
 1532|  47.9k|  if (pAMgr) {
  ------------------
  |  Branch (1532:7): [True: 47.9k, False: 0]
  ------------------
 1533|  47.9k|    int maxd = pAMgr->get_maxdiff();
 1534|  47.9k|    if (maxd >= 0)
  ------------------
  |  Branch (1534:9): [True: 0, False: 47.9k]
  ------------------
 1535|      0|      fact = (10.0 - maxd) / 5.0;
 1536|  47.9k|  }
 1537|       |
 1538|  47.9k|  std::vector<w_char> w_gl;
 1539|  9.21M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.21M|#define MAX_GUESS 200
  ------------------
  |  Branch (1539:19): [True: 9.16M, False: 45.8k]
  ------------------
 1540|  9.16M|    if (guess[i]) {
  ------------------
  |  Branch (1540:9): [True: 81.1k, False: 9.08M]
  ------------------
 1541|       |      // lowering guess[i]
 1542|  81.1k|      std::string gl;
 1543|  81.1k|      int len;
 1544|  81.1k|      if (utf8) {
  ------------------
  |  Branch (1544:11): [True: 22.9k, False: 58.2k]
  ------------------
 1545|  22.9k|        len = u8_u16(w_gl, guess[i]);
 1546|  22.9k|        mkallsmall_utf(w_gl, langnum);
 1547|  22.9k|        u16_u8(gl, w_gl);
 1548|  58.2k|      } else {
 1549|  58.2k|        gl.assign(guess[i]);
 1550|  58.2k|        if (!nonbmp)
  ------------------
  |  Branch (1550:13): [True: 58.1k, False: 102]
  ------------------
 1551|  58.1k|          mkallsmall(gl, csconv);
 1552|  58.2k|        len = strlen(guess[i]);
 1553|  58.2k|      }
 1554|       |
 1555|  81.1k|      int _lcs = lcslen(word, gl.c_str());
 1556|       |
 1557|       |      // same characters with different casing
 1558|  81.1k|      if ((n == len) && (n == _lcs)) {
  ------------------
  |  Branch (1558:11): [True: 20.1k, False: 60.9k]
  |  Branch (1558:25): [True: 2.18k, False: 18.0k]
  ------------------
 1559|  2.18k|        gscore[i] += 2000;
 1560|  2.18k|        break;
 1561|  2.18k|      }
 1562|       |      // using 2-gram instead of 3, and other weightening
 1563|       |
 1564|  79.0k|      if (utf8) {
  ------------------
  |  Branch (1564:11): [True: 21.2k, False: 57.7k]
  ------------------
 1565|  21.2k|        u8_u16(w_gl, gl);
 1566|       |        //w_gl is lowercase already at this point
 1567|  21.2k|        re = ngram(2, w_word, w_gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  21.2k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                      re = ngram(2, w_word, w_gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  21.2k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1568|  21.2k|        if (low) {
  ------------------
  |  Branch (1568:13): [True: 21.2k, False: 0]
  ------------------
 1569|  21.2k|          w_f = w_word;
 1570|       |          // lowering dictionary word
 1571|  21.2k|          mkallsmall_utf(w_f, langnum);
 1572|  21.2k|          re += ngram(2, w_gl, w_f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  21.2k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, w_gl, w_f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  21.2k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1573|  21.2k|        } else {
 1574|      0|          re += ngram(2, w_gl, w_word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|      0|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, w_gl, w_word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|      0|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1575|      0|        }
 1576|  57.7k|      } else {
 1577|       |        //gl is lowercase already at this point
 1578|  57.7k|        re = ngram(2, word, gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  57.7k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                      re = ngram(2, word, gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  57.7k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1579|  57.7k|        if (low) {
  ------------------
  |  Branch (1579:13): [True: 57.6k, False: 102]
  ------------------
 1580|  57.6k|          f = word;
 1581|       |          // lowering dictionary word
 1582|  57.6k|          mkallsmall(f, csconv);
 1583|  57.6k|          re += ngram(2, gl, f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  57.6k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, gl, f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  57.6k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1584|  57.6k|        } else {
 1585|    102|          re += ngram(2, gl, word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|    102|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, gl, word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|    102|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1586|    102|        }
 1587|  57.7k|      }
 1588|       |
 1589|  79.0k|      int ngram_score, leftcommon_score;
 1590|  79.0k|      if (utf8) {
  ------------------
  |  Branch (1590:11): [True: 21.2k, False: 57.7k]
  ------------------
 1591|       |        //w_gl is lowercase already at this point
 1592|  21.2k|        ngram_score = ngram(4, w_word, w_gl, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  21.2k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1593|  21.2k|        leftcommon_score = leftcommonsubstring(w_word, w_gl);
 1594|  57.7k|      } else {
 1595|       |        //gl is lowercase already at this point
 1596|  57.7k|        ngram_score = ngram(4, word, gl, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  57.7k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1597|  57.7k|        leftcommon_score = leftcommonsubstring(word, gl.c_str());
 1598|  57.7k|      }
 1599|  79.0k|      gscore[i] =
 1600|       |          // length of longest common subsequent minus length difference
 1601|  79.0k|          2 * _lcs - abs((int)(n - len)) +
 1602|       |          // weight length of the left common substring
 1603|  79.0k|          leftcommon_score +
 1604|       |          // weight equal character positions
 1605|  79.0k|          (!nonbmp && commoncharacterpositions(word, gl.c_str(), &is_swap)
  ------------------
  |  Branch (1605:12): [True: 78.9k, False: 102]
  |  Branch (1605:23): [True: 66.8k, False: 12.0k]
  ------------------
 1606|  79.0k|               ? 1
 1607|  79.0k|               : 0) +
 1608|       |          // swap character (not neighboring)
 1609|  79.0k|          ((is_swap) ? 10 : 0) +
  ------------------
  |  Branch (1609:12): [True: 177, False: 78.8k]
  ------------------
 1610|       |          // ngram
 1611|  79.0k|          ngram_score +
 1612|       |          // weighted ngrams
 1613|  79.0k|          re +
 1614|       |          // different limit for dictionaries with PHONE rules
 1615|  79.0k|          (ph ? (re < len * fact ? -1000 : 0)
  ------------------
  |  Branch (1615:12): [True: 5.39k, False: 73.6k]
  |  Branch (1615:18): [True: 3.92k, False: 1.46k]
  ------------------
 1616|  79.0k|              : (re < (n + len) * fact ? -1000 : 0));
  ------------------
  |  Branch (1616:18): [True: 66.7k, False: 6.90k]
  ------------------
 1617|  79.0k|    }
 1618|  9.16M|  }
 1619|       |
 1620|  47.9k|  bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS);
  ------------------
  |  |   76|  47.9k|#define MAX_GUESS 200
  ------------------
 1621|       |
 1622|       |  // phonetic version
 1623|  47.9k|  if (ph)
  ------------------
  |  Branch (1623:7): [True: 2.82k, False: 45.1k]
  ------------------
 1624|   285k|    for (int i = 0; i < MAX_ROOTS; i++) {
  ------------------
  |  |   74|   285k|#define MAX_ROOTS 100
  ------------------
  |  Branch (1624:21): [True: 282k, False: 2.82k]
  ------------------
 1625|   282k|      if (rootsphon[i]) {
  ------------------
  |  Branch (1625:11): [True: 6.97k, False: 275k]
  ------------------
 1626|       |        // lowering rootphon[i]
 1627|  6.97k|        std::string gl;
 1628|  6.97k|        int len;
 1629|  6.97k|        if (utf8) {
  ------------------
  |  Branch (1629:13): [True: 0, False: 6.97k]
  ------------------
 1630|      0|          len = u8_u16(w_gl, rootsphon[i]);
 1631|      0|          mkallsmall_utf(w_gl, langnum);
 1632|      0|          u16_u8(gl, w_gl);
 1633|  6.97k|        } else {
 1634|  6.97k|          gl.assign(rootsphon[i]);
 1635|  6.97k|          if (!nonbmp)
  ------------------
  |  Branch (1635:15): [True: 6.97k, False: 0]
  ------------------
 1636|  6.97k|            mkallsmall(gl, csconv);
 1637|  6.97k|          len = strlen(rootsphon[i]);
 1638|  6.97k|        }
 1639|       |
 1640|       |        // weight length of the left common substring
 1641|  6.97k|        int leftcommon_score;
 1642|  6.97k|        if (utf8)
  ------------------
  |  Branch (1642:13): [True: 0, False: 6.97k]
  ------------------
 1643|      0|          leftcommon_score = leftcommonsubstring(w_word, w_gl);
 1644|  6.97k|        else
 1645|  6.97k|          leftcommon_score = leftcommonsubstring(word, gl.c_str());
 1646|       |        // heuristic weigthing of ngram scores
 1647|  6.97k|        scoresphon[i] += 2 * lcslen(word, gl) - abs((int)(n - len)) +
 1648|  6.97k|                         leftcommon_score;
 1649|  6.97k|      }
 1650|   282k|    }
 1651|       |
 1652|  47.9k|  if (ph)
  ------------------
  |  Branch (1652:7): [True: 2.82k, False: 45.1k]
  ------------------
 1653|  2.82k|    bubblesort(&rootsphon[0], nullptr, &scoresphon[0], MAX_ROOTS);
  ------------------
  |  |   74|  2.82k|#define MAX_ROOTS 100
  ------------------
 1654|       |
 1655|       |  // copy over
 1656|  47.9k|  size_t oldns = wlst.size();
 1657|       |
 1658|  47.9k|  int same = 0;
 1659|  9.64M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.64M|#define MAX_GUESS 200
  ------------------
  |  Branch (1659:19): [True: 9.59M, False: 47.9k]
  ------------------
 1660|  9.59M|    if (guess[i]) {
  ------------------
  |  Branch (1660:9): [True: 103k, False: 9.49M]
  ------------------
 1661|   103k|      if ((wlst.size() < oldns + maxngramsugs) && (wlst.size() < maxSug) &&
  ------------------
  |  Branch (1661:11): [True: 96.9k, False: 6.74k]
  |  Branch (1661:51): [True: 96.9k, False: 0]
  ------------------
 1662|  96.9k|          (!same || (gscore[i] > 1000))) {
  ------------------
  |  Branch (1662:12): [True: 16.9k, False: 80.0k]
  |  Branch (1662:21): [True: 0, False: 80.0k]
  ------------------
 1663|  16.9k|        int unique = 1;
 1664|       |        // leave only excellent suggestions, if exists
 1665|  16.9k|        if (gscore[i] > 1000)
  ------------------
  |  Branch (1665:13): [True: 2.18k, False: 14.7k]
  ------------------
 1666|  2.18k|          same = 1;
 1667|  14.7k|        else if (gscore[i] < -100) {
  ------------------
  |  Branch (1667:18): [True: 9.08k, False: 5.69k]
  ------------------
 1668|  9.08k|          same = 1;
 1669|       |          // keep the best ngram suggestions, unless in ONLYMAXDIFF mode
 1670|  9.08k|          if (wlst.size() > oldns || (pAMgr && pAMgr->get_onlymaxdiff())) {
  ------------------
  |  Branch (1670:15): [True: 868, False: 8.22k]
  |  Branch (1670:39): [True: 8.22k, False: 0]
  |  Branch (1670:48): [True: 0, False: 8.22k]
  ------------------
 1671|    868|            delete[] guess[i];
 1672|    868|            delete[] guessorig[i];
 1673|    868|            continue;
 1674|    868|          }
 1675|  9.08k|        }
 1676|  16.0k|        for (auto& j : wlst) {
  ------------------
  |  Branch (1676:22): [True: 11.6k, False: 13.4k]
  ------------------
 1677|       |          // don't suggest previous suggestions or a previous suggestion with
 1678|       |          // prefixes or affixes
 1679|  11.6k|          if ((!guessorig[i] && strstr(guess[i], j.c_str())) || (guessorig[i] && strstr(guessorig[i], j.c_str())) ||
  ------------------
  |  Branch (1679:15): [True: 2.65k, False: 8.95k]
  |  Branch (1679:16): [True: 11.6k, False: 0]
  |  Branch (1679:33): [True: 2.65k, False: 8.95k]
  |  Branch (1679:66): [True: 0, False: 8.95k]
  |  Branch (1679:82): [True: 0, False: 0]
  ------------------
 1680|       |              // check forbidden words
 1681|  8.95k|              !checkword(guess[i], 0, nullptr, nullptr)) {
  ------------------
  |  Branch (1681:15): [True: 0, False: 8.95k]
  ------------------
 1682|  2.65k|            unique = 0;
 1683|  2.65k|            break;
 1684|  2.65k|          }
 1685|  11.6k|        }
 1686|  16.0k|        if (unique) {
  ------------------
  |  Branch (1686:13): [True: 13.4k, False: 2.65k]
  ------------------
 1687|  13.4k|          if (guessorig[i]) {
  ------------------
  |  Branch (1687:15): [True: 0, False: 13.4k]
  ------------------
 1688|      0|            wlst.emplace_back(guessorig[i]);
 1689|  13.4k|          } else {
 1690|  13.4k|            wlst.emplace_back(guess[i]);
 1691|  13.4k|          }
 1692|  13.4k|        }
 1693|  16.0k|        delete[] guess[i];
 1694|  16.0k|        delete[] guessorig[i];
 1695|  86.7k|      } else {
 1696|  86.7k|        delete[] guess[i];
 1697|  86.7k|        delete[] guessorig[i];
 1698|  86.7k|      }
 1699|   103k|    }
 1700|  9.59M|  }
 1701|       |
 1702|  47.9k|  oldns = wlst.size();
 1703|  47.9k|  if (ph)
  ------------------
  |  Branch (1703:7): [True: 2.82k, False: 45.1k]
  ------------------
 1704|   282k|    for (auto& i : rootsphon) {
  ------------------
  |  Branch (1704:18): [True: 282k, False: 2.82k]
  ------------------
 1705|   282k|      if (i) {
  ------------------
  |  Branch (1705:11): [True: 6.97k, False: 275k]
  ------------------
 1706|  6.97k|        if ((wlst.size() < oldns + MAXPHONSUGS) && (wlst.size() < maxSug)) {
  ------------------
  |  |   78|  6.97k|#define MAXPHONSUGS 2
  ------------------
  |  Branch (1706:13): [True: 3.33k, False: 3.64k]
  |  Branch (1706:52): [True: 3.33k, False: 0]
  ------------------
 1707|  3.33k|          int unique = 1;
 1708|  6.29k|          for (auto& j : wlst) {
  ------------------
  |  Branch (1708:24): [True: 6.29k, False: 996]
  ------------------
 1709|       |            // don't suggest previous suggestions or a previous suggestion with
 1710|       |            // prefixes or affixes
 1711|  6.29k|            if (strstr(i, j.c_str()) ||
  ------------------
  |  Branch (1711:17): [True: 2.33k, False: 3.96k]
  |  Branch (1711:17): [True: 2.33k, False: 3.96k]
  ------------------
 1712|       |                // check forbidden words
 1713|  3.96k|                !checkword(i, 0, nullptr, nullptr)) {
  ------------------
  |  Branch (1713:17): [True: 0, False: 3.96k]
  ------------------
 1714|  2.33k|              unique = 0;
 1715|  2.33k|              break;
 1716|  2.33k|            }
 1717|  6.29k|          }
 1718|  3.33k|          if (unique) {
  ------------------
  |  Branch (1718:15): [True: 996, False: 2.33k]
  ------------------
 1719|    996|            wlst.emplace_back(i);
 1720|    996|          }
 1721|  3.33k|        }
 1722|  6.97k|      }
 1723|   282k|    }
 1724|  47.9k|}
_ZN10SuggestMgr9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPiPNS0_6chrono10time_pointINSA_12steady_clockENSA_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1735|  91.8M|                          std::chrono::steady_clock::time_point* timelimit) {
 1736|       |  // check overall suggestion time limit
 1737|  91.8M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|  91.8M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (1737:7): [True: 5, False: 91.8M]
  ------------------
 1738|      5|    return 0;
 1739|       |
 1740|       |  // check time limit
 1741|  91.8M|  if (timer) {
  ------------------
  |  Branch (1741:7): [True: 3.03M, False: 88.8M]
  ------------------
 1742|  3.03M|    (*timer)--;
 1743|  3.03M|    if (!(*timer) && timelimit) {
  ------------------
  |  Branch (1743:9): [True: 25.6k, False: 3.00M]
  |  Branch (1743:22): [True: 25.6k, False: 0]
  ------------------
 1744|  25.6k|      if (std::chrono::steady_clock::now() - *timelimit > TIMELIMIT_MS)
  ------------------
  |  |  106|  25.6k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1744:11): [True: 10, False: 25.6k]
  ------------------
 1745|     10|        return 0;
 1746|  25.6k|      *timer = MAXPLUSTIMER;
  ------------------
  |  |  108|  25.6k|#define MAXPLUSTIMER 100
  ------------------
 1747|  25.6k|    }
 1748|  3.03M|  }
 1749|       |
 1750|  91.8M|  if (pAMgr) {
  ------------------
  |  Branch (1750:7): [True: 91.8M, False: 0]
  ------------------
 1751|  91.8M|    struct hentry* rv = nullptr;
 1752|  91.8M|    int nosuffix = 0;
 1753|       |
 1754|  91.8M|    if (cpdsuggest >= 1) {
  ------------------
  |  Branch (1754:9): [True: 60.0M, False: 31.7M]
  ------------------
 1755|  60.0M|      if (pAMgr->get_compound()) {
  ------------------
  |  Branch (1755:11): [True: 14.8M, False: 45.1M]
  ------------------
 1756|  14.8M|        struct hentry* rv2 = nullptr;
 1757|  14.8M|        struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
 1758|  14.8M|        int info = (cpdsuggest == 1) ? SPELL_COMPOUND_2 : 0;
  ------------------
  |  |   85|  7.42M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (1758:20): [True: 7.42M, False: 7.42M]
  ------------------
 1759|  14.8M|        AffixScratch scratch;
 1760|  14.8M|        rv = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 1, &info, scratch);  // EXT
 1761|       |        // TODO filter 3-word or more compound words, as in spell()
 1762|       |        // (it's too slow to call suggest() here for all possible compound words)
 1763|  14.8M|        if (rv &&
  ------------------
  |  Branch (1763:13): [True: 0, False: 14.8M]
  |  Branch (1763:13): [True: 0, False: 14.8M]
  ------------------
 1764|      0|            (!(rv2 = pAMgr->lookup(word.c_str(), word.size())) || !rv2->astr ||
  ------------------
  |  Branch (1764:14): [True: 0, False: 0]
  |  Branch (1764:67): [True: 0, False: 0]
  ------------------
 1765|      0|             !(TESTAFF(rv2->astr, pAMgr->get_forbiddenword(), rv2->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1766|      0|               TESTAFF(rv2->astr, pAMgr->get_nosuggest(), rv2->alen))))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1767|      0|          return 3;  // XXX obsolote categorisation + only ICONV needs affix
 1768|       |                     // flag check?
 1769|  14.8M|      }
 1770|  60.0M|      return 0;
 1771|  60.0M|    }
 1772|       |
 1773|  31.7M|    rv = pAMgr->lookup(word.c_str(), word.size());
 1774|       |
 1775|  31.7M|    if (rv) {
  ------------------
  |  Branch (1775:9): [True: 56.5k, False: 31.7M]
  ------------------
 1776|  56.5k|      if ((rv->astr) &&
  ------------------
  |  Branch (1776:11): [True: 134, False: 56.3k]
  |  Branch (1776:11): [True: 0, False: 56.5k]
  ------------------
 1777|    134|          (TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |   99|    268|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 134]
  |  |  ------------------
  ------------------
 1778|    134|           TESTAFF(rv->astr, pAMgr->get_nosuggest(), rv->alen) ||
  ------------------
  |  |   99|    268|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 134]
  |  |  ------------------
  ------------------
 1779|    134|           TESTAFF(rv->astr, pAMgr->get_substandard(), rv->alen)))
  ------------------
  |  |   99|    134|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 134]
  |  |  ------------------
  ------------------
 1780|      0|        return 0;
 1781|  56.6k|      while (rv) {
  ------------------
  |  Branch (1781:14): [True: 56.5k, False: 123]
  ------------------
 1782|  56.5k|        if (rv->astr &&
  ------------------
  |  Branch (1782:13): [True: 134, False: 56.3k]
  |  Branch (1782:13): [True: 123, False: 56.3k]
  ------------------
 1783|    134|            (TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |   99|    268|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 134]
  |  |  ------------------
  ------------------
 1784|    134|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|    268|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 123, False: 11]
  |  |  ------------------
  ------------------
 1785|    123|             TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen))) {
  ------------------
  |  |   99|     11|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 11]
  |  |  ------------------
  ------------------
 1786|    123|          rv = rv->next_homonym;
 1787|    123|        } else
 1788|  56.3k|          break;
 1789|  56.5k|      }
 1790|  31.7M|    } else {
 1791|  31.7M|      AffixScratch scratch;
 1792|  31.7M|      rv = pAMgr->prefix_check(word, 0, word.size(),
 1793|  31.7M|                               0, scratch);  // only prefix, and prefix + suffix XXX
 1794|  31.7M|    }
 1795|       |
 1796|  31.7M|    if (rv) {
  ------------------
  |  Branch (1796:9): [True: 56.3k, False: 31.7M]
  ------------------
 1797|  56.3k|      nosuffix = 1;
 1798|  31.7M|    } else {
 1799|  31.7M|      AffixScratch scratch;
 1800|  31.7M|      rv = pAMgr->suffix_check(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // only suffix
  ------------------
  |  |   96|  31.7M|#define FLAG_NULL 0x00
  ------------------
                    rv = pAMgr->suffix_check(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // only suffix
  ------------------
  |  |   96|  31.7M|#define FLAG_NULL 0x00
  ------------------
                    rv = pAMgr->suffix_check(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // only suffix
  ------------------
  |  |   72|  31.7M|#define IN_CPD_NOT 0
  ------------------
 1801|  31.7M|    }
 1802|       |
 1803|  31.7M|    if (!rv && pAMgr->have_contclass()) {
  ------------------
  |  Branch (1803:9): [True: 31.7M, False: 56.3k]
  |  Branch (1803:16): [True: 11.1M, False: 20.6M]
  ------------------
 1804|  11.1M|      AffixScratch scratch;
 1805|  11.1M|      rv = pAMgr->suffix_check_twosfx(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL);
  ------------------
  |  |   96|  11.1M|#define FLAG_NULL 0x00
  ------------------
 1806|  11.1M|      if (!rv)
  ------------------
  |  Branch (1806:11): [True: 11.1M, False: 0]
  ------------------
 1807|  11.1M|        rv = pAMgr->prefix_check_twosfx(word, 0, word.size(), 0, scratch, FLAG_NULL);
  ------------------
  |  |   96|  11.1M|#define FLAG_NULL 0x00
  ------------------
 1808|  11.1M|    }
 1809|       |
 1810|       |    // check forbidden words
 1811|  31.7M|    if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1811:9): [True: 56.3k, False: 31.7M]
  |  Branch (1811:9): [True: 0, False: 31.7M]
  |  Branch (1811:17): [True: 11, False: 56.3k]
  ------------------
 1812|     11|        (TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |   99|     22|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 11]
  |  |  ------------------
  ------------------
 1813|     11|         TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|     22|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 11]
  |  |  ------------------
  ------------------
 1814|     11|         TESTAFF(rv->astr, pAMgr->get_nosuggest(), rv->alen) ||
  ------------------
  |  |   99|     22|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 11]
  |  |  ------------------
  ------------------
 1815|     11|         TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen)))
  ------------------
  |  |   99|     11|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 11]
  |  |  ------------------
  ------------------
 1816|      0|      return 0;
 1817|       |
 1818|  31.7M|    if (rv) {  // XXX obsolote
  ------------------
  |  Branch (1818:9): [True: 56.3k, False: 31.7M]
  ------------------
 1819|  56.3k|      if ((pAMgr->get_compoundflag()) &&
  ------------------
  |  Branch (1819:11): [True: 13.9k, False: 42.4k]
  |  Branch (1819:11): [True: 8, False: 56.3k]
  ------------------
 1820|  13.9k|          TESTAFF(rv->astr, pAMgr->get_compoundflag(), rv->alen))
  ------------------
  |  |   99|  13.9k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 8, False: 13.9k]
  |  |  ------------------
  ------------------
 1821|      8|        return 2 + nosuffix;
 1822|  56.3k|      return 1;
 1823|  56.3k|    }
 1824|  31.7M|  }
 1825|  31.7M|  return 0;
 1826|  91.8M|}
_ZN10SuggestMgr15check_forbiddenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1828|  14.5k|int SuggestMgr::check_forbidden(const std::string& word) {
 1829|  14.5k|  if (pAMgr) {
  ------------------
  |  Branch (1829:7): [True: 14.5k, False: 0]
  ------------------
 1830|  14.5k|    struct hentry* rv = pAMgr->lookup(word.c_str(), word.size());
 1831|  14.5k|    if (rv && rv->astr &&
  ------------------
  |  Branch (1831:9): [True: 0, False: 14.5k]
  |  Branch (1831:9): [True: 0, False: 14.5k]
  |  Branch (1831:15): [True: 0, False: 0]
  ------------------
 1832|      0|        (TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1833|      0|         TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen)))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1834|      0|      rv = nullptr;
 1835|  14.5k|    size_t len = word.size();
 1836|  14.5k|    AffixScratch scratch;
 1837|  14.5k|    if (!(pAMgr->prefix_check(word, 0, len, 1, scratch)))
  ------------------
  |  Branch (1837:9): [True: 14.5k, False: 0]
  ------------------
 1838|  14.5k|      rv = pAMgr->suffix_check(word, 0, len, 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // prefix+suffix, suffix
  ------------------
  |  |   96|  14.5k|#define FLAG_NULL 0x00
  ------------------
                    rv = pAMgr->suffix_check(word, 0, len, 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // prefix+suffix, suffix
  ------------------
  |  |   96|  14.5k|#define FLAG_NULL 0x00
  ------------------
                    rv = pAMgr->suffix_check(word, 0, len, 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // prefix+suffix, suffix
  ------------------
  |  |   72|  14.5k|#define IN_CPD_NOT 0
  ------------------
 1839|       |    // check forbidden words
 1840|  14.5k|    if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1840:9): [True: 0, False: 14.5k]
  |  Branch (1840:9): [True: 0, False: 14.5k]
  |  Branch (1840:17): [True: 0, False: 0]
  ------------------
 1841|      0|        TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1842|      0|      return 1;
 1843|  14.5k|  }
 1844|  14.5k|  return 0;
 1845|  14.5k|}
_ZN10SuggestMgr13suggest_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1847|  14.2k|std::string SuggestMgr::suggest_morph(const std::string& in_w) {
 1848|  14.2k|  std::string result;
 1849|       |
 1850|  14.2k|  struct hentry* rv = nullptr;
 1851|       |
 1852|  14.2k|  if (!pAMgr)
  ------------------
  |  Branch (1852:7): [True: 0, False: 14.2k]
  ------------------
 1853|      0|    return {};
 1854|       |
 1855|  14.2k|  std::string w(in_w);
 1856|       |
 1857|       |  // word reversing wrapper for complex prefixes
 1858|  14.2k|  if (complexprefixes) {
  ------------------
  |  Branch (1858:7): [True: 734, False: 13.4k]
  ------------------
 1859|    734|    if (utf8)
  ------------------
  |  Branch (1859:9): [True: 0, False: 734]
  ------------------
 1860|      0|      reverseword_utf(w);
 1861|    734|    else
 1862|    734|      reverseword(w);
 1863|    734|  }
 1864|       |
 1865|  14.2k|  rv = pAMgr->lookup(w.c_str(), w.size());
 1866|       |
 1867|  17.0k|  while (rv) {
  ------------------
  |  Branch (1867:10): [True: 2.83k, False: 14.2k]
  ------------------
 1868|  2.83k|    if ((!rv->astr) ||
  ------------------
  |  Branch (1868:9): [True: 2.80k, False: 29]
  |  Branch (1868:9): [True: 2.83k, False: 0]
  ------------------
 1869|     29|        !(TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |   99|     58|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 29]
  |  |  ------------------
  ------------------
 1870|     29|          TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |   99|     58|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 29]
  |  |  ------------------
  ------------------
 1871|  2.83k|          TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen))) {
  ------------------
  |  |   99|     29|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 29]
  |  |  ------------------
  ------------------
 1872|  2.83k|      if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|  2.83k|#define MORPH_STEM "st:"
  ------------------
  |  Branch (1872:11): [True: 2.83k, False: 0]
  ------------------
 1873|  2.83k|        result.push_back(MSEP_FLD);
  ------------------
  |  |  121|  2.83k|#define MSEP_FLD ' '
  ------------------
 1874|  2.83k|        result.append(MORPH_STEM);
  ------------------
  |  |  103|  2.83k|#define MORPH_STEM "st:"
  ------------------
 1875|  2.83k|        result.append(w);
 1876|  2.83k|      }
 1877|  2.83k|      if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (1877:11): [True: 0, False: 2.83k]
  ------------------
 1878|      0|        result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 1879|      0|        result.append(HENTRY_DATA2(rv));
 1880|      0|      }
 1881|  2.83k|      result.push_back(MSEP_REC);
  ------------------
  |  |  122|  2.83k|#define MSEP_REC '\n'
  ------------------
 1882|  2.83k|    }
 1883|  2.83k|    rv = rv->next_homonym;
 1884|  2.83k|  }
 1885|       |
 1886|  14.2k|  AffixScratch scratch;
 1887|  14.2k|  std::string st = pAMgr->affix_check_morph(w, 0, w.size(), scratch);
 1888|  14.2k|  if (!st.empty()) {
  ------------------
  |  Branch (1888:7): [True: 0, False: 14.2k]
  ------------------
 1889|      0|    result.append(st);
 1890|      0|  }
 1891|       |
 1892|  14.2k|  if (pAMgr->get_compound() && result.empty()) {
  ------------------
  |  Branch (1892:7): [True: 2.97k, False: 11.2k]
  |  Branch (1892:32): [True: 2.30k, False: 669]
  ------------------
 1893|  2.30k|    struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
 1894|  2.30k|    pAMgr->compound_check_morph(w, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, result, nullptr, scratch);
 1895|  2.30k|  }
 1896|       |
 1897|  14.2k|  line_uniq(result, MSEP_REC);
  ------------------
  |  |  122|  14.2k|#define MSEP_REC '\n'
  ------------------
 1898|       |
 1899|  14.2k|  return result;
 1900|  14.2k|}
_ZN10SuggestMgr18suggest_hentry_genEP6hentryPKc:
 1925|   505k|std::string SuggestMgr::suggest_hentry_gen(hentry* rv, const char* pattern) {
 1926|   505k|  std::string result;
 1927|   505k|  int sfxcount = get_sfxcount(pattern);
 1928|       |
 1929|   505k|  if (get_sfxcount(HENTRY_DATA(rv)) > sfxcount)
  ------------------
  |  Branch (1929:7): [True: 0, False: 505k]
  ------------------
 1930|      0|    return result;
 1931|       |
 1932|   505k|  if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (1932:7): [True: 0, False: 505k]
  ------------------
 1933|      0|    std::string aff = pAMgr->morphgen(HENTRY_WORD(rv), rv->blen, rv->astr, rv->alen,
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1934|      0|                                      HENTRY_DATA(rv), pattern, 0);
 1935|      0|    if (!aff.empty()) {
  ------------------
  |  Branch (1935:9): [True: 0, False: 0]
  ------------------
 1936|      0|      result.append(aff);
 1937|      0|      result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1938|      0|    }
 1939|      0|  }
 1940|       |
 1941|       |  // check all allomorphs
 1942|   505k|  char* p = nullptr;
 1943|   505k|  if (HENTRY_DATA(rv))
  ------------------
  |  Branch (1943:7): [True: 0, False: 505k]
  ------------------
 1944|      0|    p = (char*)strstr(HENTRY_DATA2(rv), MORPH_ALLOMORPH);
  ------------------
  |  |  104|      0|#define MORPH_ALLOMORPH "al:"
  ------------------
 1945|   505k|  while (p) {
  ------------------
  |  Branch (1945:10): [True: 0, False: 505k]
  ------------------
 1946|      0|    p += MORPH_TAG_LEN;
  ------------------
  |  |  119|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
 1947|      0|    int plen = fieldlen(p);
 1948|      0|    std::string allomorph(p, plen);
 1949|      0|    struct hentry* rv2 = pAMgr->lookup(allomorph.c_str(), allomorph.size());
 1950|      0|    while (rv2) {
  ------------------
  |  Branch (1950:12): [True: 0, False: 0]
  ------------------
 1951|       |      //            if (HENTRY_DATA(rv2) && get_sfxcount(HENTRY_DATA(rv2)) <=
 1952|       |      //            sfxcount) {
 1953|      0|      if (HENTRY_DATA(rv2)) {
  ------------------
  |  Branch (1953:11): [True: 0, False: 0]
  ------------------
 1954|      0|        char* st = (char*)strstr(HENTRY_DATA2(rv2), MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 1955|      0|        if (st && (strncmp(st + MORPH_TAG_LEN, HENTRY_WORD(rv),
  ------------------
  |  |  119|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
                      if (st && (strncmp(st + MORPH_TAG_LEN, HENTRY_WORD(rv),
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (1955:13): [True: 0, False: 0]
  |  Branch (1955:19): [True: 0, False: 0]
  ------------------
 1956|      0|                           fieldlen(st + MORPH_TAG_LEN)) == 0)) {
  ------------------
  |  |  119|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
 1957|      0|          std::string aff = pAMgr->morphgen(HENTRY_WORD(rv2), rv2->blen, rv2->astr,
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1958|      0|                                            rv2->alen, HENTRY_DATA(rv2), pattern, 0);
 1959|      0|          if (!aff.empty()) {
  ------------------
  |  Branch (1959:15): [True: 0, False: 0]
  ------------------
 1960|      0|            result.append(aff);
 1961|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1962|      0|          }
 1963|      0|        }
 1964|      0|      }
 1965|      0|      rv2 = rv2->next_homonym;
 1966|      0|    }
 1967|      0|    p = strstr(p + plen, MORPH_ALLOMORPH);
  ------------------
  |  |  104|      0|#define MORPH_ALLOMORPH "al:"
  ------------------
 1968|      0|  }
 1969|       |
 1970|   505k|  return result;
 1971|   505k|}
_ZN10SuggestMgr11suggest_genERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_NS0_6chrono10time_pointINSE_12steady_clockENSE_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1974|   419k|                                    std::chrono::steady_clock::time_point start_time) {
 1975|   419k|  if (desc.empty() || !pAMgr)
  ------------------
  |  Branch (1975:7): [True: 220k, False: 199k]
  |  Branch (1975:23): [True: 0, False: 199k]
  ------------------
 1976|   220k|    return {};
 1977|       |
 1978|   199k|  const char* pattern = in_pattern.c_str();
 1979|   199k|  std::string result2;
 1980|   199k|  std::string newpattern;
 1981|   199k|  struct hentry* rv = nullptr;
 1982|       |
 1983|       |  // search affixed forms with and without derivational suffixes
 1984|   238k|  while (true) {
  ------------------
  |  Branch (1984:10): [True: 238k, Folded]
  ------------------
 1985|   238k|    for (const auto& k : desc) {
  ------------------
  |  Branch (1985:24): [True: 238k, False: 238k]
  ------------------
 1986|   238k|      if (std::chrono::steady_clock::now() - start_time > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|   238k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1986:11): [True: 0, False: 238k]
  ------------------
 1987|      0|        return result2;
 1988|   238k|      std::string result;
 1989|       |
 1990|       |      // add compound word parts (except the last one)
 1991|   238k|      const size_t lastpart = append_compound_parts(k, result);
 1992|   238k|      const char* s = k.c_str() + lastpart;
 1993|   238k|      std::string tok(k, lastpart);
 1994|   238k|      size_t pos = tok.find(" | ");
 1995|   238k|      while (pos != std::string::npos) {
  ------------------
  |  Branch (1995:14): [True: 0, False: 238k]
  ------------------
 1996|      0|        tok[pos + 1] = MSEP_ALT;
  ------------------
  |  |  123|      0|#define MSEP_ALT '\v'
  ------------------
 1997|      0|        pos = tok.find(" | ", pos);
 1998|      0|      }
 1999|   238k|      std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  123|   238k|#define MSEP_ALT '\v'
  ------------------
 2000|   273k|      for (auto& i : pl) {
  ------------------
  |  Branch (2000:20): [True: 273k, False: 238k]
  ------------------
 2001|       |        // remove inflectional and terminal suffixes
 2002|   273k|        size_t is = i.find(MORPH_INFL_SFX);
  ------------------
  |  |  110|   273k|#define MORPH_INFL_SFX "is:"
  ------------------
 2003|   273k|        if (is != std::string::npos)
  ------------------
  |  Branch (2003:13): [True: 0, False: 273k]
  ------------------
 2004|      0|          i.resize(is);
 2005|   273k|        size_t ts = i.find(MORPH_TERM_SFX);
  ------------------
  |  |  111|   273k|#define MORPH_TERM_SFX "ts:"
  ------------------
 2006|   273k|        while (ts != std::string::npos) {
  ------------------
  |  Branch (2006:16): [True: 0, False: 273k]
  ------------------
 2007|      0|          i[ts] = '_';
 2008|      0|          ts = i.find(MORPH_TERM_SFX);
  ------------------
  |  |  111|      0|#define MORPH_TERM_SFX "ts:"
  ------------------
 2009|      0|        }
 2010|   273k|        const char* st = strstr(s, MORPH_STEM);
  ------------------
  |  |  103|   273k|#define MORPH_STEM "st:"
  ------------------
 2011|   273k|        if (st) {
  ------------------
  |  Branch (2011:13): [True: 252k, False: 20.7k]
  ------------------
 2012|   252k|          copy_field(tok, st, MORPH_STEM);
  ------------------
  |  |  103|   252k|#define MORPH_STEM "st:"
  ------------------
 2013|   252k|          rv = pAMgr->lookup(tok.c_str(), tok.size());
 2014|   505k|          while (rv) {
  ------------------
  |  Branch (2014:18): [True: 252k, False: 252k]
  ------------------
 2015|   252k|            if (std::chrono::steady_clock::now() - start_time > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|   252k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (2015:17): [True: 0, False: 252k]
  ------------------
 2016|      0|              return result2;
 2017|   252k|            std::string newpat(i);
 2018|   252k|            newpat.append(pattern);
 2019|   252k|            std::string sg = suggest_hentry_gen(rv, newpat.c_str());
 2020|   252k|            if (sg.empty())
  ------------------
  |  Branch (2020:17): [True: 252k, False: 0]
  ------------------
 2021|   252k|              sg = suggest_hentry_gen(rv, pattern);
 2022|   252k|            if (!sg.empty()) {
  ------------------
  |  Branch (2022:17): [True: 0, False: 252k]
  ------------------
 2023|      0|              std::vector<std::string> gen = line_tok(sg, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2024|      0|              for (auto& j : gen) {
  ------------------
  |  Branch (2024:28): [True: 0, False: 0]
  ------------------
 2025|      0|                result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2026|      0|                result2.append(result);
 2027|      0|                if (i.find(MORPH_SURF_PFX) != std::string::npos) {
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
  |  Branch (2027:21): [True: 0, False: 0]
  ------------------
 2028|      0|                  std::string field;
 2029|      0|                  copy_field(field, i, MORPH_SURF_PFX);
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
 2030|      0|                  result2.append(field);
 2031|      0|                }
 2032|      0|                result2.append(j);
 2033|      0|              }
 2034|      0|            }
 2035|   252k|            rv = rv->next_homonym;
 2036|   252k|          }
 2037|   252k|        }
 2038|   273k|      }
 2039|   238k|    }
 2040|       |
 2041|   238k|    if (!result2.empty() || !strstr(pattern, MORPH_DERI_SFX))
  ------------------
  |  |  109|   238k|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (2041:9): [True: 0, False: 238k]
  |  Branch (2041:29): [True: 199k, False: 38.4k]
  ------------------
 2042|   199k|      break;
 2043|       |
 2044|  38.4k|    newpattern.assign(pattern);
 2045|  38.4k|    mystrrep(newpattern, MORPH_DERI_SFX, MORPH_TERM_SFX);
  ------------------
  |  |  109|  38.4k|#define MORPH_DERI_SFX "ds:"
  ------------------
                  mystrrep(newpattern, MORPH_DERI_SFX, MORPH_TERM_SFX);
  ------------------
  |  |  111|  38.4k|#define MORPH_TERM_SFX "ts:"
  ------------------
 2046|  38.4k|    pattern = newpattern.c_str();
 2047|  38.4k|  }
 2048|   199k|  return result2;
 2049|   199k|}
_ZN10SuggestMgr5ngramEiRKNSt3__16vectorI6w_charNS0_9allocatorIS2_EEEES7_i:
 2055|   629k|                      int opt) {
 2056|   629k|  int nscore = 0, ns, l1 = su1.size(), l2 = su2.size();
 2057|       |
 2058|   629k|  if (l2 == 0)
  ------------------
  |  Branch (2058:7): [True: 6.13k, False: 623k]
  ------------------
 2059|  6.13k|    return 0;
 2060|   971k|  for (int j = 1; j <= n; j++) {
  ------------------
  |  Branch (2060:19): [True: 917k, False: 53.9k]
  ------------------
 2061|   917k|    ns = 0;
 2062|  4.43M|    for (int i = 0; i <= (l1 - j); i++) {
  ------------------
  |  Branch (2062:21): [True: 3.51M, False: 917k]
  ------------------
 2063|  3.51M|      int k = 0;
 2064|  16.9M|      for (int l = 0; l <= (l2 - j); l++) {
  ------------------
  |  Branch (2064:23): [True: 14.6M, False: 2.24M]
  ------------------
 2065|  25.3M|        for (k = 0; k < j; k++) {
  ------------------
  |  Branch (2065:21): [True: 24.0M, False: 1.27M]
  ------------------
 2066|  24.0M|          if (su1[i + k] != su2[l + k])
  ------------------
  |  Branch (2066:15): [True: 13.3M, False: 10.6M]
  ------------------
 2067|  13.3M|            break;
 2068|  24.0M|        }
 2069|  14.6M|        if (k == j) {
  ------------------
  |  Branch (2069:13): [True: 1.27M, False: 13.3M]
  ------------------
 2070|  1.27M|          ns++;
 2071|  1.27M|          break;
 2072|  1.27M|        }
 2073|  14.6M|      }
 2074|  3.51M|      if (k != j && opt & NGRAM_WEIGHTED) {
  ------------------
  |  |   84|  2.24M|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2074:11): [True: 2.24M, False: 1.27M]
  |  Branch (2074:21): [True: 86.3k, False: 2.15M]
  ------------------
 2075|  86.3k|        ns--;
 2076|  86.3k|        if (i == 0 || i == l1 - j)
  ------------------
  |  Branch (2076:13): [True: 20.5k, False: 65.7k]
  |  Branch (2076:23): [True: 33.1k, False: 32.5k]
  ------------------
 2077|  53.7k|          ns--;  // side weight
 2078|  86.3k|      }
 2079|  3.51M|    }
 2080|   917k|    nscore = nscore + ns;
 2081|   917k|    if (ns < 2 && !(opt & NGRAM_WEIGHTED))
  ------------------
  |  |   84|   628k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2081:9): [True: 628k, False: 289k]
  |  Branch (2081:19): [True: 569k, False: 59.4k]
  ------------------
 2082|   569k|      break;
 2083|   917k|  }
 2084|       |
 2085|   623k|  ns = 0;
 2086|   623k|  if (opt & NGRAM_LONGER_WORSE)
  ------------------
  |  |   81|   623k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
  |  Branch (2086:7): [True: 253k, False: 370k]
  ------------------
 2087|   253k|    ns = (l2 - l1) - 2;
 2088|   623k|  if (opt & NGRAM_ANY_MISMATCH)
  ------------------
  |  |   82|   623k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
  |  Branch (2088:7): [True: 370k, False: 253k]
  ------------------
 2089|   370k|    ns = abs(l2 - l1) - 2;
 2090|   623k|  ns = (nscore - ((ns > 0) ? ns : 0));
  ------------------
  |  Branch (2090:19): [True: 106k, False: 516k]
  ------------------
 2091|   623k|  return ns;
 2092|   629k|}
_ZN10SuggestMgr5ngramEiRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 2098|   911k|                      int opt) {
 2099|   911k|  int nscore = 0, ns, l1, l2 = s2.size();
 2100|       |
 2101|   911k|  if (l2 == 0)
  ------------------
  |  Branch (2101:7): [True: 11.7k, False: 900k]
  ------------------
 2102|  11.7k|    return 0;
 2103|   900k|  l1 = s1.size();
 2104|  1.74M|  for (int j = 1; j <= n; j++) {
  ------------------
  |  Branch (2104:19): [True: 1.58M, False: 153k]
  ------------------
 2105|  1.58M|    ns = 0;
 2106|  12.4M|    for (int i = 0; i <= (l1 - j); i++) {
  ------------------
  |  Branch (2106:21): [True: 10.8M, False: 1.58M]
  ------------------
 2107|       |      //s2 is haystack, s1[i..i+j) is needle
 2108|  10.8M|      if (s2.find(s1.c_str()+i, 0, j) != std::string::npos) {
  ------------------
  |  Branch (2108:11): [True: 4.24M, False: 6.63M]
  ------------------
 2109|  4.24M|        ns++;
 2110|  6.63M|      } else if (opt & NGRAM_WEIGHTED) {
  ------------------
  |  |   84|  6.63M|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2110:18): [True: 449k, False: 6.18M]
  ------------------
 2111|   449k|        ns--;
 2112|   449k|        if (i == 0 || i == l1 - j)
  ------------------
  |  Branch (2112:13): [True: 45.7k, False: 404k]
  |  Branch (2112:23): [True: 122k, False: 281k]
  ------------------
 2113|   168k|          ns--;  // side weight
 2114|   449k|      }
 2115|  10.8M|    }
 2116|  1.58M|    nscore = nscore + ns;
 2117|  1.58M|    if (ns < 2 && !(opt & NGRAM_WEIGHTED))
  ------------------
  |  |   84|   894k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2117:9): [True: 894k, False: 695k]
  |  Branch (2117:19): [True: 746k, False: 147k]
  ------------------
 2118|   746k|      break;
 2119|  1.58M|  }
 2120|       |
 2121|   900k|  ns = 0;
 2122|   900k|  if (opt & NGRAM_LONGER_WORSE)
  ------------------
  |  |   81|   900k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
  |  Branch (2122:7): [True: 329k, False: 570k]
  ------------------
 2123|   329k|    ns = (l2 - l1) - 2;
 2124|   900k|  if (opt & NGRAM_ANY_MISMATCH)
  ------------------
  |  |   82|   900k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
  |  Branch (2124:7): [True: 570k, False: 329k]
  ------------------
 2125|   570k|    ns = abs(l2 - l1) - 2;
 2126|   900k|  ns = (nscore - ((ns > 0) ? ns : 0));
  ------------------
  |  Branch (2126:19): [True: 197k, False: 702k]
  ------------------
 2127|   900k|  return ns;
 2128|   911k|}
_ZN10SuggestMgr19leftcommonsubstringERKNSt3__16vectorI6w_charNS0_9allocatorIS2_EEEES7_:
 2133|   527k|    const std::vector<w_char>& su2) {
 2134|   527k|  int l1 = su1.size(), l2 = su2.size();
 2135|       |  // decapitalize dictionary word
 2136|   527k|  if (complexprefixes) {
  ------------------
  |  Branch (2136:7): [True: 0, False: 527k]
  ------------------
 2137|      0|    if (l1 && l2 && su1[l1 - 1] == su2[l2 - 1])
  ------------------
  |  Branch (2137:9): [True: 0, False: 0]
  |  Branch (2137:15): [True: 0, False: 0]
  |  Branch (2137:21): [True: 0, False: 0]
  ------------------
 2138|      0|      return 1;
 2139|   527k|  } else {
 2140|   527k|    unsigned short idx = su2.empty() ? 0 : (unsigned short)(su2[0]),
  ------------------
  |  Branch (2140:26): [True: 0, False: 527k]
  ------------------
 2141|   527k|                   otheridx = su1.empty() ? 0 : (unsigned short)(su1[0]);
  ------------------
  |  Branch (2141:31): [True: 16.1k, False: 511k]
  ------------------
 2142|   527k|    if (otheridx != idx && (otheridx != unicodetolower(idx, langnum)))
  ------------------
  |  Branch (2142:9): [True: 500k, False: 27.4k]
  |  Branch (2142:28): [True: 391k, False: 108k]
  ------------------
 2143|   391k|      return 0;
 2144|   136k|    int i;
 2145|   237k|    for (i = 1; (i < l1) && (i < l2) && (su1[i] == su2[i]);
  ------------------
  |  Branch (2145:17): [True: 220k, False: 16.3k]
  |  Branch (2145:29): [True: 199k, False: 20.9k]
  |  Branch (2145:41): [True: 101k, False: 98.7k]
  ------------------
 2146|   136k|         i++)
 2147|   101k|      ;
 2148|   136k|    return i;
 2149|   527k|  }
 2150|      0|  return 0;
 2151|   527k|}
_ZN10SuggestMgr19leftcommonsubstringEPKcS1_:
 2156|   711k|    const char* s2) {
 2157|   711k|  if (complexprefixes) {
  ------------------
  |  Branch (2157:7): [True: 58.1k, False: 653k]
  ------------------
 2158|  58.1k|    int l1 = strlen(s1), l2 = strlen(s2);
 2159|  58.1k|    if (l1 && l1 <= l2 && s1[l1 - 1] == s2[l2 - 1])
  ------------------
  |  Branch (2159:9): [True: 56.4k, False: 1.66k]
  |  Branch (2159:15): [True: 25.3k, False: 31.1k]
  |  Branch (2159:27): [True: 2.22k, False: 23.1k]
  ------------------
 2160|  2.22k|      return 1;
 2161|   653k|  } else if (csconv) {
  ------------------
  |  Branch (2161:14): [True: 653k, False: 0]
  ------------------
 2162|   653k|    const char* olds = s1;
 2163|       |    // decapitalise dictionary word
 2164|   653k|    if ((*s1 != *s2) && (((unsigned char)*s1) != csconv[((unsigned char)*s2)].clower))
  ------------------
  |  Branch (2164:9): [True: 592k, False: 61.1k]
  |  Branch (2164:25): [True: 434k, False: 157k]
  ------------------
 2165|   434k|      return 0;
 2166|   505k|    do {
 2167|   505k|      s1++;
 2168|   505k|      s2++;
 2169|   505k|    } while ((*s1 == *s2) && (*s1 != '\0'));
  ------------------
  |  Branch (2169:14): [True: 286k, False: 218k]
  |  Branch (2169:30): [True: 286k, False: 403]
  ------------------
 2170|   218k|    return (int)(s1 - olds);
 2171|   653k|  }
 2172|  55.9k|  return 0;
 2173|   711k|}
_ZN10SuggestMgr24commoncharacterpositionsEPKcS1_Pi:
 2177|  78.9k|                                         int* is_swap) {
 2178|  78.9k|  int num = 0, diff = 0, diffpos[2];
 2179|  78.9k|  *is_swap = 0;
 2180|  78.9k|  if (utf8) {
  ------------------
  |  Branch (2180:7): [True: 21.2k, False: 57.6k]
  ------------------
 2181|  21.2k|    std::vector<w_char> su1;
 2182|  21.2k|    std::vector<w_char> su2;
 2183|  21.2k|    int l1 = u8_u16(su1, s1), l2 = u8_u16(su2, s2);
 2184|       |
 2185|  21.2k|    if (l1 <= 0 || l2 <= 0)
  ------------------
  |  Branch (2185:9): [True: 3.53k, False: 17.7k]
  |  Branch (2185:20): [True: 0, False: 17.7k]
  ------------------
 2186|  3.53k|      return 0;
 2187|       |
 2188|       |    // decapitalize dictionary word
 2189|  17.7k|    if (complexprefixes) {
  ------------------
  |  Branch (2189:9): [True: 0, False: 17.7k]
  ------------------
 2190|      0|      su2[l2 - 1] = lower_utf(su2[l2 - 1], langnum);
 2191|  17.7k|    } else {
 2192|  17.7k|      su2[0] = lower_utf(su2[0], langnum);
 2193|  17.7k|    }
 2194|  67.7k|    for (int i = 0; (i < l1) && (i < l2); i++) {
  ------------------
  |  Branch (2194:21): [True: 56.0k, False: 11.6k]
  |  Branch (2194:33): [True: 50.0k, False: 6.01k]
  ------------------
 2195|  50.0k|      if (su1[i] == su2[i]) {
  ------------------
  |  Branch (2195:11): [True: 28.4k, False: 21.5k]
  ------------------
 2196|  28.4k|        num++;
 2197|  28.4k|      } else {
 2198|  21.5k|        if (diff < 2)
  ------------------
  |  Branch (2198:13): [True: 18.2k, False: 3.34k]
  ------------------
 2199|  18.2k|          diffpos[diff] = i;
 2200|  21.5k|        diff++;
 2201|  21.5k|      }
 2202|  50.0k|    }
 2203|  17.7k|    if ((diff == 2) && (l1 == l2) &&
  ------------------
  |  Branch (2203:9): [True: 2.89k, False: 14.8k]
  |  Branch (2203:24): [True: 807, False: 2.08k]
  ------------------
 2204|    807|        (su1[diffpos[0]] == su2[diffpos[1]]) &&
  ------------------
  |  Branch (2204:9): [True: 237, False: 570]
  ------------------
 2205|    237|        (su1[diffpos[1]] == su2[diffpos[0]]))
  ------------------
  |  Branch (2205:9): [True: 70, False: 167]
  ------------------
 2206|     70|      *is_swap = 1;
 2207|  57.6k|  } else {
 2208|  57.6k|    size_t i;
 2209|  57.6k|    std::string t(s2);
 2210|       |    // decapitalize dictionary word
 2211|  57.6k|    if (complexprefixes) {
  ------------------
  |  Branch (2211:9): [True: 3.53k, False: 54.1k]
  ------------------
 2212|  3.53k|      size_t l2 = t.size();
 2213|  3.53k|      t[l2 - 1] = csconv[(unsigned char)t[l2 - 1]].clower;
 2214|  54.1k|    } else {
 2215|  54.1k|      mkallsmall(t, csconv);
 2216|  54.1k|    }
 2217|   329k|    for (i = 0; i < t.size() && (*(s1 + i) != 0); ++i) {
  ------------------
  |  Branch (2217:17): [True: 295k, False: 33.5k]
  |  Branch (2217:33): [True: 271k, False: 24.1k]
  ------------------
 2218|   271k|      if (*(s1 + i) == t[i]) {
  ------------------
  |  Branch (2218:11): [True: 141k, False: 129k]
  ------------------
 2219|   141k|        num++;
 2220|   141k|      } else {
 2221|   129k|        if (diff < 2)
  ------------------
  |  Branch (2221:13): [True: 73.5k, False: 56.1k]
  ------------------
 2222|  73.5k|          diffpos[diff] = i;
 2223|   129k|        diff++;
 2224|   129k|      }
 2225|   271k|    }
 2226|  57.6k|    if ((diff == 2) && (*(s1 + i) == 0) && i == t.size() &&
  ------------------
  |  Branch (2226:9): [True: 12.7k, False: 44.9k]
  |  Branch (2226:24): [True: 8.89k, False: 3.82k]
  |  Branch (2226:44): [True: 3.22k, False: 5.67k]
  ------------------
 2227|  3.22k|        (*(s1 + diffpos[0]) == t[diffpos[1]]) &&
  ------------------
  |  Branch (2227:9): [True: 453, False: 2.76k]
  ------------------
 2228|    453|        (*(s1 + diffpos[1]) == t[diffpos[0]]))
  ------------------
  |  Branch (2228:9): [True: 107, False: 346]
  ------------------
 2229|    107|      *is_swap = 1;
 2230|  57.6k|  }
 2231|  75.3k|  return num;
 2232|  78.9k|}
_ZN10SuggestMgr10bubblesortEPPcS1_Pii:
 2243|   101k|void SuggestMgr::bubblesort(char** rword, char** rword2, int* rsc, int n) {
 2244|   101k|  int m = 1;
 2245|  19.7M|  while (m < n) {
  ------------------
  |  Branch (2245:10): [True: 19.6M, False: 101k]
  ------------------
 2246|  19.6M|    int j = m;
 2247|  40.2M|    while (j > 0) {
  ------------------
  |  Branch (2247:12): [True: 40.2M, False: 28.5k]
  ------------------
 2248|  40.2M|      if (rsc[j - 1] < rsc[j]) {
  ------------------
  |  Branch (2248:11): [True: 20.6M, False: 19.6M]
  ------------------
 2249|  20.6M|        int sctmp = rsc[j - 1];
 2250|  20.6M|        char* wdtmp = rword[j - 1];
 2251|  20.6M|        rsc[j - 1] = rsc[j];
 2252|  20.6M|        rword[j - 1] = rword[j];
 2253|  20.6M|        rsc[j] = sctmp;
 2254|  20.6M|        rword[j] = wdtmp;
 2255|  20.6M|        if (rword2) {
  ------------------
  |  Branch (2255:13): [True: 20.0M, False: 571k]
  ------------------
 2256|  20.0M|          wdtmp = rword2[j - 1];
 2257|  20.0M|          rword2[j - 1] = rword2[j];
 2258|  20.0M|          rword2[j] = wdtmp;
 2259|  20.0M|        }
 2260|  20.6M|        j--;
 2261|  20.6M|      } else
 2262|  19.6M|        break;
 2263|  40.2M|    }
 2264|  19.6M|    m++;
 2265|  19.6M|  }
 2266|   101k|}
_ZN10SuggestMgr3lcsEPKcS1_PiS2_:
 2272|  88.1k|                      int* l2) {
 2273|  88.1k|  int n, m, i, j;
 2274|  88.1k|  std::vector<w_char> su;
 2275|  88.1k|  std::vector<w_char> su2;
 2276|  88.1k|  if (utf8) {
  ------------------
  |  Branch (2276:7): [True: 22.9k, False: 65.2k]
  ------------------
 2277|  22.9k|    m = u8_u16(su, s);
 2278|  22.9k|    n = u8_u16(su2, s2);
 2279|  65.2k|  } else {
 2280|  65.2k|    m = strlen(s);
 2281|  65.2k|    n = strlen(s2);
 2282|  65.2k|  }
 2283|  88.1k|  if (m <= 0 || n <= 0) {
  ------------------
  |  Branch (2283:7): [True: 8.40k, False: 79.7k]
  |  Branch (2283:17): [True: 0, False: 79.7k]
  ------------------
 2284|  8.40k|    *l1 = 0;
 2285|  8.40k|    *l2 = 0;
 2286|  8.40k|    return nullptr;
 2287|  8.40k|  }
 2288|  79.7k|  char* c = new char[(m + 1) * (n + 1)]();
 2289|  79.7k|  char* b = new char[(m + 1) * (n + 1)]();
 2290|   514k|  for (i = 1; i <= m; i++) {
  ------------------
  |  Branch (2290:15): [True: 434k, False: 79.7k]
  ------------------
 2291|  4.87M|    for (j = 1; j <= n; j++) {
  ------------------
  |  Branch (2291:17): [True: 4.44M, False: 434k]
  ------------------
 2292|  4.44M|      if (((utf8) && (su[i - 1] == su2[j - 1])) ||
  ------------------
  |  Branch (2292:12): [True: 274k, False: 4.17M]
  |  Branch (2292:22): [True: 57.9k, False: 216k]
  ------------------
 2293|  4.38M|          ((!utf8) && (s[i - 1] == s2[j - 1]))) {
  ------------------
  |  Branch (2293:12): [True: 4.17M, False: 216k]
  |  Branch (2293:23): [True: 627k, False: 3.54M]
  ------------------
 2294|   685k|        c[i * (n + 1) + j] = c[(i - 1) * (n + 1) + j - 1] + 1;
 2295|   685k|        b[i * (n + 1) + j] = LCS_UPLEFT;
 2296|  3.75M|      } else if (c[(i - 1) * (n + 1) + j] >= c[i * (n + 1) + j - 1]) {
  ------------------
  |  Branch (2296:18): [True: 2.80M, False: 959k]
  ------------------
 2297|  2.80M|        c[i * (n + 1) + j] = c[(i - 1) * (n + 1) + j];
 2298|  2.80M|        b[i * (n + 1) + j] = LCS_UP;
 2299|  2.80M|      } else {
 2300|   959k|        c[i * (n + 1) + j] = c[i * (n + 1) + j - 1];
 2301|   959k|        b[i * (n + 1) + j] = LCS_LEFT;
 2302|   959k|      }
 2303|  4.44M|    }
 2304|   434k|  }
 2305|  79.7k|  delete[] c;
 2306|  79.7k|  *l1 = m;
 2307|  79.7k|  *l2 = n;
 2308|  79.7k|  return b;
 2309|  88.1k|}
_ZN10SuggestMgr6lcslenEPKcS1_:
 2311|  88.1k|int SuggestMgr::lcslen(const char* s, const char* s2) {
 2312|  88.1k|  int m, n, len = 0;
 2313|  88.1k|  char* result = lcs(s, s2, &m, &n);
 2314|  88.1k|  if (!result)
  ------------------
  |  Branch (2314:7): [True: 8.40k, False: 79.7k]
  ------------------
 2315|  8.40k|    return 0;
 2316|  79.7k|  int i = m, j = n;
 2317|   675k|  while ((i != 0) && (j != 0)) {
  ------------------
  |  Branch (2317:10): [True: 601k, False: 73.6k]
  |  Branch (2317:22): [True: 595k, False: 6.08k]
  ------------------
 2318|   595k|    if (result[i * (n + 1) + j] == LCS_UPLEFT) {
  ------------------
  |  Branch (2318:9): [True: 233k, False: 362k]
  ------------------
 2319|   233k|      len++;
 2320|   233k|      i--;
 2321|   233k|      j--;
 2322|   362k|    } else if (result[i * (n + 1) + j] == LCS_UP) {
  ------------------
  |  Branch (2322:16): [True: 188k, False: 174k]
  ------------------
 2323|   188k|      i--;
 2324|   188k|    } else
 2325|   174k|      j--;
 2326|   595k|  }
 2327|  79.7k|  delete[] result;
 2328|  79.7k|  return len;
 2329|  88.1k|}
_ZN10SuggestMgr6lcslenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 2331|  6.97k|int SuggestMgr::lcslen(const std::string& s, const std::string& s2) {
 2332|  6.97k|  return lcslen(s.c_str(), s2.c_str());
 2333|  6.97k|}
suggestmgr.cxx:_ZN12_GLOBAL__N_115ngsuggest_guardC2EbPK7cs_infoPiPS3_:
 1164|  62.2k|      : m_nonbmp(nonbmp)
 1165|  62.2k|      , m_origconv(origconv)
 1166|  62.2k|      , m_utf8(utf8)
 1167|  62.2k|      , m_csconv(csconv)
 1168|  62.2k|    {
 1169|  62.2k|    }
suggestmgr.cxx:_ZN12_GLOBAL__N_115ngsuggest_guardD2Ev:
 1172|  62.2k|    {
 1173|  62.2k|      if (m_nonbmp) {
  ------------------
  |  Branch (1173:11): [True: 2.00k, False: 60.2k]
  ------------------
 1174|  2.00k|        *m_csconv = m_origconv;
 1175|  2.00k|        *m_utf8 = 1;
 1176|  2.00k|      }
 1177|  62.2k|    }
suggestmgr.cxx:_ZL12get_sfxcountPKc:
 1902|  1.01M|static int get_sfxcount(const char* morph) {
 1903|  1.01M|  if (!morph || !*morph)
  ------------------
  |  Branch (1903:7): [True: 505k, False: 505k]
  |  Branch (1903:17): [True: 0, False: 505k]
  ------------------
 1904|   505k|    return 0;
 1905|   505k|  int n = 0;
 1906|   505k|  const char* old = morph;
 1907|   505k|  morph = strstr(morph, MORPH_DERI_SFX);
  ------------------
  |  |  109|   505k|#define MORPH_DERI_SFX "ds:"
  ------------------
 1908|   505k|  if (!morph)
  ------------------
  |  Branch (1908:7): [True: 427k, False: 78.3k]
  ------------------
 1909|   427k|    morph = strstr(old, MORPH_INFL_SFX);
  ------------------
  |  |  110|   427k|#define MORPH_INFL_SFX "is:"
  ------------------
 1910|   505k|  if (!morph)
  ------------------
  |  Branch (1910:7): [True: 427k, False: 78.8k]
  ------------------
 1911|   427k|    morph = strstr(old, MORPH_TERM_SFX);
  ------------------
  |  |  111|   427k|#define MORPH_TERM_SFX "ts:"
  ------------------
 1912|   720k|  while (morph) {
  ------------------
  |  Branch (1912:10): [True: 214k, False: 505k]
  ------------------
 1913|   214k|    n++;
 1914|   214k|    old = morph;
 1915|   214k|    morph = strstr(morph + 1, MORPH_DERI_SFX);
  ------------------
  |  |  109|   214k|#define MORPH_DERI_SFX "ds:"
  ------------------
 1916|   214k|    if (!morph)
  ------------------
  |  Branch (1916:9): [True: 186k, False: 28.7k]
  ------------------
 1917|   186k|      morph = strstr(old + 1, MORPH_INFL_SFX);
  ------------------
  |  |  110|   186k|#define MORPH_INFL_SFX "is:"
  ------------------
 1918|   214k|    if (!morph)
  ------------------
  |  Branch (1918:9): [True: 186k, False: 28.7k]
  ------------------
 1919|   186k|      morph = strstr(old + 1, MORPH_TERM_SFX);
  ------------------
  |  |  111|   186k|#define MORPH_TERM_SFX "ts:"
  ------------------
 1920|   214k|  }
 1921|   505k|  return n;
 1922|  1.01M|}

_ZNK6w_charcvtEv:
   57|   265M|  {
   58|   265M|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
   59|       |    //use little-endian optimized version
   60|       |#if (__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)) && defined __cpp_lib_bit_cast && __cpp_lib_bit_cast >= 201806L
   61|       |    return std::bit_cast<unsigned short>(*this);
   62|       |#else
   63|   265M|    unsigned short u;
   64|   265M|    memcpy(&u, this, sizeof(unsigned short));
   65|   265M|    return u;
   66|   265M|#endif
   67|       |
   68|       |#else
   69|       |    return ((unsigned short)h << 8) | (unsigned short)l;
   70|       |#endif
   71|   265M|  }
_Zlt6w_charS_:
   73|  22.9M|  friend bool operator<(const w_char a, const w_char b) {
   74|  22.9M|    return (unsigned short)a < (unsigned short)b;
   75|  22.9M|  }
_Zeq6w_charS_:
   77|  90.4M|  friend bool operator==(const w_char a, const w_char b) {
   78|  90.4M|    return (unsigned short)a == (unsigned short)b;
   79|  90.4M|  }
_Zne6w_charS_:
   81|  88.1M|  friend bool operator!=(const w_char a, const w_char b) {
   82|  88.1M|    return !(a == b);
   83|  88.1M|  }

_Z8endswithRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_:
   40|    200|{
   41|    200|    return str.size() >= suffix.size() &&
  ------------------
  |  Branch (41:12): [True: 192, False: 8]
  ------------------
   42|    192|           str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
  ------------------
  |  Branch (42:12): [True: 38, False: 154]
  ------------------
   43|    200|}
LLVMFuzzerInitialize:
   46|      2|{
   47|      2|    char* exe_path = (*argv)[0];
   48|       |    // dirname() can modify its argument.
   49|      2|    char* exe_path_copy = strdup(exe_path);
   50|      2|    char* dir = dirname(exe_path_copy);
   51|      2|    DIR* d = opendir(dir);
   52|      2|    struct dirent *direntry;
   53|      2|    std::vector<std::string> affs;
   54|    202|    while ((direntry = readdir(d)) != NULL)
  ------------------
  |  Branch (54:12): [True: 200, False: 2]
  ------------------
   55|    200|    {
   56|    200|        std::string entry(direntry->d_name);
   57|    200|        if (endswith(entry, ".aff"))
  ------------------
  |  Branch (57:13): [True: 38, False: 162]
  ------------------
   58|     38|            affs.push_back(std::move(entry));
   59|    200|    }
   60|      2|    closedir(d);
   61|      2|    free(exe_path_copy);
   62|       |
   63|       |    // sort so dict iteration order is reproducible across runs regardless of
   64|       |    // readdir ordering; a failing input then reproduces against the same dict
   65|      2|    std::sort(affs.begin(), affs.end());
   66|      2|    for (const auto& entry : affs)
  ------------------
  |  Branch (66:28): [True: 38, False: 2]
  ------------------
   67|     38|    {
   68|     38|        std::string dic = entry.substr(0, entry.size() - 4) + ".dic";
   69|     38|        dictionaries.emplace_back(new Hunspell(entry.c_str(), dic.c_str()));
   70|     38|    }
   71|       |
   72|      2|    return 0;
   73|      2|}
LLVMFuzzerTestOneInput:
   76|  3.40k|{
   77|  3.40k|    std::string word(data, size);
   78|  3.40k|    for (auto& dict : dictionaries)
  ------------------
  |  Branch (78:21): [True: 64.6k, False: 3.40k]
  ------------------
   79|  64.6k|    {
   80|  64.6k|        if (!dict->spell(word))
  ------------------
  |  Branch (80:13): [True: 64.0k, False: 583]
  ------------------
   81|  64.0k|            dict->suggest(word);
   82|  64.6k|    }
   83|  3.40k|    return 0;
   84|  3.40k|}

