_ZN8PfxEntryC2EP8AffixMgr:
   90|      8|    : pmyMgr(pmgr)
   91|      8|    , next(nullptr)
   92|      8|    , nexteq(nullptr)
   93|      8|    , nextne(nullptr)
   94|      8|    , flgnxt(nullptr) {}
_ZN8PfxEntry3addEPKcm:
   97|      1|std::string PfxEntry::add(const char* word, size_t len) {
   98|      1|  std::string result;
   99|      1|  if ((len > strip.size() || (len == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (99:7): [True: 1, False: 0]
  |  Branch (99:8): [True: 1, False: 0]
  |  Branch (99:31): [True: 0, False: 0]
  |  Branch (99:43): [True: 0, False: 0]
  ------------------
  100|      1|      (len >= numconds) && test_condition(word) &&
  ------------------
  |  Branch (100:7): [True: 1, False: 0]
  |  Branch (100:28): [True: 1, False: 0]
  ------------------
  101|      1|      (strip.empty() ||
  ------------------
  |  Branch (101:8): [True: 1, False: 0]
  ------------------
  102|      1|      (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|      1|    result.assign(appnd);
  105|      1|    result.append(word + strip.size());
  106|      1|  }
  107|      1|  return result;
  108|      1|}
_ZN8PfxEntry9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  213|  1.31M|                                   AffixScratch& scratch) {
  214|  1.31M|  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.31M|  int tmpl = len - appnd.size(); // length of tmpword
  222|       |
  223|  1.31M|  if (tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) {
  ------------------
  |  Branch (223:7): [True: 1.31M, False: 3.20k]
  |  Branch (223:20): [True: 3.20k, False: 0]
  |  Branch (223:33): [True: 0, False: 3.20k]
  ------------------
  224|       |    // generate new root word by removing prefix and adding
  225|       |    // back any characters that would have been stripped
  226|       |
  227|  1.31M|    std::string& tmpword = scratch.pfx_check_word;
  228|  1.31M|    tmpword.assign(strip);
  229|  1.31M|    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.31M|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (239:9): [True: 16.6k, False: 1.29M]
  ------------------
  240|  16.6k|      tmpl += strip.size();
  241|  16.6k|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (241:11): [True: 2, False: 16.6k]
  ------------------
  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|       |              // needflag
  247|      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 (247:16): [True: 0, False: 0]
  ------------------
  248|      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 (248:17): [True: 0, False: 0]
  ------------------
  249|      0|            return he;
  250|      2|          he = he->next_homonym;  // check homonyms
  251|      2|        } while (he);
  ------------------
  |  Branch (251:18): [True: 0, False: 2]
  ------------------
  252|      2|      }
  253|       |
  254|       |      // prefix matched but no root word was found
  255|       |      // if aeXPRODUCT is allowed, try again but now
  256|       |      // ross checked combined with a suffix
  257|       |
  258|       |      // if ((opts & aeXPRODUCT) && in_compound) {
  259|  16.6k|      if ((opts & aeXPRODUCT)) {
  ------------------
  |  |   65|  16.6k|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (259:11): [True: 16.6k, False: 0]
  ------------------
  260|  16.6k|        he = pmyMgr->suffix_check(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|  16.6k|#define aeXPRODUCT (1 << 0)
  ------------------
  261|  16.6k|                                  scratch, FLAG_NULL, needflag, in_compound);
  ------------------
  |  |   96|  16.6k|#define FLAG_NULL 0x00
  ------------------
  262|  16.6k|        if (he)
  ------------------
  |  Branch (262:13): [True: 0, False: 16.6k]
  ------------------
  263|      0|          return he;
  264|  16.6k|      }
  265|  16.6k|    }
  266|  1.31M|  }
  267|  1.31M|  return nullptr;
  268|  1.31M|}
_ZN8PfxEntry12check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  276|  1.31M|                                      AffixScratch& scratch) {
  277|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  278|       |  // So if the remaining root word has positive length
  279|       |  // and if there are enough chars in root word and added back strip chars
  280|       |  // to meet the number of characters conditions, then test it
  281|       |
  282|  1.31M|  int tmpl = len - appnd.size(); // length of tmpword
  283|       |
  284|  1.31M|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (284:8): [True: 1.30M, False: 3.16k]
  |  Branch (284:21): [True: 3.16k, False: 0]
  |  Branch (284:34): [True: 0, False: 3.16k]
  ------------------
  285|  1.30M|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (285:7): [True: 1.26M, False: 45.6k]
  ------------------
  286|       |    // generate new root word by removing prefix and adding
  287|       |    // back any characters that would have been stripped
  288|       |
  289|  1.26M|    std::string& tmpword = scratch.pfx_check_twosfx;
  290|  1.26M|    tmpword.assign(strip);
  291|  1.26M|    tmpword.append(word, start + appnd.size(), tmpl);
  292|       |
  293|       |    // now make sure all of the conditions on characters
  294|       |    // are met.  Please see the appendix at the end of
  295|       |    // this file for more info on exactly what is being
  296|       |    // tested
  297|       |
  298|       |    // if all conditions are met then check if resulting
  299|       |    // root word in the dictionary
  300|       |
  301|  1.26M|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (301:9): [True: 12.3k, False: 1.24M]
  ------------------
  302|  12.3k|      tmpl += strip.size();
  303|       |
  304|       |      // prefix matched but no root word was found
  305|       |      // if aeXPRODUCT is allowed, try again but now
  306|       |      // cross checked combined with a suffix
  307|       |
  308|  12.3k|      if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   65|  12.3k|#define aeXPRODUCT (1 << 0)
  ------------------
                    if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   73|  12.3k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (308:11): [True: 12.3k, False: 0]
  |  Branch (308:34): [True: 12.3k, False: 0]
  ------------------
  309|       |        // hash entry of root word or NULL
  310|  12.3k|        struct hentry* he = pmyMgr->suffix_check_twosfx(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|  12.3k|#define aeXPRODUCT (1 << 0)
  ------------------
  311|  12.3k|                                                        scratch, needflag);
  312|  12.3k|        if (he)
  ------------------
  |  Branch (312:13): [True: 0, False: 12.3k]
  ------------------
  313|      0|          return he;
  314|  12.3k|      }
  315|  12.3k|    }
  316|  1.26M|  }
  317|  1.31M|  return nullptr;
  318|  1.31M|}
_ZN8PfxEntry18check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  326|    674|                                         AffixScratch& scratch) {
  327|    674|  std::string result;
  328|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  329|       |  // So if the remaining root word has positive length
  330|       |  // and if there are enough chars in root word and added back strip chars
  331|       |  // to meet the number of characters conditions, then test it
  332|    674|  int tmpl = len - appnd.size(); // length of tmpword
  333|       |
  334|    674|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (334:8): [True: 674, False: 0]
  |  Branch (334:21): [True: 0, False: 0]
  |  Branch (334:34): [True: 0, False: 0]
  ------------------
  335|    674|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (335:7): [True: 543, False: 131]
  ------------------
  336|       |    // generate new root word by removing prefix and adding
  337|       |    // back any characters that would have been stripped
  338|       |
  339|    543|    std::string& tmpword = scratch.pfx_check_twosfx;
  340|    543|    tmpword.assign(strip);
  341|    543|    tmpword.append(word, start + appnd.size(), tmpl);
  342|       |
  343|       |    // now make sure all of the conditions on characters
  344|       |    // are met.  Please see the appendix at the end of
  345|       |    // this file for more info on exactly what is being
  346|       |    // tested
  347|       |
  348|       |    // if all conditions are met then check if resulting
  349|       |    // root word in the dictionary
  350|       |
  351|    543|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (351:9): [True: 0, False: 543]
  ------------------
  352|      0|      tmpl += strip.size();
  353|       |
  354|       |      // prefix matched but no root word was found
  355|       |      // if aeXPRODUCT is allowed, try again but now
  356|       |      // ross checked combined with a suffix
  357|       |
  358|      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 (358:11): [True: 0, False: 0]
  |  Branch (358:34): [True: 0, False: 0]
  ------------------
  359|      0|        result = pmyMgr->suffix_check_twosfx_morph(tmpword, 0, tmpl,
  360|      0|                                                   aeXPRODUCT,
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  361|      0|                                                   this, scratch, needflag);
  362|      0|      }
  363|      0|    }
  364|    543|  }
  365|    674|  return result;
  366|    674|}
_ZN8PfxEntry11check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  374|    674|                                  AffixScratch& scratch) {
  375|    674|  std::string result;
  376|       |
  377|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  378|       |  // So if the remaining root word has positive length
  379|       |  // and if there are enough chars in root word and added back strip chars
  380|       |  // to meet the number of characters conditions, then test it
  381|       |
  382|    674|  int tmpl = len - appnd.size(); // length of tmpword
  383|       |
  384|    674|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (384:8): [True: 674, False: 0]
  |  Branch (384:21): [True: 0, False: 0]
  |  Branch (384:34): [True: 0, False: 0]
  ------------------
  385|    674|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (385:7): [True: 543, False: 131]
  ------------------
  386|       |    // generate new root word by removing prefix and adding
  387|       |    // back any characters that would have been stripped
  388|       |
  389|    543|    std::string& tmpword = scratch.pfx_check_word;
  390|    543|    tmpword.assign(strip);
  391|    543|    tmpword.append(word, start + appnd.size(), tmpl);
  392|       |
  393|       |    // now make sure all of the conditions on characters
  394|       |    // are met.  Please see the appendix at the end of
  395|       |    // this file for more info on exactly what is being
  396|       |    // tested
  397|       |
  398|       |    // if all conditions are met then check if resulting
  399|       |    // root word in the dictionary
  400|       |
  401|    543|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (401:9): [True: 0, False: 543]
  ------------------
  402|      0|      tmpl += strip.size();
  403|      0|      struct hentry* he;  // hash entry of root word or NULL
  404|      0|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (404:11): [True: 0, False: 0]
  ------------------
  405|      0|        do {
  406|      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 (406:15): [True: 0, False: 0]
  ------------------
  407|       |              // forbid single prefixes with needaffix flag
  408|      0|              !TESTAFF(contclass, pmyMgr->get_needaffix(), contclasslen) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (408:15): [True: 0, False: 0]
  ------------------
  409|       |              // needflag
  410|      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 (410:16): [True: 0, False: 0]
  ------------------
  411|      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 (411:17): [True: 0, False: 0]
  ------------------
  412|      0|            if (morphcode) {
  ------------------
  |  Branch (412:17): [True: 0, False: 0]
  ------------------
  413|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  414|      0|              result.append(morphcode);
  415|      0|            } else
  416|      0|              result.append(getKey());
  417|      0|            if (!HENTRY_FIND(he, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (417:17): [True: 0, False: 0]
  ------------------
  418|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  419|      0|              result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  420|      0|              result.append(HENTRY_WORD(he));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  421|      0|            }
  422|       |            // store the pointer of the hash entry
  423|      0|            if (HENTRY_DATA(he)) {
  ------------------
  |  Branch (423:17): [True: 0, False: 0]
  ------------------
  424|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  425|      0|              result.append(HENTRY_DATA2(he));
  426|      0|            } else {
  427|       |              // return with debug information
  428|      0|              std::string flag = pmyMgr->encode_flag(getFlag());
  429|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  430|      0|              result.append(MORPH_FLAG);
  ------------------
  |  |  117|      0|#define MORPH_FLAG "fl:"
  ------------------
  431|      0|              result.append(flag);
  432|      0|            }
  433|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
  434|      0|          }
  435|      0|          he = he->next_homonym;
  436|      0|        } while (he);
  ------------------
  |  Branch (436:18): [True: 0, False: 0]
  ------------------
  437|      0|      }
  438|       |
  439|       |      // prefix matched but no root word was found
  440|       |      // if aeXPRODUCT is allowed, try again but now
  441|       |      // ross checked combined with a suffix
  442|       |
  443|      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 (443:11): [True: 0, False: 0]
  |  Branch (443:34): [True: 0, False: 0]
  ------------------
  444|      0|        std::string st = pmyMgr->suffix_check_morph(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  445|      0|                                                    scratch, FLAG_NULL, needflag);
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
  446|      0|        if (!st.empty()) {
  ------------------
  |  Branch (446:13): [True: 0, False: 0]
  ------------------
  447|      0|          result.append(st);
  448|      0|        }
  449|      0|      }
  450|      0|    }
  451|    543|  }
  452|       |
  453|    674|  return result;
  454|    674|}
_ZN8SfxEntryC2EP8AffixMgr:
  457|     34|    : pmyMgr(pmgr)  // register affix manager
  458|     34|    , next(nullptr)
  459|     34|    , nexteq(nullptr)
  460|     34|    , nextne(nullptr)
  461|     34|    , flgnxt(nullptr)
  462|     34|    , l_morph(nullptr)
  463|     34|    , r_morph(nullptr)
  464|     34|    , eq_morph(nullptr) {}
_ZN8SfxEntry3addEPKcm:
  467|     53|std::string SfxEntry::add(const char* word, size_t len) {
  468|     53|  std::string result;
  469|       |  /* make sure all conditions match */
  470|     53|  if ((len > strip.size() || (len == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (470:8): [True: 53, False: 0]
  |  Branch (470:31): [True: 0, False: 0]
  |  Branch (470:43): [True: 0, False: 0]
  ------------------
  471|     53|      (len >= numconds) && test_condition(word + len, word) &&
  ------------------
  |  Branch (471:7): [True: 53, False: 0]
  |  Branch (471:28): [True: 53, False: 0]
  ------------------
  472|     53|      (strip.empty() ||
  ------------------
  |  Branch (472:8): [True: 53, False: 0]
  ------------------
  473|     53|       (len >= strip.size() && strcmp(word + len - strip.size(), strip.c_str()) == 0))) {
  ------------------
  |  Branch (473:9): [True: 0, False: 0]
  |  Branch (473:32): [True: 0, False: 0]
  ------------------
  474|     53|    result.assign(word, len);
  475|       |    /* we have a match so add suffix */
  476|     53|    result.replace(len - strip.size(), std::string::npos, appnd);
  477|     53|  }
  478|     53|  return result;
  479|     53|}
_ZN8SfxEntry9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntrytttR12AffixScratch:
  627|  65.1k|                                   AffixScratch& scratch) {
  628|  65.1k|  struct hentry* he;  // hash entry pointer
  629|  65.1k|  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|  65.1k|  if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0))
  ------------------
  |  |   65|  65.1k|#define aeXPRODUCT (1 << 0)
  ------------------
                if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0))
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (634:7): [True: 0, False: 65.1k]
  |  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|  65.1k|  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|  65.1k|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (646:8): [True: 63.7k, False: 1.40k]
  |  Branch (646:21): [True: 1.40k, False: 0]
  |  Branch (646:34): [True: 0, False: 1.40k]
  ------------------
  647|  63.7k|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (647:7): [True: 63.7k, 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|  63.7k|    std::string& tmpword = scratch.sfx_check_word;
  653|  63.7k|    tmpword.assign(word, start, tmpl);
  654|  63.7k|    if (!strip.empty()) {
  ------------------
  |  Branch (654:9): [True: 0, False: 63.7k]
  ------------------
  655|      0|      tmpword.append(strip);
  656|      0|    }
  657|       |
  658|  63.7k|    const char* beg = tmpword.c_str();
  659|  63.7k|    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|  63.7k|    if (test_condition(end, beg)) {
  ------------------
  |  Branch (669:9): [True: 63.7k, False: 4]
  ------------------
  670|       |#ifdef SZOSZABLYA_POSSIBLE_ROOTS
  671|       |      fprintf(stdout, "%s %s %c\n", word.c_str() + start, beg, aflag);
  672|       |#endif
  673|  63.7k|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (673:11): [True: 26, False: 63.7k]
  ------------------
  674|     26|        do {
  675|       |          // check conditional suffix (enabled by prefix)
  676|     26|          if ((TESTAFF(he->astr, aflag, he->alen) ||
  ------------------
  |  |   99|     52|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 2, False: 24]
  |  |  ------------------
  ------------------
  |  Branch (676:15): [True: 2, False: 24]
  ------------------
  677|     24|               (ep && ep->getCont() &&
  ------------------
  |  Branch (677:17): [True: 0, False: 24]
  |  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|      2|              (((optflags & aeXPRODUCT) == 0) ||
  ------------------
  |  |   65|      2|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (679:16): [True: 2, 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|      2|              ((!cclass) ||
  ------------------
  |  Branch (685:16): [True: 2, 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|      2|              (!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: 2, False: 0]
  |  Branch (688:28): [True: 0, False: 0]
  ------------------
  689|       |              // handle required flag
  690|      2|              ((!needflag) ||
  ------------------
  |  Branch (690:16): [True: 2, 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|      2|            return he;
  694|     24|          he = he->next_homonym;  // check homonyms
  695|     24|        } while (he);
  ------------------
  |  Branch (695:18): [True: 0, False: 24]
  ------------------
  696|     26|      }
  697|  63.7k|    }
  698|  63.7k|  }
  699|  65.1k|  return nullptr;
  700|  65.1k|}
_ZN8SfxEntry12check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntrytR12AffixScratch:
  709|  25.7k|                                      AffixScratch& scratch) {
  710|  25.7k|  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|  25.7k|  if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0)
  ------------------
  |  |   65|  25.7k|#define aeXPRODUCT (1 << 0)
  ------------------
                if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0)
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (715:7): [True: 0, False: 25.7k]
  |  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|  25.7k|  int tmpl = len - appnd.size(); // length of tmpword
  724|       |
  725|  25.7k|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (725:8): [True: 25.7k, False: 41]
  |  Branch (725:21): [True: 41, False: 0]
  |  Branch (725:34): [True: 0, False: 41]
  ------------------
  726|  25.7k|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (726:7): [True: 25.7k, 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|  25.7k|    std::string& tmpword = scratch.sfx_check_twosfx;
  732|  25.7k|    tmpword.assign(word, start);
  733|  25.7k|    tmpword.resize(tmpl);
  734|  25.7k|    tmpword.append(strip);
  735|  25.7k|    tmpl += strip.size();
  736|       |
  737|  25.7k|    const char* beg = tmpword.c_str();
  738|  25.7k|    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|  25.7k|    if (test_condition(end, beg)) {
  ------------------
  |  Branch (747:9): [True: 25.7k, False: 0]
  ------------------
  748|  25.7k|      struct hentry* he;  // hash entry pointer
  749|  25.7k|      if (ppfx) {
  ------------------
  |  Branch (749:11): [True: 0, False: 25.7k]
  ------------------
  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|  25.7k|      } else {
  757|  25.7k|        he = pmyMgr->suffix_check(tmpword, 0, tmpl, 0, nullptr, scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   72|  25.7k|#define IN_CPD_NOT 0
  ------------------
  758|  25.7k|      }
  759|  25.7k|      if (he)
  ------------------
  |  Branch (759:11): [True: 0, False: 25.7k]
  ------------------
  760|      0|        return he;
  761|  25.7k|    }
  762|  25.7k|  }
  763|  25.7k|  return nullptr;
  764|  25.7k|}
_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.57M|inline int PfxEntry::test_condition(const std::string& s) {
  126|  2.57M|  size_t st = 0;
  127|  2.57M|  size_t pos = std::string::npos;  // group with pos input position
  128|  2.57M|  bool neg = false;        // complementer
  129|  2.57M|  bool ingroup = false;    // character in the group
  130|  2.57M|  if (numconds == 0)
  ------------------
  |  Branch (130:7): [True: 4.35k, False: 2.57M]
  ------------------
  131|  4.35k|    return 1;
  132|  2.57M|  char* p = c.conds;
  133|  2.69M|  while (true) {
  ------------------
  |  Branch (133:10): [True: 2.69M, Folded]
  ------------------
  134|  2.69M|    switch (*p) {
  135|      0|      case '\0':
  ------------------
  |  Branch (135:7): [True: 0, False: 2.69M]
  ------------------
  136|      0|        return 1;
  137|  24.6k|      case '[': {
  ------------------
  |  Branch (137:7): [True: 24.6k, False: 2.66M]
  ------------------
  138|  24.6k|        neg = false;
  139|  24.6k|        ingroup = false;
  140|  24.6k|        p = nextchar(p);
  141|  24.6k|        pos = st;
  142|  24.6k|        break;
  143|      0|      }
  144|  24.6k|      case '^': {
  ------------------
  |  Branch (144:7): [True: 24.6k, False: 2.66M]
  ------------------
  145|  24.6k|        p = nextchar(p);
  146|  24.6k|        neg = true;
  147|  24.6k|        break;
  148|      0|      }
  149|  24.6k|      case ']': {
  ------------------
  |  Branch (149:7): [True: 24.6k, False: 2.66M]
  ------------------
  150|  24.6k|        if (bool(neg) == bool(ingroup))
  ------------------
  |  Branch (150:13): [True: 0, False: 24.6k]
  ------------------
  151|      0|          return 0;
  152|  24.6k|        pos = std::string::npos;
  153|  24.6k|        p = nextchar(p);
  154|       |        // skip the next character
  155|  24.6k|        if (!ingroup && st < s.size())
  ------------------
  |  Branch (155:13): [True: 24.6k, False: 0]
  |  Branch (155:25): [True: 23.3k, False: 1.28k]
  ------------------
  156|  23.3k|          st = (opts & aeUTF8) ? utf8_next(s, st) : st + 1;
  ------------------
  |  |   66|  23.3k|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (156:16): [True: 23.3k, False: 0]
  ------------------
  157|  24.6k|        if (st == s.size() && p)
  ------------------
  |  Branch (157:13): [True: 3.51k, False: 21.0k]
  |  Branch (157:31): [True: 0, False: 3.51k]
  ------------------
  158|      0|          return 0;  // word <= condition
  159|  24.6k|        break;
  160|  24.6k|      }
  161|  24.6k|      case '.':
  ------------------
  |  Branch (161:7): [True: 0, False: 2.69M]
  ------------------
  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.61M|      default: {
  ------------------
  |  Branch (171:7): [True: 2.61M, False: 73.8k]
  ------------------
  172|  2.61M|        if (st < s.size() && s[st] == *p) {
  ------------------
  |  Branch (172:13): [True: 2.61M, False: 2.56k]
  |  Branch (172:30): [True: 24.7k, False: 2.59M]
  ------------------
  173|  24.7k|          ++st;
  174|  24.7k|          p = nextchar(p);
  175|  24.7k|          if ((opts & aeUTF8) && (s[st - 1] & 0x80)) {  // multibyte
  ------------------
  |  |   66|  24.7k|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (175:15): [True: 24.7k, False: 0]
  |  Branch (175:34): [True: 24.7k, False: 0]
  ------------------
  176|  49.3k|            while (p && is_utf8_cont(*p)) {             // character
  ------------------
  |  Branch (176:20): [True: 49.3k, False: 0]
  |  Branch (176:25): [True: 24.7k, False: 24.6k]
  ------------------
  177|  24.7k|              if (st >= s.size() || *p != s[st]) {
  ------------------
  |  Branch (177:19): [True: 0, False: 24.7k]
  |  Branch (177:37): [True: 128, False: 24.6k]
  ------------------
  178|    128|                if (pos == std::string::npos)
  ------------------
  |  Branch (178:21): [True: 112, False: 16]
  ------------------
  179|    112|                  return 0;
  180|     16|                st = pos;
  181|     16|                break;
  182|    128|              }
  183|  24.6k|              p = nextchar(p);
  184|  24.6k|              ++st;
  185|  24.6k|            }
  186|  24.6k|            if (pos != std::string::npos && st != pos) {
  ------------------
  |  Branch (186:17): [True: 16, False: 24.6k]
  |  Branch (186:45): [True: 0, False: 16]
  ------------------
  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.6k|          } 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.59M|        } else if (pos != std::string::npos) {  // group
  ------------------
  |  Branch (196:20): [True: 49.1k, False: 2.54M]
  ------------------
  197|  49.1k|          p = nextchar(p);
  198|  49.1k|        } else
  199|  2.54M|          return 0;
  200|  2.61M|      }
  201|  2.69M|    }
  202|   147k|    if (!p)
  ------------------
  |  Branch (202:9): [True: 24.6k, False: 123k]
  ------------------
  203|  24.6k|      return 1;
  204|   147k|  }
  205|  2.57M|}
_ZN8PfxEntry8nextcharEPc:
  110|   172k|inline char* PfxEntry::nextchar(char* p) {
  111|   172k|  if (p) {
  ------------------
  |  Branch (111:7): [True: 172k, False: 0]
  ------------------
  112|   172k|    p++;
  113|   172k|    if (opts & aeLONGCOND) {
  ------------------
  |  |   69|   172k|#define aeLONGCOND (1 << 4)
  ------------------
  |  Branch (113:9): [True: 0, False: 172k]
  ------------------
  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|   172k|    } else if (p == c.conds + MAXCONDLEN)
  ------------------
  |  |   90|   172k|#define MAXCONDLEN 20
  ------------------
  |  Branch (118:16): [True: 0, False: 172k]
  ------------------
  119|      0|      return nullptr;
  120|   172k|    return *p ? p : nullptr;
  ------------------
  |  Branch (120:12): [True: 147k, False: 24.6k]
  ------------------
  121|   172k|  }
  122|      0|  return nullptr;
  123|   172k|}
_ZN8SfxEntry14test_conditionEPKcS1_:
  496|  89.5k|inline int SfxEntry::test_condition(const char* st, const char* beg) {
  497|  89.5k|  const char* pos = nullptr;  // group with pos input position
  498|  89.5k|  bool neg = false;        // complementer
  499|  89.5k|  bool ingroup = false;    // character in the group
  500|  89.5k|  if (numconds == 0)
  ------------------
  |  Branch (500:7): [True: 89.5k, False: 4]
  ------------------
  501|  89.5k|    return 1;
  502|      4|  char* p = c.conds;
  503|      4|  st--;
  504|      4|  int i = 1;
  505|     32|  while (true) {
  ------------------
  |  Branch (505:10): [True: 32, Folded]
  ------------------
  506|     32|    switch (*p) {
  507|      0|      case '\0':
  ------------------
  |  Branch (507:7): [True: 0, False: 32]
  ------------------
  508|      0|        return 1;
  509|      4|      case '[':
  ------------------
  |  Branch (509:7): [True: 4, False: 28]
  ------------------
  510|      4|        p = nextchar(p);
  511|      4|        pos = st;
  512|      4|        break;
  513|      0|      case '^':
  ------------------
  |  Branch (513:7): [True: 0, False: 32]
  ------------------
  514|      0|        p = nextchar(p);
  515|      0|        neg = true;
  516|      0|        break;
  517|      4|      case ']':
  ------------------
  |  Branch (517:7): [True: 4, False: 28]
  ------------------
  518|      4|        if (!neg && !ingroup)
  ------------------
  |  Branch (518:13): [True: 4, False: 0]
  |  Branch (518:21): [True: 4, False: 0]
  ------------------
  519|      4|          return 0;
  520|      0|        i++;
  521|       |        // skip the next character
  522|      0|        if (!ingroup) {
  ------------------
  |  Branch (522:13): [True: 0, False: 0]
  ------------------
  523|      0|          for (; (opts & aeUTF8) && (st >= beg) && is_utf8_cont(*st); st--)
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (523:18): [True: 0, False: 0]
  |  Branch (523:37): [True: 0, False: 0]
  |  Branch (523:52): [True: 0, False: 0]
  ------------------
  524|      0|            ;
  525|      0|          st--;
  526|      0|        }
  527|      0|        pos = nullptr;
  528|      0|        neg = false;
  529|      0|        ingroup = false;
  530|      0|        p = nextchar(p);
  531|      0|        if (st < beg && p)
  ------------------
  |  Branch (531:13): [True: 0, False: 0]
  |  Branch (531:25): [True: 0, False: 0]
  ------------------
  532|      0|          return 0;  // word <= condition
  533|      0|        break;
  534|      0|      case '.':
  ------------------
  |  Branch (534:7): [True: 0, False: 32]
  ------------------
  535|      0|        if (!pos) {
  ------------------
  |  Branch (535:13): [True: 0, False: 0]
  ------------------
  536|       |          // dots are not metacharacters in groups: [.]
  537|      0|          p = nextchar(p);
  538|       |          // skip the next character
  539|      0|          for (st--; (opts & aeUTF8) && (st >= beg) && is_utf8_cont(*st);
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (539:22): [True: 0, False: 0]
  |  Branch (539:41): [True: 0, False: 0]
  |  Branch (539:56): [True: 0, False: 0]
  ------------------
  540|      0|               st--)
  541|      0|            ;
  542|      0|          if (st < beg) {  // word <= condition
  ------------------
  |  Branch (542:15): [True: 0, False: 0]
  ------------------
  543|      0|            if (p)
  ------------------
  |  Branch (543:17): [True: 0, False: 0]
  ------------------
  544|      0|              return 0;
  545|      0|            else
  546|      0|              return 1;
  547|      0|          }
  548|      0|          if ((opts & aeUTF8) && (*st & 0x80)) {  // head of the UTF-8 character
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (548:15): [True: 0, False: 0]
  |  Branch (548:34): [True: 0, False: 0]
  ------------------
  549|      0|            st--;
  550|      0|            if (st < beg) {  // word <= condition
  ------------------
  |  Branch (550:17): [True: 0, False: 0]
  ------------------
  551|      0|              if (p)
  ------------------
  |  Branch (551:19): [True: 0, False: 0]
  ------------------
  552|      0|                return 0;
  553|      0|              else
  554|      0|                return 1;
  555|      0|            }
  556|      0|          }
  557|      0|          break;
  558|      0|        }
  559|       |      /* FALLTHROUGH */
  560|     24|      default: {
  ------------------
  |  Branch (560:7): [True: 24, False: 8]
  ------------------
  561|     24|        if (*st == *p) {
  ------------------
  |  Branch (561:13): [True: 0, False: 24]
  ------------------
  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|     24|        } else if (pos) {  // group
  ------------------
  |  Branch (607:20): [True: 24, False: 0]
  ------------------
  608|     24|          p = nextchar(p);
  609|     24|        } else
  610|      0|          return 0;
  611|     24|      }
  612|     32|    }
  613|     28|    if (!p)
  ------------------
  |  Branch (613:9): [True: 0, False: 28]
  ------------------
  614|      0|      return 1;
  615|     28|  }
  616|      4|}
_ZN8SfxEntry8nextcharEPc:
  481|     28|inline char* SfxEntry::nextchar(char* p) {
  482|     28|  if (p) {
  ------------------
  |  Branch (482:7): [True: 28, False: 0]
  ------------------
  483|     28|    p++;
  484|     28|    if (opts & aeLONGCOND) {
  ------------------
  |  |   69|     28|#define aeLONGCOND (1 << 4)
  ------------------
  |  Branch (484:9): [True: 0, False: 28]
  ------------------
  485|       |      // jump to the 2nd part of the condition
  486|      0|      if (p == c.l.conds1 + MAXCONDLEN_1)
  ------------------
  |  |   91|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
  |  Branch (486:11): [True: 0, False: 0]
  ------------------
  487|      0|        return c.l.conds2;
  488|       |      // end of the MAXCONDLEN length condition
  489|     28|    } else if (p == c.conds + MAXCONDLEN)
  ------------------
  |  |   90|     28|#define MAXCONDLEN 20
  ------------------
  |  Branch (489:16): [True: 0, False: 28]
  ------------------
  490|      0|      return nullptr;
  491|     28|    return *p ? p : nullptr;
  ------------------
  |  Branch (491:12): [True: 28, False: 0]
  ------------------
  492|     28|  }
  493|      0|  return nullptr;
  494|     28|}

_ZN8PfxEntry7getNextEv:
  134|  2.55M|  inline PfxEntry* getNext() { return next; }
_ZN8SfxEntry7getNextEv:
  216|    228|  inline SfxEntry* getNext() { return next; }
_ZN8PfxEntry6getKeyEv:
  124|   116k|  const char* getKey() { return appnd.c_str(); }
_ZN8PfxEntry7getFlagEv:
  123|    848|  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|  76.1k|  inline PfxEntry* getNextEQ() { return nexteq; }
_ZN8PfxEntry9getNextNEEv:
  135|  39.5k|  inline PfxEntry* getNextNE() { return nextne; }
_ZN8SfxEntry6getKeyEv:
  205|   461k|  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|   407k|  inline SfxEntry* getNextEQ() { return nexteq; }
_ZN8SfxEntry9getNextNEEv:
  217|  53.5k|  inline SfxEntry* getNextNE() { return nextne; }
_ZN8PfxEntry7getContEv:
  131|  3.93M|  inline const unsigned short* getCont() { return contclass; }
_ZN8PfxEntry10getContLenEv:
  132|  1.31M|  inline unsigned short getContLen() { return contclasslen; }
_ZN8SfxEntry7getContEv:
  210|   544k|  inline const unsigned short* getCont() { return contclass; }
_ZN8SfxEntry10getContLenEv:
  211|  64.9k|  inline unsigned short getContLen() { return contclasslen; }
_ZN8SfxEntry9getKeyLenEv:
  214|   168k|  inline int getKeyLen() { return appnd.size(); }
_ZN8SfxEntry9getFlgNxtEv:
  223|  65.5k|  inline SfxEntry* getFlgNxt() { return flgnxt; }
_ZN8SfxEntry8getAffixEv:
  212|  37.1k|  inline const char* getAffix() { return appnd.c_str(); }
_ZNK8SfxEntry10allowCrossEv:
  171|     53|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|     53|#define aeXPRODUCT (1 << 0)
  ------------------
_ZNK8PfxEntry10allowCrossEv:
   94|      1|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|      1|#define aeXPRODUCT (1 << 0)
  ------------------
_ZN8PfxEntry9getKeyLenEv:
  127|  2.52k|  inline int getKeyLen() { return appnd.size(); }
_ZN8PfxEntry9getFlgNxtEv:
  137|    840|  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_9allocatorIcEEEEiicR12AffixScratcht:
 1083|   525M|                                      const FLAG needflag) {
 1084|   525M|  struct hentry* rv = nullptr;
 1085|       |
 1086|   525M|  pfx = nullptr;
 1087|   525M|  pfxappnd = nullptr;
 1088|   525M|  sfxappnd = nullptr;
 1089|   525M|  sfxextra = 0;
 1090|       |
 1091|       |  // first handle the special case of 0 length prefixes
 1092|   525M|  PfxEntry* pe = pStart[0];
 1093|   526M|  while (pe) {
  ------------------
  |  Branch (1093:10): [True: 1.27M, False: 525M]
  ------------------
 1094|  1.27M|    if (
 1095|       |        // fogemorpheme
 1096|  1.27M|        ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   72|  1.27M|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1096:10): [True: 0, False: 1.27M]
  ------------------
 1097|  1.27M|         !(pe->getCont() &&
  ------------------
  |  Branch (1097:12): [True: 1.27M, False: 0]
  ------------------
 1098|  1.27M|           (TESTAFF(pe->getCont(), onlyincompound, pe->getContLen())))) &&
  ------------------
  |  |   99|  1.27M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1098:12): [True: 0, False: 1.27M]
  ------------------
 1099|       |        // permit prefixes in compounds
 1100|  1.27M|        ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   74|  1.27M|#define IN_CPD_END 2
  ------------------
  |  Branch (1100:10): [True: 1.27M, False: 0]
  ------------------
 1101|      0|         (pe->getCont() &&
  ------------------
  |  Branch (1101:11): [True: 0, False: 0]
  ------------------
 1102|  1.27M|          (TESTAFF(pe->getCont(), compoundpermitflag, pe->getContLen()))))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1102:11): [True: 0, False: 0]
  ------------------
 1103|       |      // check prefix
 1104|  1.27M|      rv = pe->checkword(word, start, len, in_compound, needflag, scratch);
 1105|  1.27M|      if (rv) {
  ------------------
  |  Branch (1105:11): [True: 0, False: 1.27M]
  ------------------
 1106|      0|        pfx = pe;  // BUG: pfx not stateless
 1107|      0|        return rv;
 1108|      0|      }
 1109|  1.27M|    }
 1110|  1.27M|    pe = pe->getNext();
 1111|  1.27M|  }
 1112|       |
 1113|       |  // now handle the general case
 1114|   525M|  unsigned char sp = word[start];
 1115|   525M|  PfxEntry* pptr = pStart[sp];
 1116|       |
 1117|   525M|  while (pptr) {
  ------------------
  |  Branch (1117:10): [True: 60.0k, False: 525M]
  ------------------
 1118|  60.0k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1118:9): [True: 40.2k, False: 19.7k]
  ------------------
 1119|  40.2k|      if (
 1120|       |          // fogemorpheme
 1121|  40.2k|          ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   72|  40.2k|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1121:12): [True: 0, False: 40.2k]
  ------------------
 1122|  40.2k|           !(pptr->getCont() &&
  ------------------
  |  Branch (1122:14): [True: 35.8k, False: 4.38k]
  ------------------
 1123|  35.8k|             (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen())))) &&
  ------------------
  |  |   99|  35.8k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1123:14): [True: 0, False: 35.8k]
  ------------------
 1124|       |          // permit prefixes in compounds
 1125|  40.2k|          ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   74|  40.2k|#define IN_CPD_END 2
  ------------------
  |  Branch (1125:12): [True: 40.2k, False: 0]
  ------------------
 1126|      0|           (pptr->getCont() && (TESTAFF(pptr->getCont(), compoundpermitflag,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1126:13): [True: 0, False: 0]
  |  Branch (1126:32): [True: 0, False: 0]
  ------------------
 1127|  40.2k|                                        pptr->getContLen()))))) {
 1128|       |        // check prefix
 1129|  40.2k|        rv = pptr->checkword(word, start, len, in_compound, needflag, scratch);
 1130|  40.2k|        if (rv) {
  ------------------
  |  Branch (1130:13): [True: 0, False: 40.2k]
  ------------------
 1131|      0|          pfx = pptr;  // BUG: pfx not stateless
 1132|      0|          return rv;
 1133|      0|        }
 1134|  40.2k|      }
 1135|  40.2k|      pptr = pptr->getNextEQ();
 1136|  40.2k|    } else {
 1137|  19.7k|      pptr = pptr->getNextNE();
 1138|  19.7k|    }
 1139|  60.0k|  }
 1140|       |
 1141|   525M|  return nullptr;
 1142|   525M|}
_ZN8AffixMgr19prefix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1150|  14.7M|                                             const FLAG needflag) {
 1151|  14.7M|  struct hentry* rv = nullptr;
 1152|       |
 1153|  14.7M|  pfx = nullptr;
 1154|  14.7M|  sfxappnd = nullptr;
 1155|  14.7M|  sfxextra = 0;
 1156|       |
 1157|       |  // first handle the special case of 0 length prefixes
 1158|  14.7M|  PfxEntry* pe = pStart[0];
 1159|       |
 1160|  16.0M|  while (pe) {
  ------------------
  |  Branch (1160:10): [True: 1.27M, False: 14.7M]
  ------------------
 1161|  1.27M|    rv = pe->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1162|  1.27M|    if (rv)
  ------------------
  |  Branch (1162:9): [True: 0, False: 1.27M]
  ------------------
 1163|      0|      return rv;
 1164|  1.27M|    pe = pe->getNext();
 1165|  1.27M|  }
 1166|       |
 1167|       |  // now handle the general case
 1168|  14.7M|  unsigned char sp = word[start];
 1169|  14.7M|  PfxEntry* pptr = pStart[sp];
 1170|       |
 1171|  14.7M|  while (pptr) {
  ------------------
  |  Branch (1171:10): [True: 55.6k, False: 14.7M]
  ------------------
 1172|  55.6k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1172:9): [True: 35.8k, False: 19.7k]
  ------------------
 1173|  35.8k|      rv = pptr->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1174|  35.8k|      if (rv) {
  ------------------
  |  Branch (1174:11): [True: 0, False: 35.8k]
  ------------------
 1175|      0|        pfx = pptr;
 1176|      0|        return rv;
 1177|      0|      }
 1178|  35.8k|      pptr = pptr->getNextEQ();
 1179|  35.8k|    } else {
 1180|  19.7k|      pptr = pptr->getNextNE();
 1181|  19.7k|    }
 1182|  55.6k|  }
 1183|       |
 1184|  14.7M|  return nullptr;
 1185|  14.7M|}
_ZN8AffixMgr18prefix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1193|  12.7k|                                         const FLAG needflag) {
 1194|       |
 1195|  12.7k|  std::string result;
 1196|       |
 1197|  12.7k|  pfx = nullptr;
 1198|  12.7k|  sfxappnd = nullptr;
 1199|  12.7k|  sfxextra = 0;
 1200|       |
 1201|       |  // first handle the special case of 0 length prefixes
 1202|  12.7k|  PfxEntry* pe = pStart[0];
 1203|  13.4k|  while (pe) {
  ------------------
  |  Branch (1203:10): [True: 674, False: 12.7k]
  ------------------
 1204|    674|    std::string st = pe->check_morph(word, start, len, in_compound, needflag, scratch);
 1205|    674|    if (!st.empty()) {
  ------------------
  |  Branch (1205:9): [True: 0, False: 674]
  ------------------
 1206|      0|      result.append(st);
 1207|      0|    }
 1208|    674|    pe = pe->getNext();
 1209|    674|  }
 1210|       |
 1211|       |  // now handle the general case
 1212|  12.7k|  unsigned char sp = word[start];
 1213|  12.7k|  PfxEntry* pptr = pStart[sp];
 1214|       |
 1215|  12.7k|  while (pptr) {
  ------------------
  |  Branch (1215:10): [True: 0, False: 12.7k]
  ------------------
 1216|      0|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1216:9): [True: 0, False: 0]
  ------------------
 1217|      0|      std::string st = pptr->check_morph(word, start, len, in_compound, needflag, scratch);
 1218|      0|      if (!st.empty()) {
  ------------------
  |  Branch (1218:11): [True: 0, False: 0]
  ------------------
 1219|       |        // fogemorpheme
 1220|      0|        if ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   72|      0|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1220:13): [True: 0, False: 0]
  ------------------
 1221|      0|            !((pptr->getCont() && (TESTAFF(pptr->getCont(), onlyincompound,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1221:16): [True: 0, False: 0]
  |  Branch (1221:35): [True: 0, False: 0]
  ------------------
 1222|      0|                                           pptr->getContLen()))))) {
 1223|      0|          result.append(st);
 1224|      0|          pfx = pptr;
 1225|      0|        }
 1226|      0|      }
 1227|      0|      pptr = pptr->getNextEQ();
 1228|      0|    } else {
 1229|      0|      pptr = pptr->getNextNE();
 1230|      0|    }
 1231|      0|  }
 1232|       |
 1233|  12.7k|  return result;
 1234|  12.7k|}
_ZN8AffixMgr25prefix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1242|  3.96k|                                                const FLAG needflag) {
 1243|  3.96k|  std::string result;
 1244|       |
 1245|  3.96k|  pfx = nullptr;
 1246|  3.96k|  sfxappnd = nullptr;
 1247|  3.96k|  sfxextra = 0;
 1248|       |
 1249|       |  // first handle the special case of 0 length prefixes
 1250|  3.96k|  PfxEntry* pe = pStart[0];
 1251|  4.64k|  while (pe) {
  ------------------
  |  Branch (1251:10): [True: 674, False: 3.96k]
  ------------------
 1252|    674|    std::string st = pe->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1253|    674|    if (!st.empty()) {
  ------------------
  |  Branch (1253:9): [True: 0, False: 674]
  ------------------
 1254|      0|      result.append(st);
 1255|      0|    }
 1256|    674|    pe = pe->getNext();
 1257|    674|  }
 1258|       |
 1259|       |  // now handle the general case
 1260|  3.96k|  unsigned char sp = word[start];
 1261|  3.96k|  PfxEntry* pptr = pStart[sp];
 1262|       |
 1263|  3.96k|  while (pptr) {
  ------------------
  |  Branch (1263:10): [True: 0, False: 3.96k]
  ------------------
 1264|      0|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1264:9): [True: 0, False: 0]
  ------------------
 1265|      0|      std::string st = pptr->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1266|      0|      if (!st.empty()) {
  ------------------
  |  Branch (1266:11): [True: 0, False: 0]
  ------------------
 1267|      0|        result.append(st);
 1268|      0|        pfx = pptr;
 1269|      0|      }
 1270|      0|      pptr = pptr->getNextEQ();
 1271|      0|    } else {
 1272|      0|      pptr = pptr->getNextNE();
 1273|      0|    }
 1274|      0|  }
 1275|       |
 1276|  3.96k|  return result;
 1277|  3.96k|}
_ZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1553|    376|short AffixMgr::get_syllable(const std::string& word) {
 1554|    376|  if (cpdmaxsyllable == 0)
  ------------------
  |  Branch (1554:7): [True: 0, False: 376]
  ------------------
 1555|      0|    return 0;
 1556|       |
 1557|    376|  short num = 0;
 1558|       |
 1559|    376|  if (!utf8) {
  ------------------
  |  Branch (1559:7): [True: 0, False: 376]
  ------------------
 1560|      0|    num = (short)std::count_if(word.begin(), word.end(),
 1561|      0|          [&](char c) {
 1562|      0|            return std::binary_search(cpdvowels.begin(), cpdvowels.end(), c);
 1563|      0|          });
 1564|    376|  } else if (!cpdvowels_utf16.empty()) {
  ------------------
  |  Branch (1564:14): [True: 376, False: 0]
  ------------------
 1565|    376|    std::vector<w_char> w;
 1566|    376|    u8_u16(w, word);
 1567|    376|    num = (short)std::count_if(w.begin(), w.end(),
 1568|    376|          [&](w_char wc) {
 1569|    376|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1570|    376|          });
 1571|    376|  }
 1572|       |
 1573|    376|  return num;
 1574|    376|}
_ZN8AffixMgr10setcminmaxEPmS0_PKcm:
 1576|  19.7M|void AffixMgr::setcminmax(size_t* cmin, size_t* cmax, const char* word, size_t len) {
 1577|  19.7M|  if (utf8) {
  ------------------
  |  Branch (1577:7): [True: 1.58M, False: 18.1M]
  ------------------
 1578|  1.58M|    int i;
 1579|  4.72M|    for (*cmin = 0, i = 0; (i < cpdmin) && *cmin < len; i++) {
  ------------------
  |  Branch (1579:28): [True: 3.16M, False: 1.56M]
  |  Branch (1579:44): [True: 3.14M, False: 24.4k]
  ------------------
 1580|  3.52M|      for ((*cmin)++; *cmin < len && is_utf8_cont(word[*cmin]); (*cmin)++)
  ------------------
  |  Branch (1580:23): [True: 3.47M, False: 41.8k]
  |  Branch (1580:38): [True: 378k, False: 3.10M]
  ------------------
 1581|   378k|        ;
 1582|  3.14M|    }
 1583|  3.16M|    for (*cmax = len, i = 0; (i < (cpdmin - 1)) && *cmax > 0; i++) {
  ------------------
  |  Branch (1583:30): [True: 1.58M, False: 1.58M]
  |  Branch (1583:52): [True: 1.58M, False: 3.26k]
  ------------------
 1584|  2.54M|      for ((*cmax)--; *cmax > 0 && is_utf8_cont(word[*cmax]); (*cmax)--)
  ------------------
  |  Branch (1584:23): [True: 2.52M, False: 21.2k]
  |  Branch (1584:36): [True: 967k, False: 1.56M]
  ------------------
 1585|   967k|        ;
 1586|  1.58M|    }
 1587|  18.1M|  } else {
 1588|  18.1M|    *cmin = cpdmin;
 1589|  18.1M|    *cmax = len - cpdmin + 1;
 1590|  18.1M|  }
 1591|  19.7M|}
_ZN8AffixMgr14compound_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEssssPP6hentrySB_ccPiR12AffixScratch:
 1605|  19.7M|                                        AffixScratch& scratch) {
 1606|  19.7M|  short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2;
 1607|  19.7M|  hentry *rv = nullptr, *rv_first;
 1608|  19.7M|  std::string st;
 1609|  19.7M|  char ch = '\0', affixed;
 1610|  19.7M|  size_t cmin, cmax;
 1611|  19.7M|  int striple = 0, soldi = 0, oldcmin = 0, oldcmax = 0, oldlen = 0, checkedstriple = 0;
 1612|  19.7M|  hentry** oldwords = words;
 1613|  19.7M|  size_t scpd = 0, len = word.size();
 1614|       |
 1615|       |  // protect subsequent words[wnum + 1] reads and any recursion
 1616|  19.7M|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (1616:7): [True: 0, False: 19.7M]
  ------------------
 1617|      0|    return nullptr;
 1618|       |
 1619|  19.7M|  int checked_prefix;
 1620|       |
 1621|       |  // add a time limit to handle possible
 1622|       |  // combinatorical explosion of the overlapping words
 1623|       |
 1624|  19.7M|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  19.7M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1625|  19.7M|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  19.7M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1626|       |
 1627|       |  // get the current time
 1628|  19.7M|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 1629|       |
 1630|  19.7M|  if (wnum == 0) {
  ------------------
  |  Branch (1630:7): [True: 19.7M, False: 119]
  ------------------
 1631|       |      // set the start time
 1632|  19.7M|      clock_time_start = clock_now;
 1633|  19.7M|      timelimit_exceeded = false;
 1634|  19.7M|  }
 1635|    119|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  106|    119|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1635:12): [True: 0, False: 119]
  ------------------
 1636|      0|      timelimit_exceeded = true;
 1637|       |
 1638|  19.7M|  setcminmax(&cmin, &cmax, word.c_str(), len);
 1639|       |
 1640|  19.7M|  st.assign(word);
 1641|       |
 1642|   504M|  for (size_t i = cmin; i < cmax; ++i) {
  ------------------
  |  Branch (1642:25): [True: 485M, False: 18.8M]
  ------------------
 1643|       |    // go to end of the UTF-8 character
 1644|   485M|    if (utf8) {
  ------------------
  |  Branch (1644:9): [True: 36.7M, False: 448M]
  ------------------
 1645|  46.1M|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (1645:14): [True: 9.36M, False: 36.7M]
  ------------------
 1646|  9.36M|        ;
 1647|  36.7M|      if (i >= cmax)
  ------------------
  |  Branch (1647:11): [True: 203k, False: 36.5M]
  ------------------
 1648|   203k|        return nullptr;
 1649|  36.7M|    }
 1650|       |
 1651|   485M|    words = oldwords;
 1652|   485M|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (1652:23): [True: 0, False: 485M]
  ------------------
 1653|       |
 1654|   485M|    do {  // onlycpdrule loop
 1655|       |
 1656|   485M|      oldnumsyllable = numsyllable;
 1657|   485M|      oldwordnum = wordnum;
 1658|   485M|      checked_prefix = 0;
 1659|       |
 1660|   485M|      do {  // simplified checkcompoundpattern loop
 1661|       |
 1662|   485M|        if (timelimit_exceeded ||
  ------------------
  |  Branch (1662:13): [True: 0, False: 485M]
  |  Branch (1662:13): [True: 0, False: 485M]
  ------------------
 1663|   485M|            std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  106|   485M|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1663:13): [True: 0, False: 485M]
  ------------------
 1664|      0|          timelimit_exceeded = true;
 1665|      0|          return nullptr;
 1666|      0|        }
 1667|       |
 1668|   485M|        if (scpd > 0) {
  ------------------
  |  Branch (1668:13): [True: 0, False: 485M]
  ------------------
 1669|      0|          for (; scpd <= checkcpdtable.size() &&
  ------------------
  |  Branch (1669:18): [True: 0, False: 0]
  ------------------
 1670|      0|                 (checkcpdtable[scpd - 1].pattern3.empty() ||
  ------------------
  |  Branch (1670:19): [True: 0, False: 0]
  ------------------
 1671|      0|                  i > word.size() ||
  ------------------
  |  Branch (1671:19): [True: 0, False: 0]
  ------------------
 1672|      0|                  word.compare(i, checkcpdtable[scpd - 1].pattern3.size(), checkcpdtable[scpd - 1].pattern3) != 0);
  ------------------
  |  Branch (1672:19): [True: 0, False: 0]
  ------------------
 1673|      0|               scpd++)
 1674|      0|            ;
 1675|       |
 1676|      0|          if (scpd > checkcpdtable.size())
  ------------------
  |  Branch (1676:15): [True: 0, False: 0]
  ------------------
 1677|      0|            break;  // break simplified checkcompoundpattern loop
 1678|      0|          st.replace(i, std::string::npos, checkcpdtable[scpd - 1].pattern);
 1679|      0|          soldi = i;
 1680|      0|          i += checkcpdtable[scpd - 1].pattern.size();
 1681|      0|          st.replace(i, std::string::npos, checkcpdtable[scpd - 1].pattern2);
 1682|      0|          st.replace(i + checkcpdtable[scpd - 1].pattern2.size(), std::string::npos,
 1683|      0|                 word.substr(soldi + checkcpdtable[scpd - 1].pattern3.size()));
 1684|       |
 1685|      0|          oldlen = len;
 1686|      0|          len += checkcpdtable[scpd - 1].pattern.size() +
 1687|      0|                 checkcpdtable[scpd - 1].pattern2.size() -
 1688|      0|                 checkcpdtable[scpd - 1].pattern3.size();
 1689|      0|          oldcmin = cmin;
 1690|      0|          oldcmax = cmax;
 1691|      0|          setcminmax(&cmin, &cmax, st.c_str(), len);
 1692|       |
 1693|      0|          cmax = len - cpdmin + 1;
 1694|      0|        }
 1695|       |
 1696|   485M|        if (i >= st.size())
  ------------------
  |  Branch (1696:13): [True: 717k, False: 484M]
  ------------------
 1697|   717k|          return nullptr;
 1698|       |
 1699|   484M|        ch = st[i];
 1700|   484M|        st[i] = '\0';
 1701|       |
 1702|   484M|        sfx = nullptr;
 1703|   484M|        pfx = nullptr;
 1704|       |
 1705|       |        // FIRST WORD
 1706|       |
 1707|   484M|        affixed = 1;
 1708|   484M|        rv = lookup(st.c_str(), i);  // perhaps without prefix
 1709|       |
 1710|       |        // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 1711|       |        // compound words, overriding the effect of COMPOUNDPERMITFLAG
 1712|   484M|        if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (1712:13): [True: 964k, False: 483M]
  |  Branch (1712:21): [True: 28.1k, False: 936k]
  ------------------
 1713|  28.1k|                TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule) {
  ------------------
  |  |   99|   484M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 28.1k]
  |  |  ------------------
  ------------------
  |  Branch (1713:68): [True: 0, False: 0]
  ------------------
 1714|      0|            bool would_continue = !onlycpdrule && simplifiedcpd;
  ------------------
  |  Branch (1714:35): [True: 0, False: 0]
  |  Branch (1714:51): [True: 0, False: 0]
  ------------------
 1715|      0|            if (!scpd && would_continue) {
  ------------------
  |  Branch (1715:17): [True: 0, False: 0]
  |  Branch (1715:26): [True: 0, False: 0]
  ------------------
 1716|       |                // given the while conditions that continue jumps to, this situation
 1717|       |                // never ends
 1718|      0|                HUNSPELL_WARNING(stderr, "break infinite loop\n");
 1719|      0|                break;
 1720|      0|            }
 1721|       |
 1722|      0|            if (scpd > 0 && would_continue) {
  ------------------
  |  Branch (1722:17): [True: 0, False: 0]
  |  Branch (1722:29): [True: 0, False: 0]
  ------------------
 1723|       |                // under these conditions we loop again, but the assumption above
 1724|       |                // appears to be that cmin and cmax are the original values they
 1725|       |                // had in the outside loop
 1726|      0|                cmin = oldcmin;
 1727|      0|                cmax = oldcmax;
 1728|      0|            }
 1729|      0|            continue;
 1730|      0|        }
 1731|       |
 1732|       |        // search homonym with compound flag
 1733|   485M|        while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1733:16): [True: 964k, False: 484M]
  |  Branch (1733:24): [True: 964k, False: 90]
  ------------------
 1734|   964k|               ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |   99|   312k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 312k]
  |  |  ------------------
  ------------------
  |  Branch (1734:18): [True: 312k, False: 652k]
  ------------------
 1735|   964k|                !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (1735:20): [True: 964k, False: 0]
  |  Branch (1735:36): [True: 964k, False: 0]
  |  Branch (1735:46): [True: 964k, False: 0]
  ------------------
 1736|   964k|                   TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|   964k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 194, False: 964k]
  |  |  ------------------
  ------------------
 1737|   964k|                  (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (1737:20): [True: 0, False: 964k]
  |  Branch (1737:37): [True: 0, False: 0]
  |  Branch (1737:49): [True: 0, False: 0]
  ------------------
 1738|      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]
  |  |  ------------------
  ------------------
 1739|   964k|                  (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (1739:20): [True: 0, False: 964k]
  |  Branch (1739:38): [True: 0, False: 0]
  |  Branch (1739:49): [True: 0, False: 0]
  |  Branch (1739:59): [True: 0, False: 0]
  ------------------
 1740|      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]
  |  |  ------------------
  ------------------
 1741|   964k|                  (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (1741:20): [True: 0, False: 964k]
  |  Branch (1741:44): [True: 0, False: 0]
  ------------------
 1742|      0|                   ((!words && !wordnum &&
  ------------------
  |  Branch (1742:22): [True: 0, False: 0]
  |  Branch (1742:32): [True: 0, False: 0]
  ------------------
 1743|      0|                     defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (1743:22): [True: 0, False: 0]
  ------------------
 1744|      0|                    (words &&
  ------------------
  |  Branch (1744:22): [True: 0, False: 0]
  ------------------
 1745|      0|                     defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))) ||
  ------------------
  |  Branch (1745:22): [True: 0, False: 0]
  ------------------
 1746|    194|                (scpd != 0 && checkcpdtable[scpd - 1].cond != FLAG_NULL &&
  ------------------
  |  |   96|    194|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1746:18): [True: 0, False: 194]
  |  Branch (1746:31): [True: 0, False: 0]
  ------------------
 1747|   964k|                 !TESTAFF(rv->astr, checkcpdtable[scpd - 1].cond, rv->alen)))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1747:18): [True: 0, False: 0]
  ------------------
 1748|   964k|          rv = rv->next_homonym;
 1749|   964k|        }
 1750|       |
 1751|   484M|        if (rv)
  ------------------
  |  Branch (1751:13): [True: 284, False: 484M]
  ------------------
 1752|    284|          affixed = 0;
 1753|       |
 1754|   484M|        if (!rv) {
  ------------------
  |  Branch (1754:13): [True: 484M, False: 284]
  ------------------
 1755|   484M|          if (onlycpdrule)
  ------------------
  |  Branch (1755:15): [True: 0, False: 484M]
  ------------------
 1756|      0|            break;
 1757|   484M|          if (compoundflag &&
  ------------------
  |  Branch (1757:15): [True: 484M, False: 0]
  ------------------
 1758|   484M|              !(rv = prefix_check(st, 0, i,
  ------------------
  |  Branch (1758:15): [True: 484M, False: 0]
  ------------------
 1759|   484M|                                  hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   75|   114k|#define IN_CPD_OTHER 3
  ------------------
                                                hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   73|   968M|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1759:35): [True: 114k, False: 484M]
  ------------------
 1760|   484M|                                  scratch, compoundflag))) {
 1761|   484M|            if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   96|   484M|#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|   114k|#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|   968M|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1761:18): [True: 0, False: 484M]
  |  Branch (1761:93): [True: 114k, False: 484M]
  ------------------
 1762|   484M|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (1762:19): [True: 0, False: 484M]
  |  Branch (1762:43): [True: 0, False: 0]
  ------------------
 1763|      0|                !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (1763:17): [True: 0, False: 0]
  |  Branch (1763:33): [True: 0, False: 0]
  ------------------
 1764|      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 (1764:19): [True: 0, False: 0]
  ------------------
 1765|      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 (1765:19): [True: 0, False: 0]
  ------------------
 1766|      0|              rv = nullptr;
 1767|      0|            }
 1768|   484M|          }
 1769|       |
 1770|   484M|          if (rv ||
  ------------------
  |  Branch (1770:15): [True: 0, False: 484M]
  ------------------
 1771|   484M|              (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (1771:17): [True: 484M, False: 115k]
  |  Branch (1771:35): [True: 0, False: 484M]
  ------------------
 1772|      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 (1772:18): [True: 0, False: 0]
  |  Branch (1772:94): [True: 0, False: 0]
  ------------------
 1773|      0|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (1773:19): [True: 0, False: 0]
  |  Branch (1773:43): [True: 0, False: 0]
  ------------------
 1774|      0|                                                                    compoundbegin))) ||  // twofold suffixes + compound
 1775|      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 (1775:18): [True: 0, False: 0]
  |  Branch (1775:47): [True: 0, False: 0]
  ------------------
 1776|   484M|               ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (1776:17): [True: 503, False: 484M]
  |  Branch (1776:34): [True: 0, False: 503]
  ------------------
 1777|      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 (1777:18): [True: 0, False: 0]
  |  Branch (1777:95): [True: 0, False: 0]
  ------------------
 1778|      0|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (1778:19): [True: 0, False: 0]
  |  Branch (1778:43): [True: 0, False: 0]
  ------------------
 1779|      0|                                                                    compoundmiddle))) ||  // twofold suffixes + compound
 1780|      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 (1780:18): [True: 0, False: 0]
  |  Branch (1780:47): [True: 0, False: 0]
  ------------------
 1781|      0|            checked_prefix = 1;
 1782|       |          // else check forbiddenwords and needaffix
 1783|   484M|        } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|    440|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 220]
  |  |  ------------------
  ------------------
  |  Branch (1783:20): [True: 220, False: 64]
  |  Branch (1783:20): [True: 1, False: 283]
  ------------------
 1784|    220|                                TESTAFF(rv->astr, needaffix, rv->alen) ||
  ------------------
  |  |   99|    440|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 220]
  |  |  ------------------
  ------------------
 1785|    220|                                TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|    440|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 1, False: 219]
  |  |  ------------------
  ------------------
 1786|    219|                                (is_sug && nosuggest &&
  ------------------
  |  Branch (1786:34): [True: 0, False: 219]
  |  Branch (1786:44): [True: 0, False: 0]
  ------------------
 1787|      1|                                 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]
  |  |  ------------------
  ------------------
 1788|      1|          st[i] = ch;
 1789|       |          // continue;
 1790|      1|          break;
 1791|      1|        }
 1792|       |
 1793|       |        // check non_compound flag in suffix and prefix
 1794|   484M|        if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1794:13): [True: 283, False: 484M]
  |  Branch (1794:21): [True: 194, False: 89]
  ------------------
 1795|    194|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1795:15): [True: 0, False: 194]
  |  Branch (1795:22): [True: 0, False: 0]
  ------------------
 1796|      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]
  |  |  ------------------
  ------------------
 1797|    194|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1797:15): [True: 0, False: 194]
  |  Branch (1797:22): [True: 0, False: 0]
  ------------------
 1798|      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]
  |  |  ------------------
  ------------------
 1799|    194|                      sfx->getContLen())))) {
 1800|      0|          rv = nullptr;
 1801|      0|        }
 1802|       |
 1803|       |        // check compoundend flag in suffix and prefix
 1804|   484M|        if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (1804:13): [True: 283, False: 484M]
  |  Branch (1804:21): [True: 283, False: 0]
  |  Branch (1804:40): [True: 0, False: 283]
  |  Branch (1804:55): [True: 0, False: 0]
  ------------------
 1805|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1805:15): [True: 0, False: 0]
  |  Branch (1805:22): [True: 0, False: 0]
  ------------------
 1806|      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]
  |  |  ------------------
  ------------------
 1807|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1807:15): [True: 0, False: 0]
  |  Branch (1807:22): [True: 0, False: 0]
  ------------------
 1808|      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]
  |  |  ------------------
  ------------------
 1809|      0|          rv = nullptr;
 1810|      0|        }
 1811|       |
 1812|       |        // check compoundmiddle flag in suffix and prefix
 1813|   484M|        if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (1813:13): [True: 283, False: 484M]
  |  Branch (1813:21): [True: 283, False: 0]
  |  Branch (1813:40): [True: 194, False: 89]
  |  Branch (1813:58): [True: 0, False: 194]
  ------------------
 1814|      0|            !hu_mov_rule &&
  ------------------
  |  Branch (1814:13): [True: 0, False: 0]
  ------------------
 1815|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1815:15): [True: 0, False: 0]
  |  Branch (1815:22): [True: 0, False: 0]
  ------------------
 1816|      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]
  |  |  ------------------
  ------------------
 1817|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1817:15): [True: 0, False: 0]
  |  Branch (1817:22): [True: 0, False: 0]
  ------------------
 1818|      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]
  |  |  ------------------
  ------------------
 1819|      0|          rv = nullptr;
 1820|      0|        }
 1821|       |
 1822|       |        // check forbiddenwords
 1823|   484M|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1823:13): [True: 283, False: 484M]
  |  Branch (1823:13): [True: 0, False: 484M]
  |  Branch (1823:21): [True: 219, False: 64]
  ------------------
 1824|    219|            (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|    438|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 219]
  |  |  ------------------
  ------------------
 1825|    219|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|    438|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 219]
  |  |  ------------------
  ------------------
 1826|    219|             (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 (1826:15): [True: 0, False: 219]
  |  Branch (1826:25): [True: 0, False: 0]
  ------------------
 1827|      0|          return nullptr;
 1828|      0|        }
 1829|       |
 1830|       |        // increment word number, if the second root has a compoundroot flag
 1831|   484M|        if ((rv) && compoundroot &&
  ------------------
  |  Branch (1831:13): [True: 283, False: 484M]
  |  Branch (1831:21): [True: 0, False: 283]
  ------------------
 1832|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1832:13): [True: 0, False: 0]
  ------------------
 1833|      0|          wordnum++;
 1834|      0|        }
 1835|       |
 1836|       |        // first word is acceptable in compound words?
 1837|   484M|        if (((rv) &&
  ------------------
  |  Branch (1837:13): [True: 216, False: 484M]
  |  Branch (1837:14): [True: 283, False: 484M]
  ------------------
 1838|    283|             (checked_prefix || (words && words[wnum]) ||
  ------------------
  |  Branch (1838:15): [True: 0, False: 283]
  |  Branch (1838:34): [True: 0, False: 283]
  |  Branch (1838:43): [True: 0, False: 0]
  ------------------
 1839|    283|              (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|    283|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 216, False: 67]
  |  |  ------------------
  ------------------
  |  Branch (1839:16): [True: 283, False: 0]
  ------------------
 1840|     67|              ((oldwordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (1840:16): [True: 0, False: 67]
  |  Branch (1840:37): [True: 0, False: 0]
  ------------------
 1841|      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]
  |  |  ------------------
  ------------------
 1842|     67|              ((oldwordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (1842:16): [True: 0, False: 67]
  |  Branch (1842:36): [True: 0, False: 0]
  ------------------
 1843|      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]
  |  |  ------------------
  ------------------
 1844|       |
 1845|       |              // LANG_hu section: spec. Hungarian rule
 1846|     67|              || ((langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (1846:19): [True: 67, False: 0]
  |  Branch (1846:43): [True: 67, False: 0]
  ------------------
 1847|     67|                  (TESTAFF(
  ------------------
  |  |   99|    134|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 67]
  |  |  ------------------
  ------------------
 1848|     67|                       rv->astr, 'F',
 1849|     67|                       rv->alen) ||  // XXX hardwired Hungarian dictionary codes
 1850|     67|                   TESTAFF(rv->astr, 'G', rv->alen) ||
  ------------------
  |  |   99|    134|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 67]
  |  |  ------------------
  ------------------
 1851|     67|                   TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |   99|     67|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 67]
  |  |  ------------------
  ------------------
 1852|       |              // END of LANG_hu section
 1853|    283|              ) &&
 1854|    216|             (
 1855|       |                 // test CHECKCOMPOUNDPATTERN conditions
 1856|    216|                 scpd == 0 || checkcpdtable[scpd - 1].cond == FLAG_NULL ||
  ------------------
  |  |   96|    216|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1856:18): [True: 216, False: 0]
  |  Branch (1856:31): [True: 0, False: 0]
  ------------------
 1857|      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]
  |  |  ------------------
  ------------------
 1858|    216|             !((checkcompoundtriple && scpd == 0 &&
  ------------------
  |  Branch (1858:17): [True: 0, False: 216]
  |  Branch (1858:40): [True: 0, False: 0]
  ------------------
 1859|      0|                !words && i < word.size() && // test triple letters
  ------------------
  |  Branch (1859:17): [True: 0, False: 0]
  |  Branch (1859:27): [True: 0, False: 0]
  ------------------
 1860|      0|                (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (1860:17): [True: 0, False: 0]
  ------------------
 1861|      0|                (((i > 1) && (word[i - 1] == word[i - 2])) ||
  ------------------
  |  Branch (1861:19): [True: 0, False: 0]
  |  Branch (1861:30): [True: 0, False: 0]
  ------------------
 1862|      0|                 ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (1862:18): [True: 0, False: 0]
  ------------------
 1863|      0|                 )) ||
 1864|    216|               (checkcompoundcase && scpd == 0 && !words && i < word.size() &&
  ------------------
  |  Branch (1864:17): [True: 0, False: 216]
  |  Branch (1864:38): [True: 0, False: 0]
  |  Branch (1864:51): [True: 0, False: 0]
  |  Branch (1864:61): [True: 0, False: 0]
  ------------------
 1865|      0|                cpdcase_check(word, i))))
  ------------------
  |  Branch (1865:17): [True: 0, False: 0]
  ------------------
 1866|       |            // LANG_hu section: spec. Hungarian rule
 1867|   484M|            || ((!rv) && (langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (1867:17): [True: 484M, False: 67]
  |  Branch (1867:26): [True: 36.5M, False: 447M]
  |  Branch (1867:50): [True: 114k, False: 36.4M]
  ------------------
 1868|   114k|                (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (1868:17): [True: 0, False: 114k]
  ------------------
 1869|      0|                (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1869:18): [True: 0, False: 0]
  |  Branch (1869:25): [True: 0, False: 0]
  ------------------
 1870|      0|                 (  // XXX hardwired Hungarian dic. codes
 1871|      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]
  |  |  ------------------
  ------------------
 1872|      0|                             sfx->getContLen()) ||
 1873|      0|                     TESTAFF(
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1874|      0|                         sfx->getCont(), (unsigned short)'%',
 1875|    216|                         sfx->getContLen()))))) {  // first word is ok condition
 1876|       |
 1877|       |          // LANG_hu section: spec. Hungarian rule
 1878|    216|          if (langnum == LANG_hu) {
  ------------------
  |  Branch (1878:15): [True: 188, False: 28]
  ------------------
 1879|       |            // calculate syllable number of the word
 1880|    188|            numsyllable += get_syllable(st.substr(0, i));
 1881|       |            // + 1 word, if syllable number of the prefix > 1 (hungarian
 1882|       |            // convention)
 1883|    188|            if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (1883:17): [True: 0, False: 188]
  |  Branch (1883:17): [True: 0, False: 188]
  |  Branch (1883:24): [True: 0, False: 0]
  ------------------
 1884|      0|              wordnum++;
 1885|    188|          }
 1886|       |          // END of LANG_hu section
 1887|       |
 1888|       |          // NEXT WORD(S)
 1889|    216|          rv_first = rv;
 1890|    216|          st[i] = ch;
 1891|       |
 1892|    216|          do {  // striple loop
 1893|       |
 1894|       |            // check simplifiedtriple
 1895|    216|            if (simplifiedtriple) {
  ------------------
  |  Branch (1895:17): [True: 0, False: 216]
  ------------------
 1896|      0|              if (striple) {
  ------------------
  |  Branch (1896:19): [True: 0, False: 0]
  ------------------
 1897|      0|                checkedstriple = 1;
 1898|      0|                i--;  // check "fahrt" instead of "ahrt" in "Schiffahrt"
 1899|      0|              } else if (i > 2 && i <= word.size() && word[i - 1] == word[i - 2])
  ------------------
  |  Branch (1899:26): [True: 0, False: 0]
  |  Branch (1899:35): [True: 0, False: 0]
  |  Branch (1899:55): [True: 0, False: 0]
  ------------------
 1900|      0|                striple = 1;
 1901|      0|            }
 1902|       |
 1903|    216|            rv = lookup(st.c_str() + i, st.size() - i);  // perhaps without prefix
 1904|       |
 1905|       |            // search homonym with compound flag
 1906|    216|            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 (1906:20): [True: 0, False: 216]
  |  Branch (1906:30): [True: 0, False: 0]
  ------------------
 1907|      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 (1907:32): [True: 0, False: 0]
  |  Branch (1907:48): [True: 0, False: 0]
  ------------------
 1908|      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 (1908:32): [True: 0, False: 0]
  |  Branch (1908:47): [True: 0, False: 0]
  ------------------
 1909|      0|                              (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))) ||
  ------------------
  |  Branch (1909:32): [True: 0, False: 0]
  |  Branch (1909:56): [True: 0, False: 0]
  |  Branch (1909:65): [True: 0, False: 0]
  ------------------
 1910|      0|                            (scpd != 0 && checkcpdtable[scpd - 1].cond2 != FLAG_NULL &&
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1910:30): [True: 0, False: 0]
  |  Branch (1910:43): [True: 0, False: 0]
  ------------------
 1911|      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 (1911:30): [True: 0, False: 0]
  ------------------
 1912|      0|              rv = rv->next_homonym;
 1913|      0|            }
 1914|       |
 1915|       |            // check FORCEUCASE
 1916|    216|            if (rv && forceucase &&
  ------------------
  |  Branch (1916:17): [True: 0, False: 216]
  |  Branch (1916:23): [True: 0, False: 0]
  ------------------
 1917|      0|                (TESTAFF(rv->astr, forceucase, rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1917:17): [True: 0, False: 0]
  ------------------
 1918|      0|                !(info && *info & SPELL_ORIGCAP))
  ------------------
  |  |   83|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  |  Branch (1918:19): [True: 0, False: 0]
  |  Branch (1918:27): [True: 0, False: 0]
  ------------------
 1919|      0|              rv = nullptr;
 1920|       |
 1921|    216|            if (rv && words && words[wnum + 1])
  ------------------
  |  Branch (1921:17): [True: 0, False: 216]
  |  Branch (1921:23): [True: 0, False: 0]
  |  Branch (1921:32): [True: 0, False: 0]
  ------------------
 1922|      0|              return rv_first;
 1923|       |
 1924|    216|            oldnumsyllable2 = numsyllable;
 1925|    216|            oldwordnum2 = wordnum;
 1926|       |
 1927|       |            // LANG_hu section: spec. Hungarian rule, XXX hardwired dictionary
 1928|       |            // code
 1929|    216|            if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (1929:17): [True: 0, False: 216]
  |  Branch (1929:17): [True: 0, False: 216]
  |  Branch (1929:25): [True: 0, False: 0]
  ------------------
 1930|      0|                (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1930:17): [True: 0, False: 0]
  ------------------
 1931|      0|                !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1931:17): [True: 0, False: 0]
  ------------------
 1932|      0|              numsyllable--;
 1933|      0|            }
 1934|       |            // END of LANG_hu section
 1935|       |
 1936|       |            // increment word number, if the second root has a compoundroot flag
 1937|    216|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (1937:17): [True: 0, False: 216]
  |  Branch (1937:25): [True: 0, False: 0]
  ------------------
 1938|      0|                (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1938:17): [True: 0, False: 0]
  ------------------
 1939|      0|              wordnum++;
 1940|      0|            }
 1941|       |
 1942|       |            // check forbiddenwords
 1943|    216|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1943:17): [True: 0, False: 216]
  |  Branch (1943:17): [True: 0, False: 216]
  |  Branch (1943:25): [True: 0, False: 0]
  ------------------
 1944|      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]
  |  |  ------------------
  ------------------
 1945|      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]
  |  |  ------------------
  ------------------
 1946|      0|                 (is_sug && nosuggest &&
  ------------------
  |  Branch (1946:19): [True: 0, False: 0]
  |  Branch (1946:29): [True: 0, False: 0]
  ------------------
 1947|      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]
  |  |  ------------------
  ------------------
 1948|      0|              return nullptr;
 1949|       |
 1950|       |            // second word is acceptable, as a root?
 1951|       |            // hungarian conventions: compounding is acceptable,
 1952|       |            // when compound forms consist of 2 words, or if more,
 1953|       |            // then the syllable number of root words must be 6, or lesser.
 1954|       |
 1955|    216|            if ((rv) &&
  ------------------
  |  Branch (1955:17): [True: 0, False: 216]
  |  Branch (1955:17): [True: 0, False: 216]
  ------------------
 1956|      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 (1956:19): [True: 0, False: 0]
  ------------------
 1957|      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 (1957:19): [True: 0, False: 0]
  ------------------
 1958|      0|                (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (1958:19): [True: 0, False: 0]
  |  Branch (1958:41): [True: 0, False: 0]
  ------------------
 1959|      0|                 ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (1959:19): [True: 0, False: 0]
  ------------------
 1960|      0|                  (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (1960:19): [True: 0, False: 0]
  ------------------
 1961|      0|                   cpdmaxsyllable))) &&
 1962|      0|                (
 1963|       |                    // test CHECKCOMPOUNDPATTERN
 1964|      0|                    checkcpdtable.empty() || scpd != 0 ||
  ------------------
  |  Branch (1964:21): [True: 0, False: 0]
  |  Branch (1964:46): [True: 0, False: 0]
  ------------------
 1965|      0|                    (i < word.size() && !cpdpat_check(word, i, rv_first, rv, 0))) &&
  ------------------
  |  Branch (1965:22): [True: 0, False: 0]
  |  Branch (1965:41): [True: 0, False: 0]
  ------------------
 1966|      0|                ((!checkcompounddup || (rv != rv_first)))
  ------------------
  |  Branch (1966:19): [True: 0, False: 0]
  |  Branch (1966:40): [True: 0, False: 0]
  ------------------
 1967|       |                // test CHECKCOMPOUNDPATTERN conditions
 1968|      0|                &&
 1969|      0|                (scpd == 0 || checkcpdtable[scpd - 1].cond2 == FLAG_NULL ||
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1969:18): [True: 0, False: 0]
  |  Branch (1969:31): [True: 0, False: 0]
  ------------------
 1970|      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]
  |  |  ------------------
  ------------------
 1971|       |              // forbid compound word, if it is a non-compound word with typical
 1972|       |              // fault
 1973|      0|              if ((checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (1973:20): [True: 0, False: 0]
  |  Branch (1973:40): [True: 0, False: 0]
  ------------------
 1974|      0|                  cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (1974:19): [True: 0, False: 0]
  ------------------
 1975|      0|                return nullptr;
 1976|      0|              return rv_first;
 1977|      0|            }
 1978|       |
 1979|    216|            numsyllable = oldnumsyllable2;
 1980|    216|            wordnum = oldwordnum2;
 1981|       |
 1982|       |            // perhaps second word has prefix or/and suffix
 1983|    216|            sfx = nullptr;
 1984|    216|            sfxflag = FLAG_NULL;
  ------------------
  |  |   96|    216|#define FLAG_NULL 0x00
  ------------------
 1985|    216|            rv = (compoundflag && !onlycpdrule && i < word.size()) ? affix_check(word, i, word.size() - i, scratch, compoundflag, IN_CPD_END)
  ------------------
  |  |   74|    216|#define IN_CPD_END 2
  ------------------
  |  Branch (1985:19): [True: 216, False: 0]
  |  Branch (1985:35): [True: 216, False: 0]
  |  Branch (1985:51): [True: 216, False: 0]
  ------------------
 1986|    216|                                                                   : nullptr;
 1987|    216|            if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (1987:17): [True: 216, False: 0]
  |  Branch (1987:24): [True: 0, False: 216]
  |  Branch (1987:39): [True: 0, False: 0]
  ------------------
 1988|      0|              sfx = nullptr;
 1989|      0|              pfx = nullptr;
 1990|      0|              if (i < word.size())
  ------------------
  |  Branch (1990:19): [True: 0, False: 0]
  ------------------
 1991|      0|                rv = affix_check(word, i, word.size() - i, scratch, compoundend, IN_CPD_END);
  ------------------
  |  |   74|      0|#define IN_CPD_END 2
  ------------------
 1992|      0|            }
 1993|       |
 1994|    216|            if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (1994:17): [True: 216, False: 0]
  |  Branch (1994:24): [True: 0, False: 216]
  |  Branch (1994:48): [True: 0, False: 0]
  ------------------
 1995|      0|              if (i < word.size())
  ------------------
  |  Branch (1995:19): [True: 0, False: 0]
  ------------------
 1996|      0|                rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   74|      0|#define IN_CPD_END 2
  ------------------
 1997|      0|              if (rv && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))
  ------------------
  |  Branch (1997:19): [True: 0, False: 0]
  |  Branch (1997:25): [True: 0, False: 0]
  ------------------
 1998|      0|                return rv_first;
 1999|      0|              rv = nullptr;
 2000|      0|            }
 2001|       |
 2002|       |            // test CHECKCOMPOUNDPATTERN conditions (allowed forms)
 2003|    216|            if (rv &&
  ------------------
  |  Branch (2003:17): [True: 0, False: 216]
  ------------------
 2004|      0|                !(scpd == 0 || checkcpdtable[scpd - 1].cond2 == FLAG_NULL ||
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2004:19): [True: 0, False: 0]
  |  Branch (2004:32): [True: 0, False: 0]
  ------------------
 2005|      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]
  |  |  ------------------
  ------------------
 2006|      0|              rv = nullptr;
 2007|       |
 2008|       |            // test CHECKCOMPOUNDPATTERN conditions (forbidden compounds)
 2009|    216|            if (rv && !checkcpdtable.empty() && scpd == 0 &&
  ------------------
  |  Branch (2009:17): [True: 0, False: 216]
  |  Branch (2009:23): [True: 0, False: 0]
  |  Branch (2009:49): [True: 0, False: 0]
  ------------------
 2010|      0|                cpdpat_check(word, i, rv_first, rv, affixed))
  ------------------
  |  Branch (2010:17): [True: 0, False: 0]
  ------------------
 2011|      0|              rv = nullptr;
 2012|       |
 2013|       |            // check non_compound flag in suffix and prefix
 2014|    216|            if ((rv) && ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2014:17): [True: 0, False: 216]
  |  Branch (2014:27): [True: 0, False: 0]
  |  Branch (2014:34): [True: 0, False: 0]
  ------------------
 2015|      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]
  |  |  ------------------
  ------------------
 2016|      0|                                  pfx->getContLen())) ||
 2017|      0|                         (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2017:27): [True: 0, False: 0]
  |  Branch (2017:34): [True: 0, False: 0]
  ------------------
 2018|      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]
  |  |  ------------------
  ------------------
 2019|      0|                                  sfx->getContLen())))) {
 2020|      0|              rv = nullptr;
 2021|      0|            }
 2022|       |
 2023|       |            // check FORCEUCASE
 2024|    216|            if (rv && forceucase &&
  ------------------
  |  Branch (2024:17): [True: 0, False: 216]
  |  Branch (2024:23): [True: 0, False: 0]
  ------------------
 2025|      0|                (TESTAFF(rv->astr, forceucase, rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2025:17): [True: 0, False: 0]
  ------------------
 2026|      0|                !(info && *info & SPELL_ORIGCAP))
  ------------------
  |  |   83|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  |  Branch (2026:19): [True: 0, False: 0]
  |  Branch (2026:27): [True: 0, False: 0]
  ------------------
 2027|      0|              rv = nullptr;
 2028|       |
 2029|       |            // check forbiddenwords
 2030|    216|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2030:17): [True: 0, False: 216]
  |  Branch (2030:17): [True: 0, False: 216]
  |  Branch (2030:25): [True: 0, False: 0]
  ------------------
 2031|      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]
  |  |  ------------------
  ------------------
 2032|      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]
  |  |  ------------------
  ------------------
 2033|      0|                 (is_sug && nosuggest &&
  ------------------
  |  Branch (2033:19): [True: 0, False: 0]
  |  Branch (2033:29): [True: 0, False: 0]
  ------------------
 2034|      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]
  |  |  ------------------
  ------------------
 2035|      0|              return nullptr;
 2036|       |
 2037|       |            // pfxappnd = prefix of word+i, or NULL
 2038|       |            // calculate syllable number of prefix.
 2039|       |            // hungarian convention: when syllable number of prefix is more,
 2040|       |            // than 1, the prefix+word counts as two words.
 2041|       |
 2042|    216|            if (langnum == LANG_hu) {
  ------------------
  |  Branch (2042:17): [True: 188, False: 28]
  ------------------
 2043|    188|              if (i < word.size()) {
  ------------------
  |  Branch (2043:19): [True: 188, False: 0]
  ------------------
 2044|       |                // calculate syllable number of the word
 2045|    188|                numsyllable += get_syllable(word.substr(i));
 2046|    188|              }
 2047|       |
 2048|       |              // - affix syllable num.
 2049|       |              // XXX only second suffix (inflections, not derivations)
 2050|    188|              if (sfxappnd) {
  ------------------
  |  Branch (2050:19): [True: 0, False: 188]
  ------------------
 2051|      0|                std::string tmp(sfxappnd);
 2052|      0|                reverseword(tmp);
 2053|      0|                numsyllable -= short(get_syllable(tmp) + sfxextra);
 2054|    188|              } else {
 2055|    188|                numsyllable -= short(sfxextra);
 2056|    188|              }
 2057|       |
 2058|       |              // + 1 word, if syllable number of the prefix > 1 (hungarian
 2059|       |              // convention)
 2060|    188|              if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2060:19): [True: 0, False: 188]
  |  Branch (2060:19): [True: 0, False: 188]
  |  Branch (2060:26): [True: 0, False: 0]
  ------------------
 2061|      0|                wordnum++;
 2062|       |
 2063|       |              // increment syllable num, if last word has a SYLLABLENUM flag
 2064|       |              // and the suffix is beginning `s'
 2065|       |
 2066|    188|              if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2066:19): [True: 0, False: 188]
  ------------------
 2067|      0|                switch (sfxflag) {
  ------------------
  |  Branch (2067:25): [True: 0, False: 0]
  ------------------
 2068|      0|                  case 'c': {
  ------------------
  |  Branch (2068:19): [True: 0, False: 0]
  ------------------
 2069|      0|                    numsyllable += 2;
 2070|      0|                    break;
 2071|      0|                  }
 2072|      0|                  case 'J': {
  ------------------
  |  Branch (2072:19): [True: 0, False: 0]
  ------------------
 2073|      0|                    numsyllable += 1;
 2074|      0|                    break;
 2075|      0|                  }
 2076|      0|                  case 'I': {
  ------------------
  |  Branch (2076:19): [True: 0, False: 0]
  ------------------
 2077|      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 (2077:25): [True: 0, False: 0]
  |  Branch (2077:25): [True: 0, False: 0]
  ------------------
 2078|      0|                      numsyllable += 1;
 2079|      0|                    break;
 2080|      0|                  }
 2081|      0|                }
 2082|      0|              }
 2083|    188|            }
 2084|       |
 2085|       |            // increment word number, if the second word has a compoundroot flag
 2086|    216|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2086:17): [True: 0, False: 216]
  |  Branch (2086:25): [True: 0, False: 0]
  ------------------
 2087|      0|                (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2087:17): [True: 0, False: 0]
  ------------------
 2088|      0|              wordnum++;
 2089|      0|            }
 2090|       |            // second word is acceptable, as a word with prefix or/and suffix?
 2091|       |            // hungarian conventions: compounding is acceptable,
 2092|       |            // when compound forms consist 2 word, otherwise
 2093|       |            // the syllable number of root words is 6, or lesser.
 2094|    216|            if ((rv) &&
  ------------------
  |  Branch (2094:17): [True: 0, False: 216]
  ------------------
 2095|      0|                (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2095:19): [True: 0, False: 0]
  |  Branch (2095:41): [True: 0, False: 0]
  ------------------
 2096|      0|                 ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2096:19): [True: 0, False: 0]
  |  Branch (2096:44): [True: 0, False: 0]
  ------------------
 2097|      0|                ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2097:19): [True: 0, False: 0]
  |  Branch (2097:40): [True: 0, False: 0]
  ------------------
 2098|       |              // forbid compound word, if it is a non-compound word with typical
 2099|       |              // fault
 2100|      0|              if ((checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2100:20): [True: 0, False: 0]
  |  Branch (2100:40): [True: 0, False: 0]
  ------------------
 2101|      0|                  cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2101:19): [True: 0, False: 0]
  ------------------
 2102|      0|                return nullptr;
 2103|      0|              return rv_first;
 2104|      0|            }
 2105|       |
 2106|    216|            numsyllable = oldnumsyllable2;
 2107|    216|            wordnum = oldwordnum2;
 2108|       |
 2109|       |            // perhaps second word is a compound word (recursive call)
 2110|       |            // (only if SPELL_COMPOUND_2 is not set and maxwordnum is not exceeded)
 2111|    216|            if ((!info || !(*info & SPELL_COMPOUND_2)) && wordnum + 2 < maxwordnum && wnum + 1 < maxwordnum) {
  ------------------
  |  |   85|    216|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (2111:18): [True: 0, False: 216]
  |  Branch (2111:27): [True: 119, False: 97]
  |  Branch (2111:59): [True: 119, False: 0]
  |  Branch (2111:87): [True: 119, False: 0]
  ------------------
 2112|    119|              rv = compound_check(st.substr(i), wordnum + 1,
 2113|    119|                                  numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2114|    119|                                  is_sug, info, scratch);
 2115|       |
 2116|    119|              if (rv && !checkcpdtable.empty() && i < word.size() &&
  ------------------
  |  Branch (2116:19): [True: 0, False: 119]
  |  Branch (2116:25): [True: 0, False: 0]
  |  Branch (2116:51): [True: 0, False: 0]
  ------------------
 2117|      0|                  ((scpd == 0 &&
  ------------------
  |  Branch (2117:21): [True: 0, False: 0]
  ------------------
 2118|      0|                    cpdpat_check(word, i, rv_first, rv, affixed)) ||
  ------------------
  |  Branch (2118:21): [True: 0, False: 0]
  ------------------
 2119|      0|                   (scpd != 0 &&
  ------------------
  |  Branch (2119:21): [True: 0, False: 0]
  ------------------
 2120|      0|                    !cpdpat_check(word, i, rv_first, rv, affixed))))
  ------------------
  |  Branch (2120:21): [True: 0, False: 0]
  ------------------
 2121|      0|                rv = nullptr;
 2122|    119|            } else {
 2123|     97|              rv = nullptr;
 2124|     97|            }
 2125|    216|            if (rv) {
  ------------------
  |  Branch (2125:17): [True: 0, False: 216]
  ------------------
 2126|       |              // forbid compound word, if it is a non-compound word with typical
 2127|       |              // fault, or a dictionary word pair
 2128|       |
 2129|      0|              if (cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2129:19): [True: 0, False: 0]
  ------------------
 2130|      0|                return nullptr;
 2131|       |
 2132|      0|              if (checkcompoundrep || forbiddenword) {
  ------------------
  |  Branch (2132:19): [True: 0, False: 0]
  |  Branch (2132:39): [True: 0, False: 0]
  ------------------
 2133|      0|                if (checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2133:21): [True: 0, False: 0]
  |  Branch (2133:41): [True: 0, False: 0]
  ------------------
 2134|      0|                  return nullptr;
 2135|       |
 2136|       |                // check first part
 2137|      0|                if (i < word.size() && word.compare(i, rv->blen, rv->word, rv->blen) == 0) {
  ------------------
  |  Branch (2137:21): [True: 0, False: 0]
  |  Branch (2137:40): [True: 0, False: 0]
  ------------------
 2138|      0|                  char r = st[i + rv->blen];
 2139|      0|                  st[i + rv->blen] = '\0';
 2140|       |
 2141|      0|                  if ((checkcompoundrep && cpdrep_check(st, i + rv->blen, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2141:24): [True: 0, False: 0]
  |  Branch (2141:44): [True: 0, False: 0]
  ------------------
 2142|      0|                      cpdwordpair_check(st, i + rv->blen, scratch, timelimit_exceeded, clock_time_start)) {
  ------------------
  |  Branch (2142:23): [True: 0, False: 0]
  ------------------
 2143|      0|                    st[ + i + rv->blen] = r;
 2144|      0|                    continue;
 2145|      0|                  }
 2146|       |
 2147|      0|                  if (forbiddenword) {
  ------------------
  |  Branch (2147:23): [True: 0, False: 0]
  ------------------
 2148|      0|                    struct hentry* rv2 = lookup(word.c_str(), word.size());
 2149|      0|                    if (!rv2 && len <= word.size())
  ------------------
  |  Branch (2149:25): [True: 0, False: 0]
  |  Branch (2149:33): [True: 0, False: 0]
  ------------------
 2150|      0|                      rv2 = affix_check(word, 0, len, scratch);
 2151|      0|                    if (rv2 && rv2->astr &&
  ------------------
  |  Branch (2151:25): [True: 0, False: 0]
  |  Branch (2151:32): [True: 0, False: 0]
  ------------------
 2152|      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]
  |  |  ------------------
  ------------------
 2153|      0|                        (strncmp(rv2->word, st.c_str(), i + rv->blen) == 0)) {
  ------------------
  |  Branch (2153:25): [True: 0, False: 0]
  ------------------
 2154|      0|                      return nullptr;
 2155|      0|                    }
 2156|      0|                  }
 2157|      0|                  st[i + rv->blen] = r;
 2158|      0|                }
 2159|      0|              }
 2160|      0|              return rv_first;
 2161|      0|            }
 2162|    216|          } while (striple && !checkedstriple);  // end of striple loop
  ------------------
  |  Branch (2162:20): [True: 0, False: 216]
  |  Branch (2162:31): [True: 0, False: 0]
  ------------------
 2163|       |
 2164|    216|          if (checkedstriple) {
  ------------------
  |  Branch (2164:15): [True: 0, False: 216]
  ------------------
 2165|      0|            i++;
 2166|      0|            checkedstriple = 0;
 2167|      0|            striple = 0;
 2168|      0|          }
 2169|       |
 2170|    216|        }  // first word is ok condition
 2171|       |
 2172|   484M|        if (soldi != 0) {
  ------------------
  |  Branch (2172:13): [True: 0, False: 484M]
  ------------------
 2173|      0|          i = soldi;
 2174|      0|          soldi = 0;
 2175|      0|          len = oldlen;
 2176|      0|          cmin = oldcmin;
 2177|      0|          cmax = oldcmax;
 2178|      0|        }
 2179|   484M|        scpd++;
 2180|       |
 2181|   484M|      } while (!onlycpdrule && simplifiedcpd &&
  ------------------
  |  Branch (2181:16): [True: 484M, False: 0]
  |  Branch (2181:32): [True: 0, False: 484M]
  ------------------
 2182|      0|               scpd <= checkcpdtable.size());  // end of simplifiedcpd loop
  ------------------
  |  Branch (2182:16): [True: 0, False: 0]
  ------------------
 2183|       |
 2184|   484M|      scpd = 0;
 2185|   484M|      wordnum = oldwordnum;
 2186|   484M|      numsyllable = oldnumsyllable;
 2187|       |
 2188|   484M|      if (soldi != 0) {
  ------------------
  |  Branch (2188:11): [True: 0, False: 484M]
  ------------------
 2189|      0|        i = soldi;
 2190|      0|        st.assign(word);  // XXX add more optim.
 2191|      0|        soldi = 0;
 2192|      0|        len = oldlen;
 2193|      0|        cmin = oldcmin;
 2194|      0|        cmax = oldcmax;
 2195|      0|      } else
 2196|   484M|        st[i] = ch;
 2197|       |
 2198|   484M|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2198:14): [True: 0, False: 484M]
  |  Branch (2198:38): [True: 0, False: 0]
  ------------------
 2199|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2199:14): [True: 0, False: 0]
  ------------------
 2200|   485M|  }
 2201|       |
 2202|  18.8M|  return nullptr;
 2203|  19.7M|}
_ZN8AffixMgr20compound_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEssssPP6hentrySB_cRS6_PS7_R12AffixScratch:
 2217|  2.06k|                                   AffixScratch& scratch) {
 2218|  2.06k|  short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2;
 2219|  2.06k|  hentry *rv = nullptr, *rv_first;
 2220|  2.06k|  std::string st, presult;
 2221|  2.06k|  char ch, affixed = 0;
 2222|  2.06k|  int checked_prefix, ok = 0;
 2223|  2.06k|  size_t cmin, cmax;
 2224|  2.06k|  hentry** oldwords = words;
 2225|  2.06k|  size_t len = word.size();
 2226|       |
 2227|       |  // protect subsequent words[wnum + 1] reads and any recursion
 2228|  2.06k|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (2228:7): [True: 0, False: 2.06k]
  ------------------
 2229|      0|    return 0;
 2230|       |
 2231|       |  // add a time limit to handle possible
 2232|       |  // combinatorical explosion of the overlapping words
 2233|       |
 2234|  2.06k|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  2.06k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2235|  2.06k|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  2.06k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2236|       |
 2237|       |  // get the current time
 2238|  2.06k|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 2239|       |
 2240|  2.06k|  if (wnum == 0) {
  ------------------
  |  Branch (2240:7): [True: 2.06k, False: 0]
  ------------------
 2241|       |      // set the start time
 2242|  2.06k|      clock_time_start = clock_now;
 2243|  2.06k|      timelimit_exceeded = false;
 2244|  2.06k|  }
 2245|      0|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  106|      0|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2245:12): [True: 0, False: 0]
  ------------------
 2246|      0|      timelimit_exceeded = true;
 2247|       |
 2248|  2.06k|  setcminmax(&cmin, &cmax, word.c_str(), len);
 2249|       |
 2250|  2.06k|  st.assign(word);
 2251|       |
 2252|  32.4k|  for (size_t i = cmin; i < cmax; ++i) {
  ------------------
  |  Branch (2252:25): [True: 30.5k, False: 1.83k]
  ------------------
 2253|       |    // go to end of the UTF-8 character
 2254|  30.5k|    if (utf8) {
  ------------------
  |  Branch (2254:9): [True: 9.76k, False: 20.8k]
  ------------------
 2255|  13.4k|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (2255:14): [True: 3.66k, False: 9.76k]
  ------------------
 2256|  3.66k|        ;
 2257|  9.76k|      if (i >= cmax)
  ------------------
  |  Branch (2257:11): [True: 97, False: 9.66k]
  ------------------
 2258|     97|        return 0;
 2259|  9.76k|    }
 2260|       |
 2261|  30.4k|    words = oldwords;
 2262|  30.4k|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (2262:23): [True: 0, False: 30.4k]
  ------------------
 2263|       |
 2264|  30.4k|    do {  // onlycpdrule loop
 2265|       |
 2266|  30.4k|      if (timelimit_exceeded ||
  ------------------
  |  Branch (2266:11): [True: 0, False: 30.4k]
  |  Branch (2266:11): [True: 0, False: 30.4k]
  ------------------
 2267|  30.4k|          std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  106|  30.4k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2267:11): [True: 0, False: 30.4k]
  ------------------
 2268|      0|        timelimit_exceeded = true;
 2269|      0|        return 0;
 2270|      0|      }
 2271|       |
 2272|  30.4k|      oldnumsyllable = numsyllable;
 2273|  30.4k|      oldwordnum = wordnum;
 2274|  30.4k|      checked_prefix = 0;
 2275|       |
 2276|  30.4k|      if (i >= st.size())
  ------------------
  |  Branch (2276:11): [True: 132, False: 30.3k]
  ------------------
 2277|    132|        return 0;
 2278|       |
 2279|  30.3k|      ch = st[i];
 2280|  30.3k|      st[i] = '\0';
 2281|  30.3k|      sfx = nullptr;
 2282|       |
 2283|       |      // FIRST WORD
 2284|       |
 2285|  30.3k|      affixed = 1;
 2286|       |
 2287|  30.3k|      presult.clear();
 2288|  30.3k|      if (partresult)
  ------------------
  |  Branch (2288:11): [True: 0, False: 30.3k]
  ------------------
 2289|      0|        presult.append(*partresult);
 2290|       |
 2291|  30.3k|      rv = lookup(st.c_str(), i);  // perhaps without prefix
 2292|       |
 2293|       |      // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 2294|       |      // compound words, overriding the effect of COMPOUNDPERMITFLAG
 2295|  30.3k|      if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (2295:11): [True: 133, False: 30.2k]
  |  Branch (2295:19): [True: 1, False: 132]
  ------------------
 2296|      1|              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: 1]
  |  |  ------------------
  ------------------
  |  Branch (2296:66): [True: 0, False: 0]
  ------------------
 2297|      0|          continue;
 2298|       |
 2299|       |      // search homonym with compound flag
 2300|  30.4k|      while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2300:14): [True: 133, False: 30.3k]
  |  Branch (2300:22): [True: 133, False: 0]
  ------------------
 2301|    133|             ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |   99|     44|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 44]
  |  |  ------------------
  ------------------
  |  Branch (2301:16): [True: 44, False: 89]
  ------------------
 2302|    133|              !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (2302:18): [True: 133, False: 0]
  |  Branch (2302:34): [True: 133, False: 0]
  |  Branch (2302:44): [True: 133, False: 0]
  ------------------
 2303|    133|                 TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|    133|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 133]
  |  |  ------------------
  ------------------
 2304|    133|                (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (2304:18): [True: 0, False: 133]
  |  Branch (2304:35): [True: 0, False: 0]
  |  Branch (2304:47): [True: 0, False: 0]
  ------------------
 2305|      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]
  |  |  ------------------
  ------------------
 2306|    133|                (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (2306:18): [True: 0, False: 133]
  |  Branch (2306:36): [True: 0, False: 0]
  |  Branch (2306:47): [True: 0, False: 0]
  |  Branch (2306:57): [True: 0, False: 0]
  ------------------
 2307|      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]
  |  |  ------------------
  ------------------
 2308|    133|                (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (2308:18): [True: 0, False: 133]
  |  Branch (2308:42): [True: 0, False: 0]
  ------------------
 2309|      0|                 ((!words && !wordnum &&
  ------------------
  |  Branch (2309:20): [True: 0, False: 0]
  |  Branch (2309:30): [True: 0, False: 0]
  ------------------
 2310|      0|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (2310:20): [True: 0, False: 0]
  ------------------
 2311|      0|                  (words &&
  ------------------
  |  Branch (2311:20): [True: 0, False: 0]
  ------------------
 2312|    133|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))))) {
  ------------------
  |  Branch (2312:20): [True: 0, False: 0]
  ------------------
 2313|    133|        rv = rv->next_homonym;
 2314|    133|      }
 2315|       |
 2316|       |
 2317|  30.3k|      if (rv)
  ------------------
  |  Branch (2317:11): [True: 0, False: 30.3k]
  ------------------
 2318|      0|        affixed = 0;
 2319|       |
 2320|  30.3k|      if (rv) {
  ------------------
  |  Branch (2320:11): [True: 0, False: 30.3k]
  ------------------
 2321|      0|        presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2322|      0|        presult.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2323|      0|        presult.append(st, 0, i);
 2324|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2324:13): [True: 0, False: 0]
  ------------------
 2325|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2326|      0|          presult.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2327|      0|          presult.append(st, 0, i);
 2328|      0|        }
 2329|      0|        if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2329:13): [True: 0, False: 0]
  ------------------
 2330|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2331|      0|          presult.append(HENTRY_DATA2(rv));
 2332|      0|        }
 2333|      0|      }
 2334|       |
 2335|  30.3k|      if (!rv) {
  ------------------
  |  Branch (2335:11): [True: 30.3k, False: 0]
  ------------------
 2336|  30.3k|        if (compoundflag &&
  ------------------
  |  Branch (2336:13): [True: 30.3k, False: 0]
  ------------------
 2337|  30.3k|            !(rv =
  ------------------
  |  Branch (2337:13): [True: 30.3k, False: 0]
  ------------------
 2338|  30.3k|                  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.7k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2338:42): [True: 0, False: 30.3k]
  ------------------
 2339|  30.3k|                               scratch, compoundflag))) {
 2340|  30.3k|          if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   96|  30.3k|#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.7k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2340:16): [True: 0, False: 30.3k]
  |  Branch (2340:91): [True: 0, False: 30.3k]
  ------------------
 2341|  30.3k|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (2341:17): [True: 0, False: 30.3k]
  |  Branch (2341:41): [True: 0, False: 0]
  ------------------
 2342|      0|              !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (2342:15): [True: 0, False: 0]
  |  Branch (2342:31): [True: 0, False: 0]
  ------------------
 2343|      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 (2343:17): [True: 0, False: 0]
  ------------------
 2344|      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 (2344:17): [True: 0, False: 0]
  ------------------
 2345|      0|            rv = nullptr;
 2346|      0|          }
 2347|  30.3k|        }
 2348|       |
 2349|  30.3k|        if (rv ||
  ------------------
  |  Branch (2349:13): [True: 0, False: 30.3k]
  ------------------
 2350|  30.3k|            (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (2350:15): [True: 30.3k, False: 0]
  |  Branch (2350:33): [True: 0, False: 30.3k]
  ------------------
 2351|      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 (2351:16): [True: 0, False: 0]
  |  Branch (2351:92): [True: 0, False: 0]
  ------------------
 2352|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2352:17): [True: 0, False: 0]
  |  Branch (2352:41): [True: 0, False: 0]
  ------------------
 2353|      0|                                                                  compoundbegin))) ||  // twofold suffix+compound
 2354|      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 (2354:16): [True: 0, False: 0]
  |  Branch (2354:45): [True: 0, False: 0]
  ------------------
 2355|  30.3k|             ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (2355:15): [True: 0, False: 30.3k]
  |  Branch (2355:32): [True: 0, False: 0]
  ------------------
 2356|      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 (2356:16): [True: 0, False: 0]
  |  Branch (2356:93): [True: 0, False: 0]
  ------------------
 2357|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2357:17): [True: 0, False: 0]
  |  Branch (2357:41): [True: 0, False: 0]
  ------------------
 2358|      0|                                                                  compoundmiddle))) ||  // twofold suffix+compound
 2359|      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 (2359:16): [True: 0, False: 0]
  |  Branch (2359:45): [True: 0, False: 0]
  ------------------
 2360|      0|          std::string p;
 2361|      0|          if (compoundflag)
  ------------------
  |  Branch (2361:15): [True: 0, False: 0]
  ------------------
 2362|      0|            p = affix_check_morph(st, 0, i, scratch, compoundflag);
 2363|      0|          if (p.empty()) {
  ------------------
  |  Branch (2363:15): [True: 0, False: 0]
  ------------------
 2364|      0|            if ((wordnum == 0) && compoundbegin) {
  ------------------
  |  Branch (2364:17): [True: 0, False: 0]
  |  Branch (2364:35): [True: 0, False: 0]
  ------------------
 2365|      0|              p = affix_check_morph(st, 0, i, scratch, compoundbegin);
 2366|      0|            } else if ((wordnum > 0) && compoundmiddle) {
  ------------------
  |  Branch (2366:24): [True: 0, False: 0]
  |  Branch (2366:41): [True: 0, False: 0]
  ------------------
 2367|      0|              p = affix_check_morph(st, 0, i, scratch, compoundmiddle);
 2368|      0|            }
 2369|      0|          }
 2370|      0|          if (!p.empty()) {
  ------------------
  |  Branch (2370:15): [True: 0, False: 0]
  ------------------
 2371|      0|            presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2372|      0|            presult.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2373|      0|            presult.append(st, 0, i);
 2374|      0|            line_uniq_app(p, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2375|      0|            presult.append(p);
 2376|      0|          }
 2377|      0|          checked_prefix = 1;
 2378|      0|        }
 2379|       |        // else check forbiddenwords
 2380|  30.3k|      } 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 (2380:18): [True: 0, False: 0]
  |  Branch (2380:18): [True: 0, False: 0]
  ------------------
 2381|      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]
  |  |  ------------------
  ------------------
 2382|      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]
  |  |  ------------------
  ------------------
 2383|      0|        st[i] = ch;
 2384|      0|        continue;
 2385|      0|      }
 2386|       |
 2387|       |      // check non_compound flag in suffix and prefix
 2388|  30.3k|      if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2388:11): [True: 0, False: 30.3k]
  |  Branch (2388:19): [True: 0, False: 0]
  ------------------
 2389|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2389:13): [True: 0, False: 0]
  |  Branch (2389:20): [True: 0, False: 0]
  ------------------
 2390|      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]
  |  |  ------------------
  ------------------
 2391|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2391:13): [True: 0, False: 0]
  |  Branch (2391:20): [True: 0, False: 0]
  ------------------
 2392|      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]
  |  |  ------------------
  ------------------
 2393|      0|        continue;
 2394|      0|      }
 2395|       |
 2396|       |      // check compoundend flag in suffix and prefix
 2397|  30.3k|      if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (2397:11): [True: 0, False: 30.3k]
  |  Branch (2397:19): [True: 0, False: 0]
  |  Branch (2397:38): [True: 0, False: 0]
  |  Branch (2397:53): [True: 0, False: 0]
  ------------------
 2398|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2398:13): [True: 0, False: 0]
  |  Branch (2398:20): [True: 0, False: 0]
  ------------------
 2399|      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]
  |  |  ------------------
  ------------------
 2400|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2400:13): [True: 0, False: 0]
  |  Branch (2400:20): [True: 0, False: 0]
  ------------------
 2401|      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]
  |  |  ------------------
  ------------------
 2402|      0|        continue;
 2403|      0|      }
 2404|       |
 2405|       |      // check compoundmiddle flag in suffix and prefix
 2406|  30.3k|      if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (2406:11): [True: 0, False: 30.3k]
  |  Branch (2406:19): [True: 0, False: 0]
  |  Branch (2406:38): [True: 0, False: 0]
  |  Branch (2406:56): [True: 0, False: 0]
  ------------------
 2407|      0|          !hu_mov_rule &&
  ------------------
  |  Branch (2407:11): [True: 0, False: 0]
  ------------------
 2408|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2408:13): [True: 0, False: 0]
  |  Branch (2408:20): [True: 0, False: 0]
  ------------------
 2409|      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]
  |  |  ------------------
  ------------------
 2410|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2410:13): [True: 0, False: 0]
  |  Branch (2410:20): [True: 0, False: 0]
  ------------------
 2411|      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]
  |  |  ------------------
  ------------------
 2412|      0|        rv = nullptr;
 2413|      0|      }
 2414|       |
 2415|       |      // check forbiddenwords
 2416|  30.3k|      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 (2416:11): [True: 0, False: 30.3k]
  |  Branch (2416:11): [True: 0, False: 30.3k]
  |  Branch (2416:19): [True: 0, False: 0]
  ------------------
 2417|      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]
  |  |  ------------------
  ------------------
 2418|      0|        continue;
 2419|       |
 2420|       |      // increment word number, if the second root has a compoundroot flag
 2421|  30.3k|      if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2421:11): [True: 0, False: 30.3k]
  |  Branch (2421:19): [True: 0, False: 0]
  ------------------
 2422|      0|          (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2422:11): [True: 0, False: 0]
  ------------------
 2423|      0|        wordnum++;
 2424|      0|      }
 2425|       |
 2426|       |      // first word is acceptable in compound words?
 2427|  30.3k|      if (((rv) &&
  ------------------
  |  Branch (2427:11): [True: 0, False: 30.3k]
  |  Branch (2427:12): [True: 0, False: 30.3k]
  ------------------
 2428|      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 (2428:13): [True: 0, False: 0]
  |  Branch (2428:32): [True: 0, False: 0]
  |  Branch (2428:41): [True: 0, False: 0]
  |  Branch (2428:58): [True: 0, False: 0]
  ------------------
 2429|      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 (2429:14): [True: 0, False: 0]
  |  Branch (2429:35): [True: 0, False: 0]
  ------------------
 2430|      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 (2430:14): [True: 0, False: 0]
  |  Branch (2430:34): [True: 0, False: 0]
  ------------------
 2431|       |            // LANG_hu section: spec. Hungarian rule
 2432|      0|            || ((langnum == LANG_hu) &&  // hu_mov_rule
  ------------------
  |  Branch (2432:17): [True: 0, False: 0]
  ------------------
 2433|      0|                hu_mov_rule &&
  ------------------
  |  Branch (2433:17): [True: 0, False: 0]
  ------------------
 2434|      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]
  |  |  ------------------
  ------------------
 2435|       |            // END of LANG_hu section
 2436|      0|            ) &&
 2437|      0|           !((checkcompoundtriple && !words &&  // test triple letters
  ------------------
  |  Branch (2437:15): [True: 0, False: 0]
  |  Branch (2437:38): [True: 0, False: 0]
  ------------------
 2438|      0|              (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (2438:15): [True: 0, False: 0]
  ------------------
 2439|      0|              (((i > 1) && (word[i - 1] == word[i - 2])) || ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (2439:17): [True: 0, False: 0]
  |  Branch (2439:28): [True: 0, False: 0]
  |  Branch (2439:61): [True: 0, False: 0]
  ------------------
 2440|      0|               )) ||
 2441|      0|             (
 2442|       |                 // test CHECKCOMPOUNDPATTERN
 2443|      0|                 !checkcpdtable.empty() && !words && cpdpat_check(word, i, rv, nullptr, affixed)) ||
  ------------------
  |  Branch (2443:18): [True: 0, False: 0]
  |  Branch (2443:44): [True: 0, False: 0]
  |  Branch (2443:54): [True: 0, False: 0]
  ------------------
 2444|      0|             (checkcompoundcase && !words && cpdcase_check(word, i))))
  ------------------
  |  Branch (2444:15): [True: 0, False: 0]
  |  Branch (2444:36): [True: 0, False: 0]
  |  Branch (2444:46): [True: 0, False: 0]
  ------------------
 2445|       |          // LANG_hu section: spec. Hungarian rule
 2446|  30.3k|          || ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (2446:15): [True: 30.3k, False: 0]
  |  Branch (2446:24): [True: 9.66k, False: 20.7k]
  |  Branch (2446:48): [True: 0, False: 9.66k]
  |  Branch (2446:63): [True: 0, False: 0]
  ------------------
 2447|      0|              (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2447:16): [True: 0, False: 0]
  |  Branch (2447:23): [True: 0, False: 0]
  ------------------
 2448|      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]
  |  |  ------------------
  ------------------
 2449|      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]
  |  |  ------------------
  ------------------
 2450|       |          // END of LANG_hu section
 2451|  30.3k|      ) {
 2452|       |        // LANG_hu section: spec. Hungarian rule
 2453|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2453:13): [True: 0, False: 0]
  ------------------
 2454|       |          // calculate syllable number of the word
 2455|      0|          numsyllable += get_syllable(st.substr(0, i));
 2456|       |
 2457|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2458|       |          // convention)
 2459|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2459:15): [True: 0, False: 0]
  |  Branch (2459:15): [True: 0, False: 0]
  |  Branch (2459:22): [True: 0, False: 0]
  ------------------
 2460|      0|            wordnum++;
 2461|      0|        }
 2462|       |        // END of LANG_hu section
 2463|       |
 2464|       |        // NEXT WORD(S)
 2465|      0|        rv_first = rv;
 2466|      0|        rv = lookup(word.c_str() + i, word.size() - i);  // perhaps without prefix
 2467|       |
 2468|       |        // search homonym with compound flag
 2469|      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 (2469:16): [True: 0, False: 0]
  |  Branch (2469:26): [True: 0, False: 0]
  ------------------
 2470|      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 (2470:28): [True: 0, False: 0]
  |  Branch (2470:44): [True: 0, False: 0]
  ------------------
 2471|      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 (2471:28): [True: 0, False: 0]
  |  Branch (2471:43): [True: 0, False: 0]
  ------------------
 2472|      0|                          (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))))) {
  ------------------
  |  Branch (2472:28): [True: 0, False: 0]
  |  Branch (2472:52): [True: 0, False: 0]
  |  Branch (2472:61): [True: 0, False: 0]
  ------------------
 2473|      0|          rv = rv->next_homonym;
 2474|      0|        }
 2475|       |
 2476|      0|        if (rv && words && words[wnum + 1]) {
  ------------------
  |  Branch (2476:13): [True: 0, False: 0]
  |  Branch (2476:19): [True: 0, False: 0]
  |  Branch (2476:28): [True: 0, False: 0]
  ------------------
 2477|      0|          result.append(presult);
 2478|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2479|      0|          result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2480|      0|          result.append(word, i, word.size());
 2481|      0|          if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (2481:15): [True: 0, False: 0]
  |  Branch (2481:34): [True: 0, False: 0]
  ------------------
 2482|      0|            result.append(HENTRY_DATA2(rv));
 2483|      0|          if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2483:15): [True: 0, False: 0]
  ------------------
 2484|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2485|      0|            result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2486|      0|            result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2487|      0|          }
 2488|       |          // store the pointer of the hash entry
 2489|      0|          if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2489:15): [True: 0, False: 0]
  |  Branch (2489:35): [True: 0, False: 0]
  ------------------
 2490|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2491|      0|            result.append(HENTRY_DATA2(rv));
 2492|      0|          }
 2493|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2494|      0|          return 0;
 2495|      0|        }
 2496|       |
 2497|      0|        oldnumsyllable2 = numsyllable;
 2498|      0|        oldwordnum2 = wordnum;
 2499|       |
 2500|       |        // LANG_hu section: spec. Hungarian rule
 2501|      0|        if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (2501:13): [True: 0, False: 0]
  |  Branch (2501:13): [True: 0, False: 0]
  |  Branch (2501:21): [True: 0, False: 0]
  ------------------
 2502|      0|            (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2502:13): [True: 0, False: 0]
  ------------------
 2503|      0|            !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2503:13): [True: 0, False: 0]
  ------------------
 2504|      0|          numsyllable--;
 2505|      0|        }
 2506|       |        // END of LANG_hu section
 2507|       |        // increment word number, if the second root has a compoundroot flag
 2508|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2508:13): [True: 0, False: 0]
  |  Branch (2508:21): [True: 0, False: 0]
  ------------------
 2509|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2509:13): [True: 0, False: 0]
  ------------------
 2510|      0|          wordnum++;
 2511|      0|        }
 2512|       |
 2513|       |        // check forbiddenwords
 2514|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2514:13): [True: 0, False: 0]
  |  Branch (2514:13): [True: 0, False: 0]
  |  Branch (2514:21): [True: 0, False: 0]
  ------------------
 2515|      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]
  |  |  ------------------
  ------------------
 2516|      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]
  |  |  ------------------
  ------------------
 2517|      0|          st[i] = ch;
 2518|      0|          continue;
 2519|      0|        }
 2520|       |
 2521|       |        // second word is acceptable, as a root?
 2522|       |        // hungarian conventions: compounding is acceptable,
 2523|       |        // when compound forms consist of 2 words, or if more,
 2524|       |        // then the syllable number of root words must be 6, or lesser.
 2525|      0|        if ((rv) &&
  ------------------
  |  Branch (2525:13): [True: 0, False: 0]
  |  Branch (2525:13): [True: 0, False: 0]
  ------------------
 2526|      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 (2526:15): [True: 0, False: 0]
  ------------------
 2527|      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 (2527:15): [True: 0, False: 0]
  ------------------
 2528|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2528:15): [True: 0, False: 0]
  |  Branch (2528:37): [True: 0, False: 0]
  ------------------
 2529|      0|             ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (2529:15): [True: 0, False: 0]
  ------------------
 2530|      0|              (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (2530:15): [True: 0, False: 0]
  ------------------
 2531|      0|               cpdmaxsyllable))) &&
 2532|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2532:15): [True: 0, False: 0]
  |  Branch (2532:36): [True: 0, False: 0]
  ------------------
 2533|       |          // bad compound word
 2534|      0|          result.append(presult);
 2535|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2536|      0|          result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2537|      0|          result.append(word, i, word.size());
 2538|       |
 2539|      0|          if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2539:15): [True: 0, False: 0]
  ------------------
 2540|      0|            if (complexprefixes)
  ------------------
  |  Branch (2540:17): [True: 0, False: 0]
  ------------------
 2541|      0|              result.append(HENTRY_DATA2(rv));
 2542|      0|            if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2542:17): [True: 0, False: 0]
  ------------------
 2543|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2544|      0|              result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2545|      0|              result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2546|      0|            }
 2547|       |            // store the pointer of the hash entry
 2548|      0|            if (!complexprefixes) {
  ------------------
  |  Branch (2548:17): [True: 0, False: 0]
  ------------------
 2549|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2550|      0|              result.append(HENTRY_DATA2(rv));
 2551|      0|            }
 2552|      0|          }
 2553|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2554|      0|          ok = 1;
 2555|      0|        }
 2556|       |
 2557|      0|        numsyllable = oldnumsyllable2;
 2558|      0|        wordnum = oldwordnum2;
 2559|       |
 2560|       |        // perhaps second word has prefix or/and suffix
 2561|      0|        sfx = nullptr;
 2562|      0|        sfxflag = FLAG_NULL;
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
 2563|       |
 2564|      0|        if (compoundflag && !onlycpdrule)
  ------------------
  |  Branch (2564:13): [True: 0, False: 0]
  |  Branch (2564:29): [True: 0, False: 0]
  ------------------
 2565|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundflag);
 2566|      0|        else
 2567|      0|          rv = nullptr;
 2568|       |
 2569|      0|        if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (2569:13): [True: 0, False: 0]
  |  Branch (2569:20): [True: 0, False: 0]
  |  Branch (2569:35): [True: 0, False: 0]
  ------------------
 2570|      0|          sfx = nullptr;
 2571|      0|          pfx = nullptr;
 2572|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundend);
 2573|      0|        }
 2574|       |
 2575|      0|        if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (2575:13): [True: 0, False: 0]
  |  Branch (2575:20): [True: 0, False: 0]
  |  Branch (2575:44): [True: 0, False: 0]
  ------------------
 2576|      0|          rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   74|      0|#define IN_CPD_END 2
  ------------------
 2577|      0|          if (rv && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1)) {
  ------------------
  |  Branch (2577:15): [True: 0, False: 0]
  |  Branch (2577:21): [True: 0, False: 0]
  |  Branch (2577:30): [True: 0, False: 0]
  ------------------
 2578|      0|            std::string m;
 2579|      0|            if (compoundflag)
  ------------------
  |  Branch (2579:17): [True: 0, False: 0]
  ------------------
 2580|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag);
 2581|      0|            if (m.empty() && compoundend) {
  ------------------
  |  Branch (2581:17): [True: 0, False: 0]
  |  Branch (2581:30): [True: 0, False: 0]
  ------------------
 2582|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundend);
 2583|      0|            }
 2584|      0|            result.append(presult);
 2585|      0|            if (!m.empty()) {
  ------------------
  |  Branch (2585:17): [True: 0, False: 0]
  ------------------
 2586|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2587|      0|              result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2588|      0|              result.append(word, i, word.size());
 2589|      0|              line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2590|      0|              result.append(m);
 2591|      0|            }
 2592|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2593|      0|            ok = 1;
 2594|      0|          }
 2595|      0|        }
 2596|       |
 2597|       |        // check non_compound flag in suffix and prefix
 2598|      0|        if ((rv) &&
  ------------------
  |  Branch (2598:13): [True: 0, False: 0]
  ------------------
 2599|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2599:15): [True: 0, False: 0]
  |  Branch (2599:22): [True: 0, False: 0]
  ------------------
 2600|      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]
  |  |  ------------------
  ------------------
 2601|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2601:15): [True: 0, False: 0]
  |  Branch (2601:22): [True: 0, False: 0]
  ------------------
 2602|      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]
  |  |  ------------------
  ------------------
 2603|      0|                      sfx->getContLen())))) {
 2604|      0|          rv = nullptr;
 2605|      0|        }
 2606|       |
 2607|       |        // check forbiddenwords
 2608|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2608:13): [True: 0, False: 0]
  |  Branch (2608:13): [True: 0, False: 0]
  |  Branch (2608:21): [True: 0, False: 0]
  ------------------
 2609|      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]
  |  |  ------------------
  ------------------
 2610|      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]
  |  |  ------------------
  ------------------
 2611|      0|            (!TESTAFF(rv->astr, needaffix, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2611:13): [True: 0, False: 0]
  ------------------
 2612|      0|          st[i] = ch;
 2613|      0|          continue;
 2614|      0|        }
 2615|       |
 2616|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2616:13): [True: 0, False: 0]
  ------------------
 2617|       |          // calculate syllable number of the word
 2618|      0|          numsyllable += get_syllable(word.c_str() + i);
 2619|       |
 2620|       |          // - affix syllable num.
 2621|       |          // XXX only second suffix (inflections, not derivations)
 2622|      0|          if (sfxappnd) {
  ------------------
  |  Branch (2622:15): [True: 0, False: 0]
  ------------------
 2623|      0|            std::string tmp(sfxappnd);
 2624|      0|            reverseword(tmp);
 2625|      0|            numsyllable -= short(get_syllable(tmp) + sfxextra);
 2626|      0|          } else {
 2627|      0|            numsyllable -= short(sfxextra);
 2628|      0|          }
 2629|       |
 2630|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2631|       |          // convention)
 2632|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2632:15): [True: 0, False: 0]
  |  Branch (2632:15): [True: 0, False: 0]
  |  Branch (2632:22): [True: 0, False: 0]
  ------------------
 2633|      0|            wordnum++;
 2634|       |
 2635|       |          // increment syllable num, if last word has a SYLLABLENUM flag
 2636|       |          // and the suffix is beginning `s'
 2637|       |
 2638|      0|          if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2638:15): [True: 0, False: 0]
  ------------------
 2639|      0|            switch (sfxflag) {
  ------------------
  |  Branch (2639:21): [True: 0, False: 0]
  ------------------
 2640|      0|              case 'c': {
  ------------------
  |  Branch (2640:15): [True: 0, False: 0]
  ------------------
 2641|      0|                numsyllable += 2;
 2642|      0|                break;
 2643|      0|              }
 2644|      0|              case 'J': {
  ------------------
  |  Branch (2644:15): [True: 0, False: 0]
  ------------------
 2645|      0|                numsyllable += 1;
 2646|      0|                break;
 2647|      0|              }
 2648|      0|              case 'I': {
  ------------------
  |  Branch (2648:15): [True: 0, False: 0]
  ------------------
 2649|      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 (2649:21): [True: 0, False: 0]
  |  Branch (2649:21): [True: 0, False: 0]
  ------------------
 2650|      0|                  numsyllable += 1;
 2651|      0|                break;
 2652|      0|              }
 2653|      0|            }
 2654|      0|          }
 2655|      0|        }
 2656|       |
 2657|       |        // increment word number, if the second word has a compoundroot flag
 2658|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2658:13): [True: 0, False: 0]
  |  Branch (2658:21): [True: 0, False: 0]
  ------------------
 2659|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2659:13): [True: 0, False: 0]
  ------------------
 2660|      0|          wordnum++;
 2661|      0|        }
 2662|       |        // second word is acceptable, as a word with prefix or/and suffix?
 2663|       |        // hungarian conventions: compounding is acceptable,
 2664|       |        // when compound forms consist 2 word, otherwise
 2665|       |        // the syllable number of root words is 6, or lesser.
 2666|      0|        if ((rv) &&
  ------------------
  |  Branch (2666:13): [True: 0, False: 0]
  ------------------
 2667|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2667:15): [True: 0, False: 0]
  |  Branch (2667:37): [True: 0, False: 0]
  ------------------
 2668|      0|             ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2668:15): [True: 0, False: 0]
  |  Branch (2668:40): [True: 0, False: 0]
  ------------------
 2669|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2669:15): [True: 0, False: 0]
  |  Branch (2669:36): [True: 0, False: 0]
  ------------------
 2670|      0|          std::string m;
 2671|      0|          if (compoundflag)
  ------------------
  |  Branch (2671:15): [True: 0, False: 0]
  ------------------
 2672|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag);
 2673|      0|          if (m.empty() && compoundend) {
  ------------------
  |  Branch (2673:15): [True: 0, False: 0]
  |  Branch (2673:28): [True: 0, False: 0]
  ------------------
 2674|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundend);
 2675|      0|          }
 2676|      0|          result.append(presult);
 2677|      0|          if (!m.empty()) {
  ------------------
  |  Branch (2677:15): [True: 0, False: 0]
  ------------------
 2678|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2679|      0|            result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2680|      0|            result.append(word, i, word.size());
 2681|      0|            line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2682|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2683|      0|            result.append(m);
 2684|      0|          }
 2685|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2686|      0|          ok = 1;
 2687|      0|        }
 2688|       |
 2689|      0|        numsyllable = oldnumsyllable2;
 2690|      0|        wordnum = oldwordnum2;
 2691|       |
 2692|       |        // perhaps second word is a compound word (recursive call)
 2693|      0|        if ((wordnum + 2 < maxwordnum) && (wnum + 1 < maxwordnum) && (ok == 0)) {
  ------------------
  |  Branch (2693:13): [True: 0, False: 0]
  |  Branch (2693:43): [True: 0, False: 0]
  |  Branch (2693:70): [True: 0, False: 0]
  ------------------
 2694|      0|          compound_check_morph(word.substr(i), wordnum + 1,
 2695|      0|                               numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2696|      0|                               result, &presult, scratch);
 2697|      0|        } else {
 2698|      0|          rv = nullptr;
 2699|      0|        }
 2700|      0|      }
 2701|  30.3k|      st[i] = ch;
 2702|  30.3k|      wordnum = oldwordnum;
 2703|  30.3k|      numsyllable = oldnumsyllable;
 2704|       |
 2705|  30.3k|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2705:14): [True: 0, False: 30.3k]
  |  Branch (2705:38): [True: 0, False: 0]
  ------------------
 2706|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2706:14): [True: 0, False: 0]
  ------------------
 2707|  30.4k|  }
 2708|  1.83k|  return 0;
 2709|  2.06k|}
_ZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttc:
 2732|   525M|                                      char in_compound) {
 2733|   525M|  struct hentry* rv = nullptr;
 2734|   525M|  PfxEntry* ep = ppfx;
 2735|       |
 2736|       |  // first handle the special case of 0 length suffixes
 2737|   525M|  SfxEntry* se = sStart[0];
 2738|       |
 2739|   525M|  while (se) {
  ------------------
  |  Branch (2739:10): [True: 0, False: 525M]
  ------------------
 2740|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (2740:9): [True: 0, False: 0]
  |  Branch (2740:20): [True: 0, False: 0]
  ------------------
 2741|       |      // suffixes are not allowed in beginning of compounds
 2742|      0|      if ((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2742:12): [True: 0, False: 0]
  ------------------
 2743|       |           // except when signed with compoundpermitflag flag
 2744|      0|           (se->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2744:13): [True: 0, False: 0]
  |  Branch (2744:30): [True: 0, False: 0]
  ------------------
 2745|      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]
  |  |  ------------------
  ------------------
 2746|      0|          (!circumfix ||
  ------------------
  |  Branch (2746:12): [True: 0, False: 0]
  ------------------
 2747|       |           // no circumfix flag in prefix and suffix
 2748|      0|           ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (2748:14): [True: 0, False: 0]
  |  Branch (2748:23): [True: 0, False: 0]
  ------------------
 2749|      0|             !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2749:14): [True: 0, False: 0]
  ------------------
 2750|      0|            (!se->getCont() ||
  ------------------
  |  Branch (2750:14): [True: 0, False: 0]
  ------------------
 2751|      0|             !(TESTAFF(se->getCont(), circumfix, se->getContLen())))) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2751:14): [True: 0, False: 0]
  ------------------
 2752|       |           // circumfix flag in prefix AND suffix
 2753|      0|           ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (2753:14): [True: 0, False: 0]
  |  Branch (2753:22): [True: 0, False: 0]
  ------------------
 2754|      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]
  |  |  ------------------
  ------------------
 2755|      0|            (se->getCont() &&
  ------------------
  |  Branch (2755:14): [True: 0, False: 0]
  ------------------
 2756|      0|             (TESTAFF(se->getCont(), circumfix, se->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2756:14): [True: 0, False: 0]
  ------------------
 2757|       |          // fogemorpheme
 2758|      0|          (in_compound ||
  ------------------
  |  Branch (2758:12): [True: 0, False: 0]
  ------------------
 2759|      0|           !(se->getCont() &&
  ------------------
  |  Branch (2759:14): [True: 0, False: 0]
  ------------------
 2760|      0|             (TESTAFF(se->getCont(), onlyincompound, se->getContLen())))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2760:14): [True: 0, False: 0]
  ------------------
 2761|       |          // needaffix on prefix or first suffix
 2762|      0|          (cclass ||
  ------------------
  |  Branch (2762:12): [True: 0, False: 0]
  ------------------
 2763|      0|           !(se->getCont() &&
  ------------------
  |  Branch (2763:14): [True: 0, False: 0]
  ------------------
 2764|      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]
  |  |  ------------------
  ------------------
 2765|      0|           (ppfx &&
  ------------------
  |  Branch (2765:13): [True: 0, False: 0]
  ------------------
 2766|      0|            !((ep->getCont()) &&
  ------------------
  |  Branch (2766:15): [True: 0, False: 0]
  ------------------
 2767|      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]
  |  |  ------------------
  ------------------
 2768|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx,
 2769|      0|                           (FLAG)cclass, needflag,
 2770|      0|                           (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (2770:29): [True: 0, False: 0]
  ------------------
 2771|      0|                           scratch);
 2772|      0|        if (rv) {
  ------------------
  |  Branch (2772:13): [True: 0, False: 0]
  ------------------
 2773|      0|          sfx = se;  // BUG: sfx not stateless
 2774|      0|          return rv;
 2775|      0|        }
 2776|      0|      }
 2777|      0|    }
 2778|      0|    se = se->getNext();
 2779|      0|  }
 2780|       |
 2781|       |  // now handle the general case
 2782|   525M|  if (len == 0)
  ------------------
  |  Branch (2782:7): [True: 46.8k, False: 525M]
  ------------------
 2783|  46.8k|    return nullptr;  // FULLSTRIP
 2784|   525M|  unsigned char sp = word[start + len - 1];
 2785|   525M|  SfxEntry* sptr = sStart[sp];
 2786|       |
 2787|   526M|  while (sptr) {
  ------------------
  |  Branch (2787:10): [True: 378k, False: 525M]
  ------------------
 2788|   378k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (2788:9): [True: 349k, False: 28.9k]
  ------------------
 2789|       |      // suffixes are not allowed in beginning of compounds
 2790|   349k|      if ((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|   349k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2790:12): [True: 65.1k, False: 284k]
  ------------------
 2791|       |           // except when signed with compoundpermitflag flag
 2792|   284k|           (sptr->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2792:13): [True: 284k, False: 0]
  |  Branch (2792:32): [True: 0, False: 284k]
  ------------------
 2793|      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]
  |  |  ------------------
  ------------------
 2794|   284k|                    sptr->getContLen()))) &&
 2795|  65.1k|          (!circumfix ||
  ------------------
  |  Branch (2795:12): [True: 65.1k, False: 0]
  ------------------
 2796|       |           // no circumfix flag in prefix and suffix
 2797|      0|           ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (2797:14): [True: 0, False: 0]
  |  Branch (2797:23): [True: 0, False: 0]
  ------------------
 2798|      0|             !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2798:14): [True: 0, False: 0]
  ------------------
 2799|      0|            (!sptr->getCont() ||
  ------------------
  |  Branch (2799:14): [True: 0, False: 0]
  ------------------
 2800|      0|             !(TESTAFF(sptr->getCont(), circumfix, sptr->getContLen())))) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2800:14): [True: 0, False: 0]
  ------------------
 2801|       |           // circumfix flag in prefix AND suffix
 2802|      0|           ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (2802:14): [True: 0, False: 0]
  |  Branch (2802:22): [True: 0, False: 0]
  ------------------
 2803|      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]
  |  |  ------------------
  ------------------
 2804|      0|            (sptr->getCont() &&
  ------------------
  |  Branch (2804:14): [True: 0, False: 0]
  ------------------
 2805|      0|             (TESTAFF(sptr->getCont(), circumfix, sptr->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2805:14): [True: 0, False: 0]
  ------------------
 2806|       |          // fogemorpheme
 2807|  65.1k|          (in_compound ||
  ------------------
  |  Branch (2807:12): [True: 0, False: 65.1k]
  ------------------
 2808|  65.1k|           !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound,
  ------------------
  |  |   99|  32.4k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2808:15): [True: 32.4k, False: 32.6k]
  |  Branch (2808:34): [True: 0, False: 32.4k]
  ------------------
 2809|  32.4k|                                          sptr->getContLen()))))) &&
 2810|       |          // needaffix on prefix or first suffix
 2811|  65.1k|          (cclass ||
  ------------------
  |  Branch (2811:12): [True: 60, False: 65.0k]
  ------------------
 2812|  65.0k|           !(sptr->getCont() &&
  ------------------
  |  Branch (2812:14): [True: 32.4k, False: 32.6k]
  ------------------
 2813|  32.4k|             TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) ||
  ------------------
  |  |   99|  32.4k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 32.4k]
  |  |  ------------------
  ------------------
 2814|      0|           (ppfx &&
  ------------------
  |  Branch (2814:13): [True: 0, False: 0]
  ------------------
 2815|      0|            !((ep->getCont()) &&
  ------------------
  |  Branch (2815:15): [True: 0, False: 0]
  ------------------
 2816|      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]
  |  |  ------------------
  ------------------
 2817|  65.1k|        if (in_compound != IN_CPD_END || ppfx ||
  ------------------
  |  |   74|   130k|#define IN_CPD_END 2
  ------------------
  |  Branch (2817:13): [True: 65.1k, False: 0]
  |  Branch (2817:42): [True: 0, False: 0]
  ------------------
 2818|      0|            !(sptr->getCont() &&
  ------------------
  |  Branch (2818:15): [True: 0, False: 0]
  ------------------
 2819|  65.1k|              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]
  |  |  ------------------
  ------------------
 2820|  65.1k|          rv = sptr->checkword(word, start, len, sfxopts, ppfx,
 2821|  65.1k|                               cclass, needflag,
 2822|  65.1k|                               (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (2822:33): [True: 0, False: 65.1k]
  ------------------
 2823|  65.1k|                               scratch);
 2824|  65.1k|          if (rv) {
  ------------------
  |  Branch (2824:15): [True: 2, False: 65.1k]
  ------------------
 2825|      2|            sfx = sptr;                 // BUG: sfx not stateless
 2826|      2|            sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 2827|      2|            if (!sptr->getCont())
  ------------------
  |  Branch (2827:17): [True: 1, False: 1]
  ------------------
 2828|      1|              sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 2829|       |            // LANG_hu section: spec. Hungarian rule
 2830|      1|            else if (langnum == LANG_hu && sptr->getKeyLen() &&
  ------------------
  |  Branch (2830:22): [True: 0, False: 1]
  |  Branch (2830:44): [True: 0, False: 0]
  ------------------
 2831|      0|                     sptr->getKey()[0] == 'i' && sptr->getKey()[1] != 'y' &&
  ------------------
  |  Branch (2831:22): [True: 0, False: 0]
  |  Branch (2831:50): [True: 0, False: 0]
  ------------------
 2832|      0|                     sptr->getKey()[1] != 't') {
  ------------------
  |  Branch (2832:22): [True: 0, False: 0]
  ------------------
 2833|      0|              sfxextra = 1;
 2834|      0|            }
 2835|       |            // END of LANG_hu section
 2836|      2|            return rv;
 2837|      2|          }
 2838|  65.1k|        }
 2839|   349k|      sptr = sptr->getNextEQ();
 2840|   349k|    } else {
 2841|  28.9k|      sptr = sptr->getNextNE();
 2842|  28.9k|    }
 2843|   378k|  }
 2844|       |
 2845|   525M|  return nullptr;
 2846|   525M|}
_ZN8AffixMgr19suffix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratcht:
 2855|  14.7M|                                             const FLAG needflag) {
 2856|  14.7M|  struct hentry* rv = nullptr;
 2857|       |
 2858|       |  // first handle the special case of 0 length suffixes
 2859|  14.7M|  SfxEntry* se = sStart[0];
 2860|  14.7M|  while (se) {
  ------------------
  |  Branch (2860:10): [True: 0, False: 14.7M]
  ------------------
 2861|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (2861:9): [True: 0, False: 0]
  ------------------
 2862|      0|      rv = se->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 2863|      0|      if (rv)
  ------------------
  |  Branch (2863:11): [True: 0, False: 0]
  ------------------
 2864|      0|        return rv;
 2865|      0|    }
 2866|      0|    se = se->getNext();
 2867|      0|  }
 2868|       |
 2869|       |  // now handle the general case
 2870|  14.7M|  if (len == 0)
  ------------------
  |  Branch (2870:7): [True: 14.8k, False: 14.7M]
  ------------------
 2871|  14.8k|    return nullptr;  // FULLSTRIP
 2872|  14.7M|  unsigned char sp = word[start + len - 1];
 2873|  14.7M|  SfxEntry* sptr = sStart[sp];
 2874|       |
 2875|  14.8M|  while (sptr) {
  ------------------
  |  Branch (2875:10): [True: 82.8k, False: 14.7M]
  ------------------
 2876|  82.8k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (2876:9): [True: 58.2k, False: 24.5k]
  ------------------
 2877|  58.2k|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (2877:11): [True: 25.7k, False: 32.4k]
  ------------------
 2878|  25.7k|        rv = sptr->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 2879|  25.7k|        if (rv) {
  ------------------
  |  Branch (2879:13): [True: 0, False: 25.7k]
  ------------------
 2880|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 2881|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (2881:15): [True: 0, False: 0]
  ------------------
 2882|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 2883|      0|          return rv;
 2884|      0|        }
 2885|  25.7k|      }
 2886|  58.2k|      sptr = sptr->getNextEQ();
 2887|  58.2k|    } else {
 2888|  24.5k|      sptr = sptr->getNextNE();
 2889|  24.5k|    }
 2890|  82.8k|  }
 2891|       |
 2892|  14.7M|  return nullptr;
 2893|  14.7M|}
_ZN8AffixMgr25suffix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratcht:
 2902|  3.96k|                                                const FLAG needflag) {
 2903|  3.96k|  std::string result;
 2904|  3.96k|  std::string result2;
 2905|  3.96k|  std::string result3;
 2906|       |
 2907|       |  // first handle the special case of 0 length suffixes
 2908|  3.96k|  SfxEntry* se = sStart[0];
 2909|  3.96k|  while (se) {
  ------------------
  |  Branch (2909:10): [True: 0, False: 3.96k]
  ------------------
 2910|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (2910:9): [True: 0, False: 0]
  ------------------
 2911|      0|      std::string st = se->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 2912|      0|      if (!st.empty()) {
  ------------------
  |  Branch (2912:11): [True: 0, False: 0]
  ------------------
 2913|      0|        if (ppfx) {
  ------------------
  |  Branch (2913:13): [True: 0, False: 0]
  ------------------
 2914|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (2914:15): [True: 0, False: 0]
  ------------------
 2915|      0|            result.append(ppfx->getMorph());
 2916|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2917|      0|          } else
 2918|      0|            debugflag(result, ppfx->getFlag());
 2919|      0|        }
 2920|      0|        result.append(st);
 2921|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (2921:13): [True: 0, False: 0]
  ------------------
 2922|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2923|      0|          result.append(se->getMorph());
 2924|      0|        } else
 2925|      0|          debugflag(result, se->getFlag());
 2926|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2927|      0|      }
 2928|      0|    }
 2929|      0|    se = se->getNext();
 2930|      0|  }
 2931|       |
 2932|       |  // now handle the general case
 2933|  3.96k|  if (len == 0)
  ------------------
  |  Branch (2933:7): [True: 1, False: 3.96k]
  ------------------
 2934|      1|    return { };  // FULLSTRIP
 2935|  3.96k|  unsigned char sp = word[start + len - 1];
 2936|  3.96k|  SfxEntry* sptr = sStart[sp];
 2937|       |
 2938|  3.97k|  while (sptr) {
  ------------------
  |  Branch (2938:10): [True: 7, False: 3.96k]
  ------------------
 2939|      7|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (2939:9): [True: 0, False: 7]
  ------------------
 2940|      0|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (2940:11): [True: 0, False: 0]
  ------------------
 2941|      0|        std::string st = sptr->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 2942|      0|        if (!st.empty()) {
  ------------------
  |  Branch (2942:13): [True: 0, False: 0]
  ------------------
 2943|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 2944|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (2944:15): [True: 0, False: 0]
  ------------------
 2945|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 2946|      0|          result2.assign(st);
 2947|       |
 2948|      0|          result3.clear();
 2949|       |
 2950|      0|          if (sptr->getMorph()) {
  ------------------
  |  Branch (2950:15): [True: 0, False: 0]
  ------------------
 2951|      0|            result3.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2952|      0|            result3.append(sptr->getMorph());
 2953|      0|          } else
 2954|      0|            debugflag(result3, sptr->getFlag());
 2955|      0|          strlinecat(result2, result3);
 2956|      0|          result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2957|      0|          result.append(result2);
 2958|      0|        }
 2959|      0|      }
 2960|      0|      sptr = sptr->getNextEQ();
 2961|      7|    } else {
 2962|      7|      sptr = sptr->getNextNE();
 2963|      7|    }
 2964|      7|  }
 2965|       |
 2966|  3.96k|  return result;
 2967|  3.96k|}
_ZN8AffixMgr18suffix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttc:
 2977|  12.7k|                                         char in_compound) {
 2978|  12.7k|  std::string result;
 2979|       |
 2980|  12.7k|  struct hentry* rv = nullptr;
 2981|       |
 2982|  12.7k|  PfxEntry* ep = ppfx;
 2983|       |
 2984|       |  // first handle the special case of 0 length suffixes
 2985|  12.7k|  SfxEntry* se = sStart[0];
 2986|  12.7k|  while (se) {
  ------------------
  |  Branch (2986:10): [True: 0, False: 12.7k]
  ------------------
 2987|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (2987:9): [True: 0, False: 0]
  |  Branch (2987:20): [True: 0, False: 0]
  ------------------
 2988|       |      // suffixes are not allowed in beginning of compounds
 2989|      0|      if (((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2989:13): [True: 0, False: 0]
  ------------------
 2990|       |            // except when signed with compoundpermitflag flag
 2991|      0|            (se->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2991:14): [True: 0, False: 0]
  |  Branch (2991:31): [True: 0, False: 0]
  ------------------
 2992|      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]
  |  |  ------------------
  ------------------
 2993|      0|           (!circumfix ||
  ------------------
  |  Branch (2993:13): [True: 0, False: 0]
  ------------------
 2994|       |            // no circumfix flag in prefix and suffix
 2995|      0|            ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (2995:15): [True: 0, False: 0]
  |  Branch (2995:24): [True: 0, False: 0]
  ------------------
 2996|      0|              !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2996:15): [True: 0, False: 0]
  ------------------
 2997|      0|             (!se->getCont() ||
  ------------------
  |  Branch (2997:15): [True: 0, False: 0]
  ------------------
 2998|      0|              !(TESTAFF(se->getCont(), circumfix, se->getContLen())))) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2998:15): [True: 0, False: 0]
  ------------------
 2999|       |            // circumfix flag in prefix AND suffix
 3000|      0|            ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (3000:15): [True: 0, False: 0]
  |  Branch (3000:23): [True: 0, False: 0]
  ------------------
 3001|      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]
  |  |  ------------------
  ------------------
 3002|      0|             (se->getCont() &&
  ------------------
  |  Branch (3002:15): [True: 0, False: 0]
  ------------------
 3003|      0|              (TESTAFF(se->getCont(), circumfix, se->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3003:15): [True: 0, False: 0]
  ------------------
 3004|       |           // fogemorpheme
 3005|      0|           (in_compound ||
  ------------------
  |  Branch (3005:13): [True: 0, False: 0]
  ------------------
 3006|      0|            !((se->getCont() &&
  ------------------
  |  Branch (3006:16): [True: 0, False: 0]
  ------------------
 3007|      0|               (TESTAFF(se->getCont(), onlyincompound, se->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3007:16): [True: 0, False: 0]
  ------------------
 3008|       |           // needaffix on prefix or first suffix
 3009|      0|           (cclass ||
  ------------------
  |  Branch (3009:13): [True: 0, False: 0]
  ------------------
 3010|      0|            !(se->getCont() &&
  ------------------
  |  Branch (3010:15): [True: 0, False: 0]
  ------------------
 3011|      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]
  |  |  ------------------
  ------------------
 3012|      0|            (ppfx &&
  ------------------
  |  Branch (3012:14): [True: 0, False: 0]
  ------------------
 3013|      0|             !((ep->getCont()) &&
  ------------------
  |  Branch (3013:16): [True: 0, False: 0]
  ------------------
 3014|      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]
  |  |  ------------------
  ------------------
 3015|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx, cclass,
 3016|      0|                           needflag, FLAG_NULL, scratch);
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
 3017|      0|      while (rv) {
  ------------------
  |  Branch (3017:14): [True: 0, False: 0]
  ------------------
 3018|      0|        if (ppfx) {
  ------------------
  |  Branch (3018:13): [True: 0, False: 0]
  ------------------
 3019|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3019:15): [True: 0, False: 0]
  ------------------
 3020|      0|            result.append(ppfx->getMorph());
 3021|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3022|      0|          } else
 3023|      0|            debugflag(result, ppfx->getFlag());
 3024|      0|        }
 3025|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3025:13): [True: 0, False: 0]
  |  Branch (3025:32): [True: 0, False: 0]
  ------------------
 3026|      0|          result.append(HENTRY_DATA2(rv));
 3027|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (3027:13): [True: 0, False: 0]
  ------------------
 3028|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3029|      0|          result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 3030|      0|          result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 3031|      0|        }
 3032|       |
 3033|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3033:13): [True: 0, False: 0]
  |  Branch (3033:33): [True: 0, False: 0]
  ------------------
 3034|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3035|      0|          result.append(HENTRY_DATA2(rv));
 3036|      0|        }
 3037|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (3037:13): [True: 0, False: 0]
  ------------------
 3038|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3039|      0|          result.append(se->getMorph());
 3040|      0|        } else
 3041|      0|          debugflag(result, se->getFlag());
 3042|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 3043|      0|        rv = se->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3044|      0|      }
 3045|      0|    }
 3046|      0|    se = se->getNext();
 3047|      0|  }
 3048|       |
 3049|       |  // now handle the general case
 3050|  12.7k|  if (len == 0)
  ------------------
  |  Branch (3050:7): [True: 1, False: 12.7k]
  ------------------
 3051|      1|    return { };  // FULLSTRIP
 3052|  12.7k|  unsigned char sp = word[start + len - 1];
 3053|  12.7k|  SfxEntry* sptr = sStart[sp];
 3054|       |
 3055|  12.7k|  while (sptr) {
  ------------------
  |  Branch (3055:10): [True: 7, False: 12.7k]
  ------------------
 3056|      7|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3056:9): [True: 0, False: 7]
  ------------------
 3057|       |      // suffixes are not allowed in beginning of compounds
 3058|      0|      if (((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (3058:13): [True: 0, False: 0]
  ------------------
 3059|       |            // except when signed with compoundpermitflag flag
 3060|      0|            (sptr->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (3060:14): [True: 0, False: 0]
  |  Branch (3060:33): [True: 0, False: 0]
  ------------------
 3061|      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]
  |  |  ------------------
  ------------------
 3062|      0|                     sptr->getContLen()))) &&
 3063|      0|           (!circumfix ||
  ------------------
  |  Branch (3063:13): [True: 0, False: 0]
  ------------------
 3064|       |            // no circumfix flag in prefix and suffix
 3065|      0|            ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (3065:15): [True: 0, False: 0]
  |  Branch (3065:24): [True: 0, False: 0]
  ------------------
 3066|      0|              !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3066:15): [True: 0, False: 0]
  ------------------
 3067|      0|             (!sptr->getCont() ||
  ------------------
  |  Branch (3067:15): [True: 0, False: 0]
  ------------------
 3068|      0|              !(TESTAFF(sptr->getCont(), circumfix, sptr->getContLen())))) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3068:15): [True: 0, False: 0]
  ------------------
 3069|       |            // circumfix flag in prefix AND suffix
 3070|      0|            ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (3070:15): [True: 0, False: 0]
  |  Branch (3070:23): [True: 0, False: 0]
  ------------------
 3071|      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]
  |  |  ------------------
  ------------------
 3072|      0|             (sptr->getCont() &&
  ------------------
  |  Branch (3072:15): [True: 0, False: 0]
  ------------------
 3073|      0|              (TESTAFF(sptr->getCont(), circumfix, sptr->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3073:15): [True: 0, False: 0]
  ------------------
 3074|       |           // fogemorpheme
 3075|      0|           (in_compound ||
  ------------------
  |  Branch (3075:13): [True: 0, False: 0]
  ------------------
 3076|      0|            !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3076:16): [True: 0, False: 0]
  |  Branch (3076:35): [True: 0, False: 0]
  ------------------
 3077|      0|                                           sptr->getContLen()))))) &&
 3078|       |           // needaffix on first suffix
 3079|      0|           (cclass ||
  ------------------
  |  Branch (3079:13): [True: 0, False: 0]
  ------------------
 3080|      0|            !(sptr->getCont() &&
  ------------------
  |  Branch (3080:15): [True: 0, False: 0]
  ------------------
 3081|      0|              TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())))))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3082|      0|        rv = sptr->checkword(word, start, len, sfxopts, ppfx, cclass,
 3083|      0|                             needflag, FLAG_NULL, scratch);
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
 3084|      0|      while (rv) {
  ------------------
  |  Branch (3084:14): [True: 0, False: 0]
  ------------------
 3085|      0|        if (ppfx) {
  ------------------
  |  Branch (3085:13): [True: 0, False: 0]
  ------------------
 3086|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3086:15): [True: 0, False: 0]
  ------------------
 3087|      0|            result.append(ppfx->getMorph());
 3088|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3089|      0|          } else
 3090|      0|            debugflag(result, ppfx->getFlag());
 3091|      0|        }
 3092|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3092:13): [True: 0, False: 0]
  |  Branch (3092:32): [True: 0, False: 0]
  ------------------
 3093|      0|          result.append(HENTRY_DATA2(rv));
 3094|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (3094:13): [True: 0, False: 0]
  ------------------
 3095|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3096|      0|          result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 3097|      0|          result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 3098|      0|        }
 3099|       |
 3100|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3100:13): [True: 0, False: 0]
  |  Branch (3100:33): [True: 0, False: 0]
  ------------------
 3101|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3102|      0|          result.append(HENTRY_DATA2(rv));
 3103|      0|        }
 3104|       |
 3105|      0|        if (sptr->getMorph()) {
  ------------------
  |  Branch (3105:13): [True: 0, False: 0]
  ------------------
 3106|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3107|      0|          result.append(sptr->getMorph());
 3108|      0|        } else
 3109|      0|          debugflag(result, sptr->getFlag());
 3110|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 3111|      0|        rv = sptr->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3112|      0|      }
 3113|      0|      sptr = sptr->getNextEQ();
 3114|      7|    } else {
 3115|      7|      sptr = sptr->getNextNE();
 3116|      7|    }
 3117|      7|  }
 3118|       |
 3119|  12.7k|  return result;
 3120|  12.7k|}
_ZN8AffixMgr11affix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtc:
 3128|  11.5M|                                     char in_compound) {
 3129|       |
 3130|       |  // check all prefixes (also crossed with suffixes if allowed)
 3131|  11.5M|  struct hentry* rv = prefix_check(word, start, len, in_compound, scratch, needflag);
 3132|  11.5M|  if (rv)
  ------------------
  |  Branch (3132:7): [True: 0, False: 11.5M]
  ------------------
 3133|      0|    return rv;
 3134|       |
 3135|       |  // if still not found check all suffixes
 3136|  11.5M|  rv = suffix_check(word, start, len, 0, nullptr, scratch, FLAG_NULL, needflag, in_compound);
  ------------------
  |  |   96|  11.5M|#define FLAG_NULL 0x00
  ------------------
 3137|       |
 3138|  11.5M|  if (havecontclass) {
  ------------------
  |  Branch (3138:7): [True: 3.98M, False: 7.60M]
  ------------------
 3139|  3.98M|    sfx = nullptr;
 3140|  3.98M|    pfx = nullptr;
 3141|       |
 3142|  3.98M|    if (rv)
  ------------------
  |  Branch (3142:9): [True: 0, False: 3.98M]
  ------------------
 3143|      0|      return rv;
 3144|       |    // if still not found check all two-level suffixes
 3145|  3.98M|    rv = suffix_check_twosfx(word, start, len, 0, nullptr, scratch, needflag);
 3146|       |
 3147|  3.98M|    if (rv)
  ------------------
  |  Branch (3147:9): [True: 0, False: 3.98M]
  ------------------
 3148|      0|      return rv;
 3149|       |    // if still not found check all two-level suffixes
 3150|  3.98M|    rv = prefix_check_twosfx(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   72|  3.98M|#define IN_CPD_NOT 0
  ------------------
 3151|  3.98M|  }
 3152|       |
 3153|  11.5M|  return rv;
 3154|  11.5M|}
_ZN8AffixMgr17affix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtc:
 3162|  12.7k|                                  char in_compound) {
 3163|  12.7k|  std::string result;
 3164|       |
 3165|       |  // check all prefixes (also crossed with suffixes if allowed)
 3166|  12.7k|  std::string st = prefix_check_morph(word, start, len, in_compound, scratch);
 3167|  12.7k|  if (!st.empty()) {
  ------------------
  |  Branch (3167:7): [True: 0, False: 12.7k]
  ------------------
 3168|      0|    result.append(st);
 3169|      0|  }
 3170|       |
 3171|       |  // if still not found check all suffixes
 3172|  12.7k|  st = suffix_check_morph(word, start, len, 0, nullptr, scratch, '\0', needflag, in_compound);
 3173|  12.7k|  if (!st.empty()) {
  ------------------
  |  Branch (3173:7): [True: 0, False: 12.7k]
  ------------------
 3174|      0|    result.append(st);
 3175|      0|  }
 3176|       |
 3177|  12.7k|  if (havecontclass) {
  ------------------
  |  Branch (3177:7): [True: 3.96k, False: 8.77k]
  ------------------
 3178|  3.96k|    sfx = nullptr;
 3179|  3.96k|    pfx = nullptr;
 3180|       |    // if still not found check all two-level suffixes
 3181|  3.96k|    st = suffix_check_twosfx_morph(word, start, len, 0, nullptr, scratch, needflag);
 3182|  3.96k|    if (!st.empty()) {
  ------------------
  |  Branch (3182:9): [True: 0, False: 3.96k]
  ------------------
 3183|      0|      result.append(st);
 3184|      0|    }
 3185|       |
 3186|       |    // if still not found check all two-level suffixes
 3187|  3.96k|    st = prefix_check_twosfx_morph(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   72|  3.96k|#define IN_CPD_NOT 0
  ------------------
 3188|  3.96k|    if (!st.empty()) {
  ------------------
  |  Branch (3188:9): [True: 0, False: 3.96k]
  ------------------
 3189|      0|      result.append(st);
 3190|      0|    }
 3191|  3.96k|  }
 3192|       |
 3193|  12.7k|  return result;
 3194|  12.7k|}
_ZN8AffixMgr15expand_rootwordEP9guesswordiPKciPKttS3_iS3_:
 3382|   621k|                              const char* phon) {
 3383|   621k|  int nh = 0;
 3384|       |  // first add root word to list
 3385|   621k|  if ((nh < maxn) &&
  ------------------
  |  Branch (3385:7): [True: 621k, False: 0]
  ------------------
 3386|   621k|      !(al && ((needaffix && TESTAFF(ap, needaffix, al)) ||
  ------------------
  |  |   99|  4.66k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 2.33k, False: 2.33k]
  |  |  ------------------
  ------------------
  |  Branch (3386:9): [True: 98.8k, False: 522k]
  |  Branch (3386:17): [True: 4.66k, False: 94.1k]
  ------------------
 3387|   618k|               (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 (3387:17): [True: 0, False: 96.5k]
  ------------------
 3388|   618k|    wlst[nh].word = mystrdup(ts);
 3389|   618k|    wlst[nh].allow = false;
 3390|   618k|    wlst[nh].orig = nullptr;
 3391|   618k|    nh++;
 3392|       |    // add special phonetic version
 3393|   618k|    if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3393:9): [True: 826, False: 617k]
  |  Branch (3393:17): [True: 826, False: 0]
  ------------------
 3394|    826|      wlst[nh].word = mystrdup(phon);
 3395|    826|      wlst[nh].allow = false;
 3396|    826|      wlst[nh].orig = mystrdup(ts);
 3397|    826|      nh++;
 3398|    826|    }
 3399|   618k|  }
 3400|       |
 3401|       |  // handle suffixes
 3402|   732k|  for (int i = 0; i < al; i++) {
  ------------------
  |  Branch (3402:19): [True: 111k, False: 621k]
  ------------------
 3403|   111k|    const auto c = (unsigned char)(ap[i] & 0x00FF);
 3404|   111k|    SfxEntry* sptr = sFlag[c];
 3405|   176k|    while (sptr) {
  ------------------
  |  Branch (3405:12): [True: 65.5k, False: 111k]
  ------------------
 3406|  65.5k|      if ((sptr->getFlag() == ap[i]) &&
  ------------------
  |  Branch (3406:11): [True: 65.5k, False: 0]
  ------------------
 3407|  65.5k|          (!sptr->getKeyLen() ||
  ------------------
  |  Branch (3407:12): [True: 0, False: 65.5k]
  ------------------
 3408|  65.5k|           ((badl > sptr->getKeyLen()) &&
  ------------------
  |  Branch (3408:13): [True: 37.1k, False: 28.4k]
  ------------------
 3409|  37.1k|            (strcmp(sptr->getAffix(), bad + badl - sptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3409:13): [True: 53, False: 37.0k]
  ------------------
 3410|       |          // check needaffix flag
 3411|     53|          !(sptr->getCont() &&
  ------------------
  |  Branch (3411:13): [True: 26, False: 27]
  ------------------
 3412|     26|            ((needaffix &&
  ------------------
  |  Branch (3412:15): [True: 15, False: 11]
  ------------------
 3413|     15|              TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) ||
  ------------------
  |  |   99|     15|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 15]
  |  |  ------------------
  ------------------
 3414|     26|             (circumfix &&
  ------------------
  |  Branch (3414:15): [True: 0, False: 26]
  ------------------
 3415|      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]
  |  |  ------------------
  ------------------
 3416|     26|             (onlyincompound &&
  ------------------
  |  Branch (3416:15): [True: 0, False: 26]
  ------------------
 3417|     53|              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]
  |  |  ------------------
  ------------------
 3418|     53|        std::string newword = sptr->add(ts, wl);
 3419|     53|        if (!newword.empty()) {
  ------------------
  |  Branch (3419:13): [True: 53, False: 0]
  ------------------
 3420|     53|          if (nh < maxn) {
  ------------------
  |  Branch (3420:15): [True: 53, False: 0]
  ------------------
 3421|     53|            wlst[nh].word = mystrdup(newword.c_str());
 3422|     53|            wlst[nh].allow = sptr->allowCross();
 3423|     53|            wlst[nh].orig = nullptr;
 3424|     53|            nh++;
 3425|       |            // add special phonetic version
 3426|     53|            if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3426:17): [True: 0, False: 53]
  |  Branch (3426:25): [True: 0, False: 0]
  ------------------
 3427|      0|              std::string prefix(phon);
 3428|      0|              std::string key(sptr->getKey());
 3429|      0|              reverseword(key);
 3430|      0|              prefix.append(key);
 3431|      0|              wlst[nh].word = mystrdup(prefix.c_str());
 3432|      0|              wlst[nh].allow = false;
 3433|      0|              wlst[nh].orig = mystrdup(newword.c_str());
 3434|      0|              nh++;
 3435|      0|            }
 3436|     53|          }
 3437|     53|        }
 3438|     53|      }
 3439|  65.5k|      sptr = sptr->getFlgNxt();
 3440|  65.5k|    }
 3441|   111k|  }
 3442|       |
 3443|   621k|  int n = nh;
 3444|       |
 3445|       |  // handle cross products of prefixes and suffixes
 3446|   622k|  for (int j = 1; j < n; j++)
  ------------------
  |  Branch (3446:19): [True: 864, False: 621k]
  ------------------
 3447|    864|    if (wlst[j].allow) {
  ------------------
  |  Branch (3447:9): [True: 38, False: 826]
  ------------------
 3448|    114|      for (int k = 0; k < al; k++) {
  ------------------
  |  Branch (3448:23): [True: 76, False: 38]
  ------------------
 3449|     76|        const auto c = (unsigned char)(ap[k] & 0x00FF);
 3450|     76|        PfxEntry* cptr = pFlag[c];
 3451|     76|        while (cptr) {
  ------------------
  |  Branch (3451:16): [True: 0, False: 76]
  ------------------
 3452|      0|          if ((cptr->getFlag() == ap[k]) && cptr->allowCross() &&
  ------------------
  |  Branch (3452:15): [True: 0, False: 0]
  |  Branch (3452:45): [True: 0, False: 0]
  ------------------
 3453|      0|              (!cptr->getKeyLen() ||
  ------------------
  |  Branch (3453:16): [True: 0, False: 0]
  ------------------
 3454|      0|               ((badl > cptr->getKeyLen()) &&
  ------------------
  |  Branch (3454:17): [True: 0, False: 0]
  ------------------
 3455|      0|                (strncmp(cptr->getKey(), bad, cptr->getKeyLen()) == 0)))) {
  ------------------
  |  Branch (3455:17): [True: 0, False: 0]
  ------------------
 3456|      0|            int l1 = strlen(wlst[j].word);
 3457|      0|            std::string newword = cptr->add(wlst[j].word, l1);
 3458|      0|            if (!newword.empty()) {
  ------------------
  |  Branch (3458:17): [True: 0, False: 0]
  ------------------
 3459|      0|              if (nh < maxn) {
  ------------------
  |  Branch (3459:19): [True: 0, False: 0]
  ------------------
 3460|      0|                wlst[nh].word = mystrdup(newword.c_str());
 3461|      0|                wlst[nh].allow = cptr->allowCross();
 3462|      0|                wlst[nh].orig = nullptr;
 3463|      0|                nh++;
 3464|      0|              }
 3465|      0|            }
 3466|      0|          }
 3467|      0|          cptr = cptr->getFlgNxt();
 3468|      0|        }
 3469|     76|      }
 3470|     38|    }
 3471|       |
 3472|       |  // now handle pure prefixes
 3473|   732k|  for (int m = 0; m < al; m++) {
  ------------------
  |  Branch (3473:19): [True: 111k, False: 621k]
  ------------------
 3474|   111k|    const auto c = (unsigned char)(ap[m] & 0x00FF);
 3475|   111k|    PfxEntry* ptr = pFlag[c];
 3476|   112k|    while (ptr) {
  ------------------
  |  Branch (3476:12): [True: 840, False: 111k]
  ------------------
 3477|    840|      if ((ptr->getFlag() == ap[m]) &&
  ------------------
  |  Branch (3477:11): [True: 840, False: 0]
  ------------------
 3478|    840|          (!ptr->getKeyLen() ||
  ------------------
  |  Branch (3478:12): [True: 0, False: 840]
  ------------------
 3479|    840|           ((badl > ptr->getKeyLen()) &&
  ------------------
  |  Branch (3479:13): [True: 840, False: 0]
  ------------------
 3480|    840|            (strncmp(ptr->getKey(), bad, ptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3480:13): [True: 1, False: 839]
  ------------------
 3481|       |          // check needaffix flag
 3482|      1|          !(ptr->getCont() &&
  ------------------
  |  Branch (3482:13): [True: 0, False: 1]
  ------------------
 3483|      0|            ((needaffix &&
  ------------------
  |  Branch (3483:15): [True: 0, False: 0]
  ------------------
 3484|      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]
  |  |  ------------------
  ------------------
 3485|      0|             (circumfix &&
  ------------------
  |  Branch (3485:15): [True: 0, False: 0]
  ------------------
 3486|      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]
  |  |  ------------------
  ------------------
 3487|      0|             (onlyincompound &&
  ------------------
  |  Branch (3487:15): [True: 0, False: 0]
  ------------------
 3488|      1|              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]
  |  |  ------------------
  ------------------
 3489|      1|        std::string newword = ptr->add(ts, wl);
 3490|      1|        if (!newword.empty()) {
  ------------------
  |  Branch (3490:13): [True: 1, False: 0]
  ------------------
 3491|      1|          if (nh < maxn) {
  ------------------
  |  Branch (3491:15): [True: 1, False: 0]
  ------------------
 3492|      1|            wlst[nh].word = mystrdup(newword.c_str());
 3493|      1|            wlst[nh].allow = ptr->allowCross();
 3494|      1|            wlst[nh].orig = nullptr;
 3495|      1|            nh++;
 3496|      1|          }
 3497|      1|        }
 3498|      1|      }
 3499|    840|      ptr = ptr->getFlgNxt();
 3500|    840|    }
 3501|   111k|  }
 3502|       |
 3503|   621k|  return nh;
 3504|   621k|}
_ZNK8AffixMgr12get_reptableEv:
 3507|   376k|const std::vector<replentry>& AffixMgr::get_reptable() const {
 3508|   376k|  return pHMgr->get_reptable();
 3509|   376k|}
_ZNK8AffixMgr14get_iconvtableEv:
 3512|  10.3M|RepList* AffixMgr::get_iconvtable() const {
 3513|  10.3M|  if (!iconvtable)
  ------------------
  |  Branch (3513:7): [True: 10.0M, False: 344k]
  ------------------
 3514|  10.0M|    return nullptr;
 3515|   344k|  return iconvtable;
 3516|  10.3M|}
_ZNK8AffixMgr14get_oconvtableEv:
 3519|  98.5k|RepList* AffixMgr::get_oconvtable() const {
 3520|  98.5k|  if (!oconvtable)
  ------------------
  |  Branch (3520:7): [True: 93.2k, False: 5.25k]
  ------------------
 3521|  93.2k|    return nullptr;
 3522|  5.25k|  return oconvtable;
 3523|  98.5k|}
_ZNK8AffixMgr14get_phonetableEv:
 3526|  62.3k|struct phonetable* AffixMgr::get_phonetable() const {
 3527|  62.3k|  if (!phone)
  ------------------
  |  Branch (3527:7): [True: 58.7k, False: 3.54k]
  ------------------
 3528|  58.7k|    return nullptr;
 3529|  3.54k|  return phone;
 3530|  62.3k|}
_ZNK8AffixMgr12get_maptableEv:
 3533|   376k|const std::vector<mapentry>& AffixMgr::get_maptable() const {
 3534|   376k|  return maptable;
 3535|   376k|}
_ZNK8AffixMgr14get_breaktableEv:
 3538|     38|const std::vector<std::string>& AffixMgr::get_breaktable() const {
 3539|     38|  return breaktable;
 3540|     38|}
_ZN8AffixMgr12get_encodingEv:
 3543|     78|const std::string& AffixMgr::get_encoding() {
 3544|     78|  if (encoding.empty())
  ------------------
  |  Branch (3544:7): [True: 20, False: 58]
  ------------------
 3545|     20|    encoding = SPELL_ENCODING;
  ------------------
  |  |   99|     20|#define SPELL_ENCODING "ISO8859-1"
  ------------------
 3546|     78|  return encoding;
 3547|     78|}
_ZNK8AffixMgr11get_langnumEv:
 3550|     76|int AffixMgr::get_langnum() const {
 3551|     76|  return langnum;
 3552|     76|}
_ZNK8AffixMgr19get_complexprefixesEv:
 3555|     76|int AffixMgr::get_complexprefixes() const {
 3556|     76|  return complexprefixes;
 3557|     76|}
_ZNK8AffixMgr13get_fullstripEv:
 3560|  7.81k|int AffixMgr::get_fullstrip() const {
 3561|  7.81k|  return fullstrip;
 3562|  7.81k|}
_ZNK8AffixMgr12get_keepcaseEv:
 3564|   102k|FLAG AffixMgr::get_keepcase() const {
 3565|   102k|  return keepcase;
 3566|   102k|}
_ZNK8AffixMgr14get_forceucaseEv:
 3568|  20.5k|FLAG AffixMgr::get_forceucase() const {
 3569|  20.5k|  return forceucase;
 3570|  20.5k|}
_ZNK8AffixMgr8get_warnEv:
 3572|  27.8k|FLAG AffixMgr::get_warn() const {
 3573|  27.8k|  return warn;
 3574|  27.8k|}
_ZNK8AffixMgr14get_forbidwarnEv:
 3576|      4|int AffixMgr::get_forbidwarn() const {
 3577|      4|  return forbidwarn;
 3578|      4|}
_ZNK8AffixMgr15get_checksharpsEv:
 3580|   196k|int AffixMgr::get_checksharps() const {
 3581|   196k|  return checksharps;
 3582|   196k|}
_ZNK8AffixMgr10get_ignoreEv:
 3589|  21.8M|const char* AffixMgr::get_ignore() const {
 3590|  21.8M|  if (ignorechars.empty())
  ------------------
  |  Branch (3590:7): [True: 19.6M, False: 2.17M]
  ------------------
 3591|  19.6M|    return nullptr;
 3592|  2.17M|  return ignorechars.c_str();
 3593|  21.8M|}
_ZNK8AffixMgr16get_ignore_utf16Ev:
 3596|   512k|const std::vector<w_char>& AffixMgr::get_ignore_utf16() const {
 3597|   512k|  return ignorechars_utf16;
 3598|   512k|}
_ZN8AffixMgr14get_key_stringEv:
 3601|     38|const std::string& AffixMgr::get_key_string() {
 3602|     38|  if (keystring.empty())
  ------------------
  |  Branch (3602:7): [True: 38, False: 0]
  ------------------
 3603|     38|    keystring = SPELL_KEYSTRING;
  ------------------
  |  |  100|     38|#define SPELL_KEYSTRING "qwertyuiop|asdfghjkl|zxcvbnm"
  ------------------
 3604|     38|  return keystring;
 3605|     38|}
_ZNK8AffixMgr14get_try_stringEv:
 3608|     38|const std::string& AffixMgr::get_try_string() const {
 3609|     38|  return trystring;
 3610|     38|}
_ZNK8AffixMgr12get_compoundEv:
 3622|  67.9M|int AffixMgr::get_compound() const {
 3623|  67.9M|  return compoundflag || compoundbegin || !defcpdtable.empty();
  ------------------
  |  Branch (3623:10): [True: 17.0M, False: 50.8M]
  |  Branch (3623:26): [True: 0, False: 50.8M]
  |  Branch (3623:43): [True: 0, False: 50.8M]
  ------------------
 3624|  67.9M|}
_ZNK8AffixMgr16get_compoundflagEv:
 3627|  39.2k|FLAG AffixMgr::get_compoundflag() const {
 3628|  39.2k|  return compoundflag;
 3629|  39.2k|}
_ZNK8AffixMgr17get_forbiddenwordEv:
 3632|   161k|FLAG AffixMgr::get_forbiddenword() const {
 3633|   161k|  return forbiddenword;
 3634|   161k|}
_ZNK8AffixMgr13get_nosuggestEv:
 3637|  62.7k|FLAG AffixMgr::get_nosuggest() const {
 3638|  62.7k|  return nosuggest;
 3639|  62.7k|}
_ZNK8AffixMgr18get_nongramsuggestEv:
 3642|  62.3k|FLAG AffixMgr::get_nongramsuggest() const {
 3643|  62.3k|  return nongramsuggest;
 3644|  62.3k|}
_ZNK8AffixMgr15get_substandardEv:
 3647|    372|FLAG AffixMgr::get_substandard() const {
 3648|    372|  return substandard;
 3649|    372|}
_ZNK8AffixMgr13get_needaffixEv:
 3652|  2.89k|FLAG AffixMgr::get_needaffix() const {
 3653|  2.89k|  return needaffix;
 3654|  2.89k|}
_ZNK8AffixMgr18get_onlyincompoundEv:
 3657|  64.7k|FLAG AffixMgr::get_onlyincompound() const {
 3658|  64.7k|  return onlyincompound;
 3659|  64.7k|}
_ZN8AffixMgr6lookupEPKcm:
 3667|   514M|struct hentry* AffixMgr::lookup(const char* word, size_t len) {
 3668|   514M|  struct hentry* he = nullptr;
 3669|  1.02G|  for (size_t i = 0; i < alldic.size() && !he; ++i) {
  ------------------
  |  Branch (3669:22): [True: 514M, False: 514M]
  |  Branch (3669:43): [True: 514M, False: 0]
  ------------------
 3670|   514M|    he = alldic[i]->lookup(word, len);
 3671|   514M|  }
 3672|   514M|  return he;
 3673|   514M|}
_ZNK8AffixMgr14have_contclassEv:
 3676|  29.6M|int AffixMgr::have_contclass() const {
 3677|  29.6M|  return havecontclass;
 3678|  29.6M|}
_ZNK8AffixMgr8get_utf8Ev:
 3681|     76|int AffixMgr::get_utf8() const {
 3682|     76|  return utf8;
 3683|     76|}
_ZNK8AffixMgr16get_maxngramsugsEv:
 3685|  69.9k|int AffixMgr::get_maxngramsugs() const {
 3686|  69.9k|  return maxngramsugs;
 3687|  69.9k|}
_ZNK8AffixMgr14get_maxcpdsugsEv:
 3689|     38|int AffixMgr::get_maxcpdsugs() const {
 3690|     38|  return maxcpdsugs;
 3691|     38|}
_ZNK8AffixMgr11get_maxdiffEv:
 3693|  48.4k|int AffixMgr::get_maxdiff() const {
 3694|  48.4k|  return maxdiff;
 3695|  48.4k|}
_ZNK8AffixMgr15get_onlymaxdiffEv:
 3697|  7.56k|int AffixMgr::get_onlymaxdiff() const {
 3698|  7.56k|  return onlymaxdiff;
 3699|  7.56k|}
_ZNK8AffixMgr15get_nosplitsugsEv:
 3702|     38|int AffixMgr::get_nosplitsugs() const {
 3703|     38|  return nosplitsugs;
 3704|     38|}
_ZNK8AffixMgr16get_sugswithdotsEv:
 3707|  3.70k|int AffixMgr::get_sugswithdots() const {
 3708|  3.70k|  return sugswithdots;
 3709|  3.70k|}
_ZN8AffixMgr10parse_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPtP7FileMgr:
 3712|     22|bool AffixMgr::parse_flag(const std::string& line, unsigned short* out, FileMgr* af) {
 3713|     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 (3713:7): [True: 2, False: 20]
  |  Branch (3713:28): [True: 0, False: 2]
  ------------------
 3714|      0|    HUNSPELL_WARNING(
 3715|      0|        stderr,
 3716|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 3717|      0|        af->getlinenum());
 3718|      0|    return false;
 3719|      0|  }
 3720|     22|  std::string s;
 3721|     22|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (3721:7): [True: 0, False: 22]
  ------------------
 3722|      0|    return false;
 3723|     22|  *out = pHMgr->decode_flag(s);
 3724|     22|  return true;
 3725|     22|}
_ZN8AffixMgr9parse_numERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiP7FileMgr:
 3728|     10|bool AffixMgr::parse_num(const std::string& line, int* out, FileMgr* af) {
 3729|     10|  if (*out != -1) {
  ------------------
  |  Branch (3729:7): [True: 0, False: 10]
  ------------------
 3730|      0|    HUNSPELL_WARNING(
 3731|      0|        stderr,
 3732|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 3733|      0|        af->getlinenum());
 3734|      0|    return false;
 3735|      0|  }
 3736|     10|  std::string s;
 3737|     10|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (3737:7): [True: 0, False: 10]
  ------------------
 3738|      0|    return false;
 3739|     10|  *out = atoi(s.c_str());
 3740|     10|  return true;
 3741|     10|}
_ZN8AffixMgr17parse_cpdsyllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 3744|      2|bool AffixMgr::parse_cpdsyllable(const std::string& line, FileMgr* af) {
 3745|      2|  int i = 0;
 3746|      2|  int np = 0;
 3747|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3748|      8|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3748:10): [True: 6, False: 2]
  ------------------
 3749|      6|    switch (i) {
 3750|      2|      case 0: {
  ------------------
  |  Branch (3750:7): [True: 2, False: 4]
  ------------------
 3751|      2|        np++;
 3752|      2|        break;
 3753|      0|      }
 3754|      2|      case 1: {
  ------------------
  |  Branch (3754:7): [True: 2, False: 4]
  ------------------
 3755|      2|        cpdmaxsyllable = atoi(std::string(start_piece, iter).c_str());
 3756|      2|        np++;
 3757|      2|        break;
 3758|      0|      }
 3759|      2|      case 2: {
  ------------------
  |  Branch (3759:7): [True: 2, False: 4]
  ------------------
 3760|      2|        if (!utf8) {
  ------------------
  |  Branch (3760:13): [True: 0, False: 2]
  ------------------
 3761|      0|          cpdvowels.assign(start_piece, iter);
 3762|      0|          std::sort(cpdvowels.begin(), cpdvowels.end());
 3763|      2|        } else {
 3764|      2|          std::string piece(start_piece, iter);
 3765|      2|          u8_u16(cpdvowels_utf16, piece);
 3766|      2|          std::sort(cpdvowels_utf16.begin(), cpdvowels_utf16.end());
 3767|      2|        }
 3768|      2|        np++;
 3769|      2|        break;
 3770|      0|      }
 3771|      0|      default:
  ------------------
  |  Branch (3771:7): [True: 0, False: 6]
  ------------------
 3772|      0|        break;
 3773|      6|    }
 3774|      6|    ++i;
 3775|      6|    start_piece = mystrsep(line, iter);
 3776|      6|  }
 3777|      2|  if (np < 2) {
  ------------------
  |  Branch (3777:7): [True: 0, False: 2]
  ------------------
 3778|      0|    HUNSPELL_WARNING(stderr,
 3779|      0|                     "error: line %d: missing compoundsyllable information\n",
 3780|      0|                     af->getlinenum());
 3781|      0|    return false;
 3782|      0|  }
 3783|      2|  if (np == 2)
  ------------------
  |  Branch (3783:7): [True: 0, False: 2]
  ------------------
 3784|      0|    cpdvowels = "AEIOUaeiou";
 3785|      2|  return true;
 3786|      2|}
_ZN8AffixMgr15parse_convtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgrPP7RepListS8_:
 3791|      4|                              const std::string& keyword) {
 3792|      4|  if (*rl) {
  ------------------
  |  Branch (3792:7): [True: 0, False: 4]
  ------------------
 3793|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 3794|      0|                     af->getlinenum());
 3795|      0|    return false;
 3796|      0|  }
 3797|      4|  int i = 0;
 3798|      4|  int np = 0;
 3799|      4|  int numrl = 0;
 3800|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3801|     18|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3801:10): [True: 14, False: 4]
  ------------------
 3802|     14|    switch (i) {
 3803|      4|      case 0: {
  ------------------
  |  Branch (3803:7): [True: 4, False: 10]
  ------------------
 3804|      4|        np++;
 3805|      4|        break;
 3806|      0|      }
 3807|      4|      case 1: {
  ------------------
  |  Branch (3807:7): [True: 4, False: 10]
  ------------------
 3808|      4|        numrl = atoi(std::string(start_piece, iter).c_str());
 3809|      4|        if (numrl < 1) {
  ------------------
  |  Branch (3809:13): [True: 0, False: 4]
  ------------------
 3810|      0|          HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n",
 3811|      0|                           af->getlinenum());
 3812|      0|          return false;
 3813|      0|        }
 3814|      4|        *rl = new RepList(numrl);
 3815|      4|        if (!*rl)
  ------------------
  |  Branch (3815:13): [True: 0, False: 4]
  ------------------
 3816|      0|          return false;
 3817|      4|        np++;
 3818|      4|        break;
 3819|      4|      }
 3820|      6|      default:
  ------------------
  |  Branch (3820:7): [True: 6, False: 8]
  ------------------
 3821|      6|        break;
 3822|     14|    }
 3823|     14|    ++i;
 3824|     14|    start_piece = mystrsep(line, iter);
 3825|     14|  }
 3826|      4|  if (np != 2) {
  ------------------
  |  Branch (3826:7): [True: 0, False: 4]
  ------------------
 3827|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 3828|      0|                     af->getlinenum());
 3829|      0|    return false;
 3830|      0|  }
 3831|       |
 3832|       |  /* now parse the num lines to read in the remainder of the table */
 3833|     26|  for (int j = 0; j < numrl; j++) {
  ------------------
  |  Branch (3833:19): [True: 22, False: 4]
  ------------------
 3834|     22|    std::string nl;
 3835|     22|    if (!af->getline(nl))
  ------------------
  |  Branch (3835:9): [True: 0, False: 22]
  ------------------
 3836|      0|      return false;
 3837|     22|    mychomp(nl);
 3838|     22|    i = 0;
 3839|     22|    std::string pattern;
 3840|     22|    std::string pattern2;
 3841|     22|    iter = nl.begin();
 3842|     22|    start_piece = mystrsep(nl, iter);
 3843|    130|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (3843:12): [True: 108, False: 22]
  ------------------
 3844|    108|      {
 3845|    108|        switch (i) {
 3846|     22|          case 0: {
  ------------------
  |  Branch (3846:11): [True: 22, False: 86]
  ------------------
 3847|     22|            if (nl.compare(start_piece - nl.begin(), keyword.size(), keyword, 0, keyword.size()) != 0) {
  ------------------
  |  Branch (3847:17): [True: 0, False: 22]
  ------------------
 3848|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3849|      0|                               af->getlinenum());
 3850|      0|              delete *rl;
 3851|      0|              *rl = nullptr;
 3852|      0|              return false;
 3853|      0|            }
 3854|     22|            break;
 3855|     22|          }
 3856|     22|          case 1: {
  ------------------
  |  Branch (3856:11): [True: 22, False: 86]
  ------------------
 3857|     22|            pattern.assign(start_piece, iter);
 3858|     22|            break;
 3859|     22|          }
 3860|     22|          case 2: {
  ------------------
  |  Branch (3860:11): [True: 22, False: 86]
  ------------------
 3861|     22|            pattern2.assign(start_piece, iter);
 3862|     22|            break;
 3863|     22|          }
 3864|     42|          default:
  ------------------
  |  Branch (3864:11): [True: 42, False: 66]
  ------------------
 3865|     42|            break;
 3866|    108|        }
 3867|    108|        ++i;
 3868|    108|      }
 3869|      0|      start_piece = mystrsep(nl, iter);
 3870|    108|    }
 3871|     22|    if (pattern.empty() || pattern2.empty()) {
  ------------------
  |  Branch (3871:9): [True: 0, False: 22]
  |  Branch (3871:28): [True: 0, False: 22]
  ------------------
 3872|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3873|      0|                       af->getlinenum());
 3874|      0|      return false;
 3875|      0|    }
 3876|       |
 3877|     22|    (*rl)->add(pattern, pattern2);
 3878|     22|  }
 3879|      4|  return true;
 3880|      4|}
_ZN8AffixMgr16parse_phonetableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 3883|      2|bool AffixMgr::parse_phonetable(const std::string& line, FileMgr* af) {
 3884|      2|  if (phone) {
  ------------------
  |  Branch (3884:7): [True: 0, False: 2]
  ------------------
 3885|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 3886|      0|                     af->getlinenum());
 3887|      0|    return false;
 3888|      0|  }
 3889|      2|  std::unique_ptr<phonetable> new_phone;
 3890|      2|  int num = -1;
 3891|      2|  int i = 0;
 3892|      2|  int np = 0;
 3893|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3894|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3894:10): [True: 4, False: 2]
  ------------------
 3895|      4|    switch (i) {
 3896|      2|      case 0: {
  ------------------
  |  Branch (3896:7): [True: 2, False: 2]
  ------------------
 3897|      2|        np++;
 3898|      2|        break;
 3899|      0|      }
 3900|      2|      case 1: {
  ------------------
  |  Branch (3900:7): [True: 2, False: 2]
  ------------------
 3901|      2|        num = atoi(std::string(start_piece, iter).c_str());
 3902|      2|        if (num < 1) {
  ------------------
  |  Branch (3902:13): [True: 0, False: 2]
  ------------------
 3903|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 3904|      0|                           af->getlinenum());
 3905|      0|          return false;
 3906|      0|        }
 3907|      2|        new_phone = std::make_unique<phonetable>();
 3908|      2|        new_phone->utf8 = (char)utf8;
 3909|      2|        np++;
 3910|      2|        break;
 3911|      2|      }
 3912|      0|      default:
  ------------------
  |  Branch (3912:7): [True: 0, False: 4]
  ------------------
 3913|      0|        break;
 3914|      4|    }
 3915|      4|    ++i;
 3916|      4|    start_piece = mystrsep(line, iter);
 3917|      4|  }
 3918|      2|  if (np != 2) {
  ------------------
  |  Branch (3918:7): [True: 0, False: 2]
  ------------------
 3919|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 3920|      0|                     af->getlinenum());
 3921|      0|    return false;
 3922|      0|  }
 3923|       |
 3924|       |  /* now parse the phone->num lines to read in the remainder of the table */
 3925|    212|  for (int j = 0; j < num; ++j) {
  ------------------
  |  Branch (3925:19): [True: 210, False: 2]
  ------------------
 3926|    210|    std::string nl;
 3927|    210|    if (!af->getline(nl))
  ------------------
  |  Branch (3927:9): [True: 0, False: 210]
  ------------------
 3928|      0|      return false;
 3929|    210|    mychomp(nl);
 3930|    210|    i = 0;
 3931|    210|    const size_t old_size = new_phone->rules.size();
 3932|    210|    iter = nl.begin();
 3933|    210|    start_piece = mystrsep(nl, iter);
 3934|    840|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (3934:12): [True: 630, False: 210]
  ------------------
 3935|    630|      {
 3936|    630|        switch (i) {
 3937|    210|          case 0: {
  ------------------
  |  Branch (3937:11): [True: 210, False: 420]
  ------------------
 3938|    210|            if (nl.compare(start_piece - nl.begin(), 5, "PHONE", 5) != 0) {
  ------------------
  |  Branch (3938:17): [True: 0, False: 210]
  ------------------
 3939|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3940|      0|                               af->getlinenum());
 3941|      0|              return false;
 3942|      0|            }
 3943|    210|            break;
 3944|    210|          }
 3945|    210|          case 1: {
  ------------------
  |  Branch (3945:11): [True: 210, False: 420]
  ------------------
 3946|    210|            new_phone->rules.emplace_back(start_piece, iter);
 3947|    210|            break;
 3948|    210|          }
 3949|    210|          case 2: {
  ------------------
  |  Branch (3949:11): [True: 210, False: 420]
  ------------------
 3950|    210|            new_phone->rules.emplace_back(start_piece, iter);
 3951|    210|            mystrrep(new_phone->rules.back(), "_", "");
 3952|    210|            break;
 3953|    210|          }
 3954|      0|          default:
  ------------------
  |  Branch (3954:11): [True: 0, False: 630]
  ------------------
 3955|      0|            break;
 3956|    630|        }
 3957|    630|        ++i;
 3958|    630|      }
 3959|      0|      start_piece = mystrsep(nl, iter);
 3960|    630|    }
 3961|    210|    if (new_phone->rules.size() != old_size + 2) {
  ------------------
  |  Branch (3961:9): [True: 0, False: 210]
  ------------------
 3962|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3963|      0|                       af->getlinenum());
 3964|      0|      return false;
 3965|      0|    }
 3966|    210|  }
 3967|      2|  new_phone->rules.emplace_back("");
 3968|      2|  new_phone->rules.emplace_back("");
 3969|      2|  init_phonet_hash(*new_phone);
 3970|      2|  phone = new_phone.release();
 3971|      2|  return true;
 3972|      2|}
_ZN8AffixMgr19parse_checkcpdtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 3975|      2|bool AffixMgr::parse_checkcpdtable(const std::string& line, FileMgr* af) {
 3976|      2|  if (parsedcheckcpd) {
  ------------------
  |  Branch (3976:7): [True: 0, False: 2]
  ------------------
 3977|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 3978|      0|                     af->getlinenum());
 3979|      0|    return false;
 3980|      0|  }
 3981|      2|  parsedcheckcpd = true;
 3982|      2|  int numcheckcpd = -1;
 3983|      2|  int i = 0;
 3984|      2|  int np = 0;
 3985|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3986|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3986:10): [True: 4, False: 2]
  ------------------
 3987|      4|    switch (i) {
 3988|      2|      case 0: {
  ------------------
  |  Branch (3988:7): [True: 2, False: 2]
  ------------------
 3989|      2|        np++;
 3990|      2|        break;
 3991|      0|      }
 3992|      2|      case 1: {
  ------------------
  |  Branch (3992:7): [True: 2, False: 2]
  ------------------
 3993|      2|        numcheckcpd = atoi(std::string(start_piece, iter).c_str());
 3994|      2|        if (numcheckcpd < 1) {
  ------------------
  |  Branch (3994:13): [True: 0, False: 2]
  ------------------
 3995|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 3996|      0|                           af->getlinenum());
 3997|      0|          return false;
 3998|      0|        }
 3999|      2|        checkcpdtable.reserve(std::min(numcheckcpd, 16384));
 4000|      2|        np++;
 4001|      2|        break;
 4002|      2|      }
 4003|      0|      default:
  ------------------
  |  Branch (4003:7): [True: 0, False: 4]
  ------------------
 4004|      0|        break;
 4005|      4|    }
 4006|      4|    ++i;
 4007|      4|    start_piece = mystrsep(line, iter);
 4008|      4|  }
 4009|      2|  if (np != 2) {
  ------------------
  |  Branch (4009:7): [True: 0, False: 2]
  ------------------
 4010|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4011|      0|                     af->getlinenum());
 4012|      0|    return false;
 4013|      0|  }
 4014|       |
 4015|       |  /* now parse the numcheckcpd lines to read in the remainder of the table */
 4016|      6|  for (int j = 0; j < numcheckcpd; ++j) {
  ------------------
  |  Branch (4016:19): [True: 4, False: 2]
  ------------------
 4017|      4|    std::string nl;
 4018|      4|    if (!af->getline(nl))
  ------------------
  |  Branch (4018:9): [True: 0, False: 4]
  ------------------
 4019|      0|      return false;
 4020|      4|    mychomp(nl);
 4021|      4|    i = 0;
 4022|      4|    checkcpdtable.emplace_back();
 4023|      4|    iter = nl.begin();
 4024|      4|    start_piece = mystrsep(nl, iter);
 4025|     16|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4025:12): [True: 12, False: 4]
  ------------------
 4026|     12|      switch (i) {
 4027|      4|        case 0: {
  ------------------
  |  Branch (4027:9): [True: 4, False: 8]
  ------------------
 4028|      4|          if (nl.compare(start_piece - nl.begin(), 20, "CHECKCOMPOUNDPATTERN", 20) != 0) {
  ------------------
  |  Branch (4028:15): [True: 0, False: 4]
  ------------------
 4029|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4030|      0|                             af->getlinenum());
 4031|      0|            checkcpdtable.clear();
 4032|      0|            return false;
 4033|      0|          }
 4034|      4|          break;
 4035|      4|        }
 4036|      4|        case 1: {
  ------------------
  |  Branch (4036:9): [True: 4, False: 8]
  ------------------
 4037|      4|          checkcpdtable.back().pattern.assign(start_piece, iter);
 4038|      4|          size_t slash_pos = checkcpdtable.back().pattern.find('/');
 4039|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4039:15): [True: 0, False: 4]
  ------------------
 4040|      0|            std::string chunk(checkcpdtable.back().pattern, slash_pos + 1);
 4041|      0|            checkcpdtable.back().pattern.resize(slash_pos);
 4042|      0|            checkcpdtable.back().cond = pHMgr->decode_flag(chunk);
 4043|      0|          }
 4044|      4|          break;
 4045|      4|        }
 4046|      4|        case 2: {
  ------------------
  |  Branch (4046:9): [True: 4, False: 8]
  ------------------
 4047|      4|          checkcpdtable.back().pattern2.assign(start_piece, iter);
 4048|      4|          size_t slash_pos = checkcpdtable.back().pattern2.find('/');
 4049|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4049:15): [True: 0, False: 4]
  ------------------
 4050|      0|            std::string chunk(checkcpdtable.back().pattern2, slash_pos + 1);
 4051|      0|            checkcpdtable.back().pattern2.resize(slash_pos);
 4052|      0|            checkcpdtable.back().cond2 = pHMgr->decode_flag(chunk);
 4053|      0|          }
 4054|      4|          break;
 4055|      4|        }
 4056|      0|        case 3: {
  ------------------
  |  Branch (4056:9): [True: 0, False: 12]
  ------------------
 4057|      0|          checkcpdtable.back().pattern3.assign(start_piece, iter);
 4058|      0|          simplifiedcpd = 1;
 4059|      0|          break;
 4060|      4|        }
 4061|      0|        default:
  ------------------
  |  Branch (4061:9): [True: 0, False: 12]
  ------------------
 4062|      0|          break;
 4063|     12|      }
 4064|     12|      i++;
 4065|     12|      start_piece = mystrsep(nl, iter);
 4066|     12|    }
 4067|      4|  }
 4068|      2|  return true;
 4069|      2|}
_ZN8AffixMgr14parse_maptableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4173|      2|bool AffixMgr::parse_maptable(const std::string& line, FileMgr* af) {
 4174|      2|  if (parsedmaptable) {
  ------------------
  |  Branch (4174:7): [True: 0, False: 2]
  ------------------
 4175|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4176|      0|                     af->getlinenum());
 4177|      0|    return false;
 4178|      0|  }
 4179|      2|  parsedmaptable = true;
 4180|      2|  int nummap = -1;
 4181|      2|  int i = 0;
 4182|      2|  int np = 0;
 4183|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4184|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4184:10): [True: 4, False: 2]
  ------------------
 4185|      4|    switch (i) {
 4186|      2|      case 0: {
  ------------------
  |  Branch (4186:7): [True: 2, False: 2]
  ------------------
 4187|      2|        np++;
 4188|      2|        break;
 4189|      0|      }
 4190|      2|      case 1: {
  ------------------
  |  Branch (4190:7): [True: 2, False: 2]
  ------------------
 4191|      2|        nummap = atoi(std::string(start_piece, iter).c_str());
 4192|      2|        if (nummap < 1) {
  ------------------
  |  Branch (4192:13): [True: 0, False: 2]
  ------------------
 4193|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4194|      0|                           af->getlinenum());
 4195|      0|          return false;
 4196|      0|        }
 4197|      2|        maptable.reserve(std::min(nummap, 16384));
 4198|      2|        np++;
 4199|      2|        break;
 4200|      2|      }
 4201|      0|      default:
  ------------------
  |  Branch (4201:7): [True: 0, False: 4]
  ------------------
 4202|      0|        break;
 4203|      4|    }
 4204|      4|    ++i;
 4205|      4|    start_piece = mystrsep(line, iter);
 4206|      4|  }
 4207|      2|  if (np != 2) {
  ------------------
  |  Branch (4207:7): [True: 0, False: 2]
  ------------------
 4208|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4209|      0|                     af->getlinenum());
 4210|      0|    return false;
 4211|      0|  }
 4212|       |
 4213|       |  /* now parse the nummap lines to read in the remainder of the table */
 4214|      8|  for (int j = 0; j < nummap; ++j) {
  ------------------
  |  Branch (4214:19): [True: 6, False: 2]
  ------------------
 4215|      6|    std::string nl;
 4216|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4216:9): [True: 0, False: 6]
  ------------------
 4217|      0|      return false;
 4218|      6|    mychomp(nl);
 4219|      6|    i = 0;
 4220|      6|    maptable.emplace_back();
 4221|      6|    iter = nl.begin();
 4222|      6|    start_piece = mystrsep(nl, iter);
 4223|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4223:12): [True: 12, False: 6]
  ------------------
 4224|     12|      switch (i) {
 4225|      6|        case 0: {
  ------------------
  |  Branch (4225:9): [True: 6, False: 6]
  ------------------
 4226|      6|          if (nl.compare(start_piece - nl.begin(), 3, "MAP", 3) != 0) {
  ------------------
  |  Branch (4226:15): [True: 0, False: 6]
  ------------------
 4227|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4228|      0|                             af->getlinenum());
 4229|      0|            nummap = 0;
 4230|      0|            return false;
 4231|      0|          }
 4232|      6|          break;
 4233|      6|        }
 4234|      6|        case 1: {
  ------------------
  |  Branch (4234:9): [True: 6, False: 6]
  ------------------
 4235|     22|          for (auto k = start_piece; k != iter; ++k) {
  ------------------
  |  Branch (4235:38): [True: 16, False: 6]
  ------------------
 4236|     16|            auto chb = k, che = k + 1;
 4237|     16|            if (*k == '(') {
  ------------------
  |  Branch (4237:17): [True: 2, False: 14]
  ------------------
 4238|      2|              auto parpos = std::find(k, iter, ')');
 4239|      2|              if (parpos != iter) {
  ------------------
  |  Branch (4239:19): [True: 2, False: 0]
  ------------------
 4240|      2|                chb = k + 1;
 4241|      2|                che = parpos;
 4242|      2|                k = parpos;
 4243|      2|              }
 4244|     14|            } else {
 4245|     14|              if (utf8 && (*k & 0xc0) == 0xc0) {
  ------------------
  |  Branch (4245:19): [True: 14, False: 0]
  |  Branch (4245:27): [True: 10, False: 4]
  ------------------
 4246|     10|                ++k;
 4247|     20|                while (k != iter && is_utf8_cont(*k))
  ------------------
  |  Branch (4247:24): [True: 18, False: 2]
  |  Branch (4247:37): [True: 10, False: 8]
  ------------------
 4248|     10|                    ++k;
 4249|     10|                che = k;
 4250|     10|                --k;
 4251|     10|              }
 4252|     14|            }
 4253|     16|            if (chb == che) {
  ------------------
  |  Branch (4253:17): [True: 0, False: 16]
  ------------------
 4254|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4255|      0|                              af->getlinenum());
 4256|      0|            }
 4257|       |
 4258|     16|            maptable.back().emplace_back(chb, che);
 4259|     16|          }
 4260|      6|          break;
 4261|      6|        }
 4262|      0|        default:
  ------------------
  |  Branch (4262:9): [True: 0, False: 12]
  ------------------
 4263|      0|          break;
 4264|     12|      }
 4265|     12|      ++i;
 4266|     12|      start_piece = mystrsep(nl, iter);
 4267|     12|    }
 4268|      6|    if (maptable.back().empty()) {
  ------------------
  |  Branch (4268:9): [True: 0, False: 6]
  ------------------
 4269|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4270|      0|                       af->getlinenum());
 4271|      0|      return false;
 4272|      0|    }
 4273|      6|  }
 4274|      2|  return true;
 4275|      2|}
_ZN8AffixMgr16parse_breaktableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4278|      4|bool AffixMgr::parse_breaktable(const std::string& line, FileMgr* af) {
 4279|      4|  if (parsedbreaktable) {
  ------------------
  |  Branch (4279:7): [True: 0, False: 4]
  ------------------
 4280|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4281|      0|                     af->getlinenum());
 4282|      0|    return false;
 4283|      0|  }
 4284|      4|  parsedbreaktable = true;
 4285|      4|  int numbreak = -1;
 4286|      4|  int i = 0;
 4287|      4|  int np = 0;
 4288|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4289|     12|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4289:10): [True: 8, False: 4]
  ------------------
 4290|      8|    switch (i) {
 4291|      4|      case 0: {
  ------------------
  |  Branch (4291:7): [True: 4, False: 4]
  ------------------
 4292|      4|        np++;
 4293|      4|        break;
 4294|      0|      }
 4295|      4|      case 1: {
  ------------------
  |  Branch (4295:7): [True: 4, False: 4]
  ------------------
 4296|      4|        numbreak = atoi(std::string(start_piece, iter).c_str());
 4297|      4|        if (numbreak < 0) {
  ------------------
  |  Branch (4297:13): [True: 0, False: 4]
  ------------------
 4298|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4299|      0|                           af->getlinenum());
 4300|      0|          return false;
 4301|      0|        }
 4302|      4|        if (numbreak == 0)
  ------------------
  |  Branch (4302:13): [True: 0, False: 4]
  ------------------
 4303|      0|          return true;
 4304|      4|        breaktable.reserve(std::min(numbreak, 16384));
 4305|      4|        np++;
 4306|      4|        break;
 4307|      4|      }
 4308|      0|      default:
  ------------------
  |  Branch (4308:7): [True: 0, False: 8]
  ------------------
 4309|      0|        break;
 4310|      8|    }
 4311|      8|    ++i;
 4312|      8|    start_piece = mystrsep(line, iter);
 4313|      8|  }
 4314|      4|  if (np != 2) {
  ------------------
  |  Branch (4314:7): [True: 0, False: 4]
  ------------------
 4315|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4316|      0|                     af->getlinenum());
 4317|      0|    return false;
 4318|      0|  }
 4319|       |
 4320|       |  /* now parse the numbreak lines to read in the remainder of the table */
 4321|     10|  for (int j = 0; j < numbreak; ++j) {
  ------------------
  |  Branch (4321:19): [True: 6, False: 4]
  ------------------
 4322|      6|    std::string nl;
 4323|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4323:9): [True: 0, False: 6]
  ------------------
 4324|      0|      return false;
 4325|      6|    mychomp(nl);
 4326|      6|    i = 0;
 4327|      6|    iter = nl.begin();
 4328|      6|    start_piece = mystrsep(nl, iter);
 4329|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4329:12): [True: 12, False: 6]
  ------------------
 4330|     12|      switch (i) {
 4331|      6|        case 0: {
  ------------------
  |  Branch (4331:9): [True: 6, False: 6]
  ------------------
 4332|      6|          if (nl.compare(start_piece - nl.begin(), 5, "BREAK", 5) != 0) {
  ------------------
  |  Branch (4332:15): [True: 0, False: 6]
  ------------------
 4333|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4334|      0|                             af->getlinenum());
 4335|      0|            numbreak = 0;
 4336|      0|            return false;
 4337|      0|          }
 4338|      6|          break;
 4339|      6|        }
 4340|      6|        case 1: {
  ------------------
  |  Branch (4340:9): [True: 6, False: 6]
  ------------------
 4341|      6|          breaktable.emplace_back(start_piece, iter);
 4342|      6|          break;
 4343|      6|        }
 4344|      0|        default:
  ------------------
  |  Branch (4344:9): [True: 0, False: 12]
  ------------------
 4345|      0|          break;
 4346|     12|      }
 4347|     12|      ++i;
 4348|     12|      start_piece = mystrsep(nl, iter);
 4349|     12|    }
 4350|      6|  }
 4351|       |
 4352|      4|  if (breaktable.size() != static_cast<size_t>(numbreak)) {
  ------------------
  |  Branch (4352:7): [True: 0, False: 4]
  ------------------
 4353|      0|    HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4354|      0|                     af->getlinenum());
 4355|      0|    return false;
 4356|      0|  }
 4357|       |
 4358|      4|  return true;
 4359|      4|}
_ZN8AffixMgr17reverse_conditionERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 4361|     38|void AffixMgr::reverse_condition(std::string& piece) {
 4362|     38|  if (piece.empty())
  ------------------
  |  Branch (4362:7): [True: 0, False: 38]
  ------------------
 4363|      0|      return;
 4364|       |
 4365|     38|  int neg = 0;
 4366|       |  // iterate backwards; k wraps to npos (SIZE_MAX) when decremented past 0
 4367|     92|  for (size_t k = piece.size() - 1; k != std::string::npos; --k) {
  ------------------
  |  Branch (4367:37): [True: 54, False: 38]
  ------------------
 4368|     54|    switch (piece[k]) {
 4369|      2|      case '[': {
  ------------------
  |  Branch (4369:7): [True: 2, False: 52]
  ------------------
 4370|      2|        if (neg)
  ------------------
  |  Branch (4370:13): [True: 0, False: 2]
  ------------------
 4371|      0|          piece[k + 1] = '[';
 4372|      2|        else
 4373|      2|          piece[k] = ']';
 4374|      2|        break;
 4375|      0|      }
 4376|      2|      case ']': {
  ------------------
  |  Branch (4376:7): [True: 2, False: 52]
  ------------------
 4377|      2|        piece[k] = '[';
 4378|      2|        if (neg)
  ------------------
  |  Branch (4378:13): [True: 0, False: 2]
  ------------------
 4379|      0|          piece[k + 1] = '^';
 4380|      2|        neg = 0;
 4381|      2|        break;
 4382|      0|      }
 4383|      0|      case '^': {
  ------------------
  |  Branch (4383:7): [True: 0, False: 54]
  ------------------
 4384|      0|        if (piece[k + 1] == ']')
  ------------------
  |  Branch (4384:13): [True: 0, False: 0]
  ------------------
 4385|      0|          neg = 1;
 4386|      0|        else if (neg)
  ------------------
  |  Branch (4386:18): [True: 0, False: 0]
  ------------------
 4387|      0|          piece[k + 1] = piece[k];
 4388|      0|        break;
 4389|      0|      }
 4390|     50|      default: {
  ------------------
  |  Branch (4390:7): [True: 50, False: 4]
  ------------------
 4391|     50|        if (neg)
  ------------------
  |  Branch (4391:13): [True: 0, False: 50]
  ------------------
 4392|      0|          piece[k + 1] = piece[k];
 4393|     50|      }
 4394|     54|    }
 4395|     54|  }
 4396|     38|}
_ZN8AffixMgr11parse_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEcP7FileMgrPc:
 4450|     26|                          char* dupflags) {
 4451|     26|  int numents = 0;  // number of AffEntry structures to parse
 4452|       |
 4453|     26|  unsigned short aflag = 0;  // affix char identifier
 4454|       |
 4455|     26|  char ff = 0;
 4456|     26|  entries_container affentries(at, this);
 4457|       |
 4458|     26|  int i = 0;
 4459|       |
 4460|       |// checking lines with bad syntax
 4461|       |#ifdef DEBUG
 4462|       |  int basefieldnum = 0;
 4463|       |#endif
 4464|       |
 4465|       |  // split affix header line into pieces
 4466|       |
 4467|     26|  int np = 0;
 4468|     26|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4469|    130|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4469:10): [True: 104, False: 26]
  ------------------
 4470|    104|    switch (i) {
 4471|       |      // piece 1 - is type of affix
 4472|     26|      case 0: {
  ------------------
  |  Branch (4472:7): [True: 26, False: 78]
  ------------------
 4473|     26|        np++;
 4474|     26|        break;
 4475|      0|      }
 4476|       |
 4477|       |      // piece 2 - is affix char
 4478|     26|      case 1: {
  ------------------
  |  Branch (4478:7): [True: 26, False: 78]
  ------------------
 4479|     26|        np++;
 4480|     26|        aflag = pHMgr->decode_flag(std::string(start_piece, iter));
 4481|     26|        if (((at == 'S') && (dupflags[aflag] & dupSFX)) ||
  ------------------
  |  |   88|     18|#define dupSFX (1 << 0)
  ------------------
  |  Branch (4481:14): [True: 18, False: 8]
  |  Branch (4481:29): [True: 0, False: 18]
  ------------------
 4482|     26|            ((at == 'P') && (dupflags[aflag] & dupPFX))) {
  ------------------
  |  |   89|      8|#define dupPFX (1 << 1)
  ------------------
  |  Branch (4482:14): [True: 8, False: 18]
  |  Branch (4482:29): [True: 0, False: 8]
  ------------------
 4483|      0|          HUNSPELL_WARNING(
 4484|      0|              stderr,
 4485|      0|              "error: line %d: multiple definitions of an affix flag\n",
 4486|      0|              af->getlinenum());
 4487|      0|        }
 4488|     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 (4488:35): [True: 18, False: 8]
  ------------------
 4489|     26|        break;
 4490|      0|      }
 4491|       |      // piece 3 - is cross product indicator
 4492|     26|      case 2: {
  ------------------
  |  Branch (4492:7): [True: 26, False: 78]
  ------------------
 4493|     26|        np++;
 4494|     26|        if (*start_piece == 'Y')
  ------------------
  |  Branch (4494:13): [True: 26, False: 0]
  ------------------
 4495|     26|          ff = aeXPRODUCT;
  ------------------
  |  |   65|     26|#define aeXPRODUCT (1 << 0)
  ------------------
 4496|     26|        break;
 4497|      0|      }
 4498|       |
 4499|       |      // piece 4 - is number of affentries
 4500|     26|      case 3: {
  ------------------
  |  Branch (4500:7): [True: 26, False: 78]
  ------------------
 4501|     26|        np++;
 4502|     26|        numents = atoi(std::string(start_piece, iter).c_str());
 4503|     26|        if ((numents <= 0) || ((std::numeric_limits<size_t>::max() /
  ------------------
  |  Branch (4503:13): [True: 0, False: 26]
  |  Branch (4503:31): [True: 0, False: 26]
  ------------------
 4504|     26|                                sizeof(AffEntry)) < static_cast<size_t>(numents))) {
 4505|      0|          std::string err = pHMgr->encode_flag(aflag);
 4506|      0|          HUNSPELL_WARNING(stderr, "error: line %d: affix %s: bad entry number\n",
 4507|      0|                           af->getlinenum(), err.c_str());
 4508|      0|          return false;
 4509|      0|        }
 4510|       |
 4511|     26|        char opts = ff;
 4512|     26|        if (utf8)
  ------------------
  |  Branch (4512:13): [True: 6, False: 20]
  ------------------
 4513|      6|          opts |= aeUTF8;
  ------------------
  |  |   66|      6|#define aeUTF8 (1 << 1)
  ------------------
 4514|     26|        if (pHMgr->is_aliasf())
  ------------------
  |  Branch (4514:13): [True: 4, False: 22]
  ------------------
 4515|      4|          opts |= aeALIASF;
  ------------------
  |  |   67|      4|#define aeALIASF (1 << 2)
  ------------------
 4516|     26|        if (pHMgr->is_aliasm())
  ------------------
  |  Branch (4516:13): [True: 0, False: 26]
  ------------------
 4517|      0|          opts |= aeALIASM;
  ------------------
  |  |   68|      0|#define aeALIASM (1 << 3)
  ------------------
 4518|     26|        affentries.initialize(numents, opts, aflag);
 4519|     26|      }
 4520|       |
 4521|     26|      default:
  ------------------
  |  Branch (4521:7): [True: 0, False: 104]
  ------------------
 4522|     26|        break;
 4523|    104|    }
 4524|    104|    ++i;
 4525|    104|    start_piece = mystrsep(line, iter);
 4526|    104|  }
 4527|       |  // check to make sure we parsed enough pieces
 4528|     26|  if (np != 4) {
  ------------------
  |  Branch (4528:7): [True: 0, False: 26]
  ------------------
 4529|      0|    std::string err = pHMgr->encode_flag(aflag);
 4530|      0|    HUNSPELL_WARNING(stderr, "error: line %d: affix %s: missing data\n",
 4531|      0|                     af->getlinenum(), err.c_str());
 4532|      0|    return false;
 4533|      0|  }
 4534|       |
 4535|       |  // now parse numents affentries for this affix
 4536|     26|  AffEntry* entry = affentries.first_entry();
 4537|     68|  for (int ent = 0; ent < numents; ++ent) {
  ------------------
  |  Branch (4537:21): [True: 42, False: 26]
  ------------------
 4538|     42|    std::string nl;
 4539|     42|    if (!af->getline(nl))
  ------------------
  |  Branch (4539:9): [True: 0, False: 42]
  ------------------
 4540|      0|      return false;
 4541|     42|    mychomp(nl);
 4542|       |
 4543|     42|    iter = nl.begin();
 4544|     42|    i = 0;
 4545|     42|    np = 0;
 4546|       |
 4547|       |    // split line into pieces
 4548|     42|    start_piece = mystrsep(nl, iter);
 4549|    258|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4549:12): [True: 216, False: 42]
  ------------------
 4550|    216|      switch (i) {
 4551|       |        // piece 1 - is type
 4552|     42|        case 0: {
  ------------------
  |  Branch (4552:9): [True: 42, False: 174]
  ------------------
 4553|     42|          np++;
 4554|     42|          if (ent != 0)
  ------------------
  |  Branch (4554:15): [True: 16, False: 26]
  ------------------
 4555|     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)
  ------------------
 4556|     42|          break;
 4557|      0|        }
 4558|       |
 4559|       |        // piece 2 - is affix char
 4560|     42|        case 1: {
  ------------------
  |  Branch (4560:9): [True: 42, False: 174]
  ------------------
 4561|     42|          np++;
 4562|     42|          std::string chunk(start_piece, iter);
 4563|     42|          if (pHMgr->decode_flag(chunk) != aflag) {
  ------------------
  |  Branch (4563:15): [True: 0, False: 42]
  ------------------
 4564|      0|            std::string err = pHMgr->encode_flag(aflag);
 4565|      0|            HUNSPELL_WARNING(stderr,
 4566|      0|                             "error: line %d: affix %s is corrupt\n",
 4567|      0|                             af->getlinenum(), err.c_str());
 4568|      0|            return false;
 4569|      0|          }
 4570|       |
 4571|     42|          if (ent != 0) {
  ------------------
  |  Branch (4571:15): [True: 16, False: 26]
  ------------------
 4572|     16|            AffEntry* start_entry = affentries.first_entry();
 4573|     16|            entry->aflag = start_entry->aflag;
 4574|     16|          }
 4575|     42|          break;
 4576|     42|        }
 4577|       |
 4578|       |        // piece 3 - is string to strip or 0 for null
 4579|     42|        case 2: {
  ------------------
  |  Branch (4579:9): [True: 42, False: 174]
  ------------------
 4580|     42|          np++;
 4581|     42|          entry->strip = std::string(start_piece, iter);
 4582|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4582:15): [True: 4, False: 38]
  ------------------
 4583|      4|            if (utf8)
  ------------------
  |  Branch (4583:17): [True: 0, False: 4]
  ------------------
 4584|      0|              reverseword_utf(entry->strip);
 4585|      4|            else
 4586|      4|              reverseword(entry->strip);
 4587|      4|          }
 4588|     42|          if (entry->strip.compare("0") == 0) {
  ------------------
  |  Branch (4588:15): [True: 36, False: 6]
  ------------------
 4589|     36|            entry->strip.clear();
 4590|     36|          }
 4591|     42|          break;
 4592|     42|        }
 4593|       |
 4594|       |        // piece 4 - is affix string or 0 for null
 4595|     42|        case 3: {
  ------------------
  |  Branch (4595:9): [True: 42, False: 174]
  ------------------
 4596|     42|          entry->morphcode = nullptr;
 4597|     42|          entry->contclass = nullptr;
 4598|     42|          entry->contclasslen = 0;
 4599|     42|          np++;
 4600|     42|          std::string::const_iterator dash = std::find(start_piece, iter, '/');
 4601|     42|          if (dash != iter) {
  ------------------
  |  Branch (4601:15): [True: 18, False: 24]
  ------------------
 4602|     18|            entry->appnd = std::string(start_piece, dash);
 4603|     18|            std::string dash_str(dash + 1, iter);
 4604|       |
 4605|     18|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4605:17): [True: 2, False: 16]
  |  Branch (4605:41): [True: 0, False: 2]
  ------------------
 4606|      0|              if (utf8) {
  ------------------
  |  Branch (4606:19): [True: 0, False: 0]
  ------------------
 4607|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4608|      0|              } else {
 4609|      0|                remove_ignored_chars(entry->appnd, ignorechars);
 4610|      0|              }
 4611|      0|            }
 4612|       |
 4613|     18|            if (complexprefixes) {
  ------------------
  |  Branch (4613:17): [True: 2, False: 16]
  ------------------
 4614|      2|              if (utf8)
  ------------------
  |  Branch (4614:19): [True: 0, False: 2]
  ------------------
 4615|      0|                reverseword_utf(entry->appnd);
 4616|      2|              else
 4617|      2|                reverseword(entry->appnd);
 4618|      2|            }
 4619|       |
 4620|     18|            if (pHMgr->is_aliasf()) {
  ------------------
  |  Branch (4620:17): [True: 2, False: 16]
  ------------------
 4621|      2|              int index = atoi(dash_str.c_str());
 4622|      2|              entry->contclasslen = (unsigned short)pHMgr->get_aliasf(
 4623|      2|                  index, &(entry->contclass), af);
 4624|      2|              if (!entry->contclasslen)
  ------------------
  |  Branch (4624:19): [True: 0, False: 2]
  ------------------
 4625|      0|                HUNSPELL_WARNING(stderr,
 4626|      0|                                 "error: bad affix flag alias: \"%s\"\n",
 4627|      0|                                 dash_str.c_str());
 4628|     16|            } else {
 4629|     16|              entry->contclasslen = (unsigned short)pHMgr->decode_flags(
 4630|     16|                  &(entry->contclass), dash_str, af);
 4631|     16|              std::sort(entry->contclass, entry->contclass + entry->contclasslen);
 4632|     16|            }
 4633|       |
 4634|     18|            havecontclass = 1;
 4635|     44|            for (unsigned short _i = 0; _i < entry->contclasslen; _i++) {
  ------------------
  |  Branch (4635:41): [True: 26, False: 18]
  ------------------
 4636|     26|              contclasses[(entry->contclass)[_i]] = 1;
 4637|     26|            }
 4638|     24|          } else {
 4639|     24|            entry->appnd = std::string(start_piece, iter);
 4640|       |
 4641|     24|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4641:17): [True: 2, False: 22]
  |  Branch (4641:41): [True: 2, False: 0]
  ------------------
 4642|      2|              if (utf8) {
  ------------------
  |  Branch (4642:19): [True: 0, False: 2]
  ------------------
 4643|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4644|      2|              } else {
 4645|      2|                remove_ignored_chars(entry->appnd, ignorechars);
 4646|      2|              }
 4647|      2|            }
 4648|       |
 4649|     24|            if (complexprefixes) {
  ------------------
  |  Branch (4649:17): [True: 2, False: 22]
  ------------------
 4650|      2|              if (utf8)
  ------------------
  |  Branch (4650:19): [True: 0, False: 2]
  ------------------
 4651|      0|                reverseword_utf(entry->appnd);
 4652|      2|              else
 4653|      2|                reverseword(entry->appnd);
 4654|      2|            }
 4655|     24|          }
 4656|       |
 4657|     42|          if (entry->appnd.compare("0") == 0) {
  ------------------
  |  Branch (4657:15): [True: 2, False: 40]
  ------------------
 4658|      2|            entry->appnd.clear();
 4659|      2|          }
 4660|     42|          break;
 4661|     42|        }
 4662|       |
 4663|       |        // piece 5 - is the conditions descriptions
 4664|     42|        case 4: {
  ------------------
  |  Branch (4664:9): [True: 42, False: 174]
  ------------------
 4665|     42|          std::string chunk(start_piece, iter);
 4666|     42|          np++;
 4667|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4667:15): [True: 4, False: 38]
  ------------------
 4668|      4|            if (utf8)
  ------------------
  |  Branch (4668:17): [True: 0, False: 4]
  ------------------
 4669|      0|              reverseword_utf(chunk);
 4670|      4|            else
 4671|      4|              reverseword(chunk);
 4672|      4|            reverse_condition(chunk);
 4673|      4|          }
 4674|     42|          if (!entry->strip.empty() && chunk != "." &&
  ------------------
  |  Branch (4674:15): [True: 6, False: 36]
  |  Branch (4674:40): [True: 6, False: 0]
  ------------------
 4675|      6|              redundant_condition(at, entry->strip, chunk,
  ------------------
  |  Branch (4675:15): [True: 6, False: 0]
  ------------------
 4676|      6|                                  af->getlinenum()))
 4677|      6|            chunk = ".";
 4678|     42|          if (at == 'S') {
  ------------------
  |  Branch (4678:15): [True: 34, False: 8]
  ------------------
 4679|     34|            reverseword(chunk);
 4680|     34|            reverse_condition(chunk);
 4681|     34|          }
 4682|     42|          if (encodeit(*entry, chunk))
  ------------------
  |  Branch (4682:15): [True: 0, False: 42]
  ------------------
 4683|      0|            return false;
 4684|     42|          break;
 4685|     42|        }
 4686|       |
 4687|     42|        case 5: {
  ------------------
  |  Branch (4687:9): [True: 6, False: 210]
  ------------------
 4688|      6|          std::string chunk(start_piece, iter);
 4689|      6|          np++;
 4690|      6|          if (pHMgr->is_aliasm()) {
  ------------------
  |  Branch (4690:15): [True: 0, False: 6]
  ------------------
 4691|      0|            int index = atoi(chunk.c_str());
 4692|      0|            entry->morphcode = pHMgr->get_aliasm(index);
 4693|      6|          } else {
 4694|      6|            if (complexprefixes) {  // XXX - fix me for morph. gen.
  ------------------
  |  Branch (4694:17): [True: 0, False: 6]
  ------------------
 4695|      0|              if (utf8)
  ------------------
  |  Branch (4695:19): [True: 0, False: 0]
  ------------------
 4696|      0|                reverseword_utf(chunk);
 4697|      0|              else
 4698|      0|                reverseword(chunk);
 4699|      0|            }
 4700|       |            // add the remaining of the line
 4701|      6|            std::string::const_iterator end = nl.end();
 4702|      6|            if (iter != end) {
  ------------------
  |  Branch (4702:17): [True: 0, False: 6]
  ------------------
 4703|      0|              chunk.append(iter, end);
 4704|      0|            }
 4705|      6|            entry->morphcode = mystrdup(chunk.c_str());
 4706|      6|          }
 4707|      6|          break;
 4708|     42|        }
 4709|      0|        default:
  ------------------
  |  Branch (4709:9): [True: 0, False: 216]
  ------------------
 4710|      0|          break;
 4711|    216|      }
 4712|    216|      i++;
 4713|    216|      start_piece = mystrsep(nl, iter);
 4714|    216|    }
 4715|       |    // check to make sure we parsed enough pieces
 4716|     42|    if (np < 4) {
  ------------------
  |  Branch (4716:9): [True: 0, False: 42]
  ------------------
 4717|      0|      std::string err = pHMgr->encode_flag(aflag);
 4718|      0|      HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n",
 4719|      0|                       af->getlinenum(), err.c_str());
 4720|      0|      return false;
 4721|      0|    }
 4722|       |
 4723|       |#ifdef DEBUG
 4724|       |    // detect unnecessary fields, excepting comments
 4725|       |    if (basefieldnum) {
 4726|       |      int fieldnum =
 4727|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 4728|       |      if (fieldnum != basefieldnum)
 4729|       |        HUNSPELL_WARNING(stderr, "warning: line %d: bad field number\n",
 4730|       |                         af->getlinenum());
 4731|       |    } else {
 4732|       |      basefieldnum =
 4733|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 4734|       |    }
 4735|       |#endif
 4736|     42|  }
 4737|       |
 4738|       |  // now create SfxEntry or PfxEntry objects and use links to
 4739|       |  // build an ordered (sorted by affix string) list
 4740|     26|  auto start = affentries.begin(), end = affentries.end();
 4741|     68|  for (auto affentry = start; affentry != end; ++affentry) {
  ------------------
  |  Branch (4741:31): [True: 42, False: 26]
  ------------------
 4742|     42|    if (at == 'P') {
  ------------------
  |  Branch (4742:9): [True: 8, False: 34]
  ------------------
 4743|      8|      build_pfxtree(static_cast<PfxEntry*>(*affentry));
 4744|     34|    } else {
 4745|     34|      build_sfxtree(static_cast<SfxEntry*>(*affentry));
 4746|     34|    }
 4747|     42|  }
 4748|       |
 4749|       |  //contents belong to AffixMgr now
 4750|     26|  affentries.release();
 4751|       |
 4752|     26|  return true;
 4753|     26|}
_ZN8AffixMgr19redundant_conditionEcRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 4758|      6|                                  int linenum) {
 4759|      6|  int stripl = strip.size(), condl = cond.size(), i, j, neg, in;
 4760|      6|  if (ft == 'P') {  // prefix
  ------------------
  |  Branch (4760:7): [True: 0, False: 6]
  ------------------
 4761|      0|    if (strip.compare(0, condl, cond) == 0)
  ------------------
  |  Branch (4761:9): [True: 0, False: 0]
  ------------------
 4762|      0|      return 1;
 4763|      0|    if (utf8) {
  ------------------
  |  Branch (4763:9): [True: 0, False: 0]
  ------------------
 4764|      0|    } else {
 4765|      0|      for (i = 0, j = 0; (i < stripl) && (j < condl); i++, j++) {
  ------------------
  |  Branch (4765:26): [True: 0, False: 0]
  |  Branch (4765:42): [True: 0, False: 0]
  ------------------
 4766|      0|        if (cond[j] != '[') {
  ------------------
  |  Branch (4766:13): [True: 0, False: 0]
  ------------------
 4767|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (4767:15): [True: 0, False: 0]
  ------------------
 4768|      0|            HUNSPELL_WARNING(stderr,
 4769|      0|                             "warning: line %d: incompatible stripping "
 4770|      0|                             "characters and condition\n",
 4771|      0|                             linenum);
 4772|      0|            return 0;
 4773|      0|          }
 4774|      0|        } else {
 4775|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (4775:17): [True: 0, False: 0]
  ------------------
 4776|      0|          in = 0;
 4777|      0|          do {
 4778|      0|            j++;
 4779|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (4779:17): [True: 0, False: 0]
  ------------------
 4780|      0|              in = 1;
 4781|      0|          } while ((j < (condl - 1)) && (cond[j] != ']'));
  ------------------
  |  Branch (4781:20): [True: 0, False: 0]
  |  Branch (4781:41): [True: 0, False: 0]
  ------------------
 4782|      0|          if (j == (condl - 1) && (cond[j] != ']')) {
  ------------------
  |  Branch (4782:15): [True: 0, False: 0]
  |  Branch (4782:35): [True: 0, False: 0]
  ------------------
 4783|      0|            HUNSPELL_WARNING(stderr,
 4784|      0|                             "error: line %d: missing ] in condition:\n%s\n",
 4785|      0|                             linenum, cond.c_str());
 4786|      0|            return 0;
 4787|      0|          }
 4788|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (4788:16): [True: 0, False: 0]
  |  Branch (4788:24): [True: 0, False: 0]
  |  Branch (4788:33): [True: 0, False: 0]
  |  Branch (4788:40): [True: 0, False: 0]
  ------------------
 4789|      0|            HUNSPELL_WARNING(stderr,
 4790|      0|                             "warning: line %d: incompatible stripping "
 4791|      0|                             "characters and condition\n",
 4792|      0|                             linenum);
 4793|      0|            return 0;
 4794|      0|          }
 4795|      0|        }
 4796|      0|      }
 4797|      0|      if (j >= condl)
  ------------------
  |  Branch (4797:11): [True: 0, False: 0]
  ------------------
 4798|      0|        return 1;
 4799|      0|    }
 4800|      6|  } else {  // suffix
 4801|      6|    if ((stripl >= condl) && strip.compare(stripl - condl, std::string::npos, cond) == 0)
  ------------------
  |  Branch (4801:9): [True: 6, False: 0]
  |  Branch (4801:30): [True: 6, False: 0]
  ------------------
 4802|      6|      return 1;
 4803|      0|    if (utf8) {
  ------------------
  |  Branch (4803:9): [True: 0, False: 0]
  ------------------
 4804|      0|    } else {
 4805|      0|      for (i = stripl - 1, j = condl - 1; (i >= 0) && (j >= 0); i--, j--) {
  ------------------
  |  Branch (4805:43): [True: 0, False: 0]
  |  Branch (4805:55): [True: 0, False: 0]
  ------------------
 4806|      0|        if (cond[j] != ']') {
  ------------------
  |  Branch (4806:13): [True: 0, False: 0]
  ------------------
 4807|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (4807:15): [True: 0, False: 0]
  ------------------
 4808|      0|            HUNSPELL_WARNING(stderr,
 4809|      0|                             "warning: line %d: incompatible stripping "
 4810|      0|                             "characters and condition\n",
 4811|      0|                             linenum);
 4812|      0|            return 0;
 4813|      0|          }
 4814|      0|        } else if (j > 0) {
  ------------------
  |  Branch (4814:20): [True: 0, False: 0]
  ------------------
 4815|      0|          in = 0;
 4816|      0|          do {
 4817|      0|            j--;
 4818|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (4818:17): [True: 0, False: 0]
  ------------------
 4819|      0|              in = 1;
 4820|      0|          } while ((j > 0) && (cond[j] != '['));
  ------------------
  |  Branch (4820:20): [True: 0, False: 0]
  |  Branch (4820:31): [True: 0, False: 0]
  ------------------
 4821|      0|          if ((j == 0) && (cond[j] != '[')) {
  ------------------
  |  Branch (4821:15): [True: 0, False: 0]
  |  Branch (4821:27): [True: 0, False: 0]
  ------------------
 4822|      0|            HUNSPELL_WARNING(stderr,
 4823|      0|                             "error: line: %d: missing ] in condition:\n%s\n",
 4824|      0|                             linenum, cond.c_str());
 4825|      0|            return 0;
 4826|      0|          }
 4827|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (4827:17): [True: 0, False: 0]
  ------------------
 4828|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (4828:16): [True: 0, False: 0]
  |  Branch (4828:24): [True: 0, False: 0]
  |  Branch (4828:33): [True: 0, False: 0]
  |  Branch (4828:40): [True: 0, False: 0]
  ------------------
 4829|      0|            HUNSPELL_WARNING(stderr,
 4830|      0|                             "warning: line %d: incompatible stripping "
 4831|      0|                             "characters and condition\n",
 4832|      0|                             linenum);
 4833|      0|            return 0;
 4834|      0|          }
 4835|      0|        }
 4836|      0|      }
 4837|      0|      if (j < 0)
  ------------------
  |  Branch (4837:11): [True: 0, False: 0]
  ------------------
 4838|      0|        return 1;
 4839|      0|    }
 4840|      0|  }
 4841|      0|  return 0;
 4842|      6|}
_ZN8AffixMgr8isSubsetEPKcS1_:
 1069|   115k|inline int AffixMgr::isSubset(const char* s1, const char* s2) {
 1070|   159k|  while (((*s1 == *s2) || (*s1 == '.')) && (*s1 != '\0') && (*s2 != '\0')) {
  ------------------
  |  Branch (1070:11): [True: 116k, False: 43.1k]
  |  Branch (1070:27): [True: 0, False: 43.1k]
  |  Branch (1070:44): [True: 44.0k, False: 72.5k]
  |  Branch (1070:61): [True: 44.0k, False: 0]
  ------------------
 1071|  44.0k|    s1++;
 1072|  44.0k|    s2++;
 1073|  44.0k|  }
 1074|   115k|  return (*s1 == '\0');
 1075|   115k|}
_ZN8AffixMgr11isRevSubsetEPKcS1_i:
 2714|   461k|                                 int len) {
 2715|   923k|  while ((len > 0) && (*s1 != '\0') && ((*s1 == *end_of_s2) || (*s1 == '.'))) {
  ------------------
  |  Branch (2715:10): [True: 919k, False: 3.58k]
  |  Branch (2715:23): [True: 514k, False: 405k]
  |  Branch (2715:41): [True: 462k, False: 52.2k]
  |  Branch (2715:64): [True: 0, False: 52.2k]
  ------------------
 2716|   462k|    s1++;
 2717|   462k|    end_of_s2--;
 2718|   462k|    len--;
 2719|   462k|  }
 2720|   461k|  return (*s1 == '\0');
 2721|   461k|}
affixmgr.cxx:_ZN12_GLOBAL__N_18mystrdupEPKc:
 3363|   620k|  char* mystrdup(const char* s) {
 3364|   620k|    char* d = nullptr;
 3365|   620k|    if (s) {
  ------------------
  |  Branch (3365:9): [True: 620k, False: 0]
  ------------------
 3366|   620k|      size_t sl = strlen(s) + 1;
 3367|   620k|      d = new char[sl];
 3368|   620k|      memcpy(d, s, sl);
 3369|   620k|    }
 3370|   620k|    return d;
 3371|   620k|  }
_ZN17entries_containerC2EcP8AffixMgr:
 4404|     26|    : m_mgr(mgr)
 4405|     26|    , m_at(at) {
 4406|     26|  }
_ZN17entries_container10initializeEict:
 4411|     26|                  char opts, unsigned short aflag) {
 4412|     26|    entries.reserve(std::min(numents, 16384));
 4413|       |
 4414|     26|    if (m_at == 'P') {
  ------------------
  |  Branch (4414:9): [True: 8, False: 18]
  ------------------
 4415|      8|      entries.push_back(new PfxEntry(m_mgr));
 4416|     18|    } else {
 4417|     18|      entries.push_back(new SfxEntry(m_mgr));
 4418|     18|    }
 4419|       |
 4420|     26|    entries.back()->opts = opts;
 4421|     26|    entries.back()->aflag = aflag;
 4422|     26|  }
_ZN17entries_container11first_entryEv:
 4435|     42|  AffEntry* first_entry() { return entries.empty() ? nullptr : entries[0]; }
  ------------------
  |  Branch (4435:36): [True: 0, False: 42]
  ------------------
_ZN17entries_container9add_entryEc:
 4424|     16|  AffEntry* add_entry(char opts) {
 4425|     16|    if (m_at == 'P') {
  ------------------
  |  Branch (4425:9): [True: 0, False: 16]
  ------------------
 4426|      0|      entries.push_back(new PfxEntry(m_mgr));
 4427|     16|    } else {
 4428|     16|      entries.push_back(new SfxEntry(m_mgr));
 4429|     16|    }
 4430|     16|    AffEntry* ret = entries.back();
 4431|     16|    ret->opts = entries[0]->opts & opts;
 4432|     16|    return ret;
 4433|     16|  }
_ZN17entries_container5beginEv:
 4443|     26|  std::vector<AffEntry*>::iterator begin() { return entries.begin(); }
_ZN17entries_container3endEv:
 4444|     26|  std::vector<AffEntry*>::iterator end() { return entries.end(); }
_ZN17entries_container7releaseEv:
 4407|     26|  void release() {
 4408|     26|    entries.clear();
 4409|     26|  }
_ZN17entries_containerD2Ev:
 4437|     26|  ~entries_container() {
 4438|     26|    for (auto& entry : entries) {
  ------------------
  |  Branch (4438:22): [True: 0, False: 26]
  ------------------
 4439|      0|      delete entry;
 4440|      0|    }
 4441|     26|  }
affixmgr.cxx:_ZZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEENK3$_1clE6w_char:
 1568|  1.68k|          [&](w_char wc) {
 1569|  1.68k|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1570|  1.68k|          });

_ZN9guesswordC2Ev:
  115|  4.84M|    : word(nullptr)
  116|  4.84M|    , allow(false)
  117|  4.84M|    , orig(nullptr)
  118|  4.84M|  {
  119|  4.84M|  }
_ZN8patentryC2Ev:
  132|      4|    : cond(FLAG_NULL)
  ------------------
  |  |   96|      4|#define FLAG_NULL 0x00
  ------------------
  133|      4|    , cond2(FLAG_NULL) {
  ------------------
  |  |   96|      4|#define FLAG_NULL 0x00
  ------------------
  134|      4|  }
csutil.cxx:_ZL16HUNSPELL_WARNINGP8_IO_FILEPKcz:
   48|  1.46M|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:
  110|    114|{
  111|       |#if defined(_WIN32) && defined(_MSC_VER)
  112|       |#define WIN32_LONG_PATH_PREFIX "\\\\?\\"
  113|       |  if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
  114|       |    int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
  115|       |    wchar_t* buff = new wchar_t[len];
  116|       |    wchar_t* buff2 = new wchar_t[len];
  117|       |    MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
  118|       |    if (_wfullpath(buff2, buff, len) != NULL) {
  119|       |      stream.open(buff2, mode);
  120|       |    }
  121|       |    delete [] buff;
  122|       |    delete [] buff2;
  123|       |  }
  124|       |  else
  125|       |#endif
  126|    114|  stream.open(path, mode);
  127|    114|}
_Z6u16_u8RNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEE:
  134|  20.9M|std::string& u16_u8(std::string& dest, const std::vector<w_char>& src) {
  135|  20.9M|  dest.clear();
  136|  20.9M|  dest.reserve(src.size());
  137|   555M|  for (const w_char& wc : src) {
  ------------------
  |  Branch (137:25): [True: 555M, False: 20.9M]
  ------------------
  138|   555M|    uint16_t cp = (static_cast<uint16_t>(wc.h) << 8) | wc.l;
  139|   555M|    if (cp < 0x80) {
  ------------------
  |  Branch (139:9): [True: 480M, False: 75.0M]
  ------------------
  140|   480M|      dest.push_back(static_cast<char>(cp));
  141|   480M|    } else if (cp < 0x800) {
  ------------------
  |  Branch (141:16): [True: 2.13M, False: 72.9M]
  ------------------
  142|  2.13M|      dest.push_back(static_cast<char>(0xc0 | (cp >> 6)));
  143|  2.13M|      dest.push_back(static_cast<char>(0x80 | (cp & 0x3f)));
  144|  72.9M|    } else {
  145|  72.9M|      dest.push_back(static_cast<char>(0xe0 | (cp >> 12)));
  146|  72.9M|      dest.push_back(static_cast<char>(0x80 | ((cp >> 6) & 0x3f)));
  147|  72.9M|      dest.push_back(static_cast<char>(0x80 | (cp & 0x3f)));
  148|  72.9M|    }
  149|   555M|  }
  150|  20.9M|  return dest;
  151|  20.9M|}
_Z6u8_u16RNSt3__16vectorI6w_charNS_9allocatorIS1_EEEERKNS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEb:
  169|  3.64M|int u8_u16(std::vector<w_char>& dest, const std::string& src, bool only_convert_first_letter) {
  170|       |  // faster to oversize initially, assign to elements and resize to what's used
  171|       |  // than to reserve and push_back
  172|  3.64M|  dest.resize(only_convert_first_letter ? 1 : src.size());
  ------------------
  |  Branch (172:15): [True: 0, False: 3.64M]
  ------------------
  173|  3.64M|  auto out = dest.begin();
  174|  3.64M|  auto p = src.begin(), end = src.end();
  175|       |
  176|  25.8M|  while (p < end) {
  ------------------
  |  Branch (176:10): [True: 22.4M, False: 3.42M]
  ------------------
  177|  22.4M|    uint8_t b0 = static_cast<uint8_t>(*p);
  178|  22.4M|    uint16_t cp;
  179|       |
  180|  22.4M|    if (b0 < 0x80) {
  ------------------
  |  Branch (180:9): [True: 19.2M, False: 3.19M]
  ------------------
  181|       |      // 1-byte ASCII
  182|  19.2M|      cp = b0;
  183|  19.2M|    } else if (b0 < 0xc0) {
  ------------------
  |  Branch (183:16): [True: 471k, False: 2.71M]
  ------------------
  184|       |      // continuation byte at lead position
  185|   471k|      HUNSPELL_WARNING(stderr,
  186|   471k|                       "UTF-8 encoding error. Unexpected continuation bytes "
  187|   471k|                       "in %ld. character position\n%s\n",
  188|   471k|                       static_cast<long>(std::distance(src.begin(), p)),
  189|   471k|                       src.c_str());
  190|   471k|      cp = 0xfffd;
  191|  2.71M|    } else if (b0 < 0xe0) {
  ------------------
  |  Branch (191:16): [True: 912k, False: 1.80M]
  ------------------
  192|       |      // 2-byte sequence: 110xxxxx 10yyyyyy
  193|   912k|      if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (193:11): [True: 795k, False: 117k]
  |  Branch (193:11): [True: 212k, False: 699k]
  |  Branch (193:26): [True: 212k, False: 582k]
  ------------------
  194|   212k|        cp = ((b0 & 0x1f) << 6) | (static_cast<uint8_t>(p[1]) & 0x3f);
  195|   212k|        ++p;  // step past lead; loop bottom steps past cont
  196|   699k|      } else {
  197|   699k|        warn_missing_cont(src, p);
  198|   699k|        cp = 0xfffd;
  199|   699k|      }
  200|  1.80M|    } else if (b0 < 0xf0) {
  ------------------
  |  Branch (200:16): [True: 1.58M, False: 221k]
  ------------------
  201|       |      // 3-byte sequence: 1110xxxx 10yyyyyy 10zzzzzz
  202|  1.58M|      if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (202:11): [True: 1.56M, False: 16.7k]
  |  Branch (202:11): [True: 1.52M, False: 63.9k]
  |  Branch (202:26): [True: 1.52M, False: 47.2k]
  ------------------
  203|  1.52M|        uint8_t b1 = static_cast<uint8_t>(p[1]);
  204|  1.52M|        ++p;  // step past lead
  205|  1.52M|        if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (205:13): [True: 1.51M, False: 2.49k]
  |  Branch (205:13): [True: 1.51M, False: 10.5k]
  |  Branch (205:28): [True: 1.51M, False: 8.01k]
  ------------------
  206|  1.51M|          cp = ((b0 & 0x0f) << 12) | ((b1 & 0x3f) << 6) | (static_cast<uint8_t>(p[1]) & 0x3f);
  207|  1.51M|          ++p;  // step past first cont; loop bottom steps past second cont
  208|  1.51M|        } else {
  209|  10.5k|          warn_missing_cont(src, p);
  210|  10.5k|          cp = 0xfffd;
  211|  10.5k|        }
  212|  1.52M|      } else {
  213|  63.9k|        warn_missing_cont(src, p);
  214|  63.9k|        cp = 0xfffd;
  215|  63.9k|      }
  216|  1.58M|    } else {
  217|       |      // 4+ byte lead: codepoint >= U+10000, can't fit in w_char
  218|   221k|      HUNSPELL_WARNING(stderr,
  219|   221k|                       "This UTF-8 encoding can't convert to UTF-16:\n%s\n",
  220|   221k|                       src.c_str());
  221|   221k|      out->h = 0xff;
  222|   221k|      out->l = 0xfd;
  223|   221k|      ++out;
  224|   221k|      dest.resize(out - dest.begin());
  225|   221k|      return -1;
  226|   221k|    }
  227|       |
  228|  22.2M|    out->h = static_cast<unsigned char>(cp >> 8);
  229|  22.2M|    out->l = static_cast<unsigned char>(cp);
  230|  22.2M|    ++out;
  231|  22.2M|    if (only_convert_first_letter)
  ------------------
  |  Branch (231:9): [True: 0, False: 22.2M]
  ------------------
  232|      0|      break;
  233|  22.2M|    ++p;  // consume lead byte
  234|  22.2M|  }
  235|       |
  236|  3.42M|  int size = static_cast<int>(out - dest.begin());
  237|  3.42M|  dest.resize(size);
  238|  3.42M|  return size;
  239|  3.64M|}
_Z8mystrsepRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_11__wrap_iterIPKcEE:
  254|  1.80k|                                     std::string::const_iterator& start) {
  255|  1.80k|  auto end = str.end();
  256|       |
  257|  1.80k|  is_any_of op(" \t");
  258|       |  // don't use isspace() here, the string can be in some random charset
  259|       |  // that's way different than the locale's
  260|  1.80k|  auto sp = start;
  261|  5.87k|  while (sp != end && op(*sp))
  ------------------
  |  Branch (261:10): [True: 5.43k, False: 442]
  |  Branch (261:23): [True: 4.07k, False: 1.35k]
  ------------------
  262|  4.07k|      ++sp;
  263|       |
  264|  1.80k|  auto dp = sp;
  265|  6.69k|  while (dp != end && !op(*dp))
  ------------------
  |  Branch (265:10): [True: 5.81k, False: 882]
  |  Branch (265:23): [True: 4.89k, False: 918]
  ------------------
  266|  4.89k|      ++dp;
  267|       |
  268|  1.80k|  start = dp;
  269|  1.80k|  return sp;
  270|  1.80k|}
_Z7mychompRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  273|  1.99k|void mychomp(std::string& s) {
  274|  1.99k|  size_t k = s.size();
  275|  1.99k|  size_t newsize = k;
  276|  1.99k|  if ((k > 0) && ((s[k - 1] == '\r') || (s[k - 1] == '\n')))
  ------------------
  |  Branch (276:7): [True: 1.80k, False: 190]
  |  Branch (276:19): [True: 0, False: 1.80k]
  |  Branch (276:41): [True: 0, False: 1.80k]
  ------------------
  277|      0|    --newsize;
  278|  1.99k|  if ((k > 1) && (s[k - 2] == '\r'))
  ------------------
  |  Branch (278:7): [True: 1.60k, False: 384]
  |  Branch (278:18): [True: 0, False: 1.60k]
  ------------------
  279|      0|    --newsize;
  280|  1.99k|  s.resize(newsize);
  281|  1.99k|}
_Z8line_tokRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEc:
  284|   293k|std::vector<std::string> line_tok(const std::string& text, char breakchar) {
  285|   293k|  std::vector<std::string> ret;
  286|   293k|  if (text.empty()) {
  ------------------
  |  Branch (286:7): [True: 10.1k, False: 283k]
  ------------------
  287|  10.1k|    return ret;
  288|  10.1k|  }
  289|       |
  290|   283k|  std::stringstream ss(text);
  291|   283k|  std::string tok;
  292|   567k|  while(std::getline(ss, tok, breakchar)) {
  ------------------
  |  Branch (292:9): [True: 283k, False: 283k]
  ------------------
  293|   283k|    if (!tok.empty()) {
  ------------------
  |  Branch (293:9): [True: 283k, False: 128]
  ------------------
  294|   283k|      ret.push_back(tok);
  295|   283k|    }
  296|   283k|  }
  297|       |
  298|   283k|  return ret;
  299|   293k|}
_Z9line_uniqRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEc:
  303|  12.7k|{
  304|  12.7k|  std::vector<std::string> lines = line_tok(text, breakchar);
  305|  12.7k|  text.clear();
  306|  12.7k|  if (lines.empty()) {
  ------------------
  |  Branch (306:7): [True: 10.1k, False: 2.58k]
  ------------------
  307|  10.1k|    return;
  308|  10.1k|  }
  309|  2.58k|  text = lines[0];
  310|  2.75k|  for (size_t i = 1; i < lines.size(); ++i) {
  ------------------
  |  Branch (310:22): [True: 172, False: 2.58k]
  ------------------
  311|    172|    bool dup = false;
  312|    192|    for (size_t j = 0; j < i; ++j) {
  ------------------
  |  Branch (312:24): [True: 172, False: 20]
  ------------------
  313|    172|      if (lines[i] == lines[j]) {
  ------------------
  |  Branch (313:11): [True: 152, False: 20]
  ------------------
  314|    152|        dup = true;
  315|    152|        break;
  316|    152|      }
  317|    172|    }
  318|    172|    if (!dup) {
  ------------------
  |  Branch (318:9): [True: 20, False: 152]
  ------------------
  319|     20|      if (!text.empty())
  ------------------
  |  Branch (319:11): [True: 20, False: 0]
  ------------------
  320|     20|        text.push_back(breakchar);
  321|     20|      text.append(lines[i]);
  322|     20|    }
  323|    172|  }
  324|  2.58k|}
_Z10copy_fieldRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_S8_:
  388|   265k|                const std::string& var) {
  389|   265k|  if (morph.empty())
  ------------------
  |  Branch (389:7): [True: 0, False: 265k]
  ------------------
  390|      0|    return false;
  391|   265k|  size_t pos = morph.find(var);
  392|   265k|  if (pos == std::string::npos)
  ------------------
  |  Branch (392:7): [True: 8, False: 265k]
  ------------------
  393|      8|    return false;
  394|   265k|  dest.clear();
  395|   265k|  std::string beg(morph.substr(pos + MORPH_TAG_LEN, std::string::npos));
  ------------------
  |  |  119|   265k|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|   265k|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
  396|       |
  397|   465k|  for (const char c : beg) {
  ------------------
  |  Branch (397:21): [True: 465k, False: 265k]
  ------------------
  398|   465k|    if (c == ' ' || c == '\t' || c == '\n')
  ------------------
  |  Branch (398:9): [True: 0, False: 465k]
  |  Branch (398:21): [True: 0, False: 465k]
  |  Branch (398:34): [True: 0, False: 465k]
  ------------------
  399|      0|      break;
  400|   465k|    dest.push_back(c);
  401|   465k|  }
  402|       |
  403|   265k|  return true;
  404|   265k|}
_Z8mystrrepRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_S8_:
  408|   999k|                      const std::string& replace) {
  409|   999k|  size_t pos = 0;
  410|  1.19M|  while ((pos = str.find(search, pos)) != std::string::npos) {
  ------------------
  |  Branch (410:10): [True: 192k, False: 999k]
  ------------------
  411|   192k|    str.replace(pos, search.length(), replace);
  412|   192k|    pos += replace.length();
  413|   192k|  }
  414|   999k|  return str;
  415|   999k|}
_Z11reversewordRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  418|   919k|size_t reverseword(std::string& word) {
  419|   919k|  std::reverse(word.begin(), word.end());
  420|   919k|  return word.size();
  421|   919k|}
_Z8uniqlistRNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE:
  498|  6.20k|void uniqlist(std::vector<std::string>& list) {
  499|  6.20k|  if (list.size() < 2)
  ------------------
  |  Branch (499:7): [True: 6.20k, False: 0]
  ------------------
  500|  6.20k|    return;
  501|       |
  502|      0|  std::vector<std::string> ret;
  503|      0|  ret.push_back(list[0]);
  504|       |
  505|      0|  for (size_t i = 1; i < list.size(); ++i) {
  ------------------
  |  Branch (505:22): [True: 0, False: 0]
  ------------------
  506|      0|    if (std::find(ret.begin(), ret.end(), list[i]) == ret.end())
  ------------------
  |  Branch (506:9): [True: 0, False: 0]
  ------------------
  507|      0|        ret.push_back(list[i]);
  508|      0|  }
  509|       |
  510|      0|  list.swap(ret);
  511|      0|}
_Z9upper_utf6w_chari:
  530|  3.92M|w_char upper_utf(w_char u, int langnum) {
  531|       |
  532|  3.92M|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  533|       |
  534|       |//with these optimizations, msvc can optimize this function to one jmp instruction
  535|       |//but g++ remains in five instructions
  536|       |//maybe use inline asm for g++?
  537|       |
  538|       |#if (__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)) && defined __cpp_lib_bit_cast && __cpp_lib_bit_cast >= 201806L
  539|       |  return std::bit_cast<w_char>(unicodetoupper((unsigned short)u, langnum));
  540|       |#else
  541|  3.92M|  const auto us = unicodetoupper((unsigned short)u, langnum);
  542|  3.92M|  memcpy(&u, &us, sizeof(unsigned short));
  543|  3.92M|  return u;
  544|  3.92M|#endif
  545|       |
  546|       |#else
  547|       |  const auto us = unicodetoupper((unsigned short)u, langnum);
  548|       |  u.h = (unsigned char)(us >> 8);
  549|       |  u.l = (unsigned char)(us & 0xff);
  550|       |  return u;
  551|       |#endif
  552|  3.92M|}
_Z9lower_utf6w_chari:
  554|  5.38M|w_char lower_utf(w_char u, int langnum) {
  555|       |
  556|  5.38M|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  557|       |
  558|       |//with these optimizations, msvc can optimize this function to one jmp instruction
  559|       |//but g++ remains in five instructions
  560|       |//maybe use inline asm for g++?
  561|       |
  562|       |#if (__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)) && defined __cpp_lib_bit_cast && __cpp_lib_bit_cast >= 201806L
  563|       |  return std::bit_cast<w_char>(unicodetolower((unsigned short)u, langnum));
  564|       |#else
  565|  5.38M|  const auto us = unicodetolower((unsigned short)u, langnum);
  566|  5.38M|  memcpy(&u, &us, sizeof(unsigned short));
  567|  5.38M|  return u;
  568|  5.38M|#endif
  569|       |
  570|       |#else
  571|       |  const auto us = unicodetolower((unsigned short)u, langnum);
  572|       |  u.h = (unsigned char)(us >> 8);
  573|       |  u.l = (unsigned char)(us & 0xff);
  574|       |  return u;
  575|       |#endif
  576|  5.38M|}
_Z8mkallcapRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  579|   268k|std::string& mkallcap(std::string& s, const struct cs_info* csconv) {
  580|  5.26M|  for (char& aI : s) {
  ------------------
  |  Branch (580:17): [True: 5.26M, False: 268k]
  ------------------
  581|  5.26M|    aI = cupper(csconv, static_cast<unsigned char>(aI));
  582|  5.26M|  }
  583|   268k|  return s;
  584|   268k|}
_Z10mkallsmallRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  587|  1.61M|std::string& mkallsmall(std::string& s, const struct cs_info* csconv) {
  588|  14.6M|  for (char& aI : s) {
  ------------------
  |  Branch (588:17): [True: 14.6M, False: 1.61M]
  ------------------
  589|  14.6M|    aI = clower(csconv, static_cast<unsigned char>(aI));
  590|  14.6M|  }
  591|  1.61M|  return s;
  592|  1.61M|}
_Z14mkallsmall_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  594|   919k|std::vector<w_char>& mkallsmall_utf(std::vector<w_char>& u, int langnum) {
  595|  5.35M|  for (auto& i : u) {
  ------------------
  |  Branch (595:16): [True: 5.35M, False: 919k]
  ------------------
  596|  5.35M|    i = lower_utf(i, langnum);
  597|  5.35M|  }
  598|   919k|  return u;
  599|   919k|}
_Z12mkallcap_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  601|   156k|std::vector<w_char>& mkallcap_utf(std::vector<w_char>& u, int langnum) {
  602|  1.83M|  for (auto& i : u) {
  ------------------
  |  Branch (602:16): [True: 1.83M, False: 156k]
  ------------------
  603|  1.83M|    i = upper_utf(i, langnum);
  604|  1.83M|  }
  605|   156k|  return u;
  606|   156k|}
_Z9mkinitcapRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  608|   717k|std::string& mkinitcap(std::string& s, const struct cs_info* csconv) {
  609|   717k|  if (!s.empty()) {
  ------------------
  |  Branch (609:7): [True: 717k, False: 93]
  ------------------
  610|   717k|    s[0] = cupper(csconv, static_cast<unsigned char>(s[0]));
  611|   717k|  }
  612|   717k|  return s;
  613|   717k|}
_Z13mkinitcap_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  615|   262k|std::vector<w_char>& mkinitcap_utf(std::vector<w_char>& u, int langnum) {
  616|   262k|  if (!u.empty()) {
  ------------------
  |  Branch (616:7): [True: 262k, False: 0]
  ------------------
  617|   262k|    u[0] = upper_utf(u[0], langnum);
  618|   262k|  }
  619|   262k|  return u;
  620|   262k|}
_Z11mkinitsmallRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  622|  9.75k|std::string& mkinitsmall(std::string& s, const struct cs_info* csconv) {
  623|  9.75k|  if (!s.empty()) {
  ------------------
  |  Branch (623:7): [True: 9.75k, False: 0]
  ------------------
  624|  9.75k|    s[0] = clower(csconv, static_cast<unsigned char>(s[0]));
  625|  9.75k|  }
  626|  9.75k|  return s;
  627|  9.75k|}
_Z15mkinitsmall_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  629|  2.87k|std::vector<w_char>& mkinitsmall_utf(std::vector<w_char>& u, int langnum) {
  630|  2.87k|  if (!u.empty()) {
  ------------------
  |  Branch (630:7): [True: 2.87k, False: 0]
  ------------------
  631|  2.87k|    u[0] = lower_utf(u[0], langnum);
  632|  2.87k|  }
  633|  2.87k|  return u;
  634|  2.87k|}
_Z14get_current_csRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 2292|  1.85k|const struct cs_info* get_current_cs(const std::string& es) {
 2293|  1.85k|  char* normalized_encoding = new char[es.size() + 1];
 2294|  1.85k|  toAsciiLowerAndRemoveNonAlphanumeric(es.c_str(), normalized_encoding);
 2295|       |
 2296|  1.85k|  const struct cs_info* ccs = nullptr;
 2297|  1.85k|  for (const auto& encd : encds) {
  ------------------
  |  Branch (2297:25): [True: 1.85k, False: 0]
  ------------------
 2298|  1.85k|    if (strcmp(normalized_encoding, encd.enc_name) == 0) {
  ------------------
  |  Branch (2298:9): [True: 1.85k, False: 0]
  ------------------
 2299|  1.85k|      ccs = encd.cs_table;
 2300|  1.85k|      break;
 2301|  1.85k|    }
 2302|  1.85k|  }
 2303|       |
 2304|  1.85k|  delete[] normalized_encoding;
 2305|       |
 2306|  1.85k|  if (!ccs) {
  ------------------
  |  Branch (2306:7): [True: 0, False: 1.85k]
  ------------------
 2307|      0|    HUNSPELL_WARNING(stderr,
 2308|      0|                     "error: unknown encoding %s: using %s as fallback\n", es.c_str(),
 2309|      0|                     encds[0].enc_name);
 2310|      0|    ccs = encds[0].cs_table;
 2311|      0|  }
 2312|       |
 2313|  1.85k|  return ccs;
 2314|  1.85k|}
_Z12get_lang_numRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 2444|      4|int get_lang_num(const std::string& lang) {
 2445|     72|  for (const auto& i : lang2enc) {
  ------------------
  |  Branch (2445:22): [True: 72, False: 0]
  ------------------
 2446|     72|    if (strcmp(lang.c_str(), i.lang) == 0) {
  ------------------
  |  Branch (2446:9): [True: 4, False: 68]
  ------------------
 2447|      4|      return i.num;
 2448|      4|    }
 2449|     72|  }
 2450|      0|  return LANG_xx;
 2451|      4|}
_Z14unicodetoupperti:
 2453|  19.1M|unsigned short unicodetoupper(unsigned short c, int langnum) {
 2454|       |  // In Azeri and Turkish, I and i dictinct letters:
 2455|       |  // There are a dotless lower case i pair of upper `I',
 2456|       |  // and an upper I with dot pair of lower `i'.
 2457|  19.1M|  if (c == 0x0069 && ((langnum == LANG_az) || (langnum == LANG_tr) || (langnum == LANG_crh)))
  ------------------
  |  Branch (2457:7): [True: 23.3k, False: 19.1M]
  |  Branch (2457:23): [True: 0, False: 23.3k]
  |  Branch (2457:47): [True: 0, False: 23.3k]
  |  Branch (2457:71): [True: 0, False: 23.3k]
  ------------------
 2458|      0|    return 0x0130;
 2459|       |#ifdef OPENOFFICEORG
 2460|       |  return static_cast<unsigned short>(u_toupper(c));
 2461|       |#else
 2462|       |#ifdef MOZILLA_CLIENT
 2463|       |  return ToUpperCase((char16_t)c);
 2464|       |#else
 2465|  19.1M|  unsigned short up = utf_pages[utf_page_index[c >> 8]][c & 0xFF].cupper;
 2466|  19.1M|  return up ? up : c;
  ------------------
  |  Branch (2466:10): [True: 3.25M, False: 15.8M]
  ------------------
 2467|  19.1M|#endif
 2468|  19.1M|#endif
 2469|  19.1M|}
_Z14unicodetolowerti:
 2471|  21.5M|unsigned short unicodetolower(unsigned short c, int langnum) {
 2472|       |  // In Azeri and Turkish, I and i dictinct letters:
 2473|       |  // There are a dotless lower case i pair of upper `I',
 2474|       |  // and an upper I with dot pair of lower `i'.
 2475|  21.5M|  if (c == 0x0049 && ((langnum == LANG_az) || (langnum == LANG_tr) || (langnum == LANG_crh)))
  ------------------
  |  Branch (2475:7): [True: 6.22k, False: 21.4M]
  |  Branch (2475:23): [True: 0, False: 6.22k]
  |  Branch (2475:47): [True: 0, False: 6.22k]
  |  Branch (2475:71): [True: 0, False: 6.22k]
  ------------------
 2476|      0|    return 0x0131;
 2477|       |#ifdef OPENOFFICEORG
 2478|       |  return static_cast<unsigned short>(u_tolower(c));
 2479|       |#else
 2480|       |#ifdef MOZILLA_CLIENT
 2481|       |  return ToLowerCase((char16_t)c);
 2482|       |#else
 2483|  21.5M|  unsigned short lo = utf_pages[utf_page_index[c >> 8]][c & 0xFF].clower;
 2484|  21.5M|  return lo ? lo : c;
  ------------------
  |  Branch (2484:10): [True: 2.23M, False: 19.2M]
  ------------------
 2485|  21.5M|#endif
 2486|  21.5M|#endif
 2487|  21.5M|}
_Z11get_captypeRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
 2498|  7.58M|int get_captype(const std::string& word, const cs_info* csconv) {
 2499|       |  // now determine the capitalization type of the first nl letters
 2500|  7.58M|  size_t ncap = 0;
 2501|  7.58M|  size_t nneutral = 0;
 2502|  7.58M|  size_t firstcap = 0;
 2503|  7.58M|  if (csconv == nullptr)
  ------------------
  |  Branch (2503:7): [True: 0, False: 7.58M]
  ------------------
 2504|      0|    return NOCAP;
  ------------------
  |  |   92|      0|#define NOCAP 0
  ------------------
 2505|  89.8M|  for (char q : word) {
  ------------------
  |  Branch (2505:15): [True: 89.8M, False: 7.58M]
  ------------------
 2506|  89.8M|    const auto nIndex = static_cast<unsigned char>(q);
 2507|  89.8M|    if (ccase(csconv, nIndex))
  ------------------
  |  Branch (2507:9): [True: 3.79M, False: 86.0M]
  ------------------
 2508|  3.79M|      ncap++;
 2509|  89.8M|    if (cupper(csconv, nIndex) == clower(csconv, nIndex))
  ------------------
  |  Branch (2509:9): [True: 71.7M, False: 18.0M]
  ------------------
 2510|  71.7M|      nneutral++;
 2511|  89.8M|  }
 2512|  7.58M|  if (ncap) {
  ------------------
  |  Branch (2512:7): [True: 1.36M, False: 6.22M]
  ------------------
 2513|  1.36M|    const auto nIndex = static_cast<unsigned char>(word[0]);
 2514|  1.36M|    firstcap = csconv[nIndex].ccase;
 2515|  1.36M|  }
 2516|       |
 2517|       |  // now finally set the captype
 2518|  7.58M|  if (ncap == 0) {
  ------------------
  |  Branch (2518:7): [True: 6.22M, False: 1.36M]
  ------------------
 2519|  6.22M|    return NOCAP;
  ------------------
  |  |   92|  6.22M|#define NOCAP 0
  ------------------
 2520|  6.22M|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (2520:14): [True: 632k, False: 729k]
  |  Branch (2520:29): [True: 311k, False: 320k]
  ------------------
 2521|   311k|    return INITCAP;
  ------------------
  |  |   93|   311k|#define INITCAP 1
  ------------------
 2522|  1.05M|  } else if ((ncap == word.size()) || ((ncap + nneutral) == word.size())) {
  ------------------
  |  Branch (2522:14): [True: 22.9k, False: 1.02M]
  |  Branch (2522:39): [True: 125k, False: 902k]
  ------------------
 2523|   148k|    return ALLCAP;
  ------------------
  |  |   94|   148k|#define ALLCAP 2
  ------------------
 2524|   902k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (2524:14): [True: 625k, False: 276k]
  |  Branch (2524:28): [True: 320k, False: 304k]
  ------------------
 2525|   320k|    return HUHINITCAP;
  ------------------
  |  |   96|   320k|#define HUHINITCAP 4
  ------------------
 2526|   320k|  }
 2527|   581k|  return HUHCAP;
  ------------------
  |  |   95|   581k|#define HUHCAP 3
  ------------------
 2528|  7.58M|}
_Z16get_captype_utf8RKNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
 2530|  2.27M|int get_captype_utf8(const std::vector<w_char>& word, int langnum) {
 2531|       |  // now determine the capitalization type of the first nl letters
 2532|  2.27M|  size_t ncap = 0;
 2533|  2.27M|  size_t nneutral = 0;
 2534|  2.27M|  size_t firstcap = 0;
 2535|       |
 2536|  2.27M|  auto it = word.begin(), it_end = word.end();
 2537|  17.3M|  while (it != it_end) {
  ------------------
  |  Branch (2537:10): [True: 15.0M, False: 2.27M]
  ------------------
 2538|  15.0M|    const auto idx = (unsigned short)*it;
 2539|  15.0M|    const auto lwridx = unicodetolower(idx, langnum);
 2540|  15.0M|    if (idx != lwridx)
  ------------------
  |  Branch (2540:9): [True: 891k, False: 14.1M]
  ------------------
 2541|   891k|      ncap++;
 2542|  15.0M|    if (unicodetoupper(idx, langnum) == lwridx)
  ------------------
  |  Branch (2542:9): [True: 11.8M, False: 3.18M]
  ------------------
 2543|  11.8M|      nneutral++;
 2544|  15.0M|    ++it;
 2545|  15.0M|  }
 2546|  2.27M|  if (ncap) {
  ------------------
  |  Branch (2546:7): [True: 367k, False: 1.90M]
  ------------------
 2547|   367k|    const auto idx = (unsigned short)word[0];
 2548|   367k|    firstcap = (idx != unicodetolower(idx, langnum));
 2549|   367k|  }
 2550|       |
 2551|       |  // now finally set the captype
 2552|  2.27M|  if (ncap == 0) {
  ------------------
  |  Branch (2552:7): [True: 1.90M, False: 367k]
  ------------------
 2553|  1.90M|    return NOCAP;
  ------------------
  |  |   92|  1.90M|#define NOCAP 0
  ------------------
 2554|  1.90M|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (2554:14): [True: 215k, False: 151k]
  |  Branch (2554:29): [True: 122k, False: 92.9k]
  ------------------
 2555|   122k|    return INITCAP;
  ------------------
  |  |   93|   122k|#define INITCAP 1
  ------------------
 2556|   244k|  } else if ((ncap == word.size()) || ((ncap + nneutral) == word.size())) {
  ------------------
  |  Branch (2556:14): [True: 4.00k, False: 240k]
  |  Branch (2556:39): [True: 55.8k, False: 184k]
  ------------------
 2557|  59.8k|    return ALLCAP;
  ------------------
  |  |   94|  59.8k|#define ALLCAP 2
  ------------------
 2558|   184k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (2558:14): [True: 109k, False: 75.5k]
  |  Branch (2558:28): [True: 54.4k, False: 54.8k]
  ------------------
 2559|  54.4k|    return HUHINITCAP;
  ------------------
  |  |   96|  54.4k|#define HUHINITCAP 4
  ------------------
 2560|  54.4k|  }
 2561|   130k|  return HUHCAP;
  ------------------
  |  |   95|   130k|#define HUHCAP 3
  ------------------
 2562|  2.27M|}
_Z24remove_ignored_chars_utfRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEE:
 2566|   512k|                                const std::vector<w_char>& ignored_chars) {
 2567|   512k|  std::vector<w_char> w;
 2568|   512k|  std::vector<w_char> w2;
 2569|   512k|  u8_u16(w, word);
 2570|       |
 2571|   512k|  std::copy_if(w.begin(), w.end(), std::back_inserter(w2),
 2572|   512k|  [&ignored_chars](w_char wc) {
 2573|   512k|    return !std::binary_search(ignored_chars.begin(), ignored_chars.end(), wc);
 2574|   512k|  });
 2575|       |
 2576|   512k|  u16_u8(word, w2);
 2577|   512k|  return w2.size();
 2578|   512k|}
_Z20remove_ignored_charsRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_:
 2582|  1.66M|                            const std::string& ignored_chars) {
 2583|  1.66M|  word.erase(
 2584|  1.66M|      std::remove_if(word.begin(), word.end(), is_any_of(ignored_chars)),
 2585|  1.66M|      word.end());
 2586|  1.66M|  return word.size();
 2587|  1.66M|}
_Z12parse_stringRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_i:
 2589|     90|bool parse_string(const std::string& line, std::string& out, int ln) {
 2590|     90|  if (!out.empty()) {
  ------------------
  |  Branch (2590:7): [True: 0, False: 90]
  ------------------
 2591|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions\n", ln);
 2592|      0|    return false;
 2593|      0|  }
 2594|     90|  int i = 0;
 2595|     90|  int np = 0;
 2596|     90|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 2597|    270|  while (start_piece != line.end()) {
  ------------------
  |  Branch (2597:10): [True: 180, False: 90]
  ------------------
 2598|    180|    switch (i) {
 2599|     90|      case 0: {
  ------------------
  |  Branch (2599:7): [True: 90, False: 90]
  ------------------
 2600|     90|        np++;
 2601|     90|        break;
 2602|      0|      }
 2603|     90|      case 1: {
  ------------------
  |  Branch (2603:7): [True: 90, False: 90]
  ------------------
 2604|     90|        out.assign(start_piece, iter);
 2605|     90|        np++;
 2606|     90|        break;
 2607|      0|      }
 2608|      0|      default:
  ------------------
  |  Branch (2608:7): [True: 0, False: 180]
  ------------------
 2609|      0|        break;
 2610|    180|    }
 2611|    180|    ++i;
 2612|    180|     start_piece = mystrsep(line, iter);
 2613|    180|  }
 2614|     90|  if (np != 2) {
  ------------------
  |  Branch (2614:7): [True: 0, False: 90]
  ------------------
 2615|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", ln);
 2616|      0|    return false;
 2617|      0|  }
 2618|     90|  return true;
 2619|     90|}
_Z11parse_arrayRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_RNS_6vectorI6w_charNS3_ISA_EEEEii:
 2625|     14|                 int ln) {
 2626|     14|  if (!parse_string(line, out, ln))
  ------------------
  |  Branch (2626:7): [True: 0, False: 14]
  ------------------
 2627|      0|    return false;
 2628|     14|  if (utf8) {
  ------------------
  |  Branch (2628:7): [True: 8, False: 6]
  ------------------
 2629|      8|    u8_u16(out_utf16, out);
 2630|      8|    std::sort(out_utf16.begin(), out_utf16.end());
 2631|      8|  }
 2632|     14|  return true;
 2633|     14|}
csutil.cxx:_ZL17warn_missing_contRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_11__wrap_iterIPKcEE:
  153|   774k|static void warn_missing_cont(const std::string& src, std::string::const_iterator p) {
  154|       |  HUNSPELL_WARNING(stderr,
  155|   774k|                   "UTF-8 encoding error. Missing continuation byte in "
  156|   774k|                   "%ld. character position:\n%s\n",
  157|   774k|                   static_cast<long>(std::distance(src.begin(), p)),
  158|   774k|                   src.c_str());
  159|   774k|}
csutil.cxx:_ZN12_GLOBAL__N_19is_any_ofC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  244|  1.66M|  explicit is_any_of(const std::string& in) : chars(in) {}
csutil.cxx:_ZNK12_GLOBAL__N_19is_any_ofclEc:
  246|  20.4M|  bool operator()(char c) const { return chars.find(c) != std::string::npos; }
csutil.cxx:_ZN12_GLOBAL__N_16cupperEPK7cs_infoi:
  514|  95.7M|unsigned char cupper(const struct cs_info* csconv, int nIndex) {
  515|  95.7M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (515:3): [True: 95.7M, False: 0]
  |  Branch (515:3): [True: 95.7M, False: 0]
  |  Branch (515:3): [True: 95.7M, False: 0]
  ------------------
  516|  95.7M|  return csconv[nIndex].cupper;
  517|  95.7M|}
csutil.cxx:_ZN12_GLOBAL__N_16clowerEPK7cs_infoi:
  519|   104M|unsigned char clower(const struct cs_info* csconv, int nIndex) {
  520|   104M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (520:3): [True: 104M, False: 0]
  |  Branch (520:3): [True: 104M, False: 0]
  |  Branch (520:3): [True: 104M, False: 0]
  ------------------
  521|   104M|  return csconv[nIndex].clower;
  522|   104M|}
csutil.cxx:_ZL36toAsciiLowerAndRemoveNonAlphanumericPKcPc:
 2272|  1.85k|                                                 char* pBuf) {
 2273|  16.8k|  while (*pName) {
  ------------------
  |  Branch (2273:10): [True: 14.9k, False: 1.85k]
  ------------------
 2274|       |    /* A-Z */
 2275|  14.9k|    if ((*pName >= 0x41) && (*pName <= 0x5A)) {
  ------------------
  |  Branch (2275:9): [True: 5.56k, False: 9.37k]
  |  Branch (2275:29): [True: 294, False: 5.27k]
  ------------------
 2276|    294|      *pBuf = (*pName) + 0x20; /* toAsciiLower */
 2277|    294|      pBuf++;
 2278|    294|    }
 2279|       |    /* a-z, 0-9 */
 2280|  14.6k|    else if (((*pName >= 0x61) && (*pName <= 0x7A)) ||
  ------------------
  |  Branch (2280:15): [True: 5.27k, False: 9.37k]
  |  Branch (2280:35): [True: 5.27k, False: 0]
  ------------------
 2281|  14.5k|             ((*pName >= 0x30) && (*pName <= 0x39))) {
  ------------------
  |  Branch (2281:15): [True: 9.28k, False: 98]
  |  Branch (2281:35): [True: 9.28k, False: 0]
  ------------------
 2282|  14.5k|      *pBuf = *pName;
 2283|  14.5k|      pBuf++;
 2284|  14.5k|    }
 2285|       |
 2286|  14.9k|    pName++;
 2287|  14.9k|  }
 2288|       |
 2289|  1.85k|  *pBuf = '\0';
 2290|  1.85k|}
csutil.cxx:_ZN12_GLOBAL__N_15ccaseEPK7cs_infoi:
  524|  89.8M|unsigned char ccase(const struct cs_info* csconv, int nIndex) {
  525|  89.8M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (525:3): [True: 89.8M, False: 0]
  |  Branch (525:3): [True: 89.8M, False: 0]
  |  Branch (525:3): [True: 89.8M, False: 0]
  ------------------
  526|  89.8M|  return csconv[nIndex].ccase;
  527|  89.8M|}
csutil.cxx:_ZZ24remove_ignored_chars_utfRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEEENK3$_0clES8_:
 2572|  3.34M|  [&ignored_chars](w_char wc) {
 2573|  3.34M|    return !std::binary_search(ignored_chars.begin(), ignored_chars.end(), wc);
 2574|  3.34M|  });

_Z12is_utf8_contc:
  143|  57.4M|inline bool is_utf8_cont(char c) {
  144|  57.4M|  return (static_cast<unsigned char>(c) & 0xc0) == 0x80;
  145|  57.4M|}
_Z9utf8_nextRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm:
  148|  23.3k|inline size_t utf8_next(const std::string& s, size_t pos) {
  149|  23.3k|  if (pos < s.size()) {
  ------------------
  |  Branch (149:7): [True: 23.3k, False: 0]
  ------------------
  150|  23.3k|    ++pos;
  151|  27.2k|    while (pos < s.size() && is_utf8_cont(s[pos]))
  ------------------
  |  Branch (151:12): [True: 24.9k, False: 2.24k]
  |  Branch (151:30): [True: 3.88k, False: 21.0k]
  ------------------
  152|  3.88k|      ++pos;
  153|  23.3k|  }
  154|  23.3k|  return pos;
  155|  23.3k|}
_Z20has_no_ignored_charsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_:
  290|    753|                            const std::string& ignored_chars) {
  291|    753|  return std::all_of(ignored_chars.begin(), ignored_chars.end(),
  292|    753|    [&word](char ic) { return word.find(ic) == std::string::npos; });
  293|    753|}
_Z11HENTRY_DATAP6hentry:
  296|  1.68M|inline char* HENTRY_DATA(struct hentry* h) {
  297|  1.68M|  char* ret;
  298|  1.68M|  if (!(h->var & H_OPT))
  ------------------
  |  |   47|  1.68M|#define H_OPT (1 << 0)          // is there optional morphological data?
  ------------------
  |  Branch (298:7): [True: 1.68M, False: 1.65k]
  ------------------
  299|  1.68M|    ret = nullptr;
  300|  1.65k|  else if (h->var & H_OPT_ALIASM)
  ------------------
  |  |   48|  1.65k|#define H_OPT_ALIASM (1 << 1)   // using alias compression?
  ------------------
  |  Branch (300:12): [True: 0, False: 1.65k]
  ------------------
  301|      0|    ret = get_stored_pointer(HENTRY_WORD(h) + h->blen + 1);
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  302|  1.65k|  else
  303|  1.65k|    ret = HENTRY_WORD(h) + h->blen + 1;
  ------------------
  |  |   54|  1.65k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  304|  1.68M|  return ret;
  305|  1.68M|}
_Z11HENTRY_FINDP6hentryPKc:
  332|  2.73k|inline char* HENTRY_FIND(struct hentry* h, const char* p) {
  333|  2.73k|  char* data = HENTRY_DATA(h);
  334|  2.73k|  return data ? strstr(data, p) : nullptr;
  ------------------
  |  Branch (334:10): [True: 4, False: 2.73k]
  ------------------
  335|  2.73k|}
_ZZ20has_no_ignored_charsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_ENKUlcE_clEc:
  292|  5.62k|    [&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|    213|void HashMgr::release_flags(unsigned short* astr, bool owned) {
  113|    213|  if (owned)
  ------------------
  |  Branch (113:7): [True: 139, False: 74]
  ------------------
  114|    139|    delete[] astr;
  115|    213|}
_ZNK7HashMgr6lookupEPKcm:
  154|   526M|struct hentry* HashMgr::lookup(const char* word, size_t len) const {
  155|   526M|  struct hentry* dp = tableptr[hash(word, len)];
  156|   526M|  if (!dp)
  ------------------
  |  Branch (156:7): [True: 472M, False: 53.8M]
  ------------------
  157|   472M|    return nullptr;
  158|   113M|  for (; dp != nullptr; dp = dp->next) {
  ------------------
  |  Branch (158:10): [True: 60.5M, False: 52.5M]
  ------------------
  159|  60.5M|    if (strcmp(word, dp->word) == 0)
  ------------------
  |  Branch (159:9): [True: 1.29M, False: 59.2M]
  ------------------
  160|  1.29M|      return dp;
  161|  60.5M|  }
  162|  52.5M|  return nullptr;
  163|  53.8M|}
_ZN7HashMgr8add_wordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPtiPS7_bib:
  173|  7.35k|                      bool own_aff) {
  174|       |
  175|  7.35k|  if (al > std::numeric_limits<short>::max()) {
  ------------------
  |  Branch (175:7): [True: 0, False: 7.35k]
  ------------------
  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|  7.35k|  const std::string* word = &in_word;
  182|  7.35k|  const std::string* desc = in_desc;
  183|       |
  184|  7.35k|  std::string* word_copy = nullptr;
  185|  7.35k|  std::string* desc_copy = nullptr;
  186|  7.35k|  if ((!ignorechars.empty() && !has_no_ignored_chars(in_word, ignorechars)) || complexprefixes) {
  ------------------
  |  Branch (186:8): [True: 749, False: 6.60k]
  |  Branch (186:32): [True: 198, False: 551]
  |  Branch (186:80): [True: 451, False: 6.70k]
  ------------------
  187|    649|    word_copy = new std::string(in_word);
  188|       |
  189|    649|    if (!ignorechars.empty()) {
  ------------------
  |  Branch (189:9): [True: 198, False: 451]
  ------------------
  190|    198|      if (utf8) {
  ------------------
  |  Branch (190:11): [True: 57, False: 141]
  ------------------
  191|     57|        wcl = remove_ignored_chars_utf(*word_copy, ignorechars_utf16);
  192|    141|      } else {
  193|    141|        remove_ignored_chars(*word_copy, ignorechars);
  194|    141|      }
  195|    198|    }
  196|       |
  197|    649|    if (complexprefixes) {
  ------------------
  |  Branch (197:9): [True: 451, False: 198]
  ------------------
  198|    451|      if (utf8)
  ------------------
  |  Branch (198:11): [True: 0, False: 451]
  ------------------
  199|      0|        wcl = reverseword_utf(*word_copy);
  200|    451|      else
  201|    451|        reverseword(*word_copy);
  202|       |
  203|    451|      if (in_desc && aliasm.empty()) {
  ------------------
  |  Branch (203:11): [True: 0, False: 451]
  |  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|    451|    }
  215|       |
  216|    649|    word = word_copy;
  217|    649|  }
  218|       |
  219|       |  // limit of hp->blen
  220|  7.35k|  if (word->size() > std::numeric_limits<unsigned short>::max()) {
  ------------------
  |  Branch (220:7): [True: 0, False: 7.35k]
  ------------------
  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|  7.35k|  bool upcasehomonym = false;
  229|  7.35k|  int descl = desc ? (!aliasm.empty() ? sizeof(char*) : desc->size() + 1) : 0;
  ------------------
  |  Branch (229:15): [True: 4, False: 7.35k]
  |  Branch (229:23): [True: 0, False: 4]
  ------------------
  230|       |  // variable-length hash record with word and optional fields
  231|  7.35k|  auto hp =
  232|  7.35k|      (struct hentry*)arena_alloc(sizeof(struct hentry) + word->size() + descl,
  233|  7.35k|                                  alignof(struct hentry));
  234|  7.35k|  if (!hp) {
  ------------------
  |  Branch (234:7): [True: 0, False: 7.35k]
  ------------------
  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|  7.35k|  char* hpw = hp->word;
  242|  7.35k|  memcpy(hpw, word->data(), word->size());
  243|  7.35k|  hpw[word->size()] = 0;
  244|       |
  245|  7.35k|  int i = hash(hpw, word->size());
  246|       |
  247|  7.35k|  hp->blen = (unsigned short)word->size();
  248|  7.35k|  hp->clen = (unsigned short)wcl;
  249|  7.35k|  hp->alen = (short)al;
  250|  7.35k|  hp->astr = aff;
  251|  7.35k|  hp->next = nullptr;
  252|  7.35k|  hp->next_homonym = nullptr;
  253|  7.35k|  hp->var = (captype == INITCAP) ? H_OPT_INITCAP : 0;
  ------------------
  |  |   93|  7.35k|#define INITCAP 1
  ------------------
                hp->var = (captype == INITCAP) ? H_OPT_INITCAP : 0;
  ------------------
  |  |   50|  4.59k|#define H_OPT_INITCAP (1 << 3)  // is dictionary word capitalized?
  ------------------
  |  Branch (253:13): [True: 4.59k, False: 2.76k]
  ------------------
  254|  7.35k|  if (own_aff)
  ------------------
  |  Branch (254:7): [True: 5.04k, False: 2.31k]
  ------------------
  255|  5.04k|    hp->var |= H_OPT_OWNFLAGS;
  ------------------
  |  |   51|  5.04k|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  256|       |
  257|       |  // store the description string or its pointer
  258|  7.35k|  if (desc) {
  ------------------
  |  Branch (258:7): [True: 4, False: 7.35k]
  ------------------
  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|  7.35k|  struct hentry* dp = tableptr[i];
  370|  7.35k|  if (!dp) {
  ------------------
  |  Branch (370:7): [True: 5.89k, False: 1.46k]
  ------------------
  371|  5.89k|    tableptr[i] = hp;
  372|  5.89k|    delete desc_copy;
  373|  5.89k|    delete word_copy;
  374|  5.89k|    return 0;
  375|  5.89k|  }
  376|  1.77k|  while (dp->next != nullptr) {
  ------------------
  |  Branch (376:10): [True: 338, False: 1.44k]
  ------------------
  377|    338|    if ((!dp->next_homonym) && (strcmp(hp->word, dp->word) == 0)) {
  ------------------
  |  Branch (377:9): [True: 338, False: 0]
  |  Branch (377:32): [True: 27, False: 311]
  ------------------
  378|       |      // remove hidden onlyupcase homonym
  379|     27|      if (!onlyupcase) {
  ------------------
  |  Branch (379:11): [True: 25, False: 2]
  ------------------
  380|     25|        if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (380:13): [True: 0, False: 25]
  |  Branch (380:13): [True: 0, False: 25]
  ------------------
  381|      0|          release_flags(dp->astr, dp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|      0|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  382|      0|          dp->astr = hp->astr;
  383|      0|          dp->alen = hp->alen;
  384|      0|          dp->var &= ~H_OPT_OWNFLAGS;
  ------------------
  |  |   51|      0|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  385|      0|          dp->var |= (hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|      0|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  386|      0|          arena_free(hp);
  387|      0|          delete desc_copy;
  388|      0|          delete word_copy;
  389|      0|          return 0;
  390|     25|        } else if (!dp->astr && dp->alen == 0 &&
  ------------------
  |  Branch (390:20): [True: 25, False: 0]
  |  Branch (390:33): [True: 25, False: 0]
  ------------------
  391|     25|                   !hp->astr && hp->alen == 0) {
  ------------------
  |  Branch (391:20): [True: 25, False: 0]
  |  Branch (391:33): [True: 25, False: 0]
  ------------------
  392|       |          // word already exists with no flags, skip duplicate
  393|     25|          release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     25|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  394|     25|          arena_free(hp);
  395|     25|          delete desc_copy;
  396|     25|          delete word_copy;
  397|     25|          return 0;
  398|     25|        } else {
  399|      0|          dp->next_homonym = hp;
  400|      0|        }
  401|     25|      } else {
  402|      2|        upcasehomonym = true;
  403|      2|      }
  404|     27|    }
  405|    313|    dp = dp->next;
  406|    313|  }
  407|  1.44k|  if (strcmp(hp->word, dp->word) == 0) {
  ------------------
  |  Branch (407:7): [True: 194, False: 1.24k]
  ------------------
  408|       |    // remove hidden onlyupcase homonym
  409|    194|    if (!onlyupcase) {
  ------------------
  |  Branch (409:9): [True: 141, False: 53]
  ------------------
  410|    141|      if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) {
  ------------------
  |  |   99|     27|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 27, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (410:11): [True: 27, False: 114]
  |  Branch (410:11): [True: 27, False: 114]
  ------------------
  411|     27|        release_flags(dp->astr, dp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     27|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  412|     27|        dp->astr = hp->astr;
  413|     27|        dp->alen = hp->alen;
  414|     27|        dp->var &= ~H_OPT_OWNFLAGS;
  ------------------
  |  |   51|     27|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  415|     27|        dp->var |= (hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     27|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  416|     27|        arena_free(hp);
  417|     27|        delete desc_copy;
  418|     27|        delete word_copy;
  419|     27|        return 0;
  420|    114|      } else if (!dp->astr && dp->alen == 0 &&
  ------------------
  |  Branch (420:18): [True: 114, False: 0]
  |  Branch (420:31): [True: 114, False: 0]
  ------------------
  421|    114|                 !hp->astr && hp->alen == 0) {
  ------------------
  |  Branch (421:18): [True: 106, False: 8]
  |  Branch (421:31): [True: 106, False: 0]
  ------------------
  422|       |        // word already exists with no flags, skip duplicate
  423|    106|        release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|    106|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  424|    106|        arena_free(hp);
  425|    106|        delete desc_copy;
  426|    106|        delete word_copy;
  427|    106|        return 0;
  428|    106|      } else {
  429|      8|        dp->next_homonym = hp;
  430|      8|      }
  431|    141|    } else {
  432|     53|      upcasehomonym = true;
  433|     53|    }
  434|    194|  }
  435|  1.30k|  if (!upcasehomonym) {
  ------------------
  |  Branch (435:7): [True: 1.25k, False: 55]
  ------------------
  436|  1.25k|    dp->next = hp;
  437|  1.25k|  } else {
  438|       |    // remove hidden onlyupcase homonym
  439|     55|    release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     55|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  440|     55|    arena_free(hp);
  441|     55|  }
  442|       |
  443|  1.30k|  delete desc_copy;
  444|  1.30k|  delete word_copy;
  445|  1.30k|  return 0;
  446|  1.44k|}
_ZN7HashMgr27add_hidden_capitalized_wordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPtiPS7_i:
  453|  5.20k|                                         int captype) {
  454|  5.20k|  if (flags == nullptr)
  ------------------
  |  Branch (454:7): [True: 5.11k, False: 98]
  ------------------
  455|  5.11k|    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.20k|  if (((captype == HUHCAP) || (captype == HUHINITCAP) ||
  ------------------
  |  |   95|  5.20k|#define HUHCAP 3
  ------------------
                if (((captype == HUHCAP) || (captype == HUHINITCAP) ||
  ------------------
  |  |   96|  4.99k|#define HUHINITCAP 4
  ------------------
  |  Branch (460:8): [True: 213, False: 4.99k]
  |  Branch (460:31): [True: 1.92k, False: 3.07k]
  ------------------
  461|  3.07k|       ((captype == ALLCAP) && (flagslen != 0))) &&
  ------------------
  |  |   94|  3.07k|#define ALLCAP 2
  ------------------
  |  Branch (461:9): [True: 168, False: 2.90k]
  |  Branch (461:32): [True: 16, False: 152]
  ------------------
  462|  2.15k|      !((flagslen != 0) && TESTAFF(flags, forbiddenword, flagslen))) {
  ------------------
  |  |   99|     16|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 16]
  |  |  ------------------
  ------------------
  |  Branch (462:9): [True: 16, False: 2.13k]
  ------------------
  463|  2.15k|    auto flags2 = (unsigned short*)arena_alloc((flagslen + 1) * sizeof(unsigned short),
  464|  2.15k|                                                alignof(unsigned short));
  465|  2.15k|    flags2[flagslen] = ONLYUPCASEFLAG;
  ------------------
  |  |  128|  2.15k|#define ONLYUPCASEFLAG 65511
  ------------------
  466|  2.15k|    if (flagslen) {
  ------------------
  |  Branch (466:9): [True: 16, False: 2.13k]
  ------------------
  467|     16|      memcpy(flags2, flags, flagslen * sizeof(unsigned short));
  468|     16|      std::sort(flags2, flags2 + flagslen + 1);
  469|     16|    }
  470|  2.15k|    if (utf8) {
  ------------------
  |  Branch (470:9): [True: 315, False: 1.83k]
  ------------------
  471|    315|      std::string st;
  472|    315|      std::vector<w_char> w;
  473|    315|      u8_u16(w, word);
  474|    315|      mkallsmall_utf(w, langnum);
  475|    315|      mkinitcap_utf(w, langnum);
  476|    315|      u16_u8(st, w);
  477|    315|      return add_word(st, wcl, flags2, flagslen + 1, dp, true, INITCAP, false);
  ------------------
  |  |   93|    315|#define INITCAP 1
  ------------------
  478|  1.83k|    } else {
  479|  1.83k|      std::string new_word(word);
  480|  1.83k|      mkallsmall(new_word, csconv);
  481|  1.83k|      mkinitcap(new_word, csconv);
  482|  1.83k|      int ret = add_word(new_word, wcl, flags2, flagslen + 1, dp, true, INITCAP, false);
  ------------------
  |  |   93|  1.83k|#define INITCAP 1
  ------------------
  483|  1.83k|      return ret;
  484|  1.83k|    }
  485|  2.15k|  }
  486|  3.05k|  return 0;
  487|  5.20k|}
_ZN7HashMgr20get_clen_and_captypeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiRNS0_6vectorI6w_charNS4_ISB_EEEE:
  490|  5.20k|int HashMgr::get_clen_and_captype(const std::string& word, int* captype, std::vector<w_char> &workbuf) {
  491|  5.20k|  int len;
  492|  5.20k|  if (utf8) {
  ------------------
  |  Branch (492:7): [True: 2.48k, False: 2.72k]
  ------------------
  493|  2.48k|    len = u8_u16(workbuf, word);
  494|  2.48k|    *captype = get_captype_utf8(workbuf, langnum);
  495|  2.72k|  } else {
  496|  2.72k|    len = word.size();
  497|  2.72k|    *captype = get_captype(word, csconv);
  498|  2.72k|  }
  499|  5.20k|  return len;
  500|  5.20k|}
_ZN7HashMgr20get_clen_and_captypeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPi:
  502|  5.04k|int HashMgr::get_clen_and_captype(const std::string& word, int* captype) {
  503|  5.04k|  std::vector<w_char> workbuf;
  504|  5.04k|  return get_clen_and_captype(word, captype, workbuf);
  505|  5.04k|}
_ZN7HashMgr21remove_forbidden_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  528|  7.08k|void HashMgr::remove_forbidden_flag(const std::string& word) {
  529|  7.08k|  struct hentry* dp = lookup(word.c_str(), word.size());
  530|  7.08k|  if (!dp)
  ------------------
  |  Branch (530:7): [True: 6.87k, False: 204]
  ------------------
  531|  6.87k|    return;
  532|    416|  while (dp) {
  ------------------
  |  Branch (532:10): [True: 212, False: 204]
  ------------------
  533|    212|    if (dp->astr && TESTAFF(dp->astr, forbiddenword, dp->alen)) {
  ------------------
  |  |   99|     34|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 34]
  |  |  ------------------
  ------------------
  |  Branch (533:9): [True: 34, False: 178]
  ------------------
  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|    212|    dp = dp->next_homonym;
  553|    212|  }
  554|    204|}
_ZN7HashMgr3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  557|  5.03k|int HashMgr::add(const std::string& word) {
  558|  5.03k|  remove_forbidden_flag(word);
  559|  5.03k|  int captype, al = 0;
  560|  5.03k|  unsigned short* flags = nullptr;
  561|  5.03k|  int wcl = get_clen_and_captype(word, &captype);
  562|  5.03k|  if (add_word(word, wcl, flags, al, nullptr, false, captype, true))
  ------------------
  |  Branch (562:7): [True: 0, False: 5.03k]
  ------------------
  563|      0|    return 1;
  564|  5.03k|  return add_hidden_capitalized_word(word, wcl, flags, al, nullptr, captype);
  565|  5.03k|}
_ZN7HashMgr14add_with_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
  578|  2.04k|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.04k|  struct hentry* dp = lookup(example.c_str(), example.size());
  581|  2.04k|  remove_forbidden_flag(word);
  582|  2.04k|  if (dp && dp->astr) {
  ------------------
  |  Branch (582:7): [True: 87, False: 1.96k]
  |  Branch (582:13): [True: 16, False: 71]
  ------------------
  583|     16|    int captype;
  584|     16|    int wcl = get_clen_and_captype(word, &captype);
  585|     16|    auto flags = new unsigned short[dp->alen];
  586|     16|    memcpy(flags, dp->astr, dp->alen * sizeof(unsigned short));
  587|     16|    if (add_word(word, wcl, flags, dp->alen, nullptr, false, captype, true))
  ------------------
  |  Branch (587:9): [True: 0, False: 16]
  ------------------
  588|      0|      return 1;
  589|     16|    return add_hidden_capitalized_word(word, wcl, flags, dp->alen, nullptr, captype);
  590|     16|  }
  591|  2.03k|  return 1;
  592|  2.04k|}
_ZNK7HashMgr14walk_hashtableERiP6hentry:
  596|  2.08M|struct hentry* HashMgr::walk_hashtable(int& col, struct hentry* hp) const {
  597|  2.08M|  if (hp && hp->next != nullptr)
  ------------------
  |  Branch (597:7): [True: 2.02M, False: 62.3k]
  |  Branch (597:13): [True: 175k, False: 1.84M]
  ------------------
  598|   175k|    return hp->next;
  599|  62.9M|  for (col++; col < (int)tableptr.size(); ++col) {
  ------------------
  |  Branch (599:15): [True: 62.9M, False: 62.3k]
  ------------------
  600|  62.9M|    if (tableptr[col])
  ------------------
  |  Branch (600:9): [True: 1.84M, False: 61.0M]
  ------------------
  601|  1.84M|      return tableptr[col];
  602|  62.9M|  }
  603|       |  // null at end and reset to start
  604|  62.3k|  col = -1;
  605|  62.3k|  return nullptr;
  606|  1.91M|}
_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|        continue;
  701|     82|      } else if (ts[ap_pos - 1] != '\\')
  ------------------
  |  Branch (701:18): [True: 82, False: 0]
  ------------------
  702|     82|        break;
  703|       |      // replace "\/" with "/"
  704|      0|      ts.erase(ap_pos - 1, 1);
  705|      0|      ap_pos = ts.find('/', ap_pos);
  706|      0|    }
  707|       |
  708|    160|    unsigned short* flags;
  709|    160|    int al;
  710|    160|    if (ap_pos != std::string::npos && ap_pos != ts.size()) {
  ------------------
  |  Branch (710:9): [True: 82, False: 78]
  |  Branch (710:40): [True: 82, False: 0]
  ------------------
  711|     82|      std::string ap(ts.substr(ap_pos + 1));
  712|     82|      ts.resize(ap_pos);
  713|     82|      if (!aliasf.empty()) {
  ------------------
  |  Branch (713:11): [True: 2, False: 80]
  ------------------
  714|      2|        int index = atoi(ap.c_str());
  715|      2|        al = get_aliasf(index, &flags, dict);
  716|      2|        if (!al) {
  ------------------
  |  Branch (716:13): [True: 0, False: 2]
  ------------------
  717|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad flag vector alias\n",
  718|      0|                           dict->getlinenum());
  719|      0|        }
  720|     80|      } else {
  721|     80|        al = decode_flags(&flags, ap, dict, /* arena = */ true);
  722|     80|        if (al == -1) {
  ------------------
  |  Branch (722:13): [True: 0, False: 80]
  ------------------
  723|      0|          HUNSPELL_WARNING(stderr, "Can't allocate memory.\n");
  724|      0|          delete dict;
  725|      0|          return 6;
  726|      0|        }
  727|     80|        std::sort(flags, flags + al);
  728|     80|      }
  729|     82|    } else {
  730|     78|      al = 0;
  731|     78|      flags = nullptr;
  732|     78|    }
  733|       |
  734|    160|    int captype;
  735|    160|    int wcl = get_clen_and_captype(ts, &captype, workbuf);
  736|    160|    const std::string* dp_str = dp.empty() ? nullptr : &dp;
  ------------------
  |  Branch (736:33): [True: 156, False: 4]
  ------------------
  737|       |    // add the word and its index plus its capitalized form optionally
  738|       |    // flags are arena-allocated, so own_aff must be false
  739|    160|    bool own = false;
  740|    160|    if (add_word(ts, wcl, flags, al, dp_str, false, captype, own) ||
  ------------------
  |  Branch (740:9): [True: 0, False: 160]
  ------------------
  741|    160|        add_hidden_capitalized_word(ts, wcl, flags, al, dp_str, captype)) {
  ------------------
  |  Branch (741:9): [True: 0, False: 160]
  ------------------
  742|      0|      delete dict;
  743|      0|      return 5;
  744|      0|    }
  745|    160|  }
  746|       |
  747|     38|  int ret(0);
  748|       |
  749|       |  // reject ludicrous tablesizes
  750|     38|  if (tablesize > 8192 + nExtra && tablesize > nLineCount * 10 + nExtra) {
  ------------------
  |  Branch (750:7): [True: 0, False: 38]
  |  Branch (750:36): [True: 0, False: 0]
  ------------------
  751|      0|    HUNSPELL_WARNING(stderr, ".dic initial approximate word count line value of %d is too large for %d lines\n", tablesize, nLineCount);
  752|      0|    ret = 3;
  753|      0|  }
  754|       |
  755|     38|  delete dict;
  756|     38|  return ret;
  757|     38|}
_ZNK7HashMgr4hashEPKcm:
  761|   526M|int HashMgr::hash(const char* word, size_t len) const {
  762|   526M|  unsigned long hv = 0;
  763|   526M|  size_t i = 0;
  764|  2.60G|  while (i < 4 && i < len)
  ------------------
  |  Branch (764:10): [True: 2.09G, False: 503M]
  |  Branch (764:19): [True: 2.07G, False: 22.7M]
  ------------------
  765|  2.07G|    hv = (hv << 8) | word[i++];
  766|  11.2G|  while (i < len) {
  ------------------
  |  Branch (766:10): [True: 10.7G, False: 526M]
  ------------------
  767|  10.7G|    ROTATE(hv, ROTATE_LEN);
  ------------------
  |  |   44|  10.7G|  (v) = ((v) << (q)) | (((v) >> (32 - q)) & ((1 << (q)) - 1));
  ------------------
  768|  10.7G|    hv ^= word[i++];
  769|  10.7G|  }
  770|   526M|  return (unsigned long)hv % tableptr.size();
  771|   526M|}
_ZNK7HashMgr12decode_flagsEPPtRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEP7FileMgr:
  773|     16|int HashMgr::decode_flags(unsigned short** result, const std::string& flags, FileMgr* af) const {
  774|     16|  return decode_flags(result, flags, af, /* arena = */ false);
  775|     16|}
_ZNK7HashMgr12decode_flagsEPPtRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEP7FileMgrb:
  777|    100|int HashMgr::decode_flags(unsigned short** result, const std::string& flags, FileMgr* af, bool use_arena) const {
  778|    100|  auto alloc = [&](int n) -> unsigned short* {
  779|    100|    return use_arena ? (unsigned short*)this->arena_alloc(n * sizeof(unsigned short),
  780|    100|                                                          alignof(unsigned short))
  781|    100|                     : new unsigned short[n];
  782|    100|  };
  783|    100|  int len;
  784|    100|  if (flags.empty()) {
  ------------------
  |  Branch (784:7): [True: 0, False: 100]
  ------------------
  785|      0|    *result = nullptr;
  786|      0|    return 0;
  787|      0|  }
  788|    100|  switch (flag_mode) {
  789|      0|    case FLAG_LONG: {  // two-character flags (1x2yZz -> 1x 2y Zz)
  ------------------
  |  Branch (789:5): [True: 0, False: 100]
  ------------------
  790|      0|      len = flags.size();
  791|      0|      if ((len & 1) == 1 && af != nullptr)
  ------------------
  |  Branch (791:11): [True: 0, False: 0]
  |  Branch (791:29): [True: 0, False: 0]
  ------------------
  792|      0|        HUNSPELL_WARNING(stderr, "error: line %d: bad flagvector\n",
  793|      0|                         af->getlinenum());
  794|      0|      len >>= 1;
  795|      0|      *result = alloc(len);
  796|      0|      for (int i = 0; i < len; i++) {
  ------------------
  |  Branch (796:23): [True: 0, False: 0]
  ------------------
  797|      0|        unsigned short flag = ((unsigned short)((unsigned char)flags[i << 1]) << 8) |
  798|      0|                              ((unsigned short)((unsigned char)flags[(i << 1) | 1]));
  799|       |
  800|      0|        (*result)[i] = flag;
  801|      0|      }
  802|      0|      break;
  803|      0|    }
  804|      0|    case FLAG_NUM: {  // decimal numbers separated by comma (4521,23,233 -> 4521
  ------------------
  |  Branch (804:5): [True: 0, False: 100]
  ------------------
  805|       |                      // 23 233)
  806|      0|      len = int(1 + std::count_if(flags.begin(), flags.end(), [](char c) { return c == ','; }));
  807|      0|      *result = alloc(len);
  808|      0|      unsigned short* dest = *result;
  809|      0|      const char* src = flags.c_str();
  810|      0|      for (size_t p = 0; p < flags.size(); ++p) {
  ------------------
  |  Branch (810:26): [True: 0, False: 0]
  ------------------
  811|      0|        if (flags[p] == ',') {
  ------------------
  |  Branch (811:13): [True: 0, False: 0]
  ------------------
  812|      0|          int i = atoi(src);
  813|      0|          if ((i > std::numeric_limits<unsigned short>::max() || i < 0) && af != nullptr) {
  ------------------
  |  Branch (813:16): [True: 0, False: 0]
  |  Branch (813:66): [True: 0, False: 0]
  |  Branch (813:76): [True: 0, False: 0]
  ------------------
  814|      0|            HUNSPELL_WARNING(
  815|      0|                stderr, "error: line %d: flag id %d is out of range\n",
  816|      0|                af->getlinenum(), i);
  817|      0|             i = 0;
  818|      0|          }
  819|      0|          *dest = (unsigned short)i;
  820|      0|          if (*dest == 0 && af != nullptr)
  ------------------
  |  Branch (820:15): [True: 0, False: 0]
  |  Branch (820:29): [True: 0, False: 0]
  ------------------
  821|      0|            HUNSPELL_WARNING(stderr, "error: line %d: 0 is wrong flag id\n",
  822|      0|                             af->getlinenum());
  823|      0|          src = flags.c_str() + p + 1;
  824|      0|          dest++;
  825|      0|        }
  826|      0|      }
  827|      0|      int i = atoi(src);
  828|      0|      if ((i > std::numeric_limits<unsigned short>::max() || i < 0) && af) {
  ------------------
  |  Branch (828:12): [True: 0, False: 0]
  |  Branch (828:62): [True: 0, False: 0]
  |  Branch (828:72): [True: 0, False: 0]
  ------------------
  829|      0|        HUNSPELL_WARNING(stderr,
  830|      0|                         "error: line %d: flag id %d is out of range\n",
  831|      0|                         af->getlinenum(), i);
  832|      0|        i = 0;
  833|      0|      }
  834|      0|      *dest = (unsigned short)i;
  835|      0|      if (*dest == 0 && af)
  ------------------
  |  Branch (835:11): [True: 0, False: 0]
  |  Branch (835:25): [True: 0, False: 0]
  ------------------
  836|      0|        HUNSPELL_WARNING(stderr, "error: line %d: 0 is wrong flag id\n",
  837|      0|                         af->getlinenum());
  838|      0|      break;
  839|      0|    }
  840|      0|    case FLAG_UNI: {  // UTF-8 characters
  ------------------
  |  Branch (840:5): [True: 0, False: 100]
  ------------------
  841|      0|      std::vector<w_char> w;
  842|      0|      u8_u16(w, flags);
  843|      0|      len = w.size();
  844|      0|      *result = alloc(len);
  845|      0|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  846|      0|      memcpy(*result, w.data(), len * sizeof(unsigned short));
  847|       |#else
  848|       |      unsigned short* dest = *result;
  849|       |      for (const w_char wc : w) {
  850|       |        *dest = (unsigned short)wc;
  851|       |        dest++;
  852|       |      }
  853|       |#endif
  854|      0|      break;
  855|      0|    }
  856|    100|    default: {  // Ispell's one-character flags (erfg -> e r f g)
  ------------------
  |  Branch (856:5): [True: 100, False: 0]
  ------------------
  857|    100|      len = flags.size();
  858|    100|      *result = alloc(len);
  859|    100|      unsigned short* dest = *result;
  860|    118|      for (const char flag : flags) {
  ------------------
  |  Branch (860:28): [True: 118, False: 100]
  ------------------
  861|    118|        *dest = (unsigned char)flag;
  862|    118|        dest++;
  863|    118|      }
  864|    100|    }
  865|    100|  }
  866|    100|  return len;
  867|    100|}
_ZNK7HashMgr11decode_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  943|     92|unsigned short HashMgr::decode_flag(const std::string& f) const {
  944|     92|  unsigned short s = 0;
  945|     92|  int i;
  946|     92|  switch (flag_mode) {
  947|      0|    case FLAG_LONG:
  ------------------
  |  Branch (947:5): [True: 0, False: 92]
  ------------------
  948|      0|      if (f.size() >= 2)
  ------------------
  |  Branch (948:11): [True: 0, False: 0]
  ------------------
  949|      0|        s = ((unsigned short)((unsigned char)f[0]) << 8) | ((unsigned short)((unsigned char)f[1]));
  950|      0|      break;
  951|      0|    case FLAG_NUM:
  ------------------
  |  Branch (951:5): [True: 0, False: 92]
  ------------------
  952|      0|      i = atoi(f.c_str());
  953|      0|      if (i > std::numeric_limits<unsigned short>::max() || i < 0) {
  ------------------
  |  Branch (953:11): [True: 0, False: 0]
  |  Branch (953:61): [True: 0, False: 0]
  ------------------
  954|      0|        HUNSPELL_WARNING(stderr, "error: flag id %d is out of range\n", i);
  955|      0|        i = 0;
  956|      0|      }
  957|      0|      s = (unsigned short)i;
  958|      0|      break;
  959|      0|    case FLAG_UNI: {
  ------------------
  |  Branch (959:5): [True: 0, False: 92]
  ------------------
  960|      0|      std::vector<w_char> w;
  961|      0|      u8_u16(w, f);
  962|      0|      if (!w.empty())
  ------------------
  |  Branch (962:11): [True: 0, False: 0]
  ------------------
  963|      0|        s = (unsigned short)w[0];
  964|      0|      break;
  965|      0|    }
  966|     92|    default:
  ------------------
  |  Branch (966:5): [True: 92, False: 0]
  ------------------
  967|     92|      if (!f.empty())
  ------------------
  |  Branch (967:11): [True: 92, False: 0]
  ------------------
  968|     92|        s = (unsigned char)f[0];
  969|     92|  }
  970|     92|  if (s == 0)
  ------------------
  |  Branch (970:7): [True: 0, False: 92]
  ------------------
  971|      0|    HUNSPELL_WARNING(stderr, "error: 0 is wrong flag id\n");
  972|     92|  return s;
  973|     92|}
_ZN7HashMgr11load_configEPKcS1_:
 1009|     38|int HashMgr::load_config(const char* affpath, const char* key) {
 1010|     38|  int firstline = 1;
 1011|       |
 1012|       |  // open the affix file
 1013|     38|  FileMgr* afflst = new FileMgr(affpath, key);
 1014|       |
 1015|       |  // read in each line ignoring any that do not
 1016|       |  // start with a known line type indicator
 1017|       |
 1018|     38|  std::string line;
 1019|    922|  while (afflst->getline(line)) {
  ------------------
  |  Branch (1019:10): [True: 886, False: 36]
  ------------------
 1020|    886|    mychomp(line);
 1021|       |
 1022|       |    /* remove byte order mark */
 1023|    886|    if (firstline) {
  ------------------
  |  Branch (1023:9): [True: 38, False: 848]
  ------------------
 1024|     38|      firstline = 0;
 1025|     38|      if (line.compare(0, 3, "\xEF\xBB\xBF", 3) == 0) {
  ------------------
  |  Branch (1025:11): [True: 0, False: 38]
  ------------------
 1026|      0|        line.erase(0, 3);
 1027|      0|      }
 1028|     38|    }
 1029|       |
 1030|       |    /* parse in the try string */
 1031|    886|    if ((line.compare(0, 4, "FLAG", 4) == 0) && line.size() > 4 && isspace(line[4])) {
  ------------------
  |  Branch (1031:9): [True: 0, False: 886]
  |  Branch (1031:49): [True: 0, False: 0]
  |  Branch (1031:68): [True: 0, False: 0]
  ------------------
 1032|      0|      if (flag_mode != FLAG_CHAR) {
  ------------------
  |  Branch (1032:11): [True: 0, False: 0]
  ------------------
 1033|      0|        HUNSPELL_WARNING(stderr,
 1034|      0|                         "error: line %d: multiple definitions of the FLAG "
 1035|      0|                         "affix file parameter\n",
 1036|      0|                         afflst->getlinenum());
 1037|      0|      }
 1038|      0|      if (line.find("long") != std::string::npos)
  ------------------
  |  Branch (1038:11): [True: 0, False: 0]
  ------------------
 1039|      0|        flag_mode = FLAG_LONG;
 1040|      0|      if (line.find("num") != std::string::npos)
  ------------------
  |  Branch (1040:11): [True: 0, False: 0]
  ------------------
 1041|      0|        flag_mode = FLAG_NUM;
 1042|      0|      if (line.find("UTF-8") != std::string::npos)
  ------------------
  |  Branch (1042:11): [True: 0, False: 0]
  ------------------
 1043|      0|        flag_mode = FLAG_UNI;
 1044|      0|      if (flag_mode == FLAG_CHAR) {
  ------------------
  |  Branch (1044:11): [True: 0, False: 0]
  ------------------
 1045|      0|        HUNSPELL_WARNING(
 1046|      0|            stderr,
 1047|      0|            "error: line %d: FLAG needs `num', `long' or `UTF-8' parameter\n",
 1048|      0|            afflst->getlinenum());
 1049|      0|      }
 1050|      0|    }
 1051|       |
 1052|    886|    if (line.compare(0, 13, "FORBIDDENWORD", 13) == 0) {
  ------------------
  |  Branch (1052:9): [True: 2, False: 884]
  ------------------
 1053|      2|      std::string st;
 1054|      2|      if (!parse_string(line, st, afflst->getlinenum())) {
  ------------------
  |  Branch (1054:11): [True: 0, False: 2]
  ------------------
 1055|      0|        delete afflst;
 1056|      0|        return 1;
 1057|      0|      }
 1058|      2|      forbiddenword = decode_flag(st);
 1059|      2|    }
 1060|       |
 1061|    886|    if (line.compare(0, 3, "SET", 3) == 0) {
  ------------------
  |  Branch (1061:9): [True: 18, False: 868]
  ------------------
 1062|     18|      if (!parse_string(line, enc, afflst->getlinenum())) {
  ------------------
  |  Branch (1062:11): [True: 0, False: 18]
  ------------------
 1063|      0|        delete afflst;
 1064|      0|        return 1;
 1065|      0|      }
 1066|     18|      if (enc == "UTF-8") {
  ------------------
  |  Branch (1066:11): [True: 18, False: 0]
  ------------------
 1067|     18|        utf8 = 1;
 1068|     18|      } else
 1069|      0|        csconv = get_current_cs(enc);
 1070|     18|    }
 1071|       |
 1072|    886|    if (line.compare(0, 4, "LANG", 4) == 0) {
  ------------------
  |  Branch (1072:9): [True: 2, False: 884]
  ------------------
 1073|      2|      if (!parse_string(line, lang, afflst->getlinenum())) {
  ------------------
  |  Branch (1073:11): [True: 0, False: 2]
  ------------------
 1074|      0|        delete afflst;
 1075|      0|        return 1;
 1076|      0|      }
 1077|      2|      langnum = get_lang_num(lang);
 1078|      2|    }
 1079|       |
 1080|       |    /* parse in the ignored characters (for example, Arabic optional diacritics
 1081|       |     * characters */
 1082|    886|    if (line.compare(0, 6, "IGNORE", 6) == 0) {
  ------------------
  |  Branch (1082:9): [True: 4, False: 882]
  ------------------
 1083|      4|      if (!parse_array(line, ignorechars, ignorechars_utf16,
  ------------------
  |  Branch (1083:11): [True: 0, False: 4]
  ------------------
 1084|      4|                       utf8, afflst->getlinenum())) {
 1085|      0|        delete afflst;
 1086|      0|        return 1;
 1087|      0|      }
 1088|      4|    }
 1089|       |
 1090|    886|    if ((line.compare(0, 2, "AF", 2) == 0) && line.size() > 2 && isspace(line[2])) {
  ------------------
  |  Branch (1090:9): [True: 2, False: 884]
  |  Branch (1090:47): [True: 2, False: 0]
  |  Branch (1090:66): [True: 2, False: 0]
  ------------------
 1091|      2|      if (!parse_aliasf(line, afflst)) {
  ------------------
  |  Branch (1091:11): [True: 0, False: 2]
  ------------------
 1092|      0|        delete afflst;
 1093|      0|        return 1;
 1094|      0|      }
 1095|      2|    }
 1096|       |
 1097|    886|    if ((line.compare(0, 2, "AM", 2) == 0) && line.size() > 2 && isspace(line[2])) {
  ------------------
  |  Branch (1097:9): [True: 0, False: 886]
  |  Branch (1097:47): [True: 0, False: 0]
  |  Branch (1097:66): [True: 0, False: 0]
  ------------------
 1098|      0|      if (!parse_aliasm(line, afflst)) {
  ------------------
  |  Branch (1098:11): [True: 0, False: 0]
  ------------------
 1099|      0|        delete afflst;
 1100|      0|        return 1;
 1101|      0|      }
 1102|      0|    }
 1103|       |
 1104|    886|    if (line.compare(0, 15, "COMPLEXPREFIXES", 15) == 0)
  ------------------
  |  Branch (1104:9): [True: 2, False: 884]
  ------------------
 1105|      2|      complexprefixes = 1;
 1106|       |
 1107|       |    /* parse in the typical fault correcting table */
 1108|    886|    if (line.compare(0, 3, "REP", 3) == 0) {
  ------------------
  |  Branch (1108:9): [True: 6, False: 880]
  ------------------
 1109|      6|      if (!parse_reptable(line, afflst)) {
  ------------------
  |  Branch (1109:11): [True: 0, False: 6]
  ------------------
 1110|      0|        delete afflst;
 1111|      0|        return 1;
 1112|      0|      }
 1113|      6|    }
 1114|       |
 1115|       |    // don't check the full affix file, yet
 1116|    886|    if (((line.compare(0, 3, "SFX", 3) == 0) ||
  ------------------
  |  Branch (1116:10): [True: 42, False: 844]
  ------------------
 1117|    844|         (line.compare(0, 3, "PFX", 3) == 0)) &&
  ------------------
  |  Branch (1117:10): [True: 24, False: 820]
  ------------------
 1118|     66|            line.size() > 3 && isspace(line[3]) &&
  ------------------
  |  Branch (1118:13): [True: 66, False: 0]
  |  Branch (1118:32): [True: 66, False: 0]
  ------------------
 1119|     66|            !reptable.empty()) // (REP table is in the end of Afrikaans aff file)
  ------------------
  |  Branch (1119:13): [True: 2, False: 64]
  ------------------
 1120|      2|      break;
 1121|    886|  }
 1122|       |
 1123|     38|  delete afflst;
 1124|     38|  return 0;
 1125|     38|}
_ZN7HashMgr12parse_aliasfERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 1128|      2|bool HashMgr::parse_aliasf(const std::string& line, FileMgr* af) {
 1129|      2|  if (!aliasf.empty()) {
  ------------------
  |  Branch (1129:7): [True: 0, False: 2]
  ------------------
 1130|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 1131|      0|                     af->getlinenum());
 1132|      0|    return false;
 1133|      0|  }
 1134|      2|  int i = 0, np = 0, numaliasf = 0;
 1135|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 1136|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (1136:10): [True: 4, False: 2]
  ------------------
 1137|      4|    switch (i) {
 1138|      2|      case 0: {
  ------------------
  |  Branch (1138:7): [True: 2, False: 2]
  ------------------
 1139|      2|        np++;
 1140|      2|        break;
 1141|      0|      }
 1142|      2|      case 1: {
  ------------------
  |  Branch (1142:7): [True: 2, False: 2]
  ------------------
 1143|      2|        numaliasf = atoi(std::string(start_piece, iter).c_str());
 1144|      2|        if (numaliasf < 1) {
  ------------------
  |  Branch (1144:13): [True: 0, False: 2]
  ------------------
 1145|      0|          aliasf.clear();
 1146|      0|          aliasflen.clear();
 1147|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 1148|      0|                           af->getlinenum());
 1149|      0|          return false;
 1150|      0|        }
 1151|      2|        aliasf.reserve(std::min(numaliasf, 16384));
 1152|      2|        aliasflen.reserve(std::min(numaliasf, 16384));
 1153|      2|        np++;
 1154|      2|        break;
 1155|      2|      }
 1156|      0|      default:
  ------------------
  |  Branch (1156:7): [True: 0, False: 4]
  ------------------
 1157|      0|        break;
 1158|      4|    }
 1159|      4|    ++i;
 1160|      4|    start_piece = mystrsep(line, iter);
 1161|      4|  }
 1162|      2|  if (np != 2) {
  ------------------
  |  Branch (1162:7): [True: 0, False: 2]
  ------------------
 1163|      0|    aliasf.clear();
 1164|      0|    aliasflen.clear();
 1165|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 1166|      0|                     af->getlinenum());
 1167|      0|    return false;
 1168|      0|  }
 1169|       |
 1170|       |  /* now parse the numaliasf lines to read in the remainder of the table */
 1171|      6|  for (int j = 0; j < numaliasf; ++j) {
  ------------------
  |  Branch (1171:19): [True: 4, False: 2]
  ------------------
 1172|      4|    std::string nl;
 1173|      4|    unsigned short* alias = nullptr;
 1174|      4|    unsigned aliaslen = 0;
 1175|      4|    i = 0;
 1176|      4|    if (af->getline(nl)) {
  ------------------
  |  Branch (1176:9): [True: 4, False: 0]
  ------------------
 1177|      4|      mychomp(nl);
 1178|      4|      iter = nl.begin();
 1179|      4|      start_piece = mystrsep(nl, iter);
 1180|      4|      bool errored = false;
 1181|     12|      while (!errored && start_piece != nl.end()) {
  ------------------
  |  Branch (1181:14): [True: 12, False: 0]
  |  Branch (1181:14): [True: 8, False: 4]
  |  Branch (1181:26): [True: 8, False: 4]
  ------------------
 1182|      8|        switch (i) {
 1183|      4|          case 0: {
  ------------------
  |  Branch (1183:11): [True: 4, False: 4]
  ------------------
 1184|      4|            if (nl.compare(start_piece - nl.begin(), 2, "AF", 2) != 0) {
  ------------------
  |  Branch (1184:17): [True: 0, False: 4]
  ------------------
 1185|      0|              errored = true;
 1186|      0|              break;
 1187|      0|            }
 1188|      4|            break;
 1189|      4|          }
 1190|      4|          case 1: {
  ------------------
  |  Branch (1190:11): [True: 4, False: 4]
  ------------------
 1191|      4|            std::string piece(start_piece, iter);
 1192|      4|            aliaslen =
 1193|      4|                (unsigned short)decode_flags(&alias, piece, af, /* arena = */ true);
 1194|      4|            std::sort(alias, alias + aliaslen);
 1195|      4|            break;
 1196|      4|          }
 1197|      0|          default:
  ------------------
  |  Branch (1197:11): [True: 0, False: 8]
  ------------------
 1198|      0|            break;
 1199|      8|        }
 1200|      8|        ++i;
 1201|      8|        start_piece = mystrsep(nl, iter);
 1202|      8|      }
 1203|      4|    }
 1204|      4|    if (!alias) {
  ------------------
  |  Branch (1204:9): [True: 0, False: 4]
  ------------------
 1205|      0|      for (int k = 0; k < j; ++k) {
  ------------------
  |  Branch (1205:23): [True: 0, False: 0]
  ------------------
 1206|      0|        arena_free(aliasf[k]);
 1207|      0|      }
 1208|      0|      aliasf.clear();
 1209|      0|      aliasflen.clear();
 1210|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 1211|      0|                       af->getlinenum());
 1212|      0|      return false;
 1213|      0|    }
 1214|       |
 1215|      4|    aliasf.push_back(alias);
 1216|      4|    aliasflen.push_back(aliaslen);
 1217|      4|  }
 1218|      2|  return true;
 1219|      2|}
_ZNK7HashMgr9is_aliasfEv:
 1221|     44|int HashMgr::is_aliasf() const {
 1222|     44|  return !aliasf.empty();
 1223|     44|}
_ZNK7HashMgr10get_aliasfEiPPtP7FileMgr:
 1225|      4|int HashMgr::get_aliasf(int index, unsigned short** fvec, FileMgr* af) const {
 1226|      4|  if (index > 0 && static_cast<size_t>(index) <= aliasflen.size()) {
  ------------------
  |  Branch (1226:7): [True: 4, False: 0]
  |  Branch (1226:20): [True: 4, False: 0]
  ------------------
 1227|      4|    *fvec = aliasf[index - 1];
 1228|      4|    return aliasflen[index - 1];
 1229|      4|  }
 1230|      0|  HUNSPELL_WARNING(stderr, "error: line %d: bad flag alias index: %d\n",
 1231|      0|                   af->getlinenum(), index);
 1232|      0|  *fvec = nullptr;
 1233|      0|  return 0;
 1234|      4|}
_ZNK7HashMgr9is_aliasmEv:
 1332|     32|int HashMgr::is_aliasm() const {
 1333|     32|  return !aliasm.empty();
 1334|     32|}
_ZN7HashMgr14parse_reptableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 1344|      6|bool HashMgr::parse_reptable(const std::string& line, FileMgr* af) {
 1345|      6|  if (!reptable.empty()) {
  ------------------
  |  Branch (1345:7): [True: 0, False: 6]
  ------------------
 1346|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 1347|      0|                     af->getlinenum());
 1348|      0|    return false;
 1349|      0|  }
 1350|      6|  int numrep = -1, i = 0, np = 0;
 1351|      6|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 1352|     18|  while (start_piece != line.end()) {
  ------------------
  |  Branch (1352:10): [True: 12, False: 6]
  ------------------
 1353|     12|    switch (i) {
 1354|      6|      case 0: {
  ------------------
  |  Branch (1354:7): [True: 6, False: 6]
  ------------------
 1355|      6|        np++;
 1356|      6|        break;
 1357|      0|      }
 1358|      6|      case 1: {
  ------------------
  |  Branch (1358:7): [True: 6, False: 6]
  ------------------
 1359|      6|        numrep = atoi(std::string(start_piece, iter).c_str());
 1360|      6|        if (numrep < 1) {
  ------------------
  |  Branch (1360:13): [True: 0, False: 6]
  ------------------
 1361|      0|          HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n",
 1362|      0|                           af->getlinenum());
 1363|      0|          return false;
 1364|      0|        }
 1365|      6|        reptable.reserve(std::min(numrep, 16384));
 1366|      6|        np++;
 1367|      6|        break;
 1368|      6|      }
 1369|      0|      default:
  ------------------
  |  Branch (1369:7): [True: 0, False: 12]
  ------------------
 1370|      0|        break;
 1371|     12|    }
 1372|     12|    ++i;
 1373|     12|    start_piece = mystrsep(line, iter);
 1374|     12|  }
 1375|      6|  if (np != 2) {
  ------------------
  |  Branch (1375:7): [True: 0, False: 6]
  ------------------
 1376|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 1377|      0|                     af->getlinenum());
 1378|      0|    return false;
 1379|      0|  }
 1380|       |
 1381|       |  /* now parse the numrep lines to read in the remainder of the table */
 1382|     12|  for (int j = 0; j < numrep; ++j) {
  ------------------
  |  Branch (1382:19): [True: 6, False: 6]
  ------------------
 1383|      6|    std::string nl;
 1384|      6|    reptable.emplace_back();
 1385|      6|    int type = 0;
 1386|      6|    if (af->getline(nl)) {
  ------------------
  |  Branch (1386:9): [True: 6, False: 0]
  ------------------
 1387|      6|      mychomp(nl);
 1388|      6|      iter = nl.begin();
 1389|      6|      i = 0;
 1390|      6|      start_piece = mystrsep(nl, iter);
 1391|      6|      bool errored = false;
 1392|     24|      while (!errored && start_piece != nl.end()) {
  ------------------
  |  Branch (1392:14): [True: 24, False: 0]
  |  Branch (1392:14): [True: 18, False: 6]
  |  Branch (1392:26): [True: 18, False: 6]
  ------------------
 1393|     18|        switch (i) {
 1394|      6|          case 0: {
  ------------------
  |  Branch (1394:11): [True: 6, False: 12]
  ------------------
 1395|      6|            if (nl.compare(start_piece - nl.begin(), 3, "REP", 3) != 0) {
  ------------------
  |  Branch (1395:17): [True: 0, False: 6]
  ------------------
 1396|      0|              errored = true;
 1397|      0|              break;
 1398|      0|            }
 1399|      6|            break;
 1400|      6|          }
 1401|      6|          case 1: {
  ------------------
  |  Branch (1401:11): [True: 6, False: 12]
  ------------------
 1402|      6|            if (*start_piece == '^')
  ------------------
  |  Branch (1402:17): [True: 0, False: 6]
  ------------------
 1403|      0|              type = 1;
 1404|      6|            reptable.back().pattern.assign(start_piece + type, iter);
 1405|      6|            mystrrep(reptable.back().pattern, "_", " ");
 1406|      6|            if (!reptable.back().pattern.empty() && reptable.back().pattern[reptable.back().pattern.size() - 1] == '$') {
  ------------------
  |  Branch (1406:17): [True: 6, False: 0]
  |  Branch (1406:53): [True: 0, False: 6]
  ------------------
 1407|      0|              type += 2;
 1408|      0|              reptable.back().pattern.resize(reptable.back().pattern.size() - 1);
 1409|      0|            }
 1410|      6|            break;
 1411|      6|          }
 1412|      6|          case 2: {
  ------------------
  |  Branch (1412:11): [True: 6, False: 12]
  ------------------
 1413|      6|            reptable.back().outstrings[type].assign(start_piece, iter);
 1414|      6|            mystrrep(reptable.back().outstrings[type], "_", " ");
 1415|      6|            break;
 1416|      6|          }
 1417|      0|          default:
  ------------------
  |  Branch (1417:11): [True: 0, False: 18]
  ------------------
 1418|      0|            break;
 1419|     18|        }
 1420|     18|        ++i;
 1421|     18|        start_piece = mystrsep(nl, iter);
 1422|     18|      }
 1423|      6|    }
 1424|      6|    if (reptable.back().pattern.empty() || reptable.back().outstrings[type].empty()) {
  ------------------
  |  Branch (1424:9): [True: 0, False: 6]
  |  Branch (1424:44): [True: 0, False: 6]
  ------------------
 1425|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 1426|      0|                       af->getlinenum());
 1427|      0|      reptable.clear();
 1428|      0|      return false;
 1429|      0|    }
 1430|      6|  }
 1431|      6|  return true;
 1432|      6|}
_ZNK7HashMgr12get_reptableEv:
 1435|   376k|const std::vector<replentry>& HashMgr::get_reptable() const {
 1436|   376k|  return reptable;
 1437|   376k|}
_ZNK7HashMgr11arena_allocEmm:
 1439|  9.59k|void* HashMgr::arena_alloc(size_t num_bytes, size_t alignment) const {
 1440|       |  // Fixed-size 64KB chunks: small enough to avoid significant waste on small
 1441|       |  // dictionaries, large enough to amortize per-chunk malloc overhead on large
 1442|       |  // ones. make_unique throws std::bad_alloc on OOM.
 1443|  9.59k|  static const size_t MIN_CHUNK_SIZE = 65536;
 1444|  9.59k|  static const size_t MAX_ALIGNMENT = alignof(max_align_t);
 1445|       |  // Chunk sizes are rounded up to MAX_ALIGNMENT below; with this invariant,
 1446|       |  // any alignment that divides MAX_ALIGNMENT keeps aligned_offset within bounds.
 1447|  9.59k|  assert(alignment > 0 && alignment <= MAX_ALIGNMENT);
  ------------------
  |  Branch (1447:3): [True: 9.59k, False: 0]
  |  Branch (1447:3): [True: 9.59k, False: 0]
  |  Branch (1447:3): [True: 9.59k, False: 0]
  ------------------
 1448|       |  // Pad the offset up to the requested alignment before placing this allocation.
 1449|       |  // make_unique returns memory aligned for any scalar, so chunk-start is fine.
 1450|  9.59k|  size_t aligned_offset = (current_chunk_offset + alignment - 1) & ~(alignment - 1);
 1451|  9.59k|  if (arena.empty() || current_chunk_size - aligned_offset < num_bytes) {
  ------------------
  |  Branch (1451:7): [True: 38, False: 9.55k]
  |  Branch (1451:24): [True: 47, False: 9.50k]
  ------------------
 1452|       |    // Round the new chunk's size up to a multiple of MAX_ALIGNMENT so that an
 1453|       |    // oversized num_bytes (>= MIN_CHUNK_SIZE) cannot leave a non-aligned
 1454|       |    // current_chunk_size that would later cause aligned_offset to overshoot.
 1455|       |    // Allocate before mutating current_chunk_size so a throwing make_unique
 1456|       |    // leaves the HashMgr in a consistent state.
 1457|     85|    size_t new_size = std::max(MIN_CHUNK_SIZE, num_bytes);
 1458|     85|    new_size = (new_size + MAX_ALIGNMENT - 1) & ~(MAX_ALIGNMENT - 1);
 1459|     85|    arena.push_back(std::make_unique<uint8_t[]>(new_size));
 1460|     85|    current_chunk_size = new_size;
 1461|     85|    aligned_offset = 0;
 1462|     85|  }
 1463|       |
 1464|  9.59k|  uint8_t* ptr = &arena.back()[aligned_offset];
 1465|  9.59k|  current_chunk_offset = aligned_offset + num_bytes;
 1466|  9.59k|  ++outstanding_arena_allocations;
 1467|  9.59k|  return ptr;
 1468|  9.59k|}
_ZNK7HashMgr10arena_freeEPv:
 1470|    213|void HashMgr::arena_free(void*) const {
 1471|       |  // The arena vector owns all allocations and frees them in bulk at HashMgr
 1472|       |  // destruction, so this is a no-op for the memory itself. The counter is a
 1473|       |  // memory-safety check: more arena_free calls than arena_alloc calls would
 1474|       |  // indicate a double-free or use-after-free in Hunspell. Abort hard rather
 1475|       |  // than silently desynchronize tracking, even in release builds.
 1476|    213|  if (outstanding_arena_allocations == 0) {
  ------------------
  |  Branch (1476:7): [True: 0, False: 213]
  ------------------
 1477|      0|    std::abort();
 1478|      0|  }
 1479|    213|  --outstanding_arena_allocations;
 1480|    213|}
hashmgr.cxx:_ZZNK7HashMgr12decode_flagsEPPtRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEP7FileMgrbENK3$_0clEi:
  778|    100|  auto alloc = [&](int n) -> unsigned short* {
  779|    100|    return use_arena ? (unsigned short*)this->arena_alloc(n * sizeof(unsigned short),
  ------------------
  |  Branch (779:12): [True: 84, False: 16]
  ------------------
  780|     84|                                                          alignof(unsigned short))
  781|    100|                     : new unsigned short[n];
  782|    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());
  ------------------
  |  |   82|     38|#define MAXSUGGESTION 15
  ------------------
  216|     38|}
_ZN12HunspellImpl12clean_ignoreERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
  235|  21.8M|                                const std::string& src) {
  236|  21.8M|  dest.clear();
  237|  21.8M|  dest.assign(src);
  238|  21.8M|  const char* ignoredchars = pAMgr ? pAMgr->get_ignore() : nullptr;
  ------------------
  |  Branch (238:30): [True: 21.8M, False: 0]
  ------------------
  239|  21.8M|  if (ignoredchars != nullptr) {
  ------------------
  |  Branch (239:7): [True: 2.17M, False: 19.6M]
  ------------------
  240|  2.17M|    if (utf8) {
  ------------------
  |  Branch (240:9): [True: 512k, False: 1.66M]
  ------------------
  241|   512k|      const std::vector<w_char>& ignoredchars_utf16 =
  242|   512k|          pAMgr->get_ignore_utf16();
  243|   512k|      remove_ignored_chars_utf(dest, ignoredchars_utf16);
  244|  1.66M|    } else {
  245|  1.66M|      remove_ignored_chars(dest, ignoredchars);
  246|  1.66M|    }
  247|  2.17M|  }
  248|  21.8M|}
_ZN12HunspellImpl10cleanword2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEERKS6_PiPm:
  262|  10.3M|                         size_t* pabbrev) {
  263|  10.3M|  dest.clear();
  264|  10.3M|  dest_utf.clear();
  265|       |
  266|       |  // remove IGNORE characters from the string
  267|  10.3M|  std::string w2;
  268|  10.3M|  clean_ignore(w2, src);
  269|       |
  270|  10.3M|  const char* q = w2.c_str();
  271|  10.3M|  int nl = (int)w2.size();
  272|       |
  273|       |  // first skip over any leading blanks
  274|  10.4M|  while (*q == ' ') {
  ------------------
  |  Branch (274:10): [True: 131k, False: 10.3M]
  ------------------
  275|   131k|    ++q;
  276|   131k|    nl--;
  277|   131k|  }
  278|       |
  279|       |  // now strip off any trailing periods (recording their presence)
  280|  10.3M|  *pabbrev = 0;
  281|       |
  282|  12.2M|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (282:10): [True: 11.7M, False: 504k]
  |  Branch (282:22): [True: 1.93M, False: 9.85M]
  ------------------
  283|  1.93M|    nl--;
  284|  1.93M|    (*pabbrev)++;
  285|  1.93M|  }
  286|       |
  287|       |  // if no characters are left it can't be capitalized
  288|  10.3M|  if (nl <= 0) {
  ------------------
  |  Branch (288:7): [True: 504k, False: 9.85M]
  ------------------
  289|   504k|    *pcaptype = NOCAP;
  ------------------
  |  |   92|   504k|#define NOCAP 0
  ------------------
  290|   504k|    return 0;
  291|   504k|  }
  292|       |
  293|  9.85M|  dest.append(q, nl);
  294|  9.85M|  nl = dest.size();
  295|  9.85M|  if (utf8) {
  ------------------
  |  Branch (295:7): [True: 2.27M, False: 7.57M]
  ------------------
  296|  2.27M|    u8_u16(dest_utf, dest);
  297|  2.27M|    *pcaptype = get_captype_utf8(dest_utf, langnum);
  298|  7.57M|  } else {
  299|  7.57M|    *pcaptype = get_captype(dest, csconv);
  300|  7.57M|  }
  301|  9.85M|  return nl;
  302|  10.3M|}
_ZN12HunspellImpl9cleanwordERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_PiSA_:
  307|  5.53k|                        int* pabbrev) {
  308|  5.53k|  dest.clear();
  309|  5.53k|  const unsigned char* q = (const unsigned char*)src.c_str();
  310|  5.53k|  int firstcap = 0, nl = (int)src.size();
  311|       |
  312|       |  // first skip over any leading blanks
  313|  10.7k|  while (*q == ' ') {
  ------------------
  |  Branch (313:10): [True: 5.18k, False: 5.53k]
  ------------------
  314|  5.18k|    ++q;
  315|  5.18k|    nl--;
  316|  5.18k|  }
  317|       |
  318|       |  // now strip off any trailing periods (recording their presence)
  319|  5.53k|  *pabbrev = 0;
  320|       |
  321|  13.8k|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (321:10): [True: 13.6k, False: 171]
  |  Branch (321:22): [True: 8.30k, False: 5.36k]
  ------------------
  322|  8.30k|    nl--;
  323|  8.30k|    (*pabbrev)++;
  324|  8.30k|  }
  325|       |
  326|       |  // if no characters are left it can't be capitalized
  327|  5.53k|  if (nl <= 0) {
  ------------------
  |  Branch (327:7): [True: 171, False: 5.36k]
  ------------------
  328|    171|    *pcaptype = NOCAP;
  ------------------
  |  |   92|    171|#define NOCAP 0
  ------------------
  329|    171|    return;
  330|    171|  }
  331|       |
  332|       |  // now determine the capitalization type of the first nl letters
  333|  5.36k|  int ncap = 0;
  334|  5.36k|  int nneutral = 0;
  335|  5.36k|  int nc = 0;
  336|       |
  337|  5.36k|  if (!utf8) {
  ------------------
  |  Branch (337:7): [True: 2.82k, False: 2.53k]
  ------------------
  338|   445k|    while (nl > 0) {
  ------------------
  |  Branch (338:12): [True: 442k, False: 2.82k]
  ------------------
  339|   442k|      nc++;
  340|   442k|      if (csconv[(*q)].ccase)
  ------------------
  |  Branch (340:11): [True: 390k, False: 51.4k]
  ------------------
  341|   390k|        ncap++;
  342|   442k|      if (csconv[(*q)].cupper == csconv[(*q)].clower)
  ------------------
  |  Branch (342:11): [True: 43.0k, False: 399k]
  ------------------
  343|  43.0k|        nneutral++;
  344|   442k|      dest.push_back(*q++);
  345|   442k|      nl--;
  346|   442k|    }
  347|       |    // remember to terminate the destination string
  348|  2.82k|    firstcap = csconv[static_cast<unsigned char>(dest[0])].ccase;
  349|  2.82k|  } else {
  350|  2.53k|    std::vector<w_char> t;
  351|  2.53k|    u8_u16(t, src);
  352|   148k|    for (auto& wc : t) {
  ------------------
  |  Branch (352:19): [True: 148k, False: 2.53k]
  ------------------
  353|   148k|      const auto idx = (unsigned short)wc;
  354|   148k|      const auto low = unicodetolower(idx, langnum);
  355|   148k|      if (idx != low)
  ------------------
  |  Branch (355:11): [True: 104k, False: 44.5k]
  ------------------
  356|   104k|        ncap++;
  357|   148k|      if (unicodetoupper(idx, langnum) == low)
  ------------------
  |  Branch (357:11): [True: 43.0k, False: 105k]
  ------------------
  358|  43.0k|        nneutral++;
  359|   148k|    }
  360|  2.53k|    u16_u8(dest, t);
  361|  2.53k|    if (ncap) {
  ------------------
  |  Branch (361:9): [True: 1.37k, False: 1.15k]
  ------------------
  362|  1.37k|      const auto idx = (unsigned short)t[0];
  363|  1.37k|      firstcap = (idx != unicodetolower(idx, langnum));
  364|  1.37k|    }
  365|  2.53k|  }
  366|       |
  367|       |  // now finally set the captype
  368|  5.36k|  if (ncap == 0) {
  ------------------
  |  Branch (368:7): [True: 2.33k, False: 3.02k]
  ------------------
  369|  2.33k|    *pcaptype = NOCAP;
  ------------------
  |  |   92|  2.33k|#define NOCAP 0
  ------------------
  370|  3.02k|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (370:14): [True: 1.69k, False: 1.33k]
  |  Branch (370:29): [True: 1.29k, False: 404]
  ------------------
  371|  1.29k|    *pcaptype = INITCAP;
  ------------------
  |  |   93|  1.29k|#define INITCAP 1
  ------------------
  372|  1.73k|  } else if ((ncap == nc) || ((ncap + nneutral) == nc)) {
  ------------------
  |  Branch (372:14): [True: 50, False: 1.68k]
  |  Branch (372:30): [True: 339, False: 1.34k]
  ------------------
  373|    389|    *pcaptype = ALLCAP;
  ------------------
  |  |   94|    389|#define ALLCAP 2
  ------------------
  374|  1.34k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (374:14): [True: 973, False: 374]
  |  Branch (374:28): [True: 692, False: 281]
  ------------------
  375|    692|    *pcaptype = HUHINITCAP;
  ------------------
  |  |   96|    692|#define HUHINITCAP 4
  ------------------
  376|    692|  } else {
  377|    655|    *pcaptype = HUHCAP;
  ------------------
  |  |   95|    655|#define HUHCAP 3
  ------------------
  378|    655|  }
  379|  5.36k|}
_ZN12HunspellImpl8mkallcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  381|  3.37k|void HunspellImpl::mkallcap(std::string& u8) {
  382|  3.37k|  if (utf8) {
  ------------------
  |  Branch (382:7): [True: 1.67k, False: 1.70k]
  ------------------
  383|  1.67k|    std::vector<w_char> u16;
  384|  1.67k|    u8_u16(u16, u8);
  385|  1.67k|    ::mkallcap_utf(u16, langnum);
  386|  1.67k|    u16_u8(u8, u16);
  387|  1.70k|  } else {
  388|  1.70k|    ::mkallcap(u8, csconv);
  389|  1.70k|  }
  390|  3.37k|}
_ZN12HunspellImpl11mkallsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
  392|   971k|int HunspellImpl::mkallsmall2(std::string& u8, std::vector<w_char>& u16) {
  393|   971k|  if (utf8) {
  ------------------
  |  Branch (393:7): [True: 272k, False: 699k]
  ------------------
  394|   272k|    ::mkallsmall_utf(u16, langnum);
  395|   272k|    u16_u8(u8, u16);
  396|   699k|  } else {
  397|   699k|    ::mkallsmall(u8, csconv);
  398|   699k|  }
  399|   971k|  return u8.size();
  400|   971k|}
_ZN12HunspellImpl11is_keepcaseEPK6hentry:
  438|  16.7k|int HunspellImpl::is_keepcase(const hentry* rv) {
  439|  16.7k|  return pAMgr && rv->astr && pAMgr->get_keepcase() &&
  ------------------
  |  Branch (439:10): [True: 16.7k, False: 0]
  |  Branch (439:19): [True: 1.60k, False: 15.1k]
  |  Branch (439:31): [True: 149, False: 1.45k]
  ------------------
  440|    149|         TESTAFF(rv->astr, pAMgr->get_keepcase(), rv->alen);
  ------------------
  |  |   99|  16.9k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 32, False: 117]
  |  |  ------------------
  ------------------
  441|  16.7k|}
_ZN12HunspellImpl10insert_sugERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_:
  444|  13.2k|void HunspellImpl::insert_sug(std::vector<std::string>& slst, const std::string& word) {
  445|  13.2k|  slst.insert(slst.begin(), word);
  446|  13.2k|}
_ZN12HunspellImpl5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  450|  10.3M|                         std::chrono::steady_clock::time_point suggest_start) {
  451|       |  // something very broken if spell ends up calling itself with the same word
  452|  10.3M|  if (std::find(candidate_stack.begin(), candidate_stack.end(), word) != candidate_stack.end())
  ------------------
  |  Branch (452:7): [True: 0, False: 10.3M]
  ------------------
  453|      0|    return false;
  454|       |
  455|  10.3M|  if (candidate_stack.size() >= MAXBREAKDEPTH)
  ------------------
  |  |   86|  10.3M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (455:7): [True: 0, False: 10.3M]
  ------------------
  456|      0|    return false;
  457|       |
  458|  10.3M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  10.3M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (458:7): [True: 0, False: 10.3M]
  ------------------
  459|      0|    return false;
  460|       |
  461|  10.3M|  candidate_stack.push_back(word);
  462|  10.3M|  bool r = spell_internal(word, candidate_stack, info, root, suggest_start);
  463|  10.3M|  candidate_stack.pop_back();
  464|       |
  465|  10.3M|  if (r && root) {
  ------------------
  |  Branch (465:7): [True: 2.14M, False: 8.21M]
  |  Branch (465:12): [True: 0, False: 2.14M]
  ------------------
  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|  10.3M|  return r;
  476|  10.3M|}
_ZN12HunspellImpl14spell_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  480|  10.3M|                                  std::chrono::steady_clock::time_point suggest_start) {
  481|  10.3M|  struct hentry* rv = nullptr;
  482|       |
  483|  10.3M|  int info2 = 0;
  484|  10.3M|  if (!info)
  ------------------
  |  Branch (484:7): [True: 10.3M, False: 35]
  ------------------
  485|  10.3M|    info = &info2;
  486|     35|  else
  487|     35|    *info = 0;
  488|       |
  489|       |  // Hunspell supports XML input of the simplified API (see manual)
  490|  10.3M|  if (word == SPELL_XML)
  ------------------
  |  |   79|  10.3M|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (490:7): [True: 69.2k, False: 10.2M]
  ------------------
  491|  69.2k|    return true;
  492|  10.2M|  if (utf8) {
  ------------------
  |  Branch (492:7): [True: 2.33M, False: 7.94M]
  ------------------
  493|  2.33M|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   86|  2.33M|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   89|  2.33M|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (493:9): [True: 3.73k, False: 2.33M]
  ------------------
  494|  3.73k|      return false;
  495|  7.94M|  } else {
  496|  7.94M|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   89|  7.94M|#define MAXWORDLEN 100
  ------------------
  |  Branch (496:9): [True: 6.18k, False: 7.94M]
  ------------------
  497|  6.18k|      return false;
  498|  7.94M|  }
  499|  10.2M|  int captype = NOCAP;
  ------------------
  |  |   92|  10.2M|#define NOCAP 0
  ------------------
  500|  10.2M|  size_t abbv = 0;
  501|  10.2M|  size_t wl = 0;
  502|       |
  503|  10.2M|  std::string scw;
  504|  10.2M|  std::vector<w_char> sunicw;
  505|       |
  506|       |  // input conversion
  507|  10.2M|  RepList* rl = pAMgr ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (507:17): [True: 10.2M, False: 0]
  ------------------
  508|  10.2M|  {
  509|  10.2M|    std::string wspace;
  510|       |
  511|  10.2M|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (511:23): [True: 340k, False: 9.93M]
  ------------------
  512|  10.2M|    if (convstatus)
  ------------------
  |  Branch (512:9): [True: 1, False: 10.2M]
  ------------------
  513|      1|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
  514|  10.2M|    else
  515|  10.2M|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
  516|  10.2M|  }
  517|       |
  518|  10.2M|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  519|  10.2M|    if (wl > 32768)
  ------------------
  |  Branch (519:9): [True: 0, False: 10.2M]
  ------------------
  520|      0|      return false;
  521|  10.2M|#endif
  522|       |
  523|       |#ifdef MOZILLA_CLIENT
  524|       |  // accept the abbreviated words without dots
  525|       |  // workaround for the incomplete tokenization of Mozilla
  526|       |  abbv = 1;
  527|       |#endif
  528|       |
  529|  10.2M|  if (wl == 0 || m_HMgrs.empty())
  ------------------
  |  Branch (529:7): [True: 504k, False: 9.77M]
  |  Branch (529:18): [True: 0, False: 9.77M]
  ------------------
  530|   504k|    return true;
  531|  9.77M|  if (root)
  ------------------
  |  Branch (531:7): [True: 0, False: 9.77M]
  ------------------
  532|      0|    root->clear();
  533|       |
  534|       |  // allow numbers with dots, dashes and commas (but forbid double separators:
  535|       |  // "..", "--" etc.)
  536|  9.77M|  enum { NBEGIN, NNUM, NSEP };
  537|  9.77M|  int nstate = NBEGIN;
  538|  9.77M|  size_t i;
  539|       |
  540|  15.0M|  for (i = 0; (i < wl); i++) {
  ------------------
  |  Branch (540:15): [True: 14.2M, False: 737k]
  ------------------
  541|  14.2M|    if ((scw[i] <= '9') && (scw[i] >= '0')) {
  ------------------
  |  Branch (541:9): [True: 11.1M, False: 3.08M]
  |  Branch (541:28): [True: 4.76M, False: 6.41M]
  ------------------
  542|  4.76M|      nstate = NNUM;
  543|  9.49M|    } else if ((scw[i] == ',') || (scw[i] == '.') || (scw[i] == '-')) {
  ------------------
  |  Branch (543:16): [True: 99.6k, False: 9.39M]
  |  Branch (543:35): [True: 946k, False: 8.45M]
  |  Branch (543:54): [True: 1.97M, False: 6.48M]
  ------------------
  544|  3.01M|      if ((nstate == NSEP) || (i == 0))
  ------------------
  |  Branch (544:11): [True: 104k, False: 2.91M]
  |  Branch (544:31): [True: 2.45M, False: 462k]
  ------------------
  545|  2.55M|        break;
  546|   462k|      nstate = NSEP;
  547|   462k|    } else
  548|  6.48M|      break;
  549|  14.2M|  }
  550|  9.77M|  if ((i == wl) && (nstate == NNUM))
  ------------------
  |  Branch (550:7): [True: 737k, False: 9.03M]
  |  Branch (550:20): [True: 579k, False: 158k]
  ------------------
  551|   579k|    return true;
  552|       |
  553|  9.19M|  switch (captype) {
  ------------------
  |  Branch (553:11): [True: 9.19M, False: 0]
  ------------------
  554|   693k|    case HUHCAP:
  ------------------
  |  |   95|   693k|#define HUHCAP 3
  ------------------
  |  Branch (554:5): [True: 693k, False: 8.49M]
  ------------------
  555|       |    /* FALLTHROUGH */
  556|  1.05M|    case HUHINITCAP:
  ------------------
  |  |   96|  1.05M|#define HUHINITCAP 4
  ------------------
  |  Branch (556:5): [True: 359k, False: 8.83M]
  ------------------
  557|  1.05M|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   83|  1.05M|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  558|       |    /* FALLTHROUGH */
  559|  8.58M|    case NOCAP:
  ------------------
  |  |   92|  8.58M|#define NOCAP 0
  ------------------
  |  Branch (559:5): [True: 7.52M, False: 1.66M]
  ------------------
  560|  8.58M|      rv = checkword(scw, info, root, suggest_start);
  561|  8.58M|      if ((abbv) && !(rv)) {
  ------------------
  |  Branch (561:11): [True: 1.17M, False: 7.41M]
  |  Branch (561:21): [True: 1.16M, False: 2.78k]
  ------------------
  562|  1.16M|        std::string u8buffer(scw);
  563|  1.16M|        u8buffer.push_back('.');
  564|  1.16M|        rv = checkword(u8buffer, info, root, suggest_start);
  565|  1.16M|      }
  566|  8.58M|      break;
  567|   196k|    case ALLCAP: {
  ------------------
  |  |   94|   196k|#define ALLCAP 2
  ------------------
  |  Branch (567:5): [True: 196k, False: 8.99M]
  ------------------
  568|   196k|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   83|   196k|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  569|   196k|      rv = checkword(scw, info, root, suggest_start);
  570|   196k|      if (rv)
  ------------------
  |  Branch (570:11): [True: 22, False: 196k]
  ------------------
  571|     22|        break;
  572|   196k|      if (abbv) {
  ------------------
  |  Branch (572:11): [True: 15.5k, False: 180k]
  ------------------
  573|  15.5k|        std::string u8buffer(scw);
  574|  15.5k|        u8buffer.push_back('.');
  575|  15.5k|        rv = checkword(u8buffer, info, root, suggest_start);
  576|  15.5k|        if (rv)
  ------------------
  |  Branch (576:13): [True: 0, False: 15.5k]
  ------------------
  577|      0|          break;
  578|  15.5k|      }
  579|       |      // Spec. prefix handling for Catalan, French, Italian:
  580|       |      // prefixes separated by apostrophe (SANT'ELIA -> Sant'+Elia).
  581|   196k|      size_t apos = pAMgr ? scw.find('\'') : std::string::npos;
  ------------------
  |  Branch (581:21): [True: 196k, False: 0]
  ------------------
  582|   196k|      if (apos != std::string::npos) {
  ------------------
  |  Branch (582:11): [True: 76.3k, False: 119k]
  ------------------
  583|  76.3k|        mkallsmall2(scw, sunicw);
  584|       |        //conversion may result in string with different len to pre-mkallsmall2
  585|       |        //so re-scan
  586|  76.3k|        if (apos != std::string::npos && apos < scw.size() - 1) {
  ------------------
  |  Branch (586:13): [True: 76.3k, False: 0]
  |  Branch (586:42): [True: 69.8k, False: 6.51k]
  ------------------
  587|  69.8k|          std::string part1 = scw.substr(0, apos + 1), part2 = scw.substr(apos + 1);
  588|  69.8k|          if (utf8) {
  ------------------
  |  Branch (588:15): [True: 15.0k, False: 54.7k]
  ------------------
  589|  15.0k|            std::vector<w_char> part1u, part2u;
  590|  15.0k|            u8_u16(part1u, part1);
  591|  15.0k|            u8_u16(part2u, part2);
  592|  15.0k|            mkinitcap2(part2, part2u);
  593|  15.0k|            scw = part1 + part2;
  594|  15.0k|            sunicw = std::move(part1u);
  595|  15.0k|            sunicw.insert(sunicw.end(), part2u.begin(), part2u.end());
  596|  15.0k|            rv = checkword(scw, info, root, suggest_start);
  597|  15.0k|            if (rv)
  ------------------
  |  Branch (597:17): [True: 0, False: 15.0k]
  ------------------
  598|      0|              break;
  599|  54.7k|          } else {
  600|  54.7k|            mkinitcap2(part2, sunicw);
  601|  54.7k|            scw = part1 + part2;
  602|  54.7k|            rv = checkword(scw, info, root, suggest_start);
  603|  54.7k|            if (rv)
  ------------------
  |  Branch (603:17): [True: 1, False: 54.7k]
  ------------------
  604|      1|              break;
  605|  54.7k|          }
  606|  69.8k|          mkinitcap2(scw, sunicw);
  607|  69.8k|          rv = checkword(scw, info, root, suggest_start);
  608|  69.8k|          if (rv)
  ------------------
  |  Branch (608:15): [True: 0, False: 69.8k]
  ------------------
  609|      0|            break;
  610|  69.8k|        }
  611|  76.3k|      }
  612|   196k|      if (pAMgr && pAMgr->get_checksharps() && scw.find("SS") != std::string::npos) {
  ------------------
  |  Branch (612:11): [True: 196k, False: 0]
  |  Branch (612:20): [True: 0, False: 196k]
  |  Branch (612:48): [True: 0, False: 0]
  ------------------
  613|       |
  614|      0|        mkallsmall2(scw, sunicw);
  615|      0|        std::string u8buffer(scw);
  616|      0|        rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  617|      0|        if (!rv) {
  ------------------
  |  Branch (617:13): [True: 0, False: 0]
  ------------------
  618|      0|          mkinitcap2(scw, sunicw);
  619|      0|          rv = spellsharps(scw, 0, 0, 0, info, root, suggest_start);
  620|      0|        }
  621|      0|        if ((abbv) && !(rv)) {
  ------------------
  |  Branch (621:13): [True: 0, False: 0]
  |  Branch (621:23): [True: 0, False: 0]
  ------------------
  622|      0|          u8buffer.push_back('.');
  623|      0|          rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  624|      0|          if (!rv) {
  ------------------
  |  Branch (624:15): [True: 0, False: 0]
  ------------------
  625|      0|            u8buffer = std::string(scw);
  626|      0|            u8buffer.push_back('.');
  627|      0|            rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  628|      0|          }
  629|      0|        }
  630|      0|        if (rv)
  ------------------
  |  Branch (630:13): [True: 0, False: 0]
  ------------------
  631|      0|          break;
  632|      0|      }
  633|   196k|    }
  634|       |      /* FALLTHROUGH */
  635|   611k|    case INITCAP: {
  ------------------
  |  |   93|   611k|#define INITCAP 1
  ------------------
  |  Branch (635:5): [True: 414k, False: 8.77M]
  ------------------
  636|       |      // handle special capitalization of dotted I
  637|   611k|      bool Idot = (utf8 && (unsigned char) scw[0] == 0xc4 && (unsigned char) scw[1] == 0xb0);
  ------------------
  |  Branch (637:20): [True: 164k, False: 446k]
  |  Branch (637:28): [True: 0, False: 164k]
  |  Branch (637:62): [True: 0, False: 0]
  ------------------
  638|   611k|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   83|   611k|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  639|   611k|      if (captype == ALLCAP) {
  ------------------
  |  |   94|   611k|#define ALLCAP 2
  ------------------
  |  Branch (639:11): [True: 196k, False: 414k]
  ------------------
  640|   196k|          mkallsmall2(scw, sunicw);
  641|   196k|          mkinitcap2(scw, sunicw);
  642|   196k|          if (Idot)
  ------------------
  |  Branch (642:15): [True: 0, False: 196k]
  ------------------
  643|      0|             scw.replace(0, 1, "\xc4\xb0");
  644|   196k|      }
  645|   611k|      if (captype == INITCAP)
  ------------------
  |  |   93|   611k|#define INITCAP 1
  ------------------
  |  Branch (645:11): [True: 414k, False: 196k]
  ------------------
  646|   414k|        *info |= SPELL_INITCAP;
  ------------------
  |  |   82|   414k|#define SPELL_INITCAP (1 << 4)
  ------------------
  647|   611k|      rv = checkword(scw, info, root, suggest_start);
  648|   611k|      if (captype == INITCAP)
  ------------------
  |  |   93|   611k|#define INITCAP 1
  ------------------
  |  Branch (648:11): [True: 414k, False: 196k]
  ------------------
  649|   414k|        *info &= ~SPELL_INITCAP;
  ------------------
  |  |   82|   414k|#define SPELL_INITCAP (1 << 4)
  ------------------
  650|       |      // forbid bad capitalization
  651|       |      // (for example, ijs -> Ijs instead of IJs in Dutch)
  652|       |      // use explicit forms in dic: Ijs/F (F = FORBIDDENWORD flag)
  653|   611k|      if (*info & SPELL_FORBIDDEN) {
  ------------------
  |  |   79|   611k|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (653:11): [True: 0, False: 611k]
  ------------------
  654|      0|        rv = nullptr;
  655|      0|        break;
  656|      0|      }
  657|   611k|      if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   94|     13|#define ALLCAP 2
  ------------------
  |  Branch (657:11): [True: 13.0k, False: 598k]
  |  Branch (657:17): [True: 13, False: 13.0k]
  |  Branch (657:36): [True: 1, False: 12]
  ------------------
  658|      1|        rv = nullptr;
  659|   611k|      if (rv || (Idot && langnum != LANG_az && langnum != LANG_tr && langnum != LANG_crh))
  ------------------
  |  Branch (659:11): [True: 13.0k, False: 598k]
  |  Branch (659:18): [True: 0, False: 598k]
  |  Branch (659:26): [True: 0, False: 0]
  |  Branch (659:48): [True: 0, False: 0]
  |  Branch (659:70): [True: 0, False: 0]
  ------------------
  660|  13.0k|        break;
  661|       |
  662|   598k|      mkallsmall2(scw, sunicw);
  663|   598k|      std::string u8buffer(scw);
  664|   598k|      mkinitcap2(scw, sunicw);
  665|       |
  666|   598k|      rv = checkword(u8buffer, info, root, suggest_start);
  667|   598k|      if (abbv && !rv) {
  ------------------
  |  Branch (667:11): [True: 92.6k, False: 505k]
  |  Branch (667:19): [True: 92.1k, False: 499]
  ------------------
  668|  92.1k|        u8buffer.push_back('.');
  669|  92.1k|        rv = checkword(u8buffer, info, root, suggest_start);
  670|  92.1k|        if (!rv) {
  ------------------
  |  Branch (670:13): [True: 92.1k, False: 1]
  ------------------
  671|  92.1k|          u8buffer = scw;
  672|  92.1k|          u8buffer.push_back('.');
  673|  92.1k|          if (captype == INITCAP)
  ------------------
  |  |   93|  92.1k|#define INITCAP 1
  ------------------
  |  Branch (673:15): [True: 76.5k, False: 15.5k]
  ------------------
  674|  76.5k|            *info |= SPELL_INITCAP;
  ------------------
  |  |   82|  76.5k|#define SPELL_INITCAP (1 << 4)
  ------------------
  675|  92.1k|          rv = checkword(u8buffer, info, root, suggest_start);
  676|  92.1k|          if (captype == INITCAP)
  ------------------
  |  |   93|  92.1k|#define INITCAP 1
  ------------------
  |  Branch (676:15): [True: 76.5k, False: 15.5k]
  ------------------
  677|  76.5k|            *info &= ~SPELL_INITCAP;
  ------------------
  |  |   82|  76.5k|#define SPELL_INITCAP (1 << 4)
  ------------------
  678|  92.1k|          if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   94|     14|#define ALLCAP 2
  ------------------
  |  Branch (678:15): [True: 14, False: 92.1k]
  |  Branch (678:21): [True: 14, False: 0]
  |  Branch (678:40): [True: 5, False: 9]
  ------------------
  679|      5|            rv = nullptr;
  680|  92.1k|          break;
  681|  92.1k|        }
  682|  92.1k|      }
  683|   505k|      if (rv && is_keepcase(rv) &&
  ------------------
  |  Branch (683:11): [True: 3.69k, False: 502k]
  |  Branch (683:17): [True: 5, False: 3.68k]
  ------------------
  684|      5|          ((captype == ALLCAP) ||
  ------------------
  |  |   94|      5|#define ALLCAP 2
  ------------------
  |  Branch (684:12): [True: 2, False: 3]
  ------------------
  685|       |           // if CHECKSHARPS: KEEPCASE words with \xDF  are allowed
  686|       |           // in INITCAP form, too.
  687|      3|           !(pAMgr->get_checksharps() &&
  ------------------
  |  Branch (687:14): [True: 0, False: 3]
  ------------------
  688|      0|             ((utf8 && u8buffer.find("\xC3\x9F") != std::string::npos) ||
  ------------------
  |  Branch (688:16): [True: 0, False: 0]
  |  Branch (688:24): [True: 0, False: 0]
  ------------------
  689|      0|              (!utf8 && u8buffer.find('\xDF') != std::string::npos)))))
  ------------------
  |  Branch (689:16): [True: 0, False: 0]
  |  Branch (689:25): [True: 0, False: 0]
  ------------------
  690|      5|        rv = nullptr;
  691|   505k|      break;
  692|   598k|    }
  693|  9.19M|  }
  694|       |
  695|  9.19M|  if (rv) {
  ------------------
  |  Branch (695:7): [True: 27.6k, False: 9.16M]
  ------------------
  696|  27.6k|    if (pAMgr && pAMgr->get_warn() && rv->astr &&
  ------------------
  |  Branch (696:9): [True: 27.6k, False: 0]
  |  Branch (696:9): [True: 4, False: 27.6k]
  |  Branch (696:18): [True: 2.19k, False: 25.4k]
  |  Branch (696:39): [True: 162, False: 2.02k]
  ------------------
  697|    162|        TESTAFF(rv->astr, pAMgr->get_warn(), rv->alen)) {
  ------------------
  |  |   99|    162|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 4, False: 158]
  |  |  ------------------
  ------------------
  698|      4|      *info |= SPELL_WARN;
  ------------------
  |  |   84|      4|#define SPELL_WARN (1 << 6)
  ------------------
  699|      4|      if (pAMgr->get_forbidwarn())
  ------------------
  |  Branch (699:11): [True: 0, False: 4]
  ------------------
  700|      0|        return false;
  701|      4|      return true;
  702|      4|    }
  703|  27.6k|    return true;
  704|  27.6k|  }
  705|       |
  706|       |  // recursive breaking at break points
  707|  9.16M|  if (!wordbreak.empty() && !(*info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   79|  9.16M|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (707:7): [True: 9.16M, False: 0]
  |  Branch (707:29): [True: 9.16M, False: 0]
  ------------------
  708|       |
  709|  9.16M|    int nbr = 0;
  710|  9.16M|    wl = scw.size();
  711|       |
  712|       |    // calculate break points for recursion limit
  713|  27.4M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (713:18): [True: 27.4M, False: 9.16M]
  ------------------
  714|  27.4M|      size_t pos = 0;
  715|  37.5M|      while ((pos = scw.find(j, pos)) != std::string::npos) {
  ------------------
  |  Branch (715:14): [True: 10.1M, False: 27.4M]
  ------------------
  716|  10.1M|        ++nbr;
  717|  10.1M|        pos += j.size();
  718|  10.1M|      }
  719|  27.4M|    }
  720|  9.16M|    if (nbr >= MAXBREAKDEPTH)
  ------------------
  |  |   86|  9.16M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (720:9): [True: 2.63k, False: 9.16M]
  ------------------
  721|  2.63k|      return false;
  722|       |
  723|       |    // check boundary patterns (^begin and end$)
  724|  27.3M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (724:18): [True: 27.3M, False: 8.24M]
  ------------------
  725|  27.3M|      size_t plen = j.size();
  726|  27.3M|      if (plen == 1 || plen > wl)
  ------------------
  |  Branch (726:11): [True: 9.16M, False: 18.1M]
  |  Branch (726:24): [True: 2.78M, False: 15.3M]
  ------------------
  727|  11.9M|        continue;
  728|       |
  729|  15.3M|      if (j[0] == '^' && scw.compare(0, plen - 1, j, 1, plen - 1) == 0 &&
  ------------------
  |  Branch (729:11): [True: 7.72M, False: 7.63M]
  |  Branch (729:11): [True: 111k, False: 15.2M]
  |  Branch (729:26): [True: 880k, False: 6.84M]
  ------------------
  730|   880k|          spell(scw.substr(plen - 1), candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (730:11): [True: 111k, False: 768k]
  ------------------
  731|   111k|        *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|   111k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  732|   111k|        return true;
  733|   111k|      }
  734|       |
  735|  15.2M|      if (j[plen - 1] == '$' &&
  ------------------
  |  Branch (735:11): [True: 7.61M, False: 7.63M]
  ------------------
  736|  7.61M|          scw.compare(wl - plen + 1, plen - 1, j, 0, plen - 1) == 0) {
  ------------------
  |  Branch (736:11): [True: 3.15M, False: 4.46M]
  ------------------
  737|  3.15M|        std::string suffix(scw.substr(wl - plen + 1));
  738|  3.15M|        scw.resize(wl - plen + 1);
  739|  3.15M|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (739:13): [True: 808k, False: 2.34M]
  ------------------
  740|   808k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|   808k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  741|   808k|          return true;
  742|   808k|        }
  743|  2.34M|        scw.append(suffix);
  744|  2.34M|      }
  745|  15.2M|    }
  746|       |
  747|       |    // other patterns
  748|  24.6M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (748:18): [True: 24.6M, False: 8.20M]
  ------------------
  749|  24.6M|      size_t plen = j.size();
  750|  24.6M|      size_t found = scw.find(j);
  751|  24.6M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (751:11): [True: 23.1M, False: 1.44M]
  |  Branch (751:26): [True: 2.52M, False: 20.6M]
  ------------------
  752|  2.52M|        size_t found2 = scw.find(j, found + 1);
  753|       |        // try to break at the second occurance
  754|       |        // to recognize dictionary words with wordbreak
  755|  2.52M|        if (found2 > 0 && (found2 < wl - plen))
  ------------------
  |  Branch (755:13): [True: 2.52M, False: 0]
  |  Branch (755:27): [True: 1.01M, False: 1.51M]
  ------------------
  756|  1.01M|            found = found2;
  757|  2.52M|        std::string substring(scw.substr(found + plen));
  758|  2.52M|        if (!spell(substring, candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (758:13): [True: 1.87M, False: 653k]
  ------------------
  759|  1.87M|          continue;
  760|   653k|        std::string suffix(scw.substr(found));
  761|   653k|        scw.resize(found);
  762|       |        // examine 2 sides of the break point
  763|   653k|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (763:13): [True: 39.5k, False: 613k]
  ------------------
  764|  39.5k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|  39.5k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  765|  39.5k|          return true;
  766|  39.5k|        }
  767|   613k|        scw.append(suffix);
  768|       |
  769|       |        // LANG_hu: spec. dash rule
  770|   613k|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (770:13): [True: 285, False: 613k]
  |  Branch (770:35): [True: 285, False: 0]
  ------------------
  771|    285|          suffix = scw.substr(found + 1);
  772|    285|          scw.resize(found + 1);
  773|    285|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (773:15): [True: 0, False: 285]
  ------------------
  774|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  775|      0|            return true;  // check the first part with dash
  776|      0|          }
  777|    285|          scw.append(suffix);
  778|    285|        }
  779|       |        // end of LANG specific region
  780|   613k|      }
  781|  24.6M|    }
  782|       |
  783|       |    // other patterns (break at first break point)
  784|  24.5M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (784:18): [True: 24.5M, False: 8.20M]
  ------------------
  785|  24.5M|      size_t plen = j.size(), found = scw.find(j);
  786|  24.5M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (786:11): [True: 23.0M, False: 1.44M]
  |  Branch (786:26): [True: 2.47M, False: 20.6M]
  ------------------
  787|  2.47M|        if (!spell(scw.substr(found + plen), candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (787:13): [True: 1.99M, False: 478k]
  ------------------
  788|  1.99M|          continue;
  789|   478k|        std::string suffix(scw.substr(found));
  790|   478k|        scw.resize(found);
  791|       |        // examine 2 sides of the break point
  792|   478k|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (792:13): [True: 3.26k, False: 475k]
  ------------------
  793|  3.26k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|  3.26k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  794|  3.26k|          return true;
  795|  3.26k|        }
  796|   475k|        scw.append(suffix);
  797|       |
  798|       |        // LANG_hu: spec. dash rule
  799|   475k|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (799:13): [True: 130, False: 475k]
  |  Branch (799:35): [True: 130, False: 0]
  ------------------
  800|    130|          suffix = scw.substr(found + 1);
  801|    130|          scw.resize(found + 1);
  802|    130|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (802:15): [True: 0, False: 130]
  ------------------
  803|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  804|      0|            return true;  // check the first part with dash
  805|      0|          }
  806|    130|          scw.append(suffix);
  807|    130|        }
  808|       |        // end of LANG specific region
  809|   475k|      }
  810|  24.5M|    }
  811|  8.20M|  }
  812|       |
  813|  8.20M|  return false;
  814|  9.16M|}
_ZN12HunspellImpl9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_NS0_6chrono10time_pointINSB_12steady_clockENSB_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  817|  11.5M|                                       std::chrono::steady_clock::time_point suggest_start) {
  818|       |  // check overall suggest time limit
  819|  11.5M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  11.5M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (819:7): [True: 0, False: 11.5M]
  ------------------
  820|      0|    return nullptr;
  821|       |
  822|  11.5M|  std::string word;
  823|       |
  824|       |  // remove IGNORE characters from the string
  825|  11.5M|  clean_ignore(word, w);
  826|       |
  827|  11.5M|  if (word.empty())
  ------------------
  |  Branch (827:7): [True: 347, False: 11.5M]
  ------------------
  828|    347|    return nullptr;
  829|       |
  830|       |  // word reversing wrapper for complex prefixes
  831|  11.5M|  if (complexprefixes) {
  ------------------
  |  Branch (831:7): [True: 903k, False: 10.6M]
  ------------------
  832|   903k|    if (utf8)
  ------------------
  |  Branch (832:9): [True: 0, False: 903k]
  ------------------
  833|      0|      reverseword_utf(word);
  834|   903k|    else
  835|   903k|      reverseword(word);
  836|   903k|  }
  837|       |
  838|  11.5M|  int len = word.size();
  839|       |
  840|       |  // look word in hash table
  841|  11.5M|  struct hentry* he = nullptr;
  842|  23.0M|  for (size_t i = 0; (i < m_HMgrs.size()) && !he; ++i) {
  ------------------
  |  Branch (842:22): [True: 11.5M, False: 11.5M]
  |  Branch (842:46): [True: 11.5M, False: 0]
  ------------------
  843|  11.5M|    he = m_HMgrs[i]->lookup(word.c_str(), word.size());
  844|       |
  845|       |    // check forbidden and onlyincompound words
  846|  11.5M|    if ((he) && (he->astr) && (pAMgr) &&
  ------------------
  |  Branch (846:9): [True: 27.6k, False: 11.4M]
  |  Branch (846:9): [True: 0, False: 11.5M]
  |  Branch (846:17): [True: 2.04k, False: 25.6k]
  |  Branch (846:31): [True: 2.04k, False: 0]
  ------------------
  847|  2.04k|        TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) {
  ------------------
  |  |   99|  2.04k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 2.04k]
  |  |  ------------------
  ------------------
  848|      0|      if (info)
  ------------------
  |  Branch (848:11): [True: 0, False: 0]
  ------------------
  849|      0|        *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   79|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  850|       |      // LANG_hu section: set dash information for suggestions
  851|      0|      if (langnum == LANG_hu) {
  ------------------
  |  Branch (851:11): [True: 0, False: 0]
  ------------------
  852|      0|        if (pAMgr->get_compoundflag() &&
  ------------------
  |  Branch (852:13): [True: 0, False: 0]
  |  Branch (852:13): [True: 0, False: 0]
  ------------------
  853|      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]
  |  |  ------------------
  ------------------
  854|      0|          if (info)
  ------------------
  |  Branch (854:15): [True: 0, False: 0]
  ------------------
  855|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  856|      0|        }
  857|      0|      }
  858|      0|      return nullptr;
  859|      0|    }
  860|       |
  861|       |    // he = next not needaffix, onlyincompound homonym or onlyupcase word
  862|  11.5M|    while (he && (he->astr) && pAMgr &&
  ------------------
  |  Branch (862:12): [True: 27.6k, False: 11.4M]
  |  Branch (862:12): [True: 28, False: 11.5M]
  |  Branch (862:18): [True: 2.04k, False: 25.6k]
  |  Branch (862:32): [True: 2.04k, False: 0]
  ------------------
  863|  2.04k|           ((pAMgr->get_needaffix() &&
  ------------------
  |  Branch (863:14): [True: 172, False: 1.87k]
  ------------------
  864|    172|             TESTAFF(he->astr, pAMgr->get_needaffix(), he->alen)) ||
  ------------------
  |  |   99|    172|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 172]
  |  |  ------------------
  ------------------
  865|  2.04k|            (pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (865:14): [True: 0, False: 2.04k]
  ------------------
  866|      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]
  |  |  ------------------
  ------------------
  867|  2.04k|            (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   82|  2.04k|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (867:14): [True: 2.04k, False: 0]
  |  Branch (867:22): [True: 49, False: 1.99k]
  ------------------
  868|     49|             TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen))))
  ------------------
  |  |   99|     49|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 28, False: 21]
  |  |  ------------------
  ------------------
  869|     28|      he = he->next_homonym;
  870|  11.5M|  }
  871|       |
  872|       |  // check with affixes
  873|  11.5M|  if (!he && pAMgr) {
  ------------------
  |  Branch (873:7): [True: 11.4M, False: 27.6k]
  |  Branch (873:14): [True: 11.4M, False: 0]
  ------------------
  874|       |    // try stripping off affixes
  875|  11.4M|    AffixScratch scratch;
  876|  11.4M|    he = pAMgr->affix_check(word, 0, len, scratch, 0);
  877|       |
  878|       |    // check compound restriction and onlyupcase
  879|  11.4M|    if (he && he->astr &&
  ------------------
  |  Branch (879:9): [True: 0, False: 11.4M]
  |  Branch (879:9): [True: 0, False: 11.4M]
  |  Branch (879:15): [True: 0, False: 0]
  ------------------
  880|      0|        ((pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (880:11): [True: 0, False: 0]
  ------------------
  881|      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]
  |  |  ------------------
  ------------------
  882|      0|         (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   82|      0|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (882:11): [True: 0, False: 0]
  |  Branch (882:19): [True: 0, False: 0]
  ------------------
  883|      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]
  |  |  ------------------
  ------------------
  884|      0|      he = nullptr;
  885|      0|    }
  886|       |
  887|  11.4M|    if (he) {
  ------------------
  |  Branch (887:9): [True: 0, False: 11.4M]
  ------------------
  888|      0|      if ((he->astr) && (pAMgr) &&
  ------------------
  |  Branch (888:11): [True: 0, False: 0]
  |  Branch (888:11): [True: 0, False: 0]
  |  Branch (888:25): [True: 0, False: 0]
  ------------------
  889|      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]
  |  |  ------------------
  ------------------
  890|      0|        if (info)
  ------------------
  |  Branch (890:13): [True: 0, False: 0]
  ------------------
  891|      0|          *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   79|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  892|      0|        return nullptr;
  893|      0|      }
  894|      0|      if (root) {
  ------------------
  |  Branch (894:11): [True: 0, False: 0]
  ------------------
  895|      0|        root->assign(he->word);
  896|      0|        if (complexprefixes) {
  ------------------
  |  Branch (896:13): [True: 0, False: 0]
  ------------------
  897|      0|          if (utf8)
  ------------------
  |  Branch (897:15): [True: 0, False: 0]
  ------------------
  898|      0|            reverseword_utf(*root);
  899|      0|          else
  900|      0|            reverseword(*root);
  901|      0|        }
  902|      0|      }
  903|       |      // try check compound word
  904|  11.4M|    } else if (pAMgr->get_compound()) {
  ------------------
  |  Branch (904:16): [True: 2.71M, False: 8.76M]
  ------------------
  905|  2.71M|      struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
  906|       |
  907|       |      // first allow only 2 words in the compound
  908|  2.71M|      int setinfo = SPELL_COMPOUND_2;
  ------------------
  |  |   85|  2.71M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  909|  2.71M|      if (info)
  ------------------
  |  Branch (909:11): [True: 2.71M, False: 0]
  ------------------
  910|  2.71M|        setinfo |= *info;
  911|  2.71M|      he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, &setinfo, scratch);
  912|  2.71M|      if (info)
  ------------------
  |  Branch (912:11): [True: 2.71M, False: 0]
  ------------------
  913|  2.71M|        *info = setinfo & ~SPELL_COMPOUND_2;
  ------------------
  |  |   85|  2.71M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  914|       |      // if not 2-word compoud word, try with 3 or more words
  915|       |      // (only if original info didn't forbid it)
  916|  2.71M|      if (!he && info && !(*info & SPELL_COMPOUND_2)) {
  ------------------
  |  |   85|  2.71M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (916:11): [True: 2.71M, False: 0]
  |  Branch (916:18): [True: 2.71M, False: 0]
  |  Branch (916:26): [True: 2.71M, False: 0]
  ------------------
  917|  2.71M|        *info &= ~SPELL_COMPOUND_2;
  ------------------
  |  |   85|  2.71M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  918|  2.71M|        he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, info, scratch);
  919|       |        // accept the compound with 3 or more words only if it is
  920|       |        // - not a dictionary word with a typo and
  921|       |        // - not two words written separately,
  922|       |        // - or if it's an arbitrary number accepted by compound rules (e.g. 999%)
  923|  2.71M|        if (he && !isdigit(word[0]))
  ------------------
  |  Branch (923:13): [True: 0, False: 2.71M]
  |  Branch (923:19): [True: 0, False: 0]
  ------------------
  924|      0|        {
  925|      0|          std::vector<std::string> slst;
  926|      0|          if (pSMgr->suggest(slst, word, nullptr, /*test_simplesug=*/true))
  ------------------
  |  Branch (926:15): [True: 0, False: 0]
  ------------------
  927|      0|            he = nullptr;
  928|      0|        }
  929|  2.71M|      }
  930|       |
  931|       |      // LANG_hu section: `moving rule' with last dash
  932|  2.71M|      if ((!he) && (langnum == LANG_hu) && (word[len - 1] == '-')) {
  ------------------
  |  Branch (932:11): [True: 2.71M, False: 0]
  |  Branch (932:20): [True: 28.1k, False: 2.68M]
  |  Branch (932:44): [True: 10.7k, False: 17.4k]
  ------------------
  933|  10.7k|        std::string dup(word, 0, len - 1);
  934|  10.7k|        he = pAMgr->compound_check(dup, -5, 0, 100, 0, nullptr, (hentry**)&rwords, 1, 0, info, scratch);
  935|  10.7k|      }
  936|       |      // end of LANG specific region
  937|  2.71M|      if (he) {
  ------------------
  |  Branch (937:11): [True: 0, False: 2.71M]
  ------------------
  938|      0|        if (root) {
  ------------------
  |  Branch (938:13): [True: 0, False: 0]
  ------------------
  939|      0|          root->assign(he->word);
  940|      0|          if (complexprefixes) {
  ------------------
  |  Branch (940:15): [True: 0, False: 0]
  ------------------
  941|      0|            if (utf8)
  ------------------
  |  Branch (941:17): [True: 0, False: 0]
  ------------------
  942|      0|              reverseword_utf(*root);
  943|      0|            else
  944|      0|              reverseword(*root);
  945|      0|          }
  946|      0|        }
  947|      0|        if (info)
  ------------------
  |  Branch (947:13): [True: 0, False: 0]
  ------------------
  948|      0|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  949|      0|      }
  950|  2.71M|    }
  951|  11.4M|  }
  952|       |
  953|  11.5M|  return he;
  954|  11.5M|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEENS0_6chrono10time_pointINSD_12steady_clockENSD_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  962|  90.8k|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) {
  963|       |
  964|  90.8k|  if (suggest_candidate_stack.size() > MAX_CANDIDATE_STACK_DEPTH || // apply a fairly arbitrary depth limit
  ------------------
  |  |  957|   181k|#define MAX_CANDIDATE_STACK_DEPTH 512
  ------------------
  |  Branch (964:7): [True: 0, False: 90.8k]
  |  Branch (964:7): [True: 0, False: 90.8k]
  ------------------
  965|       |      // something very broken if suggest ends up calling itself with the same word
  966|  90.8k|      std::find(suggest_candidate_stack.begin(), suggest_candidate_stack.end(), word) != suggest_candidate_stack.end()) {
  ------------------
  |  Branch (966:7): [True: 0, False: 90.8k]
  ------------------
  967|      0|    return { };
  968|      0|  }
  969|       |
  970|  90.8k|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  90.8k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (970:7): [True: 0, False: 90.8k]
  ------------------
  971|      0|    return { };
  972|       |
  973|  90.8k|  bool capwords;
  974|  90.8k|  size_t abbv;
  975|  90.8k|  int captype;
  976|  90.8k|  std::vector<std::string> spell_candidate_stack;
  977|  90.8k|  suggest_candidate_stack.push_back(word);
  978|  90.8k|  std::vector<std::string> slst = suggest_internal(word, spell_candidate_stack, suggest_candidate_stack,
  979|  90.8k|                                                   capwords, abbv, captype, suggest_start);
  980|  90.8k|  suggest_candidate_stack.pop_back();
  981|       |  // word reversing wrapper for complex prefixes
  982|  90.8k|  if (complexprefixes) {
  ------------------
  |  Branch (982:7): [True: 4.72k, False: 86.1k]
  ------------------
  983|  4.72k|    for (auto& j : slst) {
  ------------------
  |  Branch (983:18): [True: 2.20k, False: 4.72k]
  ------------------
  984|  2.20k|      if (utf8)
  ------------------
  |  Branch (984:11): [True: 0, False: 2.20k]
  ------------------
  985|      0|        reverseword_utf(j);
  986|  2.20k|      else
  987|  2.20k|        reverseword(j);
  988|  2.20k|    }
  989|  4.72k|  }
  990|       |
  991|       |  // capitalize
  992|  90.8k|  if (capwords) {
  ------------------
  |  Branch (992:7): [True: 25.5k, False: 65.2k]
  ------------------
  993|  25.5k|    for (auto& j : slst) {
  ------------------
  |  Branch (993:18): [True: 14.2k, False: 25.5k]
  ------------------
  994|  14.2k|      std::string capitalized(j);
  995|  14.2k|      mkinitcap(capitalized);
  996|  14.2k|      if (capitalized == word)
  ------------------
  |  Branch (996:11): [True: 35, False: 14.2k]
  ------------------
  997|     35|        continue;  // capitalizing would just reproduce the misspelled word
  998|  14.2k|      j = std::move(capitalized);
  999|  14.2k|    }
 1000|  25.5k|  }
 1001|       |
 1002|       |  // expand suggestions with dot(s)
 1003|  90.8k|  if (abbv && pAMgr && pAMgr->get_sugswithdots() && word.size() >= abbv) {
  ------------------
  |  Branch (1003:7): [True: 3.70k, False: 87.1k]
  |  Branch (1003:15): [True: 3.70k, False: 0]
  |  Branch (1003:24): [True: 0, False: 3.70k]
  |  Branch (1003:53): [True: 0, False: 0]
  ------------------
 1004|      0|    for (auto& j : slst) {
  ------------------
  |  Branch (1004:18): [True: 0, False: 0]
  ------------------
 1005|      0|      j.append(word.substr(word.size() - abbv));
 1006|      0|    }
 1007|      0|  }
 1008|       |
 1009|       |  // remove bad capitalized and forbidden forms
 1010|  90.8k|  if (pAMgr && (pAMgr->get_keepcase() || pAMgr->get_forbiddenword())) {
  ------------------
  |  Branch (1010:7): [True: 90.8k, False: 0]
  |  Branch (1010:17): [True: 4.75k, False: 86.0k]
  |  Branch (1010:42): [True: 86.0k, False: 0]
  ------------------
 1011|  90.8k|    switch (captype) {
  ------------------
  |  Branch (1011:13): [True: 23.1k, False: 67.6k]
  ------------------
 1012|  12.9k|      case INITCAP:
  ------------------
  |  |   93|  12.9k|#define INITCAP 1
  ------------------
  |  Branch (1012:7): [True: 12.9k, False: 77.8k]
  ------------------
 1013|  23.1k|      case ALLCAP: {
  ------------------
  |  |   94|  23.1k|#define ALLCAP 2
  ------------------
  |  Branch (1013:7): [True: 10.1k, False: 80.6k]
  ------------------
 1014|  23.1k|        size_t l = 0;
 1015|  33.1k|        for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1015:28): [True: 9.97k, False: 23.1k]
  ------------------
 1016|  9.97k|          if (slst[j].find(' ') == std::string::npos && !spell(slst[j], spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1016:15): [True: 9.48k, False: 491]
  |  Branch (1016:57): [True: 4.26k, False: 5.22k]
  ------------------
 1017|  4.26k|            std::string s;
 1018|  4.26k|            std::vector<w_char> w;
 1019|  4.26k|            if (utf8) {
  ------------------
  |  Branch (1019:17): [True: 3.46k, False: 798]
  ------------------
 1020|  3.46k|              u8_u16(w, slst[j]);
 1021|  3.46k|            } else {
 1022|    798|              s = slst[j];
 1023|    798|            }
 1024|  4.26k|            mkallsmall2(s, w);
 1025|  4.26k|            if (spell(s, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1025:17): [True: 5, False: 4.26k]
  ------------------
 1026|      5|              slst[l] = std::move(s);
 1027|      5|              ++l;
 1028|  4.26k|            } else {
 1029|  4.26k|              mkinitcap2(s, w);
 1030|  4.26k|              if (spell(s, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1030:19): [True: 6, False: 4.25k]
  ------------------
 1031|      6|                slst[l] = std::move(s);
 1032|      6|                ++l;
 1033|      6|              }
 1034|  4.26k|            }
 1035|  5.71k|          } else {
 1036|  5.71k|            slst[l] = slst[j];
 1037|  5.71k|            ++l;
 1038|  5.71k|          }
 1039|  9.97k|        }
 1040|  23.1k|        slst.resize(l);
 1041|  23.1k|      }
 1042|  90.8k|    }
 1043|  90.8k|  }
 1044|       |
 1045|       |  // remove duplications
 1046|  90.8k|  size_t l = 0;
 1047|   117k|  for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1047:22): [True: 26.4k, False: 90.8k]
  ------------------
 1048|  26.4k|    slst[l] = slst[j];
 1049|  41.6k|    for (size_t k = 0; k < l; ++k) {
  ------------------
  |  Branch (1049:24): [True: 16.2k, False: 25.3k]
  ------------------
 1050|  16.2k|      if (slst[k] == slst[j]) {
  ------------------
  |  Branch (1050:11): [True: 1.04k, False: 15.2k]
  ------------------
 1051|  1.04k|        --l;
 1052|  1.04k|        break;
 1053|  1.04k|      }
 1054|  16.2k|    }
 1055|  26.4k|    ++l;
 1056|  26.4k|  }
 1057|  90.8k|  slst.resize(l);
 1058|       |
 1059|       |  // output conversion
 1060|  90.8k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1060:17): [True: 90.8k, False: 0]
  ------------------
 1061|  90.8k|  if (rl) {
  ------------------
  |  Branch (1061:7): [True: 4.85k, False: 85.9k]
  ------------------
 1062|  4.85k|    size_t l = 0;
 1063|  5.79k|    for (size_t i = 0; i < slst.size(); ++i) {
  ------------------
  |  Branch (1063:24): [True: 940, False: 4.85k]
  ------------------
 1064|    940|      std::string wspace;
 1065|    940|      if (rl->conv(slst[i], wspace)) {
  ------------------
  |  Branch (1065:11): [True: 302, False: 638]
  ------------------
 1066|    302|        slst[i] = std::move(wspace);
 1067|    302|      }
 1068|       |      // gh#1002: OCONV can map a generated form back to the input word
 1069|       |      // (e.g. "románórum" -> "romanórum" when the user typed "romanórum"),
 1070|       |      // leaving the misspelled word as its own suggestion.
 1071|    940|      if (slst[i] == word)
  ------------------
  |  Branch (1071:11): [True: 0, False: 940]
  ------------------
 1072|      0|        continue;
 1073|    940|      if (l != i)
  ------------------
  |  Branch (1073:11): [True: 0, False: 940]
  ------------------
 1074|      0|        slst[l] = std::move(slst[i]);
 1075|    940|      ++l;
 1076|    940|    }
 1077|  4.85k|    slst.resize(l);
 1078|  4.85k|  }
 1079|  90.8k|  return slst;
 1080|  90.8k|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1082|  59.9k|std::vector<std::string> HunspellImpl::suggest(const std::string& word) {
 1083|  59.9k|  std::vector<std::string> suggest_candidate_stack;
 1084|  59.9k|  auto suggest_start = std::chrono::steady_clock::now();
 1085|  59.9k|  return suggest(word, suggest_candidate_stack, suggest_start);
 1086|  59.9k|}
_ZN12HunspellImpl16suggest_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEESC_RbRmRiNS0_6chrono10time_pointINSG_12steady_clockENSG_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1092|  90.8k|        std::chrono::steady_clock::time_point suggest_start) {
 1093|  90.8k|  captype = NOCAP;
  ------------------
  |  |   92|  90.8k|#define NOCAP 0
  ------------------
 1094|  90.8k|  abbv = 0;
 1095|  90.8k|  capwords = false;
 1096|       |
 1097|  90.8k|  std::vector<std::string> slst;
 1098|       |
 1099|  90.8k|  int onlycmpdsug = 0;
 1100|  90.8k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1100:7): [True: 0, False: 90.8k]
  |  Branch (1100:17): [True: 0, False: 90.8k]
  ------------------
 1101|      0|    return slst;
 1102|       |
 1103|       |  // process XML input of the simplified API (see manual)
 1104|  90.8k|  if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   79|  90.8k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   79|  90.8k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   79|  90.8k|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (1104:7): [True: 20.5k, False: 70.2k]
  ------------------
 1105|  20.5k|    if (word.size() > MAXSPELLMLLEN)
  ------------------
  |  |   87|  20.5k|#define MAXSPELLMLLEN 8192
  ------------------
  |  Branch (1105:9): [True: 456, False: 20.1k]
  ------------------
 1106|    456|      return slst;
 1107|  20.1k|    return spellml(word);
 1108|  20.5k|  }
 1109|  70.2k|  if (utf8) {
  ------------------
  |  Branch (1109:7): [True: 33.6k, False: 36.5k]
  ------------------
 1110|  33.6k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   86|  33.6k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   89|  33.6k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1110:9): [True: 126, False: 33.5k]
  ------------------
 1111|    126|      return slst;
 1112|  36.5k|  } else {
 1113|  36.5k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   89|  36.5k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1113:9): [True: 160, False: 36.4k]
  ------------------
 1114|    160|      return slst;
 1115|  36.5k|  }
 1116|  69.9k|  size_t wl = 0;
 1117|       |
 1118|  69.9k|  std::string scw;
 1119|  69.9k|  std::vector<w_char> sunicw;
 1120|       |
 1121|       |  // input conversion
 1122|  69.9k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1122:17): [True: 69.9k, False: 0]
  ------------------
 1123|  69.9k|  {
 1124|  69.9k|    std::string wspace;
 1125|       |
 1126|  69.9k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1126:23): [True: 3.75k, False: 66.2k]
  ------------------
 1127|  69.9k|    if (convstatus)
  ------------------
  |  Branch (1127:9): [True: 0, False: 69.9k]
  ------------------
 1128|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1129|  69.9k|    else
 1130|  69.9k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1131|       |
 1132|  69.9k|    if (wl == 0)
  ------------------
  |  Branch (1132:9): [True: 0, False: 69.9k]
  ------------------
 1133|      0|      return slst;
 1134|       |
 1135|  69.9k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1136|  69.9k|    if (wl > 32768)
  ------------------
  |  Branch (1136:9): [True: 0, False: 69.9k]
  ------------------
 1137|      0|      return slst;
 1138|  69.9k|#endif
 1139|  69.9k|  }
 1140|       |
 1141|  69.9k|  bool good = false;
 1142|       |
 1143|       |  // check capitalized form for FORCEUCASE
 1144|  69.9k|  if (pAMgr && captype == NOCAP && pAMgr->get_forceucase()) {
  ------------------
  |  |   92|   139k|#define NOCAP 0
  ------------------
  |  Branch (1144:7): [True: 69.9k, False: 0]
  |  Branch (1144:16): [True: 20.5k, False: 49.4k]
  |  Branch (1144:36): [True: 0, False: 20.5k]
  ------------------
 1145|      0|    int info = SPELL_ORIGCAP;
  ------------------
  |  |   83|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
 1146|      0|    if (checkword(scw, &info, nullptr, suggest_start)) {
  ------------------
  |  Branch (1146:9): [True: 0, False: 0]
  ------------------
 1147|      0|      std::string form(std::move(scw));
 1148|      0|      mkinitcap(form);
 1149|      0|      slst.push_back(std::move(form));
 1150|      0|      return slst;
 1151|      0|    }
 1152|      0|  }
 1153|       |
 1154|  69.9k|  switch (captype) {
  ------------------
  |  Branch (1154:11): [True: 69.9k, False: 0]
  ------------------
 1155|  20.5k|    case NOCAP: {
  ------------------
  |  |   92|  20.5k|#define NOCAP 0
  ------------------
  |  Branch (1155:5): [True: 20.5k, False: 49.4k]
  ------------------
 1156|  20.5k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1157|  20.5k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  20.5k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1157:11): [True: 0, False: 20.5k]
  ------------------
 1158|      0|          return slst;
 1159|  20.5k|      if (abbv) {
  ------------------
  |  Branch (1159:11): [True: 2.20k, False: 18.3k]
  ------------------
 1160|  2.20k|        std::string wspace(scw);
 1161|  2.20k|        wspace.push_back('.');
 1162|  2.20k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1163|  2.20k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  2.20k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1163:13): [True: 0, False: 2.20k]
  ------------------
 1164|      0|            return slst;
 1165|  2.20k|      }
 1166|  20.5k|      break;
 1167|  20.5k|    }
 1168|       |
 1169|  20.5k|    case INITCAP: {
  ------------------
  |  |   93|  12.9k|#define INITCAP 1
  ------------------
  |  Branch (1169:5): [True: 12.9k, False: 57.0k]
  ------------------
 1170|  12.9k|      capwords = true;
 1171|  12.9k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1172|  12.9k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  12.9k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1172:11): [True: 0, False: 12.9k]
  ------------------
 1173|      0|          return slst;
 1174|  12.9k|      std::string wspace(scw);
 1175|  12.9k|      mkallsmall2(wspace, sunicw);
 1176|  12.9k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1177|  12.9k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  12.9k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1177:11): [True: 0, False: 12.9k]
  ------------------
 1178|      0|          return slst;
 1179|  12.9k|      break;
 1180|  12.9k|    }
 1181|  12.9k|    case HUHINITCAP:
  ------------------
  |  |   96|  12.6k|#define HUHINITCAP 4
  ------------------
  |  Branch (1181:5): [True: 12.6k, False: 57.3k]
  ------------------
 1182|  12.6k|      capwords = true;
 1183|       |      /* FALLTHROUGH */
 1184|  26.2k|    case HUHCAP: {
  ------------------
  |  |   95|  26.2k|#define HUHCAP 3
  ------------------
  |  Branch (1184:5): [True: 13.6k, False: 56.3k]
  ------------------
 1185|  26.2k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1186|  26.2k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  26.2k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1186:11): [True: 0, False: 26.2k]
  ------------------
 1187|      0|          return slst;
 1188|       |      // something.The -> something. The
 1189|  26.2k|      size_t dot_pos = scw.find('.');
 1190|  26.2k|      if (dot_pos != std::string::npos) {
  ------------------
  |  Branch (1190:11): [True: 8.44k, False: 17.8k]
  ------------------
 1191|  8.44k|        std::string postdot = scw.substr(dot_pos + 1);
 1192|  8.44k|        int captype_;
 1193|  8.44k|        if (utf8) {
  ------------------
  |  Branch (1193:13): [True: 2.17k, False: 6.26k]
  ------------------
 1194|  2.17k|          std::vector<w_char> postdotu;
 1195|  2.17k|          u8_u16(postdotu, postdot);
 1196|  2.17k|          captype_ = get_captype_utf8(postdotu, langnum);
 1197|  6.26k|        } else {
 1198|  6.26k|          captype_ = get_captype(postdot, csconv);
 1199|  6.26k|        }
 1200|  8.44k|        if (captype_ == INITCAP) {
  ------------------
  |  |   93|  8.44k|#define INITCAP 1
  ------------------
  |  Branch (1200:13): [True: 2.01k, False: 6.42k]
  ------------------
 1201|  2.01k|          std::string str(scw);
 1202|  2.01k|          str.insert(dot_pos + 1, 1, ' ');
 1203|  2.01k|          insert_sug(slst, str);
 1204|  2.01k|        }
 1205|  8.44k|      }
 1206|       |
 1207|  26.2k|      std::string wspace;
 1208|       |
 1209|  26.2k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   96|  26.2k|#define HUHINITCAP 4
  ------------------
  |  Branch (1209:11): [True: 12.6k, False: 13.6k]
  ------------------
 1210|       |        // TheOpenOffice.org -> The OpenOffice.org
 1211|  12.6k|        wspace = scw;
 1212|  12.6k|        mkinitsmall2(wspace, sunicw);
 1213|  12.6k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1214|  12.6k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  12.6k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1214:13): [True: 1, False: 12.6k]
  ------------------
 1215|      1|            return slst;
 1216|  12.6k|      }
 1217|  26.2k|      wspace = scw;
 1218|  26.2k|      mkallsmall2(wspace, sunicw);
 1219|  26.2k|      if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1219:11): [True: 895, False: 25.3k]
  ------------------
 1220|    895|        insert_sug(slst, wspace);
 1221|  26.2k|      size_t prevns = slst.size();
 1222|  26.2k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1223|  26.2k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  26.2k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1223:11): [True: 0, False: 26.2k]
  ------------------
 1224|      0|          return slst;
 1225|  26.2k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   96|  26.2k|#define HUHINITCAP 4
  ------------------
  |  Branch (1225:11): [True: 12.6k, False: 13.6k]
  ------------------
 1226|  12.6k|        mkinitcap2(wspace, sunicw);
 1227|  12.6k|        if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1227:13): [True: 278, False: 12.3k]
  ------------------
 1228|    278|          insert_sug(slst, wspace);
 1229|  12.6k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1230|  12.6k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  12.6k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1230:13): [True: 5, False: 12.6k]
  ------------------
 1231|      5|            return slst;
 1232|  12.6k|      }
 1233|       |      // aNew -> "a New" (instead of "a new")
 1234|  26.6k|      for (size_t j = prevns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1234:31): [True: 418, False: 26.2k]
  ------------------
 1235|    418|        const char* space = strchr(slst[j].c_str(), ' ');
 1236|    418|        if (space) {
  ------------------
  |  Branch (1236:13): [True: 293, False: 125]
  ------------------
 1237|    293|          size_t slen = strlen(space + 1);
 1238|       |          // different case after space (need capitalisation)
 1239|    293|          if ((slen < wl) && strcmp(scw.c_str() + wl - slen, space + 1) != 0) {
  ------------------
  |  Branch (1239:15): [True: 293, False: 0]
  |  Branch (1239:30): [True: 293, False: 0]
  ------------------
 1240|    293|            std::string first(slst[j].c_str(), space + 1);
 1241|    293|            std::string second(space + 1);
 1242|    293|            std::vector<w_char> w;
 1243|    293|            if (utf8)
  ------------------
  |  Branch (1243:17): [True: 87, False: 206]
  ------------------
 1244|     87|              u8_u16(w, second);
 1245|    293|            mkinitcap2(second, w);
 1246|       |            // set as first suggestion
 1247|    293|            slst.erase(slst.begin() + j);
 1248|    293|            slst.insert(slst.begin(), first + second);
 1249|    293|          }
 1250|    293|        }
 1251|    418|      }
 1252|  26.2k|      break;
 1253|  26.2k|    }
 1254|       |
 1255|  10.1k|    case ALLCAP: {
  ------------------
  |  |   94|  10.1k|#define ALLCAP 2
  ------------------
  |  Branch (1255:5): [True: 10.1k, False: 59.7k]
  ------------------
 1256|  10.1k|      std::string wspace(scw);
 1257|  10.1k|      mkallsmall2(wspace, sunicw);
 1258|  10.1k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1259|  10.1k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  10.1k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1259:11): [True: 0, False: 10.1k]
  ------------------
 1260|      0|          return slst;
 1261|  10.1k|      if (pAMgr && pAMgr->get_keepcase() && spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1261:11): [True: 10.1k, False: 0]
  |  Branch (1261:20): [True: 457, False: 9.73k]
  |  Branch (1261:45): [True: 0, False: 457]
  ------------------
 1262|      0|        insert_sug(slst, wspace);
 1263|  10.1k|      mkinitcap2(wspace, sunicw);
 1264|  10.1k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1265|  10.1k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  10.1k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1265:11): [True: 0, False: 10.1k]
  ------------------
 1266|      0|          return slst;
 1267|  10.1k|      for (auto& j : slst) {
  ------------------
  |  Branch (1267:20): [True: 484, False: 10.1k]
  ------------------
 1268|    484|        mkallcap(j);
 1269|    484|        if (pAMgr && pAMgr->get_checksharps()) {
  ------------------
  |  Branch (1269:13): [True: 484, False: 0]
  |  Branch (1269:22): [True: 0, False: 484]
  ------------------
 1270|      0|          if (utf8) {
  ------------------
  |  Branch (1270:15): [True: 0, False: 0]
  ------------------
 1271|      0|            mystrrep(j, "\xC3\x9F", "SS");
 1272|      0|          } else {
 1273|      0|            mystrrep(j, "\xDF", "SS");
 1274|      0|          }
 1275|      0|        }
 1276|    484|      }
 1277|  10.1k|      break;
 1278|  10.1k|    }
 1279|  69.9k|  }
 1280|       |
 1281|       |  // LANG_hu section: replace '-' with ' ' in Hungarian
 1282|  69.9k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1282:7): [True: 3.81k, False: 66.1k]
  ------------------
 1283|  3.81k|    for (auto& j : slst) {
  ------------------
  |  Branch (1283:18): [True: 173, False: 3.81k]
  ------------------
 1284|    173|      size_t pos = j.find('-');
 1285|    173|      if (pos != std::string::npos) {
  ------------------
  |  Branch (1285:11): [True: 35, False: 138]
  ------------------
 1286|     35|        int info = 0;
 1287|     35|        std::string w(j.substr(0, pos));
 1288|     35|        w.append(j.substr(pos + 1));
 1289|     35|        (void)spell(w, spell_candidate_stack, &info, nullptr, suggest_start);
 1290|     35|        if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   78|     35|#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 (1290:13): [True: 0, False: 35]
  |  Branch (1290:40): [True: 0, False: 0]
  ------------------
 1291|      0|          j[pos] = ' ';
 1292|      0|        } else
 1293|     35|          j[pos] = '-';
 1294|     35|      }
 1295|    173|    }
 1296|  3.81k|  }
 1297|       |  // END OF LANG_hu section
 1298|       |  // try ngram approach since found nothing good suggestion
 1299|  69.9k|  if (!good && pAMgr && (slst.empty() || onlycmpdsug) && (pAMgr->get_maxngramsugs() != 0)) {
  ------------------
  |  Branch (1299:7): [True: 69.9k, False: 75]
  |  Branch (1299:16): [True: 69.9k, False: 0]
  |  Branch (1299:26): [True: 65.2k, False: 4.67k]
  |  Branch (1299:42): [True: 4.65k, False: 25]
  |  Branch (1299:58): [True: 62.3k, False: 7.53k]
  ------------------
 1300|  62.3k|    switch (captype) {
  ------------------
  |  Branch (1300:13): [True: 62.3k, False: 0]
  ------------------
 1301|  17.7k|      case NOCAP: {
  ------------------
  |  |   92|  17.7k|#define NOCAP 0
  ------------------
  |  Branch (1301:7): [True: 17.7k, False: 44.6k]
  ------------------
 1302|  17.7k|        pSMgr->ngsuggest(slst, scw.c_str(), m_HMgrs, NOCAP);
  ------------------
  |  |   92|  17.7k|#define NOCAP 0
  ------------------
 1303|  17.7k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  17.7k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1303:13): [True: 0, False: 17.7k]
  ------------------
 1304|      0|            return slst;
 1305|  17.7k|        break;
 1306|  17.7k|      }
 1307|       |      /* FALLTHROUGH */
 1308|  17.7k|      case HUHINITCAP:
  ------------------
  |  |   96|  11.9k|#define HUHINITCAP 4
  ------------------
  |  Branch (1308:7): [True: 11.9k, False: 50.3k]
  ------------------
 1309|  11.9k|        capwords = true;
 1310|       |      /* FALLTHROUGH */
 1311|  24.5k|      case HUHCAP: {
  ------------------
  |  |   95|  24.5k|#define HUHCAP 3
  ------------------
  |  Branch (1311:7): [True: 12.6k, False: 49.7k]
  ------------------
 1312|  24.5k|        std::string wspace(scw);
 1313|  24.5k|        mkallsmall2(wspace, sunicw);
 1314|  24.5k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, HUHCAP);
  ------------------
  |  |   95|  24.5k|#define HUHCAP 3
  ------------------
 1315|  24.5k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  24.5k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1315:13): [True: 0, False: 24.5k]
  ------------------
 1316|      0|            return slst;
 1317|  24.5k|        break;
 1318|  24.5k|      }
 1319|  24.5k|      case INITCAP: {
  ------------------
  |  |   93|  11.1k|#define INITCAP 1
  ------------------
  |  Branch (1319:7): [True: 11.1k, False: 51.2k]
  ------------------
 1320|  11.1k|        capwords = true;
 1321|  11.1k|        std::string wspace(scw);
 1322|  11.1k|        mkallsmall2(wspace, sunicw);
 1323|  11.1k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, INITCAP);
  ------------------
  |  |   93|  11.1k|#define INITCAP 1
  ------------------
 1324|  11.1k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  11.1k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1324:13): [True: 0, False: 11.1k]
  ------------------
 1325|      0|            return slst;
 1326|  11.1k|        break;
 1327|  11.1k|      }
 1328|  11.1k|      case ALLCAP: {
  ------------------
  |  |   94|  8.91k|#define ALLCAP 2
  ------------------
  |  Branch (1328:7): [True: 8.91k, False: 53.4k]
  ------------------
 1329|  8.91k|        std::string wspace(scw);
 1330|  8.91k|        mkallsmall2(wspace, sunicw);
 1331|  8.91k|        size_t oldns = slst.size();
 1332|  8.91k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, ALLCAP);
  ------------------
  |  |   94|  8.91k|#define ALLCAP 2
  ------------------
 1333|  8.91k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  8.91k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1333:13): [True: 0, False: 8.91k]
  ------------------
 1334|      0|            return slst;
 1335|  11.8k|        for (size_t j = oldns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1335:32): [True: 2.89k, False: 8.91k]
  ------------------
 1336|  2.89k|          mkallcap(slst[j]);
 1337|  2.89k|        }
 1338|  8.91k|        break;
 1339|  8.91k|      }
 1340|  62.3k|    }
 1341|  62.3k|  }
 1342|       |
 1343|       |  // try dash suggestion (Afo-American -> Afro-American)
 1344|       |  // Note: LibreOffice was modified to treat dashes as word
 1345|       |  // characters to check "scot-free" etc. word forms, but
 1346|       |  // we need to handle suggestions for "Afo-American", etc.,
 1347|       |  // while "Afro-American" is missing from the dictionary.
 1348|       |  // TODO avoid possible overgeneration
 1349|  69.9k|  size_t dash_pos = scw.find('-');
 1350|  69.9k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1350:7): [True: 34.3k, False: 35.6k]
  ------------------
 1351|  34.3k|    int nodashsug = 1;
 1352|  41.2k|    for (size_t j = 0; j < slst.size() && nodashsug == 1; ++j) {
  ------------------
  |  Branch (1352:24): [True: 7.33k, False: 33.8k]
  |  Branch (1352:43): [True: 6.88k, False: 459]
  ------------------
 1353|  6.88k|      if (slst[j].find('-') != std::string::npos)
  ------------------
  |  Branch (1353:11): [True: 2.76k, False: 4.11k]
  ------------------
 1354|  2.76k|        nodashsug = 0;
 1355|  6.88k|    }
 1356|       |
 1357|  34.3k|    size_t prev_pos = 0;
 1358|  34.3k|    bool last = false;
 1359|       |
 1360|   107k|    while (!good && nodashsug && !last) {
  ------------------
  |  Branch (1360:12): [True: 107k, False: 42]
  |  Branch (1360:21): [True: 73.7k, False: 33.6k]
  |  Branch (1360:34): [True: 73.0k, False: 667]
  ------------------
 1361|  73.0k|      if (dash_pos == scw.size())
  ------------------
  |  Branch (1361:11): [True: 5.70k, False: 67.3k]
  ------------------
 1362|  5.70k|        last = true;
 1363|  73.0k|      std::string chunk = scw.substr(prev_pos, dash_pos - prev_pos);
 1364|  73.0k|      if (chunk != word && !spell(chunk, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1364:11): [True: 73.0k, False: 0]
  |  Branch (1364:28): [True: 30.8k, False: 42.1k]
  ------------------
 1365|  30.8k|        std::vector<std::string> nlst = suggest(chunk, suggest_candidate_stack, suggest_start);
 1366|  30.8k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  30.8k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1366:13): [True: 3, False: 30.8k]
  ------------------
 1367|      3|            return slst;
 1368|  40.9k|        for (auto j = nlst.rbegin(); j != nlst.rend(); ++j) {
  ------------------
  |  Branch (1368:38): [True: 10.0k, False: 30.8k]
  ------------------
 1369|  10.0k|          std::string wspace = scw.substr(0, prev_pos);
 1370|  10.0k|          wspace.append(*j);
 1371|  10.0k|          if (!last) {
  ------------------
  |  Branch (1371:15): [True: 8.02k, False: 2.01k]
  ------------------
 1372|  8.02k|            wspace.append("-");
 1373|  8.02k|            wspace.append(scw.substr(dash_pos + 1));
 1374|  8.02k|          }
 1375|  10.0k|          int info = 0;
 1376|  10.0k|          if (pAMgr && pAMgr->get_forbiddenword())
  ------------------
  |  Branch (1376:15): [True: 10.0k, False: 0]
  |  Branch (1376:24): [True: 10.0k, False: 0]
  ------------------
 1377|  10.0k|            checkword(wspace, &info, nullptr, suggest_start);
 1378|  10.0k|          if (!(info & SPELL_FORBIDDEN))
  ------------------
  |  |   79|  10.0k|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (1378:15): [True: 10.0k, False: 0]
  ------------------
 1379|  10.0k|            insert_sug(slst, wspace);
 1380|  10.0k|        }
 1381|  30.8k|        nodashsug = 0;
 1382|  30.8k|      }
 1383|  73.0k|      if (!last) {
  ------------------
  |  Branch (1383:11): [True: 67.3k, False: 5.70k]
  ------------------
 1384|  67.3k|        prev_pos = dash_pos + 1;
 1385|  67.3k|        dash_pos = scw.find('-', prev_pos);
 1386|  67.3k|      }
 1387|  73.0k|      if (dash_pos == std::string::npos)
  ------------------
  |  Branch (1387:11): [True: 12.8k, False: 60.1k]
  ------------------
 1388|  12.8k|        dash_pos = scw.size();
 1389|  73.0k|    }
 1390|  34.3k|  }
 1391|  69.9k|  return slst;
 1392|  69.9k|}
_ZN12HunspellImpl4stemERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
 1398|  1.10k|std::vector<std::string> HunspellImpl::stem(const std::vector<std::string>& desc) {
 1399|  1.10k|  std::vector<std::string> slst;
 1400|       |
 1401|  1.10k|  std::string result2;
 1402|  1.10k|  if (desc.empty())
  ------------------
  |  Branch (1402:7): [True: 974, False: 128]
  ------------------
 1403|    974|    return slst;
 1404|    128|  for (const auto& i : desc) {
  ------------------
  |  Branch (1404:22): [True: 128, False: 128]
  ------------------
 1405|    128|    std::string result;
 1406|       |
 1407|       |    // add compound word parts (except the last one)
 1408|    128|    const char* s = i.c_str();
 1409|    128|    const char* part = strstr(s, MORPH_PART);
  ------------------
  |  |  116|    128|#define MORPH_PART "pa:"
  ------------------
 1410|    128|    if (part) {
  ------------------
  |  Branch (1410:9): [True: 0, False: 128]
  ------------------
 1411|      0|      const char* nextpart = strstr(part + 1, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1412|      0|      while (nextpart) {
  ------------------
  |  Branch (1412:14): [True: 0, False: 0]
  ------------------
 1413|      0|        std::string field;
 1414|      0|        copy_field(field, part, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1415|      0|        result.append(field);
 1416|      0|        part = nextpart;
 1417|      0|        nextpart = strstr(part + 1, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1418|      0|      }
 1419|      0|      s = part;
 1420|      0|    }
 1421|       |
 1422|    128|    std::string tok(s);
 1423|    128|    size_t alt = 0;
 1424|    128|    while ((alt = tok.find(" | ", alt)) != std::string::npos) {
  ------------------
  |  Branch (1424:12): [True: 0, False: 128]
  ------------------
 1425|      0|      tok[alt + 1] = MSEP_ALT;
  ------------------
  |  |  123|      0|#define MSEP_ALT '\v'
  ------------------
 1426|      0|    }
 1427|    128|    std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  123|    128|#define MSEP_ALT '\v'
  ------------------
 1428|    128|    for (auto& k : pl) {
  ------------------
  |  Branch (1428:18): [True: 128, False: 128]
  ------------------
 1429|       |      // add derivational suffixes
 1430|    128|      if (k.find(MORPH_DERI_SFX) != std::string::npos) {
  ------------------
  |  |  109|    128|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (1430:11): [True: 0, False: 128]
  ------------------
 1431|       |        // remove inflectional suffixes
 1432|      0|        const size_t is = k.find(MORPH_INFL_SFX);
  ------------------
  |  |  110|      0|#define MORPH_INFL_SFX "is:"
  ------------------
 1433|      0|        if (is != std::string::npos)
  ------------------
  |  Branch (1433:13): [True: 0, False: 0]
  ------------------
 1434|      0|          k.resize(is);
 1435|      0|        std::vector<std::string> singlepl;
 1436|      0|        singlepl.push_back(k);
 1437|      0|        std::string sg = pSMgr->suggest_gen(singlepl, k);
 1438|      0|        if (!sg.empty()) {
  ------------------
  |  Branch (1438:13): [True: 0, False: 0]
  ------------------
 1439|      0|          std::vector<std::string> gen = line_tok(sg, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1440|      0|          for (auto& j : gen) {
  ------------------
  |  Branch (1440:24): [True: 0, False: 0]
  ------------------
 1441|      0|            result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1442|      0|            result2.append(result);
 1443|      0|            result2.append(j);
 1444|      0|          }
 1445|      0|        }
 1446|    128|      } else {
 1447|    128|        result2.push_back(MSEP_REC);
  ------------------
  |  |  122|    128|#define MSEP_REC '\n'
  ------------------
 1448|    128|        result2.append(result);
 1449|    128|        if (k.find(MORPH_SURF_PFX) != std::string::npos) {
  ------------------
  |  |  112|    128|#define MORPH_SURF_PFX "sp:"
  ------------------
  |  Branch (1449:13): [True: 0, False: 128]
  ------------------
 1450|      0|          std::string field;
 1451|      0|          copy_field(field, k, MORPH_SURF_PFX);
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
 1452|      0|          result2.append(field);
 1453|      0|        }
 1454|    128|        std::string field;
 1455|    128|        copy_field(field, k, MORPH_STEM);
  ------------------
  |  |  103|    128|#define MORPH_STEM "st:"
  ------------------
 1456|    128|        result2.append(field);
 1457|    128|      }
 1458|    128|    }
 1459|    128|  }
 1460|    128|  slst = line_tok(result2, MSEP_REC);
  ------------------
  |  |  122|    128|#define MSEP_REC '\n'
  ------------------
 1461|    128|  uniqlist(slst);
 1462|    128|  return slst;
 1463|  1.10k|}
_ZN12HunspellImpl4stemERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1465|  1.10k|std::vector<std::string> HunspellImpl::stem(const std::string& word) {
 1466|  1.10k|  return stem(analyze(word));
 1467|  1.10k|}
_ZN12HunspellImpl9mkinitcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1477|  14.2k|void HunspellImpl::mkinitcap(std::string& u8) {
 1478|  14.2k|  if (utf8) {
  ------------------
  |  Branch (1478:7): [True: 4.17k, False: 10.0k]
  ------------------
 1479|  4.17k|    std::vector<w_char> u16;
 1480|  4.17k|    u8_u16(u16, u8);
 1481|  4.17k|    ::mkinitcap_utf(u16, langnum);
 1482|  4.17k|    u16_u8(u8, u16);
 1483|  10.0k|  } else {
 1484|  10.0k|    ::mkinitcap(u8, csconv);
 1485|  10.0k|  }
 1486|  14.2k|}
_ZN12HunspellImpl10mkinitcap2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1488|   964k|int HunspellImpl::mkinitcap2(std::string& u8, std::vector<w_char>& u16) {
 1489|   964k|  if (utf8) {
  ------------------
  |  Branch (1489:7): [True: 258k, False: 705k]
  ------------------
 1490|   258k|    ::mkinitcap_utf(u16, langnum);
 1491|   258k|    u16_u8(u8, u16);
 1492|   705k|  } else {
 1493|   705k|    ::mkinitcap(u8, csconv);
 1494|   705k|  }
 1495|   964k|  return u8.size();
 1496|   964k|}
_ZN12HunspellImpl12mkinitsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1498|  12.6k|int HunspellImpl::mkinitsmall2(std::string& u8, std::vector<w_char>& u16) {
 1499|  12.6k|  if (utf8) {
  ------------------
  |  Branch (1499:7): [True: 2.87k, False: 9.75k]
  ------------------
 1500|  2.87k|    ::mkinitsmall_utf(u16, langnum);
 1501|  2.87k|    u16_u8(u8, u16);
 1502|  9.75k|  } else {
 1503|  9.75k|    ::mkinitsmall(u8, csconv);
 1504|  9.75k|  }
 1505|  12.6k|  return u8.size();
 1506|  12.6k|}
_ZN12HunspellImpl3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1508|  5.03k|int HunspellImpl::add(const std::string& word) {
 1509|  5.03k|  if (!m_HMgrs.empty())
  ------------------
  |  Branch (1509:7): [True: 5.03k, False: 0]
  ------------------
 1510|  5.03k|    return m_HMgrs[0]->add(word);
 1511|      0|  return 0;
 1512|  5.03k|}
_ZN12HunspellImpl14add_with_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 1520|  2.04k|int HunspellImpl::add_with_affix(const std::string& word, const std::string& example) {
 1521|  2.04k|  if (!m_HMgrs.empty())
  ------------------
  |  Branch (1521:7): [True: 2.04k, False: 0]
  ------------------
 1522|  2.04k|    return m_HMgrs[0]->add_with_affix(word, example);
 1523|      0|  return 0;
 1524|  2.04k|}
_ZN12HunspellImpl10cat_resultERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
 1543|   383k|void HunspellImpl::cat_result(std::string& result, const std::string& st) {
 1544|   383k|  if (!st.empty()) {
  ------------------
  |  Branch (1544:7): [True: 2.58k, False: 381k]
  ------------------
 1545|  2.58k|    if (!result.empty())
  ------------------
  |  Branch (1545:9): [True: 152, False: 2.43k]
  ------------------
 1546|    152|      result.append("\n");
 1547|  2.58k|    result.append(st);
 1548|  2.58k|  }
 1549|   383k|}
_ZN12HunspellImpl7analyzeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1551|  7.69k|std::vector<std::string> HunspellImpl::analyze(const std::string& word) {
 1552|  7.69k|  std::vector<std::string> slst = analyze_internal(word);
 1553|       |  // output conversion
 1554|  7.69k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1554:17): [True: 7.69k, False: 0]
  ------------------
 1555|  7.69k|  if (rl) {
  ------------------
  |  Branch (1555:7): [True: 403, False: 7.29k]
  ------------------
 1556|    522|    for (size_t i = 0; rl && i < slst.size(); ++i) {
  ------------------
  |  Branch (1556:24): [True: 522, False: 0]
  |  Branch (1556:30): [True: 119, False: 403]
  ------------------
 1557|    119|      std::string wspace;
 1558|    119|      if (rl->conv(slst[i], wspace)) {
  ------------------
  |  Branch (1558:11): [True: 5, False: 114]
  ------------------
 1559|      5|        slst[i] = std::move(wspace);
 1560|      5|      }
 1561|    119|    }
 1562|    403|  }
 1563|  7.69k|  return slst;
 1564|  7.69k|}
_ZN12HunspellImpl16analyze_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1566|  7.69k|std::vector<std::string> HunspellImpl::analyze_internal(const std::string& word) {
 1567|  7.69k|  std::vector<std::string> candidate_stack, slst;
 1568|  7.69k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1568:7): [True: 0, False: 7.69k]
  |  Branch (1568:17): [True: 0, False: 7.69k]
  ------------------
 1569|      0|    return slst;
 1570|  7.69k|  if (utf8) {
  ------------------
  |  Branch (1570:7): [True: 3.64k, False: 4.05k]
  ------------------
 1571|  3.64k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   86|  3.64k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   89|  3.64k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1571:9): [True: 244, False: 3.39k]
  ------------------
 1572|    244|      return slst;
 1573|  4.05k|  } else {
 1574|  4.05k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   89|  4.05k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1574:9): [True: 450, False: 3.60k]
  ------------------
 1575|    450|      return slst;
 1576|  4.05k|  }
 1577|  7.00k|  int captype = NOCAP;
  ------------------
  |  |   92|  7.00k|#define NOCAP 0
  ------------------
 1578|  7.00k|  size_t abbv = 0;
 1579|  7.00k|  size_t wl = 0;
 1580|       |
 1581|  7.00k|  std::string scw;
 1582|  7.00k|  std::vector<w_char> sunicw;
 1583|       |
 1584|       |  // input conversion
 1585|  7.00k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1585:17): [True: 7.00k, False: 0]
  ------------------
 1586|  7.00k|  {
 1587|  7.00k|    std::string wspace;
 1588|       |
 1589|  7.00k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1589:23): [True: 376, False: 6.62k]
  ------------------
 1590|  7.00k|    if (convstatus)
  ------------------
  |  Branch (1590:9): [True: 0, False: 7.00k]
  ------------------
 1591|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1592|  7.00k|    else
 1593|  7.00k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1594|       |
 1595|  7.00k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1596|  7.00k|    if (wl > 32768)
  ------------------
  |  Branch (1596:9): [True: 0, False: 7.00k]
  ------------------
 1597|      0|      return slst;
 1598|  7.00k|#endif
 1599|  7.00k|  }
 1600|       |
 1601|  7.00k|  if (wl == 0) {
  ------------------
  |  Branch (1601:7): [True: 421, False: 6.58k]
  ------------------
 1602|    421|    if (abbv) {
  ------------------
  |  Branch (1602:9): [True: 266, False: 155]
  ------------------
 1603|    266|      scw.clear();
 1604|  5.13k|      for (wl = 0; wl < abbv; wl++)
  ------------------
  |  Branch (1604:20): [True: 4.86k, False: 266]
  ------------------
 1605|  4.86k|        scw.push_back('.');
 1606|    266|      abbv = 0;
 1607|    266|    } else
 1608|    155|      return slst;
 1609|    421|  }
 1610|       |
 1611|  6.84k|  std::string result;
 1612|       |
 1613|  6.84k|  size_t n = 0;
 1614|       |  // test numbers
 1615|       |  // LANG_hu section: set dash information for suggestions
 1616|  6.84k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1616:7): [True: 370, False: 6.47k]
  ------------------
 1617|    370|    size_t n2 = 0;
 1618|    370|    size_t n3 = 0;
 1619|       |
 1620|    524|    while ((n < wl) && (((scw[n] <= '9') && (scw[n] >= '0')) ||
  ------------------
  |  Branch (1620:12): [True: 491, False: 33]
  |  Branch (1620:26): [True: 249, False: 242]
  |  Branch (1620:45): [True: 154, False: 95]
  ------------------
 1621|    337|                        (((scw[n] == '.') || (scw[n] == ',')) && (n > 0)))) {
  ------------------
  |  Branch (1621:27): [True: 22, False: 315]
  |  Branch (1621:46): [True: 0, False: 315]
  |  Branch (1621:66): [True: 0, False: 22]
  ------------------
 1622|    154|      n++;
 1623|    154|      if ((scw[n] == '.') || (scw[n] == ',')) {
  ------------------
  |  Branch (1623:11): [True: 0, False: 154]
  |  Branch (1623:30): [True: 0, False: 154]
  ------------------
 1624|      0|        if (((n2 == 0) && (n > 3)) ||
  ------------------
  |  Branch (1624:14): [True: 0, False: 0]
  |  Branch (1624:27): [True: 0, False: 0]
  ------------------
 1625|      0|            ((n2 > 0) && ((scw[n - 1] == '.') || (scw[n - 1] == ','))))
  ------------------
  |  Branch (1625:14): [True: 0, False: 0]
  |  Branch (1625:27): [True: 0, False: 0]
  |  Branch (1625:50): [True: 0, False: 0]
  ------------------
 1626|      0|          break;
 1627|      0|        n2++;
 1628|      0|        n3 = n;
 1629|      0|      }
 1630|    154|    }
 1631|       |
 1632|    370|    if ((n == wl) && (n3 > 0) && (n - n3 > 3))
  ------------------
  |  Branch (1632:9): [True: 33, False: 337]
  |  Branch (1632:22): [True: 0, False: 33]
  |  Branch (1632:34): [True: 0, False: 0]
  ------------------
 1633|      0|      return slst;
 1634|    370|    if ((n == wl) || ((n > 0) && ((scw[n] == '%') || (scw[n] == '\xB0')) && checkword(scw.substr(n), nullptr, nullptr))) {
  ------------------
  |  Branch (1634:9): [True: 33, False: 337]
  |  Branch (1634:9): [True: 33, False: 337]
  |  Branch (1634:23): [True: 2, False: 335]
  |  Branch (1634:35): [True: 0, False: 2]
  |  Branch (1634:54): [True: 0, False: 2]
  |  Branch (1634:77): [True: 0, False: 0]
  ------------------
 1635|     33|      result.append(scw);
 1636|     33|      result.resize(n - 1);
 1637|     33|      if (n == wl)
  ------------------
  |  Branch (1637:11): [True: 33, False: 0]
  ------------------
 1638|     33|        cat_result(result, pSMgr->suggest_morph(scw.substr(n - 1)));
 1639|      0|      else {
 1640|      0|        std::string chunk = scw.substr(n - 1, 1);
 1641|      0|        cat_result(result, pSMgr->suggest_morph(chunk));
 1642|      0|        result.push_back('+');  // XXX SPEC. MORPHCODE
 1643|      0|        cat_result(result, pSMgr->suggest_morph(scw.substr(n)));
 1644|      0|      }
 1645|     33|      return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|     33|#define MSEP_REC '\n'
  ------------------
 1646|     33|    }
 1647|    370|  }
 1648|       |  // END OF LANG_hu section
 1649|       |
 1650|  6.81k|  switch (captype) {
  ------------------
  |  Branch (1650:11): [True: 6.81k, False: 0]
  ------------------
 1651|    592|    case HUHCAP:
  ------------------
  |  |   95|    592|#define HUHCAP 3
  ------------------
  |  Branch (1651:5): [True: 592, False: 6.22k]
  ------------------
 1652|    950|    case HUHINITCAP:
  ------------------
  |  |   96|    950|#define HUHINITCAP 4
  ------------------
  |  Branch (1652:5): [True: 358, False: 6.45k]
  ------------------
 1653|  3.95k|    case NOCAP: {
  ------------------
  |  |   92|  3.95k|#define NOCAP 0
  ------------------
  |  Branch (1653:5): [True: 3.00k, False: 3.80k]
  ------------------
 1654|  3.95k|      cat_result(result, pSMgr->suggest_morph(scw));
 1655|  3.95k|      if (abbv) {
  ------------------
  |  Branch (1655:11): [True: 389, False: 3.56k]
  ------------------
 1656|    389|        std::string u8buffer(scw);
 1657|    389|        u8buffer.push_back('.');
 1658|    389|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1659|    389|      }
 1660|  3.95k|      break;
 1661|    950|    }
 1662|  1.82k|    case INITCAP: {
  ------------------
  |  |   93|  1.82k|#define INITCAP 1
  ------------------
  |  Branch (1662:5): [True: 1.82k, False: 4.99k]
  ------------------
 1663|  1.82k|      mkallsmall2(scw, sunicw);
 1664|  1.82k|      std::string u8buffer(scw);
 1665|  1.82k|      mkinitcap2(scw, sunicw);
 1666|  1.82k|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1667|  1.82k|      cat_result(result, pSMgr->suggest_morph(scw));
 1668|  1.82k|      if (abbv) {
  ------------------
  |  Branch (1668:11): [True: 357, False: 1.46k]
  ------------------
 1669|    357|        u8buffer.push_back('.');
 1670|    357|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1671|       |
 1672|    357|        u8buffer = scw;
 1673|    357|        u8buffer.push_back('.');
 1674|       |
 1675|    357|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1676|    357|      }
 1677|  1.82k|      break;
 1678|    950|    }
 1679|  1.03k|    case ALLCAP: {
  ------------------
  |  |   94|  1.03k|#define ALLCAP 2
  ------------------
  |  Branch (1679:5): [True: 1.03k, False: 5.78k]
  ------------------
 1680|  1.03k|      cat_result(result, pSMgr->suggest_morph(scw));
 1681|  1.03k|      if (abbv) {
  ------------------
  |  Branch (1681:11): [True: 298, False: 735]
  ------------------
 1682|    298|        std::string u8buffer(scw);
 1683|    298|        u8buffer.push_back('.');
 1684|    298|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1685|    298|      }
 1686|  1.03k|      mkallsmall2(scw, sunicw);
 1687|  1.03k|      std::string u8buffer(scw);
 1688|  1.03k|      mkinitcap2(scw, sunicw);
 1689|       |
 1690|  1.03k|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1691|  1.03k|      cat_result(result, pSMgr->suggest_morph(scw));
 1692|  1.03k|      if (abbv) {
  ------------------
  |  Branch (1692:11): [True: 298, False: 735]
  ------------------
 1693|    298|        u8buffer.push_back('.');
 1694|    298|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1695|       |
 1696|    298|        u8buffer = scw;
 1697|    298|        u8buffer.push_back('.');
 1698|       |
 1699|    298|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1700|    298|      }
 1701|  1.03k|      break;
 1702|    950|    }
 1703|  6.81k|  }
 1704|       |
 1705|  6.81k|  if (!result.empty()) {
  ------------------
  |  Branch (1705:7): [True: 2.41k, False: 4.40k]
  ------------------
 1706|       |    // word reversing wrapper for complex prefixes
 1707|  2.41k|    if (complexprefixes) {
  ------------------
  |  Branch (1707:9): [True: 135, False: 2.27k]
  ------------------
 1708|    135|      if (utf8)
  ------------------
  |  Branch (1708:11): [True: 0, False: 135]
  ------------------
 1709|      0|        reverseword_utf(result);
 1710|    135|      else
 1711|    135|        reverseword(result);
 1712|    135|    }
 1713|  2.41k|    return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|  2.41k|#define MSEP_REC '\n'
  ------------------
 1714|  2.41k|  }
 1715|       |
 1716|       |  // compound word with dash (HU) I18n
 1717|       |  // LANG_hu section: set dash information for suggestions
 1718|       |
 1719|  4.40k|  size_t dash_pos = langnum == LANG_hu ? scw.find('-') : std::string::npos;
  ------------------
  |  Branch (1719:21): [True: 237, False: 4.16k]
  ------------------
 1720|  4.40k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1720:7): [True: 38, False: 4.36k]
  ------------------
 1721|     38|    int nresult = 0;
 1722|       |
 1723|     38|    std::string part1 = scw.substr(0, dash_pos), part2 = scw.substr(dash_pos + 1);
 1724|       |
 1725|       |    // examine 2 sides of the dash
 1726|     38|    if (part2.empty()) {  // base word ending with dash
  ------------------
  |  Branch (1726:9): [True: 7, False: 31]
  ------------------
 1727|      7|      if (spell(part1, candidate_stack)) {
  ------------------
  |  Branch (1727:11): [True: 1, False: 6]
  ------------------
 1728|      1|        std::string p = pSMgr->suggest_morph(part1);
 1729|      1|        if (!p.empty()) {
  ------------------
  |  Branch (1729:13): [True: 0, False: 1]
  ------------------
 1730|      0|          slst = line_tok(p, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1731|      0|          return slst;
 1732|      0|        }
 1733|      1|      }
 1734|     31|    } else if (part2.size() == 1 && part2[0] == 'e') {  // XXX (HU) -e hat.
  ------------------
  |  Branch (1734:16): [True: 1, False: 30]
  |  Branch (1734:37): [True: 0, False: 1]
  ------------------
 1735|      0|      if (spell(part1, candidate_stack) && (spell("-e", candidate_stack))) {
  ------------------
  |  Branch (1735:11): [True: 0, False: 0]
  |  Branch (1735:11): [True: 0, False: 0]
  |  Branch (1735:44): [True: 0, False: 0]
  ------------------
 1736|      0|        std::string st = pSMgr->suggest_morph(part1);
 1737|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1737:13): [True: 0, False: 0]
  ------------------
 1738|      0|          result.append(st);
 1739|      0|        }
 1740|      0|        result.push_back('+');  // XXX spec. separator in MORPHCODE
 1741|      0|        st = pSMgr->suggest_morph("-e");
 1742|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1742:13): [True: 0, False: 0]
  ------------------
 1743|      0|          result.append(st);
 1744|      0|        }
 1745|      0|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1746|      0|      }
 1747|     31|    } else {
 1748|       |      // first word ending with dash: word- XXX ???
 1749|     31|      part1.push_back(' ');
 1750|     31|      nresult = spell(part1, candidate_stack);
 1751|     31|      part1.erase(part1.size() - 1);
 1752|     31|      if (nresult && spell(part2, candidate_stack) &&
  ------------------
  |  Branch (1752:11): [True: 3, False: 28]
  |  Branch (1752:22): [True: 1, False: 2]
  ------------------
 1753|      1|          ((part2.size() > 1) || ((part2[0] > '0') && (part2[0] < '9')))) {
  ------------------
  |  Branch (1753:12): [True: 0, False: 1]
  |  Branch (1753:35): [True: 1, False: 0]
  |  Branch (1753:55): [True: 1, False: 0]
  ------------------
 1754|      1|        std::string st = pSMgr->suggest_morph(part1);
 1755|      1|        if (!st.empty()) {
  ------------------
  |  Branch (1755:13): [True: 0, False: 1]
  ------------------
 1756|      0|          result.append(st);
 1757|      0|          result.push_back('+');  // XXX spec. separator in MORPHCODE
 1758|      0|        }
 1759|      1|        st = pSMgr->suggest_morph(part2);
 1760|      1|        if (!st.empty()) {
  ------------------
  |  Branch (1760:13): [True: 1, False: 0]
  ------------------
 1761|      1|          result.append(st);
 1762|      1|        }
 1763|      1|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      1|#define MSEP_REC '\n'
  ------------------
 1764|      1|      }
 1765|     31|    }
 1766|       |    // affixed number in correct word
 1767|     37|    if (nresult && (dash_pos > 0) &&
  ------------------
  |  Branch (1767:9): [True: 2, False: 35]
  |  Branch (1767:20): [True: 0, False: 2]
  ------------------
 1768|      0|        (((scw[dash_pos - 1] <= '9') && (scw[dash_pos - 1] >= '0')) ||
  ------------------
  |  Branch (1768:11): [True: 0, False: 0]
  |  Branch (1768:41): [True: 0, False: 0]
  ------------------
 1769|      0|         (scw[dash_pos - 1] == '.'))) {
  ------------------
  |  Branch (1769:10): [True: 0, False: 0]
  ------------------
 1770|      0|      n = 1;
 1771|      0|      if (scw[dash_pos - n] == '.')
  ------------------
  |  Branch (1771:11): [True: 0, False: 0]
  ------------------
 1772|      0|        n++;
 1773|       |      // search first not a number character to left from dash
 1774|      0|      while ((dash_pos >= n) && ((scw[dash_pos - n] == '0') || (n < 3)) &&
  ------------------
  |  Branch (1774:14): [True: 0, False: 0]
  |  Branch (1774:34): [True: 0, False: 0]
  |  Branch (1774:64): [True: 0, False: 0]
  ------------------
 1775|      0|             (n < 6)) {
  ------------------
  |  Branch (1775:14): [True: 0, False: 0]
  ------------------
 1776|      0|        n++;
 1777|      0|      }
 1778|      0|      if (dash_pos < n)
  ------------------
  |  Branch (1778:11): [True: 0, False: 0]
  ------------------
 1779|      0|        n--;
 1780|       |      // numbers: valami1000000-hoz
 1781|       |      // examine 100000-hoz, 10000-hoz 1000-hoz, 10-hoz,
 1782|       |      // 56-hoz, 6-hoz
 1783|      0|      for (; n >= 1; n--) {
  ------------------
  |  Branch (1783:14): [True: 0, False: 0]
  ------------------
 1784|      0|        if (scw[dash_pos - n] < '0' || scw[dash_pos - n] > '9') {
  ------------------
  |  Branch (1784:13): [True: 0, False: 0]
  |  Branch (1784:40): [True: 0, False: 0]
  ------------------
 1785|      0|            continue;
 1786|      0|        }
 1787|      0|        std::string chunk = scw.substr(dash_pos - n);
 1788|      0|        if (checkword(chunk, nullptr, nullptr)) {
  ------------------
  |  Branch (1788:13): [True: 0, False: 0]
  ------------------
 1789|      0|          result.append(chunk);
 1790|      0|          std::string st = pSMgr->suggest_morph(chunk);
 1791|      0|          if (!st.empty()) {
  ------------------
  |  Branch (1791:15): [True: 0, False: 0]
  ------------------
 1792|      0|            result.append(st);
 1793|      0|          }
 1794|      0|          return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1795|      0|        }
 1796|      0|      }
 1797|      0|    }
 1798|     37|  }
 1799|  4.40k|  return slst;
 1800|  4.40k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS0_6vectorIS6_NS4_IS6_EEEE:
 1802|  6.08k|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::vector<std::string>& pl) {
 1803|  6.08k|  std::vector<std::string> slst;
 1804|  6.08k|  if (!pSMgr || pl.empty())
  ------------------
  |  Branch (1804:7): [True: 0, False: 6.08k]
  |  Branch (1804:17): [True: 548, False: 5.53k]
  ------------------
 1805|    548|    return slst;
 1806|  5.53k|  std::vector<std::string> pl2 = analyze(word);
 1807|  5.53k|  int captype = NOCAP, abbv = 0;
  ------------------
  |  |   92|  5.53k|#define NOCAP 0
  ------------------
 1808|  5.53k|  std::string cw;
 1809|  5.53k|  cleanword(cw, word, &captype, &abbv);
 1810|  5.53k|  std::string result;
 1811|       |
 1812|  5.53k|  auto suggest_start = std::chrono::steady_clock::now();
 1813|   371k|  for (const auto& i : pl) {
  ------------------
  |  Branch (1813:22): [True: 371k, False: 5.53k]
  ------------------
 1814|   371k|    cat_result(result, pSMgr->suggest_gen(pl2, i, suggest_start));
 1815|   371k|  }
 1816|       |
 1817|  5.53k|  if (!result.empty()) {
  ------------------
  |  Branch (1817:7): [True: 0, False: 5.53k]
  ------------------
 1818|       |    // allcap
 1819|      0|    if (captype == ALLCAP)
  ------------------
  |  |   94|      0|#define ALLCAP 2
  ------------------
  |  Branch (1819:9): [True: 0, False: 0]
  ------------------
 1820|      0|      mkallcap(result);
 1821|       |
 1822|       |    // line split
 1823|      0|    slst = line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1824|       |
 1825|       |    // capitalize
 1826|      0|    if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   93|      0|#define INITCAP 1
  ------------------
                  if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   96|      0|#define HUHINITCAP 4
  ------------------
  |  Branch (1826:9): [True: 0, False: 0]
  |  Branch (1826:31): [True: 0, False: 0]
  ------------------
 1827|      0|      for (auto& str : slst) {
  ------------------
  |  Branch (1827:22): [True: 0, False: 0]
  ------------------
 1828|      0|        mkinitcap(str);
 1829|      0|      }
 1830|      0|    }
 1831|       |
 1832|       |    // temporary filtering of prefix related errors (eg.
 1833|       |    // generate("undrinkable", "eats") --> "undrinkables" and "*undrinks")
 1834|      0|    auto it = slst.begin();
 1835|      0|    while (it != slst.end()) {
  ------------------
  |  Branch (1835:12): [True: 0, False: 0]
  ------------------
 1836|      0|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|      0|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1836:11): [True: 0, False: 0]
  ------------------
 1837|      0|        break;
 1838|      0|      std::vector<std::string> candidate_stack;
 1839|      0|      if (!spell(*it, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1839:11): [True: 0, False: 0]
  ------------------
 1840|      0|        it = slst.erase(it);
 1841|      0|      } else  {
 1842|      0|        ++it;
 1843|      0|      }
 1844|      0|    }
 1845|      0|  }
 1846|  5.53k|  return slst;
 1847|  6.08k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 1849|    779|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::string& pattern) {
 1850|    779|  std::vector<std::string> pl = analyze(pattern);
 1851|    779|  std::vector<std::string> slst = generate(word, pl);
 1852|    779|  uniqlist(slst);
 1853|    779|  return slst;
 1854|    779|}
_ZN12HunspellImpl11get_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEm:
 1857|   457k|std::string HunspellImpl::get_xml_par(const std::string& in_par, std::string::size_type pos) {
 1858|   457k|  std::string dest;
 1859|   457k|  if (pos == std::string::npos)
  ------------------
  |  Branch (1859:7): [True: 5.92k, False: 451k]
  ------------------
 1860|  5.92k|    return dest;
 1861|   451k|  const char* par = in_par.c_str() + pos;
 1862|   451k|  char end = *par;
 1863|   451k|  if (end == '>')
  ------------------
  |  Branch (1863:7): [True: 448k, False: 3.02k]
  ------------------
 1864|   448k|    end = '<';
 1865|  3.02k|  else if (end != '\'' && end != '"')
  ------------------
  |  Branch (1865:12): [True: 2.56k, False: 456]
  |  Branch (1865:27): [True: 1.44k, False: 1.12k]
  ------------------
 1866|  1.44k|    return dest;  // bad XML
 1867|  11.4M|  for (par++; *par != '\0' && *par != end; ++par) {
  ------------------
  |  Branch (1867:15): [True: 11.4M, False: 35.9k]
  |  Branch (1867:31): [True: 11.0M, False: 414k]
  ------------------
 1868|  11.0M|    dest.push_back(*par);
 1869|  11.0M|  }
 1870|   450k|  mystrrep(dest, "&lt;", "<");
 1871|   450k|  mystrrep(dest, "&amp;", "&");
 1872|   450k|  return dest;
 1873|   451k|}
_ZN12HunspellImpl11get_xml_posERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 1889|  65.4k|std::string::size_type HunspellImpl::get_xml_pos(const std::string& s, std::string::size_type pos, const char* attr) {
 1890|  65.4k|  if (pos == std::string::npos)
  ------------------
  |  Branch (1890:7): [True: 0, False: 65.4k]
  ------------------
 1891|      0|    return std::string::npos;
 1892|       |
 1893|  65.4k|  std::string::size_type endpos = s.find('>', pos);
 1894|  65.4k|  if (attr == nullptr)
  ------------------
  |  Branch (1894:7): [True: 0, False: 65.4k]
  ------------------
 1895|      0|    return endpos;
 1896|   250k|  while (true) {
  ------------------
  |  Branch (1896:10): [True: 250k, Folded]
  ------------------
 1897|   250k|    pos = s.find(attr, pos);
 1898|   250k|    if (pos == std::string::npos || pos >= endpos)
  ------------------
  |  Branch (1898:9): [True: 2.81k, False: 247k]
  |  Branch (1898:37): [True: 1.90k, False: 245k]
  ------------------
 1899|  4.71k|      return std::string::npos;
 1900|   245k|    if (pos == 0 || s[pos - 1] == ' ' || s[pos - 1] == '\n')
  ------------------
  |  Branch (1900:9): [True: 0, False: 245k]
  |  Branch (1900:21): [True: 2.01k, False: 243k]
  |  Branch (1900:42): [True: 58.7k, False: 185k]
  ------------------
 1901|  60.7k|      break;
 1902|   185k|    pos += strlen(attr);
 1903|   185k|  }
 1904|  60.7k|  return pos + strlen(attr);
 1905|  65.4k|}
_ZN12HunspellImpl13check_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKcSA_:
 1909|  65.4k|                                const char* value) {
 1910|  65.4k|  const std::string cw = get_xml_par(q, get_xml_pos(q, pos, attr));
 1911|  65.4k|  return cw == value ? 1 : 0;
  ------------------
  |  Branch (1911:10): [True: 16.3k, False: 49.0k]
  ------------------
 1912|  65.4k|}
_ZN12HunspellImpl12get_xml_listERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 1914|  5.89k|std::vector<std::string> HunspellImpl::get_xml_list(const std::string& list, std::string::size_type pos, const char* tag) {
 1915|  5.89k|  std::vector<std::string> slst;
 1916|  5.89k|  if (pos == std::string::npos)
  ------------------
  |  Branch (1916:7): [True: 19, False: 5.87k]
  ------------------
 1917|     19|    return slst;
 1918|   376k|  while (true) {
  ------------------
  |  Branch (1918:10): [True: 376k, Folded]
  ------------------
 1919|   376k|    pos = list.find(tag, pos);
 1920|   376k|    if (pos == std::string::npos)
  ------------------
  |  Branch (1920:9): [True: 4.35k, False: 372k]
  ------------------
 1921|  4.35k|        break;
 1922|   372k|    std::string cw = get_xml_par(list, pos + strlen(tag) - 1);
 1923|   372k|    if (cw.empty()) {
  ------------------
  |  Branch (1923:9): [True: 1.52k, False: 370k]
  ------------------
 1924|  1.52k|      break;
 1925|  1.52k|    }
 1926|   370k|    slst.push_back(std::move(cw));
 1927|   370k|    ++pos;
 1928|   370k|  }
 1929|  5.87k|  return slst;
 1930|  5.89k|}
_ZN12HunspellImpl7spellmlERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1932|  20.1k|std::vector<std::string> HunspellImpl::spellml(const std::string& in_word) {
 1933|  20.1k|  std::vector<std::string> slst;
 1934|       |
 1935|  20.1k|  std::string::size_type qpos = in_word.find("<query");
 1936|  20.1k|  if (qpos == std::string::npos)
  ------------------
  |  Branch (1936:7): [True: 367, False: 19.7k]
  ------------------
 1937|    367|    return slst;  // bad XML input
 1938|       |
 1939|  19.7k|  std::string::size_type q2pos = in_word.find('>', qpos);
 1940|  19.7k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (1940:7): [True: 133, False: 19.6k]
  ------------------
 1941|    133|    return slst;  // bad XML input
 1942|       |
 1943|  19.6k|  q2pos = in_word.find("<word", q2pos);
 1944|  19.6k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (1944:7): [True: 304, False: 19.3k]
  ------------------
 1945|    304|    return slst;  // bad XML input
 1946|       |
 1947|  19.3k|  if (check_xml_par(in_word, qpos, "type=", "analyze")) {
  ------------------
  |  Branch (1947:7): [True: 589, False: 18.7k]
  ------------------
 1948|    589|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 1949|    589|    if (!cw.empty())
  ------------------
  |  Branch (1949:9): [True: 285, False: 304]
  ------------------
 1950|    285|      slst = analyze(cw);
 1951|    589|    if (slst.empty())
  ------------------
  |  Branch (1951:9): [True: 548, False: 41]
  ------------------
 1952|    548|      return slst;
 1953|       |    // convert the result to <code><a>ana1</a><a>ana2</a></code> format
 1954|     41|    std::string r;
 1955|     41|    r.append("<code>");
 1956|     41|    for (auto entry : slst) {
  ------------------
  |  Branch (1956:21): [True: 41, False: 41]
  ------------------
 1957|     41|      r.append("<a>");
 1958|       |
 1959|     41|      mystrrep(entry, "\t", " ");
 1960|     41|      mystrrep(entry, "&", "&amp;");
 1961|     41|      mystrrep(entry, "<", "&lt;");
 1962|     41|      r.append(entry);
 1963|       |
 1964|     41|      r.append("</a>");
 1965|     41|    }
 1966|     41|    r.append("</code>");
 1967|     41|    slst.clear();
 1968|     41|    slst.push_back(std::move(r));
 1969|     41|    return slst;
 1970|  18.7k|  } else if (check_xml_par(in_word, qpos, "type=", "stem")) {
  ------------------
  |  Branch (1970:14): [True: 1.48k, False: 17.2k]
  ------------------
 1971|  1.48k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 1972|  1.48k|    if (!cw.empty())
  ------------------
  |  Branch (1972:9): [True: 1.10k, False: 380]
  ------------------
 1973|  1.10k|      return stem(cw);
 1974|  17.2k|  } else if (check_xml_par(in_word, qpos, "type=", "generate")) {
  ------------------
  |  Branch (1974:14): [True: 7.08k, False: 10.1k]
  ------------------
 1975|  7.08k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 1976|  7.08k|    if (cw.empty())
  ------------------
  |  Branch (1976:9): [True: 209, False: 6.87k]
  ------------------
 1977|    209|      return slst;
 1978|  6.87k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 1979|  6.87k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (1979:9): [True: 855, False: 6.02k]
  ------------------
 1980|    855|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 1981|    855|      if (!cw2.empty()) {
  ------------------
  |  Branch (1981:11): [True: 779, False: 76]
  ------------------
 1982|    779|        return generate(cw, cw2);
 1983|    779|      }
 1984|  6.02k|    } else {
 1985|  6.02k|      q2pos = in_word.find("<code", q2pos + 1);
 1986|  6.02k|      if (q2pos != std::string::npos) {
  ------------------
  |  Branch (1986:11): [True: 5.89k, False: 133]
  ------------------
 1987|  5.89k|        std::vector<std::string> slst2 = get_xml_list(in_word, in_word.find('>', q2pos), "<a>");
 1988|  5.89k|        if (!slst2.empty()) {
  ------------------
  |  Branch (1988:13): [True: 5.30k, False: 589]
  ------------------
 1989|  5.30k|          slst = generate(cw, slst2);
 1990|  5.30k|          uniqlist(slst);
 1991|  5.30k|          return slst;
 1992|  5.30k|        }
 1993|  5.89k|      }
 1994|  6.02k|    }
 1995|  10.1k|  } else if (check_xml_par(in_word, qpos, "type=", "add")) {
  ------------------
  |  Branch (1995:14): [True: 7.19k, False: 2.96k]
  ------------------
 1996|  7.19k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 1997|  7.19k|    if (cw.empty())
  ------------------
  |  Branch (1997:9): [True: 115, False: 7.08k]
  ------------------
 1998|    115|      return slst;
 1999|  7.08k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 2000|  7.08k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (2000:9): [True: 2.38k, False: 4.69k]
  ------------------
 2001|  2.38k|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2002|  2.38k|      if (!cw2.empty()) {
  ------------------
  |  Branch (2002:11): [True: 2.04k, False: 341]
  ------------------
 2003|  2.04k|        add_with_affix(cw, cw2);
 2004|  2.04k|      } else {
 2005|    341|        add(cw);
 2006|    341|      }
 2007|  4.69k|    } else {
 2008|  4.69k|        add(cw);
 2009|  4.69k|    }
 2010|  7.08k|  }
 2011|  11.2k|  return slst;
 2012|  19.3k|}
_ZN8HunspellC2EPKcS1_S1_:
 2162|     38|  : m_Impl(new HunspellImpl(affpath, dpath, key)) {
 2163|     38|}
_ZN8Hunspell5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_:
 2174|  60.3k|bool Hunspell::spell(const std::string& word, int* info, std::string* root) {
 2175|  60.3k|  std::vector<std::string> candidate_stack;
 2176|  60.3k|  return m_Impl->spell(word, candidate_stack, info, root,
 2177|  60.3k|                       std::chrono::steady_clock::now());
 2178|  60.3k|}
_ZN8Hunspell7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 2180|  59.9k|std::vector<std::string> Hunspell::suggest(const std::string& word) {
 2181|  59.9k|  return m_Impl->suggest(word);
 2182|  59.9k|}

_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.9k|std::string phonet(const std::string& inword, phonetable& parms) {
   70|       |
   71|  10.9k|  int i, k = 0, p, z, k0, n0, p0 = -333;
   72|  10.9k|  char c;
   73|  10.9k|  using uchar = unsigned char;
   74|       |
   75|  10.9k|  size_t len = inword.size();
   76|  10.9k|  if (len > MAXPHONETUTF8LEN)
  ------------------
  |  |   35|  10.9k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.9k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
  |  Branch (76:7): [True: 0, False: 10.9k]
  ------------------
   77|      0|    return {};
   78|  10.9k|  char word[MAXPHONETUTF8LEN + 1];
   79|  10.9k|  strncpy(word, inword.c_str(), MAXPHONETUTF8LEN);
  ------------------
  |  |   35|  10.9k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.9k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   80|  10.9k|  word[MAXPHONETUTF8LEN] = '\0';
  ------------------
  |  |   35|  10.9k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.9k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   81|       |
   82|  10.9k|  std::string target;
   83|       |  /**  check word  **/
   84|  10.9k|  i = z = 0;
   85|  94.5k|  while ((c = word[i]) != '\0') {
  ------------------
  |  Branch (85:10): [True: 83.6k, False: 10.9k]
  ------------------
   86|  83.6k|    int n = parms.hash[(uchar)c];
   87|  83.6k|    int z0 = 0;
   88|       |
   89|  83.6k|    if (n >= 0 && !parms.rules[n].empty()) {
  ------------------
  |  Branch (89:9): [True: 24.8k, False: 58.7k]
  |  Branch (89:19): [True: 24.8k, False: 0]
  ------------------
   90|       |      /**  check all rules for the same letter  **/
   91|  60.0k|      while (parms.rules[n][0] == c) {
  ------------------
  |  Branch (91:14): [True: 58.4k, False: 1.58k]
  ------------------
   92|       |        /**  check whole string  **/
   93|  58.4k|        k = 1; /** number of found letters  **/
   94|  58.4k|        p = 5; /** default priority  **/
   95|  58.4k|        const char*s = parms.rules[n].c_str();
   96|  58.4k|        s++; /**  important for (see below)  "*(s-1)"  **/
   97|       |
   98|  59.9k|        while (*s != '\0' && word[i + k] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (98:16): [True: 38.3k, False: 21.5k]
  |  Branch (98:30): [True: 1.51k, False: 36.8k]
  |  Branch (98:51): [True: 1.51k, False: 0]
  |  Branch (98:82): [True: 1.48k, False: 24]
  ------------------
   99|  1.48k|          k++;
  100|  1.48k|          s++;
  101|  1.48k|        }
  102|  58.4k|        if (*s == '(') {
  ------------------
  |  Branch (102:13): [True: 3.33k, False: 55.1k]
  ------------------
  103|       |          /**  check letters in "(..)"  **/
  104|  3.33k|          if (myisalpha(word[i + k])  // ...could be implied?
  ------------------
  |  Branch (104:15): [True: 2.16k, False: 1.16k]
  ------------------
  105|  2.16k|              && strchr(s + 1, word[i + k]) != nullptr) {
  ------------------
  |  Branch (105:18): [True: 282, False: 1.88k]
  ------------------
  106|    282|            k++;
  107|  1.60k|            while (*s && *s != ')')
  ------------------
  |  Branch (107:20): [True: 1.60k, False: 0]
  |  Branch (107:26): [True: 1.32k, False: 282]
  ------------------
  108|  1.32k|              s++;
  109|    282|            if (*s == ')')
  ------------------
  |  Branch (109:17): [True: 282, False: 0]
  ------------------
  110|    282|              s++;
  111|    282|          }
  112|  3.33k|        }
  113|  58.4k|        p0 = (int)*s;
  114|  58.4k|        k0 = k;
  115|  59.5k|        while (*s == '-' && k > 1) {
  ------------------
  |  Branch (115:16): [True: 1.08k, False: 58.4k]
  |  Branch (115:29): [True: 1.08k, False: 0]
  ------------------
  116|  1.08k|          k--;
  117|  1.08k|          s++;
  118|  1.08k|        }
  119|  58.4k|        if (*s == '<')
  ------------------
  |  Branch (119:13): [True: 143, False: 58.3k]
  ------------------
  120|    143|          s++;
  121|  58.4k|        if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (121:13): [True: 0, False: 58.4k]
  ------------------
  122|       |          /**  determine priority  **/
  123|      0|          p = *s - '0';
  124|      0|          s++;
  125|      0|        }
  126|  58.4k|        if (*s == '^' && *(s + 1) == '^')
  ------------------
  |  Branch (126:13): [True: 2.28k, False: 56.1k]
  |  Branch (126:26): [True: 0, False: 2.28k]
  ------------------
  127|      0|          s++;
  128|       |
  129|  58.4k|        if (*s == '\0' || (*s == '^' && (i == 0 || !myisalpha(word[i - 1])) &&
  ------------------
  |  Branch (129:13): [True: 22.7k, False: 35.6k]
  |  Branch (129:28): [True: 2.28k, False: 33.3k]
  |  Branch (129:42): [True: 150, False: 2.13k]
  |  Branch (129:52): [True: 596, False: 1.53k]
  ------------------
  130|    746|                           (*(s + 1) != '$' || (!myisalpha(word[i + k0])))) ||
  ------------------
  |  Branch (130:29): [True: 746, False: 0]
  |  Branch (130:48): [True: 0, False: 0]
  ------------------
  131|  34.9k|            (*s == '$' && i > 0 && myisalpha(word[i - 1]) &&
  ------------------
  |  Branch (131:14): [True: 0, False: 34.9k]
  |  Branch (131:27): [True: 0, False: 0]
  |  Branch (131:36): [True: 0, False: 0]
  ------------------
  132|  23.5k|             (!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.5k|          char c0 = word[i + k - 1];
  136|  23.5k|          n0 = parms.hash[(uchar)c0];
  137|       |
  138|       |          //            if (parms.followup  &&  k > 1  &&  n0 >= 0
  139|  23.5k|          if (k > 1 && n0 >= 0 && p0 != (int)'-' && word[i + k] != '\0' && !parms.rules[n0].empty()) {
  ------------------
  |  Branch (139:15): [True: 406, False: 23.1k]
  |  Branch (139:24): [True: 406, False: 0]
  |  Branch (139:35): [True: 361, False: 45]
  |  Branch (139:53): [True: 328, False: 33]
  |  Branch (139:76): [True: 328, False: 0]
  ------------------
  140|       |            /**  test follow-up rule for "word[i+k]"  **/
  141|  1.11k|            while (parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (141:20): [True: 1.01k, False: 98]
  ------------------
  142|       |              /**  check whole string  **/
  143|  1.01k|              k0 = k;
  144|  1.01k|              p0 = 5;
  145|  1.01k|              s = parms.rules[n0].c_str();
  146|  1.01k|              s++;
  147|  1.24k|              while (*s != '\0' && word[i + k0] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (147:22): [True: 966, False: 277]
  |  Branch (147:36): [True: 230, False: 736]
  |  Branch (147:58): [True: 230, False: 0]
  |  Branch (147:89): [True: 230, False: 0]
  ------------------
  148|    230|                k0++;
  149|    230|                s++;
  150|    230|              }
  151|  1.01k|              if (*s == '(') {
  ------------------
  |  Branch (151:19): [True: 52, False: 961]
  ------------------
  152|       |                /**  check letters  **/
  153|     52|                if (myisalpha(word[i + k0]) && strchr(s + 1, word[i + k0]) != nullptr) {
  ------------------
  |  Branch (153:21): [True: 52, False: 0]
  |  Branch (153:48): [True: 0, False: 52]
  ------------------
  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|     52|              }
  161|  1.01k|              while (*s == '-') {
  ------------------
  |  Branch (161:22): [True: 0, False: 1.01k]
  ------------------
  162|       |                /**  "k0" gets NOT reduced   **/
  163|       |                /**  because "if (k0 == k)"  **/
  164|      0|                s++;
  165|      0|              }
  166|  1.01k|              if (*s == '<')
  ------------------
  |  Branch (166:19): [True: 51, False: 962]
  ------------------
  167|     51|                s++;
  168|  1.01k|              if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (168:19): [True: 0, False: 1.01k]
  ------------------
  169|      0|                p0 = *s - '0';
  170|      0|                s++;
  171|      0|              }
  172|       |
  173|  1.01k|              if (*s == '\0'
  ------------------
  |  Branch (173:19): [True: 328, False: 685]
  ------------------
  174|       |                  /**  *s == '^' cuts  **/
  175|    685|                  || (*s == '$' && !myisalpha(word[i + k0]))) {
  ------------------
  |  Branch (175:23): [True: 0, False: 685]
  |  Branch (175:36): [True: 0, False: 0]
  ------------------
  176|    328|                if (k0 == k) {
  ------------------
  |  Branch (176:21): [True: 98, False: 230]
  ------------------
  177|       |                  /**  this is just a piece of the string  **/
  178|     98|                  n0 += 2;
  179|     98|                  continue;
  180|     98|                }
  181|       |
  182|    230|                if (p0 < p) {
  ------------------
  |  Branch (182:21): [True: 0, False: 230]
  ------------------
  183|       |                  /**  priority too low  **/
  184|      0|                  n0 += 2;
  185|      0|                  continue;
  186|      0|                }
  187|       |                /**  rule fits; stop search  **/
  188|    230|                break;
  189|    230|              }
  190|    685|              n0 += 2;
  191|    685|            } /**  End of "while (parms.rules[n0][0] == c0)"  **/
  192|       |
  193|    328|            if (p0 >= p && parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (193:17): [True: 328, False: 0]
  |  Branch (193:28): [True: 230, False: 98]
  ------------------
  194|    230|              n += 2;
  195|    230|              continue;
  196|    230|            }
  197|    328|          } /** end of follow-up stuff **/
  198|       |
  199|       |          /**  replace string  **/
  200|  23.3k|          s = parms.rules[n + 1].c_str();
  201|  23.3k|          p0 = (!parms.rules[n].empty() && strchr(parms.rules[n].c_str() + 1, '<') != nullptr) ? 1 : 0;
  ------------------
  |  Branch (201:17): [True: 23.3k, False: 0]
  |  Branch (201:44): [True: 92, False: 23.2k]
  ------------------
  202|  23.3k|          if (p0 == 1 && z == 0) {
  ------------------
  |  Branch (202:15): [True: 92, False: 23.2k]
  |  Branch (202:26): [True: 92, False: 0]
  ------------------
  203|       |            /**  rule with '<' is used  **/
  204|     92|            if (!target.empty() && *s != '\0' &&
  ------------------
  |  Branch (204:17): [True: 67, False: 25]
  |  Branch (204:36): [True: 67, False: 0]
  ------------------
  205|     67|                (target[target.size()-1] == c || target[target.size()-1] == *s)) {
  ------------------
  |  Branch (205:18): [True: 0, False: 67]
  |  Branch (205:50): [True: 0, False: 67]
  ------------------
  206|      0|              target.erase(target.size() - 1);
  207|      0|            }
  208|     92|            z0 = 1;
  209|     92|            z = 1;
  210|     92|            k0 = 0;
  211|    184|            while (*s != '\0' && word[i + k0] != '\0') {
  ------------------
  |  Branch (211:20): [True: 92, False: 92]
  |  Branch (211:34): [True: 92, False: 0]
  ------------------
  212|     92|              word[i + k0] = *s;
  213|     92|              k0++;
  214|     92|              s++;
  215|     92|            }
  216|     92|            if (k > k0)
  ------------------
  |  Branch (216:17): [True: 6, False: 86]
  ------------------
  217|      6|              strmove(&word[0] + i + k0, &word[0] + i + k);
  218|       |
  219|       |            /**  new "actual letter"  **/
  220|     92|            c = word[i];
  221|  23.2k|          } else { /** no '<' rule used **/
  222|  23.2k|            i += k - 1;
  223|  23.2k|            z = 0;
  224|  23.5k|            while (*s != '\0' && *(s + 1) != '\0' && target.size() < len) {
  ------------------
  |  Branch (224:20): [True: 22.5k, False: 989]
  |  Branch (224:34): [True: 365, False: 22.1k]
  |  Branch (224:54): [True: 305, False: 60]
  ------------------
  225|    305|              if (target.empty() || target[target.size()-1] != *s) {
  ------------------
  |  Branch (225:19): [True: 8, False: 297]
  |  Branch (225:37): [True: 93, False: 204]
  ------------------
  226|    101|                target.push_back(*s);
  227|    101|              }
  228|    305|              s++;
  229|    305|            }
  230|       |            /**  new "actual letter"  **/
  231|  23.2k|            c = *s;
  232|  23.2k|            if (!parms.rules[n].empty() && strstr(parms.rules[n].c_str() + 1, "^^") != nullptr) {
  ------------------
  |  Branch (232:17): [True: 23.2k, False: 0]
  |  Branch (232:44): [True: 0, False: 23.2k]
  ------------------
  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.2k|          }
  241|  23.3k|          break;
  242|  23.5k|        } /** end of follow-up stuff **/
  243|  34.9k|        n += 2;
  244|  34.9k|      } /**  end of while (parms.rules[n][0] == c)  **/
  245|  24.8k|    }   /**  end of if (n >= 0)  **/
  246|  83.6k|    if (z0 == 0) {
  ------------------
  |  Branch (246:9): [True: 83.5k, False: 92]
  ------------------
  247|  83.5k|      if (k && !p0 && target.size() < len && c != '\0') {
  ------------------
  |  Branch (247:11): [True: 24.8k, False: 58.7k]
  |  Branch (247:16): [True: 23.2k, False: 1.58k]
  |  Branch (247:23): [True: 23.1k, False: 75]
  |  Branch (247:46): [True: 22.1k, False: 989]
  ------------------
  248|       |        /**  condense only double letters  **/
  249|  22.1k|        target.push_back(c);
  250|       |        /// printf("\n setting \n");
  251|  22.1k|      }
  252|       |
  253|  83.5k|      i++;
  254|  83.5k|      z = 0;
  255|  83.5k|      k = 0;
  256|  83.5k|    }
  257|  83.6k|  } /**  end of   while ((c = word[i]) != '\0')  **/
  258|       |
  259|  10.9k|  return target;
  260|  10.9k|} /**  end of function "phonet"  **/
phonet.cxx:_ZL9myisalphac:
   59|  5.51k|static int myisalpha(char ch) {
   60|  5.51k|  if ((unsigned char)ch < 128)
  ------------------
  |  Branch (60:7): [True: 5.02k, False: 489]
  ------------------
   61|  5.02k|    return isalpha(ch);
   62|    489|  return 1;
   63|  5.51k|}
phonet.cxx:_ZL7strmovePcS_:
   53|      6|static inline void strmove(char* dest, char* src) {
   54|     20|  while (*src)
  ------------------
  |  Branch (54:10): [True: 14, False: 6]
  ------------------
   55|     14|    *dest++ = *src++;
   56|      6|  *dest = '\0';
   57|      6|}

_ZN7RepListC2Ei:
   79|      4|RepList::RepList(int n) {
   80|      4|  dat.reserve(std::min(n, 16384));
   81|      4|}
_ZN7RepList4findEPKc:
   89|  3.05M|int RepList::find(const char* word) {
   90|  3.05M|  int p1 = 0;
   91|  3.05M|  int p2 = dat.size() - 1;
   92|  3.05M|  int ret = -1;
   93|  9.54M|  while (p1 <= p2) {
  ------------------
  |  Branch (93:10): [True: 6.49M, False: 3.05M]
  ------------------
   94|  6.49M|    int m = ((unsigned)p1 + (unsigned)p2) >> 1;
   95|  6.49M|    int c = strncmp(word, dat[m]->pattern.c_str(), dat[m]->pattern.size());
   96|  6.49M|    if (c < 0)
  ------------------
  |  Branch (96:9): [True: 5.36M, False: 1.12M]
  ------------------
   97|  5.36M|      p2 = m - 1;
   98|  1.12M|    else if (c > 0)
  ------------------
  |  Branch (98:14): [True: 1.12M, False: 479]
  ------------------
   99|  1.12M|      p1 = m + 1;
  100|    479|    else {      // scan in the right half for a longer match
  101|    479|      ret = m;
  102|    479|      p1 = m + 1;
  103|    479|    }
  104|  6.49M|  }
  105|  3.05M|  return ret;
  106|  3.05M|}
_ZN7RepList7replaceEmib:
  108|    479|std::string RepList::replace(const size_t wordlen, int ind, bool atstart) {
  109|    479|  int type = atstart ? 1 : 0;
  ------------------
  |  Branch (109:14): [True: 9, False: 470]
  ------------------
  110|    479|  if (wordlen == dat[ind]->pattern.size())
  ------------------
  |  Branch (110:7): [True: 101, False: 378]
  ------------------
  111|    101|    type = atstart ? 3 : 2;
  ------------------
  |  Branch (111:12): [True: 0, False: 101]
  ------------------
  112|    589|  while (type && dat[ind]->outstrings[type].empty())
  ------------------
  |  Branch (112:10): [True: 110, False: 479]
  |  Branch (112:18): [True: 110, False: 0]
  ------------------
  113|    110|    type = (type == 2 && !atstart) ? 0 : type - 1;
  ------------------
  |  Branch (113:13): [True: 101, False: 9]
  |  Branch (113:26): [True: 101, False: 0]
  ------------------
  114|    479|  return dat[ind]->outstrings[type];
  115|    479|}
_ZN7RepList3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
  117|     22|int RepList::add(const std::string& in_pat1, const std::string& pat2) {
  118|     22|  if (in_pat1.empty() || pat2.empty()) {
  ------------------
  |  Branch (118:7): [True: 0, False: 22]
  |  Branch (118:26): [True: 0, False: 22]
  ------------------
  119|      0|    return 1;
  120|      0|  }
  121|       |  // analyse word context
  122|     22|  int type = 0;
  123|     22|  std::string pat1(in_pat1);
  124|     22|  if (pat1[0] == '_') {
  ------------------
  |  Branch (124:7): [True: 0, False: 22]
  ------------------
  125|      0|    pat1.erase(0, 1);
  126|      0|    type = 1;
  127|      0|  }
  128|     22|  if (!pat1.empty() && pat1[pat1.size() - 1] == '_') {
  ------------------
  |  Branch (128:7): [True: 22, False: 0]
  |  Branch (128:24): [True: 0, False: 22]
  ------------------
  129|      0|    type = type + 2;
  130|      0|    pat1.erase(pat1.size() - 1);
  131|      0|  }
  132|     22|  mystrrep(pat1, "_", " ");
  133|       |
  134|       |  // find existing entry
  135|     22|  int m = find(pat1.c_str());
  136|     22|  if (m >= 0 && dat[m]->pattern == pat1) {
  ------------------
  |  Branch (136:7): [True: 0, False: 22]
  |  Branch (136:17): [True: 0, False: 0]
  ------------------
  137|       |    // since already used
  138|      0|    dat[m]->outstrings[type] = pat2;
  139|      0|    mystrrep(dat[m]->outstrings[type], "_", " ");
  140|      0|    return 0;
  141|      0|  }
  142|       |
  143|       |  // make a new entry if none exists
  144|     22|  replentry* r = new replentry;
  145|     22|  r->pattern = std::move(pat1);
  146|     22|  r->outstrings[type] = pat2;
  147|     22|  mystrrep(r->outstrings[type], "_", " ");
  148|     22|  dat.push_back(r);
  149|       |  // sort to the right place in the list
  150|     22|  size_t i;
  151|     36|  for (i = dat.size() - 1; i > 0; --i) {
  ------------------
  |  Branch (151:28): [True: 30, False: 6]
  ------------------
  152|     30|    if (strcmp(r->pattern.c_str(), dat[i - 1]->pattern.c_str()) < 0) {
  ------------------
  |  Branch (152:9): [True: 14, False: 16]
  ------------------
  153|     14|      dat[i] = dat[i - 1];
  154|     14|    } else
  155|     16|      break;
  156|     30|  }
  157|     22|  dat[i] = r;
  158|     22|  return 0;
  159|     22|}
_ZN7RepList4convERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERS6_:
  161|   345k|bool RepList::conv(const std::string& in_word, std::string& dest) {
  162|   345k|  dest.clear();
  163|       |
  164|   345k|  const size_t wordlen = in_word.size();
  165|   345k|  const char* word = in_word.c_str();
  166|       |
  167|   345k|  bool change = false;
  168|  3.40M|  for (size_t i = 0; i < wordlen; ++i) {
  ------------------
  |  Branch (168:22): [True: 3.05M, False: 345k]
  ------------------
  169|  3.05M|    int n = find(word + i);
  170|       |
  171|  3.05M|    bool empty = n < 0;
  172|  3.05M|    if (empty) {
  ------------------
  |  Branch (172:9): [True: 3.05M, False: 479]
  ------------------
  173|  3.05M|      dest.push_back(word[i]);
  174|  3.05M|      continue;
  175|  3.05M|    }
  176|       |
  177|    479|    std::string l = replace(wordlen - i, n, i == 0);
  178|    479|    if (l.empty()) {
  ------------------
  |  Branch (178:9): [True: 0, False: 479]
  ------------------
  179|      0|      dest.push_back(word[i]);
  180|      0|      continue;
  181|      0|    }
  182|       |
  183|    479|    dest.append(l);
  184|    479|    if (!dat[n]->pattern.empty()) {
  ------------------
  |  Branch (184:9): [True: 479, False: 0]
  ------------------
  185|    479|      i += dat[n]->pattern.size() - 1;
  186|    479|    }
  187|    479|    change = true;
  188|    479|  }
  189|       |
  190|   345k|  return change;
  191|   345k|}
_ZNK7RepList24check_against_breaktableERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
  193|      2|bool RepList::check_against_breaktable(const std::vector<std::string>& breaktable) const {
  194|      8|  for (const auto i : dat) {
  ------------------
  |  Branch (194:21): [True: 8, False: 2]
  ------------------
  195|     32|    for (auto& outstring : i->outstrings) {
  ------------------
  |  Branch (195:26): [True: 32, False: 8]
  ------------------
  196|     96|      for (const auto& str : breaktable) {
  ------------------
  |  Branch (196:28): [True: 96, False: 32]
  ------------------
  197|     96|        if (outstring.find(str) != std::string::npos) {
  ------------------
  |  Branch (197:13): [True: 0, False: 96]
  ------------------
  198|      0|          return false;
  199|      0|        }
  200|     96|      }
  201|     32|    }
  202|      8|  }
  203|       |
  204|      2|  return true;
  205|      2|}

_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|  80.5M|                        int& info) {
  167|  80.5M|  if (wlst.size() == maxSug)
  ------------------
  |  Branch (167:7): [True: 0, False: 80.5M]
  ------------------
  168|      0|    return;
  169|       |
  170|  80.5M|  const int cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (170:20): [True: 21.7k, False: 80.4M]
  ------------------
  171|       |
  172|  80.5M|  if (cwrd) {
  ------------------
  |  Branch (172:7): [True: 80.4M, False: 21.7k]
  ------------------
  173|  80.4M|    if (int result = checkword(candidate, cpdsuggest, timer, timelimit)) {
  ------------------
  |  Branch (173:13): [True: 1.13k, False: 80.4M]
  ------------------
  174|       |      // compound word in the dictionary
  175|  1.13k|      if (cpdsuggest == 0 && result >= 2)
  ------------------
  |  Branch (175:11): [True: 1.13k, False: 0]
  |  Branch (175:30): [True: 3, False: 1.13k]
  ------------------
  176|      3|          info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      3|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  177|  1.13k|      wlst.push_back(candidate);
  178|  1.13k|    }
  179|  80.4M|  }
  180|  80.5M|}
_ZN10SuggestMgr7suggestERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_Pib:
  190|   146k|                        int* onlycompoundsug, bool test_simplesug) {
  191|   146k|  int nocompoundtwowords = 0; // no second or third loops, see below
  192|   146k|  std::vector<w_char> word_utf;
  193|   146k|  size_t nsugorig = slst.size(), oldSug = 0;
  194|   146k|  std::string w2;
  195|   146k|  bool good_suggestion = false;
  196|       |
  197|       |  // word reversing wrapper for complex prefixes
  198|   146k|  if (complexprefixes) {
  ------------------
  |  Branch (198:7): [True: 8.50k, False: 138k]
  ------------------
  199|  8.50k|    w2.assign(w);
  200|  8.50k|    if (utf8)
  ------------------
  |  Branch (200:9): [True: 0, False: 8.50k]
  ------------------
  201|      0|      reverseword_utf(w2);
  202|  8.50k|    else
  203|  8.50k|      reverseword(w2);
  204|  8.50k|  }
  205|       |
  206|   146k|  const std::string& word = complexprefixes ? w2 : w;
  ------------------
  |  Branch (206:29): [True: 8.50k, False: 138k]
  ------------------
  207|       |
  208|   146k|  suggest_start = std::chrono::steady_clock::now();
  209|       |
  210|   146k|  if (utf8) {
  ------------------
  |  Branch (210:7): [True: 61.6k, False: 85.2k]
  ------------------
  211|  61.6k|    int wl = u8_u16(word_utf, word);
  212|  61.6k|    if (wl == -1) {
  ------------------
  |  Branch (212:9): [True: 9.90k, False: 51.7k]
  ------------------
  213|  9.90k|      return false;
  214|  9.90k|    }
  215|  61.6k|  }
  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|   136k|  int info = 0;
  225|   547k|  for (int cpdsuggest = 0; cpdsuggest < 3 && nocompoundtwowords == 0; cpdsuggest++) {
  ------------------
  |  Branch (225:28): [True: 410k, False: 136k]
  |  Branch (225:46): [True: 410k, False: 35]
  ------------------
  226|       |
  227|       |    // limit compound suggestion
  228|   410k|    if (cpdsuggest > 0)
  ------------------
  |  Branch (228:9): [True: 273k, False: 136k]
  ------------------
  229|   273k|      oldSug = slst.size();
  230|       |
  231|       |    // suggestions for an uppercase word (html -> HTML)
  232|   410k|    if (slst.size() < maxSug) {
  ------------------
  |  Branch (232:9): [True: 410k, False: 21]
  ------------------
  233|   410k|      size_t i = slst.size();
  234|   410k|      if (utf8)
  ------------------
  |  Branch (234:11): [True: 155k, False: 255k]
  ------------------
  235|   155k|        capchars_utf(slst, word_utf, cpdsuggest, info);
  236|   255k|      else
  237|   255k|        capchars(slst, word, cpdsuggest, info);
  238|   410k|      if (slst.size() > i)
  ------------------
  |  Branch (238:11): [True: 33, False: 410k]
  ------------------
  239|     33|        good_suggestion = true;
  240|   410k|    }
  241|       |
  242|       |    // perhaps we made a typical fault of spelling
  243|   410k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (243:9): [True: 410k, False: 21]
  |  Branch (243:36): [True: 136k, False: 273k]
  |  Branch (243:51): [True: 273k, False: 0]
  ------------------
  244|   410k|      size_t i = slst.size();
  245|   410k|      replchars(slst, word, cpdsuggest, info);
  246|   410k|      if (slst.size() > i) {
  ------------------
  |  Branch (246:11): [True: 0, False: 410k]
  ------------------
  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|   410k|    }
  252|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (252:9): [True: 0, False: 410k]
  ------------------
  253|      0|      return good_suggestion;
  254|   410k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (254:9): [True: 0, False: 410k]
  |  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|   410k|    if ((slst.size() < maxSug) &&
  ------------------
  |  Branch (258:9): [True: 410k, False: 21]
  ------------------
  259|   410k|        (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (259:10): [True: 136k, False: 273k]
  |  Branch (259:25): [True: 273k, False: 0]
  ------------------
  260|   410k|      mapchars(slst, word, cpdsuggest, info);
  261|   410k|    }
  262|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (262:9): [True: 2, False: 410k]
  ------------------
  263|      2|      return good_suggestion;
  264|   410k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (264:9): [True: 0, False: 410k]
  |  Branch (264:27): [True: 0, False: 0]
  ------------------
  265|      0|      return true;
  266|       |
  267|       |    // only suggest compound words when no other ~good suggestion
  268|   410k|    if ((cpdsuggest == 0) && (slst.size() > nsugorig))
  ------------------
  |  Branch (268:9): [True: 136k, False: 273k]
  |  Branch (268:30): [True: 33, False: 136k]
  ------------------
  269|     33|      nocompoundtwowords = 1;
  270|       |
  271|       |    // did we swap the order of chars by mistake
  272|   410k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (272:9): [True: 410k, False: 21]
  |  Branch (272:36): [True: 136k, False: 273k]
  |  Branch (272:51): [True: 273k, False: 0]
  ------------------
  273|   410k|      if (utf8)
  ------------------
  |  Branch (273:11): [True: 155k, False: 255k]
  ------------------
  274|   155k|        swapchar_utf(slst, word_utf, cpdsuggest, info);
  275|   255k|      else
  276|   255k|        swapchar(slst, word, cpdsuggest, info);
  277|   410k|    }
  278|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (278:9): [True: 0, False: 410k]
  ------------------
  279|      0|      return good_suggestion;
  280|   410k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (280:9): [True: 0, False: 410k]
  |  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|   410k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (284:9): [True: 410k, False: 21]
  |  Branch (284:36): [True: 136k, False: 273k]
  |  Branch (284:51): [True: 273k, False: 0]
  ------------------
  285|   410k|      if (utf8)
  ------------------
  |  Branch (285:11): [True: 155k, False: 255k]
  ------------------
  286|   155k|        longswapchar_utf(slst, word_utf, cpdsuggest, info);
  287|   255k|      else
  288|   255k|        longswapchar(slst, word, cpdsuggest, info);
  289|   410k|    }
  290|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (290:9): [True: 0, False: 410k]
  ------------------
  291|      0|      return good_suggestion;
  292|   410k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (292:9): [True: 0, False: 410k]
  |  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|   410k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (296:9): [True: 410k, False: 21]
  |  Branch (296:36): [True: 136k, False: 273k]
  |  Branch (296:51): [True: 273k, False: 0]
  ------------------
  297|   410k|      if (utf8)
  ------------------
  |  Branch (297:11): [True: 155k, False: 255k]
  ------------------
  298|   155k|        badcharkey_utf(slst, word_utf, cpdsuggest, info);
  299|   255k|      else
  300|   255k|        badcharkey(slst, word, cpdsuggest, info);
  301|   410k|    }
  302|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (302:9): [True: 0, False: 410k]
  ------------------
  303|      0|      return good_suggestion;
  304|   410k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (304:9): [True: 0, False: 410k]
  |  Branch (304:27): [True: 0, False: 0]
  ------------------
  305|      0|      return true;
  306|       |
  307|       |    // did we add a char that should not be there
  308|   410k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (308:9): [True: 410k, False: 21]
  |  Branch (308:36): [True: 136k, False: 273k]
  |  Branch (308:51): [True: 273k, False: 0]
  ------------------
  309|   410k|      if (utf8)
  ------------------
  |  Branch (309:11): [True: 155k, False: 255k]
  ------------------
  310|   155k|        extrachar_utf(slst, word_utf, cpdsuggest, info);
  311|   255k|      else
  312|   255k|        extrachar(slst, word, cpdsuggest, info);
  313|   410k|    }
  314|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (314:9): [True: 0, False: 410k]
  ------------------
  315|      0|      return good_suggestion;
  316|   410k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (316:9): [True: 0, False: 410k]
  |  Branch (316:27): [True: 0, False: 0]
  ------------------
  317|      0|      return true;
  318|       |
  319|       |    // did we forgot a char
  320|   410k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (320:9): [True: 410k, False: 21]
  |  Branch (320:36): [True: 136k, False: 273k]
  |  Branch (320:51): [True: 273k, False: 0]
  ------------------
  321|   410k|      if (utf8)
  ------------------
  |  Branch (321:11): [True: 155k, False: 255k]
  ------------------
  322|   155k|        forgotchar_utf(slst, word_utf, cpdsuggest, info);
  323|   255k|      else
  324|   255k|        forgotchar(slst, word, cpdsuggest, info);
  325|   410k|    }
  326|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (326:9): [True: 0, False: 410k]
  ------------------
  327|      0|      return good_suggestion;
  328|   410k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (328:9): [True: 0, False: 410k]
  |  Branch (328:27): [True: 0, False: 0]
  ------------------
  329|      0|      return true;
  330|       |
  331|       |    // did we move a char
  332|   410k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (332:9): [True: 410k, False: 21]
  |  Branch (332:36): [True: 136k, False: 273k]
  |  Branch (332:51): [True: 273k, False: 0]
  ------------------
  333|   410k|      if (utf8)
  ------------------
  |  Branch (333:11): [True: 155k, False: 255k]
  ------------------
  334|   155k|        movechar_utf(slst, word_utf, cpdsuggest, info);
  335|   255k|      else
  336|   255k|        movechar(slst, word, cpdsuggest, info);
  337|   410k|    }
  338|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (338:9): [True: 0, False: 410k]
  ------------------
  339|      0|      return good_suggestion;
  340|   410k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (340:9): [True: 0, False: 410k]
  |  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|   410k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (344:9): [True: 410k, False: 21]
  |  Branch (344:36): [True: 136k, False: 273k]
  |  Branch (344:51): [True: 273k, False: 0]
  ------------------
  345|   410k|      if (utf8)
  ------------------
  |  Branch (345:11): [True: 155k, False: 255k]
  ------------------
  346|   155k|        badchar_utf(slst, word_utf, cpdsuggest, info);
  347|   255k|      else
  348|   255k|        badchar(slst, word, cpdsuggest, info);
  349|   410k|    }
  350|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (350:9): [True: 0, False: 410k]
  ------------------
  351|      0|      return good_suggestion;
  352|   410k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (352:9): [True: 0, False: 410k]
  |  Branch (352:27): [True: 0, False: 0]
  ------------------
  353|      0|      return true;
  354|       |
  355|       |    // did we double two characters
  356|   410k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (356:9): [True: 410k, False: 21]
  |  Branch (356:36): [True: 136k, False: 273k]
  |  Branch (356:51): [True: 273k, False: 0]
  ------------------
  357|   410k|      if (utf8)
  ------------------
  |  Branch (357:11): [True: 155k, False: 255k]
  ------------------
  358|   155k|        doubletwochars_utf(slst, word_utf, cpdsuggest, info);
  359|   255k|      else
  360|   255k|        doubletwochars(slst, word, cpdsuggest, info);
  361|   410k|    }
  362|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (362:9): [True: 0, False: 410k]
  ------------------
  363|      0|      return good_suggestion;
  364|   410k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (364:9): [True: 0, False: 410k]
  |  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|   410k|    if (!cpdsuggest || (!nosplitsugs && slst.size() < oldSug + maxcpdsugs)) {
  ------------------
  |  Branch (371:9): [True: 136k, False: 273k]
  |  Branch (371:25): [True: 273k, False: 0]
  |  Branch (371:41): [True: 273k, False: 0]
  ------------------
  372|   410k|      good_suggestion = twowords(slst, word, cpdsuggest, good_suggestion, info);
  373|       |
  374|   410k|      if (info & SPELL_BEST_SUG)
  ------------------
  |  |   86|   410k|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  |  Branch (374:11): [True: 152, False: 410k]
  ------------------
  375|    152|        return true;
  376|   410k|    }
  377|   410k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   410k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (377:9): [True: 0, False: 410k]
  ------------------
  378|      0|      return good_suggestion;
  379|       |
  380|       |    // testing returns after the first loop
  381|   410k|    if (test_simplesug)
  ------------------
  |  Branch (381:9): [True: 0, False: 410k]
  ------------------
  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|   410k|    if (cpdsuggest == 1 && (slst.size() > oldSug || (info & SPELL_COMPOUND)))
  ------------------
  |  |   78|   136k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  |  Branch (387:9): [True: 136k, False: 273k]
  |  Branch (387:29): [True: 0, False: 136k]
  |  Branch (387:53): [True: 2, False: 136k]
  ------------------
  388|      2|       nocompoundtwowords = 1;
  389|       |
  390|   410k|  }  // repeating ``for'' statement compounding support
  391|       |
  392|   136k|  if (!nocompoundtwowords && (!slst.empty()) && onlycompoundsug)
  ------------------
  |  Branch (392:7): [True: 136k, False: 35]
  |  Branch (392:30): [True: 8.73k, False: 128k]
  |  Branch (392:49): [True: 8.73k, False: 0]
  ------------------
  393|  8.73k|    *onlycompoundsug = 1;
  394|       |
  395|   136k|  return good_suggestion;
  396|   136k|}
_ZN10SuggestMgr12capchars_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  401|   155k|                              int cpdsuggest, int& info) {
  402|   155k|  std::vector<w_char> candidate_utf(word);
  403|   155k|  mkallcap_utf(candidate_utf, langnum);
  404|   155k|  std::string candidate;
  405|   155k|  u16_u8(candidate, candidate_utf);
  406|   155k|  testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  407|   155k|}
_ZN10SuggestMgr8capcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  412|   255k|                          int cpdsuggest, int& info) {
  413|   255k|  std::string candidate(word);
  414|   255k|  mkallcap(candidate, csconv);
  415|   255k|  testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  416|   255k|}
_ZN10SuggestMgr8mapcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  421|   410k|                         int cpdsuggest, int& info) {
  422|   410k|  std::string candidate;
  423|   410k|  std::chrono::steady_clock::time_point timelimit;
  424|   410k|  int timer;
  425|       |
  426|   410k|  if (word.size() < 2 || !pAMgr)
  ------------------
  |  Branch (426:7): [True: 33.8k, False: 376k]
  |  Branch (426:26): [True: 0, False: 376k]
  ------------------
  427|  33.8k|    return wlst.size();
  428|       |
  429|   376k|  const std::vector<mapentry>& maptable = pAMgr->get_maptable();
  430|   376k|  if (maptable.empty())
  ------------------
  |  Branch (430:7): [True: 361k, False: 15.3k]
  ------------------
  431|   361k|    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|   376k|}
_ZN10SuggestMgr11map_relatedERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERS6_mRNS0_6vectorIS6_NS4_IS6_EEEEiRKNSA_ISC_NS4_ISC_EEEEPiPNS0_6chrono10time_pointINSJ_12steady_clockENSJ_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEEiRi:
  447|  1.63M|                            int depth, int& info) {
  448|  1.63M|  if (word.size() == wn) {
  ------------------
  |  Branch (448:7): [True: 199k, False: 1.44M]
  ------------------
  449|   199k|    if (candidate == word)
  ------------------
  |  Branch (449:9): [True: 15.3k, False: 183k]
  ------------------
  450|  15.3k|      return wlst.size();
  451|   183k|    const int cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (451:22): [True: 0, False: 183k]
  ------------------
  452|   183k|    if ((cwrd) && checkword(candidate, cpdsuggest, timer, timelimit)) {
  ------------------
  |  Branch (452:9): [True: 183k, False: 0]
  |  Branch (452:19): [True: 0, False: 183k]
  ------------------
  453|      0|      if (wlst.size() < maxSug) {
  ------------------
  |  Branch (453:11): [True: 0, False: 0]
  ------------------
  454|      0|        wlst.push_back(candidate);
  455|      0|      }
  456|      0|    }
  457|   183k|    return wlst.size();
  458|   199k|  }
  459|       |
  460|  1.44M|  if (depth > 0x3F00) {
  ------------------
  |  Branch (460:7): [True: 0, False: 1.44M]
  ------------------
  461|      0|    *timer = 0;
  462|      0|    return wlst.size();
  463|      0|  }
  464|       |
  465|  1.44M|  int in_map = 0;
  466|  5.76M|  for (size_t j = 0; j < maptable.size(); ++j) {
  ------------------
  |  Branch (466:22): [True: 4.32M, False: 1.43M]
  ------------------
  467|  15.8M|    for (size_t k = 0; k < maptable[j].size(); ++k) {
  ------------------
  |  Branch (467:24): [True: 11.5M, False: 4.32M]
  ------------------
  468|  11.5M|      size_t len = maptable[j][k].size();
  469|  11.5M|      if (len && word.compare(wn, len, maptable[j][k]) == 0) {
  ------------------
  |  Branch (469:11): [True: 11.5M, False: 0]
  |  Branch (469:18): [True: 91.9k, False: 11.4M]
  ------------------
  470|  91.9k|        in_map = 1;
  471|  91.9k|        size_t cn = candidate.size();
  472|   367k|        for (size_t l = 0; l < maptable[j].size(); ++l) {
  ------------------
  |  Branch (472:28): [True: 275k, False: 91.8k]
  ------------------
  473|   275k|          candidate.resize(cn);
  474|   275k|          candidate.append(maptable[j][l]);
  475|   275k|          map_related(word, candidate, wn + len, wlst,
  476|   275k|                           cpdsuggest, maptable, timer, timelimit, depth + 1, info);
  477|   275k|          if (!(*timer))
  ------------------
  |  Branch (477:15): [True: 38, False: 275k]
  ------------------
  478|     38|            return wlst.size();
  479|   275k|          if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS) {
  ------------------
  |  |  105|   275k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (479:15): [True: 2, False: 275k]
  ------------------
  480|      2|            *timer = 0;
  481|      2|            return wlst.size();
  482|      2|          }
  483|   275k|        }
  484|  91.9k|      }
  485|  11.5M|    }
  486|  4.32M|  }
  487|  1.43M|  if (!in_map) {
  ------------------
  |  Branch (487:7): [True: 1.34M, False: 91.8k]
  ------------------
  488|  1.34M|    candidate.push_back(word[wn]);
  489|  1.34M|    map_related(word, candidate, wn + 1, wlst, cpdsuggest,
  490|  1.34M|                maptable, timer, timelimit, depth + 1, info);
  491|  1.34M|  }
  492|  1.43M|  return wlst.size();
  493|  1.44M|}
_ZN10SuggestMgr9replcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  499|   410k|                          int cpdsuggest, int& info) {
  500|   410k|  std::string candidate;
  501|   410k|  int wl = word.size();
  502|   410k|  if (wl < 2 || !pAMgr)
  ------------------
  |  Branch (502:7): [True: 33.8k, False: 376k]
  |  Branch (502:17): [True: 0, False: 376k]
  ------------------
  503|  33.8k|    return wlst.size();
  504|   376k|  const std::vector<replentry>& reptable = pAMgr->get_reptable();
  505|   376k|  auto replchars_start = std::chrono::steady_clock::now();
  506|   376k|  for (const auto& entry : reptable) {
  ------------------
  |  Branch (506:26): [True: 77.7k, False: 376k]
  ------------------
  507|  77.7k|    size_t r = 0;
  508|       |    // search every occurence of the pattern in the word
  509|  77.7k|    while ((r = word.find(entry.pattern, r)) != std::string::npos) {
  ------------------
  |  Branch (509:12): [True: 0, False: 77.7k]
  ------------------
  510|      0|      if (std::chrono::steady_clock::now() - replchars_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|      0|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (510:11): [True: 0, False: 0]
  ------------------
  511|      0|        return wlst.size();
  512|      0|      int type = (r == 0) ? 1 : 0;
  ------------------
  |  Branch (512:18): [True: 0, False: 0]
  ------------------
  513|      0|      if (r + entry.pattern.size() == word.size())
  ------------------
  |  Branch (513:11): [True: 0, False: 0]
  ------------------
  514|      0|        type += 2;
  515|      0|      while (type && entry.outstrings[type].empty())
  ------------------
  |  Branch (515:14): [True: 0, False: 0]
  |  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|      0|      const std::string&out = entry.outstrings[type];
  518|      0|      if (out.empty()) {
  ------------------
  |  Branch (518:11): [True: 0, False: 0]
  ------------------
  519|      0|        ++r;
  520|      0|        continue;
  521|      0|      }
  522|      0|      candidate.assign(word, 0, r);
  523|      0|      candidate.append(entry.outstrings[type]);
  524|      0|      candidate.append(word, r + entry.pattern.size(), std::string::npos);
  525|      0|      size_t sp = candidate.find(' ');
  526|      0|      size_t oldns = wlst.size();
  527|      0|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  528|      0|      if (oldns < wlst.size()) {
  ------------------
  |  Branch (528:11): [True: 0, False: 0]
  ------------------
  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|      0|      if (sp != std::string::npos) {
  ------------------
  |  Branch (534:11): [True: 0, False: 0]
  ------------------
  535|      0|        size_t prev = 0;
  536|      0|        while (sp != std::string::npos) {
  ------------------
  |  Branch (536:16): [True: 0, False: 0]
  ------------------
  537|      0|          std::string prev_chunk = candidate.substr(prev, sp - prev);
  538|      0|          if (checkword(prev_chunk, 0, nullptr, nullptr)) {
  ------------------
  |  Branch (538:15): [True: 0, False: 0]
  ------------------
  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|      0|          prev = sp + 1;
  547|      0|          sp = candidate.find(' ', prev);
  548|      0|        }
  549|      0|      }
  550|      0|      r++;  // search for the next letter
  551|      0|    }
  552|  77.7k|  }
  553|   376k|  return wlst.size();
  554|   376k|}
_ZN10SuggestMgr14doubletwocharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  563|   255k|                               int cpdsuggest, int& info) {
  564|   255k|  size_t wl = word.size();
  565|   255k|  if (wl < 5 || !pAMgr)
  ------------------
  |  Branch (565:7): [True: 60.4k, False: 194k]
  |  Branch (565:17): [True: 0, False: 194k]
  ------------------
  566|  60.4k|    return wlst.size();
  567|       |
  568|   194k|  int state = 0;
  569|  4.83M|  for (size_t i = 2; i < wl; ++i) {
  ------------------
  |  Branch (569:22): [True: 4.63M, False: 194k]
  ------------------
  570|  4.63M|    if (word[i] == word[i - 2]) {
  ------------------
  |  Branch (570:9): [True: 1.12M, False: 3.51M]
  ------------------
  571|  1.12M|      state++;
  572|  1.12M|      if (state == 3 || (state == 2 && i >= 4)) {
  ------------------
  |  Branch (572:11): [True: 7.21k, False: 1.11M]
  |  Branch (572:26): [True: 390k, False: 725k]
  |  Branch (572:40): [True: 380k, False: 9.96k]
  ------------------
  573|   388k|        auto word_iter = word.begin();
  574|   388k|        std::string candidate(word_iter, word_iter + i - 1);
  575|   388k|        candidate.insert(candidate.end(), word_iter + i + 1, word.end());
  576|   388k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  577|   388k|        state = 0;
  578|   388k|      }
  579|  3.51M|    } else {
  580|  3.51M|      state = 0;
  581|  3.51M|    }
  582|  4.63M|  }
  583|   194k|  return wlst.size();
  584|   255k|}
_ZN10SuggestMgr18doubletwochars_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  593|   155k|                                   int cpdsuggest, int& info) {
  594|   155k|  size_t wl = word.size();
  595|   155k|  int state = 0;
  596|   155k|  if (wl < 5 || !pAMgr)
  ------------------
  |  Branch (596:7): [True: 57.0k, False: 98.0k]
  |  Branch (596:17): [True: 0, False: 98.0k]
  ------------------
  597|  57.0k|    return wlst.size();
  598|  1.58M|  for (size_t i = 2; i < wl; ++i) {
  ------------------
  |  Branch (598:22): [True: 1.48M, False: 98.0k]
  ------------------
  599|  1.48M|    if (word[i] == word[i - 2]) {
  ------------------
  |  Branch (599:9): [True: 445k, False: 1.03M]
  ------------------
  600|   445k|      state++;
  601|   445k|      if (state == 3 || (state == 2 && i >= 4)) {
  ------------------
  |  Branch (601:11): [True: 3.97k, False: 441k]
  |  Branch (601:26): [True: 154k, False: 286k]
  |  Branch (601:40): [True: 148k, False: 5.77k]
  ------------------
  602|   152k|        auto word_iter = word.begin();
  603|   152k|        std::vector<w_char> candidate_utf(word_iter, word_iter + i - 1);
  604|   152k|        candidate_utf.insert(candidate_utf.end(), word_iter + i + 1, word.end());
  605|   152k|        std::string candidate;
  606|   152k|        u16_u8(candidate, candidate_utf);
  607|   152k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  608|   152k|        state = 0;
  609|   152k|      }
  610|  1.03M|    } else {
  611|  1.03M|      state = 0;
  612|  1.03M|    }
  613|  1.48M|  }
  614|  98.0k|  return wlst.size();
  615|   155k|}
_ZN10SuggestMgr10badcharkeyERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  621|   255k|                           int cpdsuggest, int& info) {
  622|   255k|  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.42M|  for (size_t i = 0, wl = candidate.size(); i < wl; ++i) {
  ------------------
  |  Branch (626:45): [True: 5.17M, False: 255k]
  ------------------
  627|  5.17M|    char tmpc = candidate[i];
  628|       |    // check with uppercase letters
  629|  5.17M|    candidate[i] = csconv[((unsigned char)tmpc)].cupper;
  630|  5.17M|    if (tmpc != candidate[i]) {
  ------------------
  |  Branch (630:9): [True: 1.21M, False: 3.95M]
  ------------------
  631|  1.21M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  632|  1.21M|      candidate[i] = tmpc;
  633|  1.21M|    }
  634|       |    // check neighbor characters in keyboard string
  635|  5.17M|    if (ckey.empty())
  ------------------
  |  Branch (635:9): [True: 0, False: 5.17M]
  ------------------
  636|      0|      continue;
  637|  5.17M|    size_t loc = 0;
  638|   137M|    while ((loc < ckeyl) && ckey[loc] != tmpc)
  ------------------
  |  Branch (638:12): [True: 132M, False: 4.39M]
  |  Branch (638:29): [True: 132M, False: 783k]
  ------------------
  639|   132M|      ++loc;
  640|  5.96M|    while (loc < ckeyl) {
  ------------------
  |  Branch (640:12): [True: 794k, False: 5.17M]
  ------------------
  641|   794k|      if ((loc > 0) && ckey[loc - 1] != '|') {
  ------------------
  |  Branch (641:11): [True: 632k, False: 162k]
  |  Branch (641:24): [True: 600k, False: 31.5k]
  ------------------
  642|   600k|        candidate[i] = ckey[loc - 1];
  643|   600k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  644|   600k|      }
  645|   794k|      if (((loc + 1) < ckeyl) && (ckey[loc + 1] != '|')) {
  ------------------
  |  Branch (645:11): [True: 737k, False: 56.7k]
  |  Branch (645:34): [True: 646k, False: 91.6k]
  ------------------
  646|   646k|        candidate[i] = ckey[loc + 1];
  647|   646k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  648|   646k|      }
  649|  12.8M|      do {
  650|  12.8M|        loc++;
  651|  12.8M|      } while ((loc < ckeyl) && ckey[loc] != tmpc);
  ------------------
  |  Branch (651:16): [True: 12.0M, False: 783k]
  |  Branch (651:33): [True: 12.0M, False: 11.3k]
  ------------------
  652|   794k|    }
  653|  5.17M|    candidate[i] = tmpc;
  654|  5.17M|  }
  655|   255k|  return wlst.size();
  656|   255k|}
_ZN10SuggestMgr14badcharkey_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  662|   155k|                               int cpdsuggest, int& info) {
  663|   155k|  std::string candidate;
  664|   155k|  std::vector<w_char> candidate_utf(word);
  665|       |  // swap out each char one by one and try all the tryme
  666|       |  // chars in its place to see if that makes a good word
  667|  1.98M|  for (size_t i = 0, wl = word.size(); i < wl; ++i) {
  ------------------
  |  Branch (667:40): [True: 1.82M, False: 155k]
  ------------------
  668|  1.82M|    w_char tmpc = candidate_utf[i];
  669|       |    // check with uppercase letters
  670|  1.82M|    candidate_utf[i] = upper_utf(candidate_utf[i], 1);
  671|  1.82M|    if (tmpc != candidate_utf[i]) {
  ------------------
  |  Branch (671:9): [True: 409k, False: 1.41M]
  ------------------
  672|   409k|      u16_u8(candidate, candidate_utf);
  673|   409k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  674|   409k|      candidate_utf[i] = tmpc;
  675|   409k|    }
  676|       |    // check neighbor characters in keyboard string
  677|  1.82M|    if (ckey_utf.empty())
  ------------------
  |  Branch (677:9): [True: 0, False: 1.82M]
  ------------------
  678|      0|      continue;
  679|  1.82M|    size_t loc = 0;
  680|  46.1M|    while ((loc < ckeyl) && ckey_utf[loc] != tmpc)
  ------------------
  |  Branch (680:12): [True: 44.6M, False: 1.41M]
  |  Branch (680:29): [True: 44.2M, False: 412k]
  ------------------
  681|  44.2M|      ++loc;
  682|  2.24M|    while (loc < ckeyl) {
  ------------------
  |  Branch (682:12): [True: 419k, False: 1.82M]
  ------------------
  683|   419k|      if ((loc > 0) && ckey_utf[loc - 1] != W_VLINE) {
  ------------------
  |  Branch (683:11): [True: 313k, False: 105k]
  |  Branch (683:24): [True: 313k, False: 0]
  ------------------
  684|   313k|        candidate_utf[i] = ckey_utf[loc - 1];
  685|   313k|        u16_u8(candidate, candidate_utf);
  686|   313k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  687|   313k|      }
  688|   419k|      if (((loc + 1) < ckeyl) && (ckey_utf[loc + 1] != W_VLINE)) {
  ------------------
  |  Branch (688:11): [True: 383k, False: 35.4k]
  |  Branch (688:34): [True: 383k, False: 0]
  ------------------
  689|   383k|        candidate_utf[i] = ckey_utf[loc + 1];
  690|   383k|        u16_u8(candidate, candidate_utf);
  691|   383k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  692|   383k|      }
  693|  6.91M|      do {
  694|  6.91M|        loc++;
  695|  6.91M|      } while ((loc < ckeyl) && ckey_utf[loc] != tmpc);
  ------------------
  |  Branch (695:16): [True: 6.50M, False: 412k]
  |  Branch (695:33): [True: 6.50M, False: 6.02k]
  ------------------
  696|   419k|    }
  697|  1.82M|    candidate_utf[i] = tmpc;
  698|  1.82M|  }
  699|   155k|  return wlst.size();
  700|   155k|}
_ZN10SuggestMgr7badcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  705|   255k|                               int cpdsuggest, int& info) {
  706|   255k|  std::string candidate(word);
  707|   255k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  708|   255k|  int timer = MINTIMER;
  ------------------
  |  |  107|   255k|#define MINTIMER 100
  ------------------
  709|       |  // swap out each char one by one and try all the tryme
  710|       |  // chars in its place to see if that makes a good word
  711|   255k|  for (size_t j = 0; j < ctryl; ++j) {
  ------------------
  |  Branch (711:22): [True: 0, False: 255k]
  ------------------
  712|      0|    for (auto aI = candidate.rbegin(), aEnd = candidate.rend(); aI != aEnd; ++aI) {
  ------------------
  |  Branch (712:65): [True: 0, False: 0]
  ------------------
  713|      0|      char tmpc = *aI;
  714|      0|      if (ctry[j] == tmpc)
  ------------------
  |  Branch (714:11): [True: 0, False: 0]
  ------------------
  715|      0|        continue;
  716|      0|      *aI = ctry[j];
  717|      0|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  718|      0|      if (!timer)
  ------------------
  |  Branch (718:11): [True: 0, False: 0]
  ------------------
  719|      0|        return wlst.size();
  720|      0|      *aI = tmpc;
  721|      0|    }
  722|      0|  }
  723|   255k|  return wlst.size();
  724|   255k|}
_ZN10SuggestMgr11badchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  729|   155k|                            int cpdsuggest, int& info) {
  730|   155k|  std::vector<w_char> candidate_utf(word);
  731|   155k|  std::string candidate;
  732|   155k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  733|   155k|  int timer = MINTIMER;
  ------------------
  |  |  107|   155k|#define MINTIMER 100
  ------------------
  734|       |  // swap out each char one by one and try all the tryme
  735|       |  // chars in its place to see if that makes a good word
  736|   173k|  for (size_t j = 0; j < ctryl; ++j) {
  ------------------
  |  Branch (736:22): [True: 18.4k, False: 155k]
  ------------------
  737|   237k|    for (auto aI = candidate_utf.rbegin(), aEnd = candidate_utf.rend(); aI != aEnd; ++aI) {
  ------------------
  |  Branch (737:73): [True: 218k, False: 18.4k]
  ------------------
  738|   218k|      w_char tmpc = *aI;
  739|   218k|      if (tmpc == ctry_utf[j])
  ------------------
  |  Branch (739:11): [True: 0, False: 218k]
  ------------------
  740|      0|        continue;
  741|   218k|      *aI = ctry_utf[j];
  742|   218k|      u16_u8(candidate, candidate_utf);
  743|   218k|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  744|   218k|      if (!timer)
  ------------------
  |  Branch (744:11): [True: 0, False: 218k]
  ------------------
  745|      0|        return wlst.size();
  746|   218k|      *aI = tmpc;
  747|   218k|    }
  748|  18.4k|  }
  749|   155k|  return wlst.size();
  750|   155k|}
_ZN10SuggestMgr13extrachar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  755|   155k|                              int cpdsuggest, int& info) {
  756|   155k|  std::vector<w_char> candidate_utf(word);
  757|   155k|  if (candidate_utf.size() < 2)
  ------------------
  |  Branch (757:7): [True: 15.5k, False: 139k]
  ------------------
  758|  15.5k|    return wlst.size();
  759|       |  // try omitting one char of word at a time
  760|  1.95M|  for (size_t i = 0; i < candidate_utf.size(); ++i) {
  ------------------
  |  Branch (760:22): [True: 1.81M, False: 139k]
  ------------------
  761|  1.81M|    size_t index = candidate_utf.size() - 1 - i;
  762|  1.81M|    w_char tmpc = candidate_utf[index];
  763|  1.81M|    candidate_utf.erase(candidate_utf.begin() + index);
  764|  1.81M|    std::string candidate;
  765|  1.81M|    u16_u8(candidate, candidate_utf);
  766|  1.81M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  767|  1.81M|    candidate_utf.insert(candidate_utf.begin() + index, tmpc);
  768|  1.81M|  }
  769|   139k|  return wlst.size();
  770|   155k|}
_ZN10SuggestMgr9extracharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  775|   255k|                          int cpdsuggest, int& info) {
  776|   255k|  std::string candidate(word);
  777|   255k|  if (candidate.size() < 2)
  ------------------
  |  Branch (777:7): [True: 18.7k, False: 236k]
  ------------------
  778|  18.7k|    return wlst.size();
  779|       |  // try omitting one char of word at a time
  780|  5.39M|  for (size_t i = 0; i < candidate.size(); ++i) {
  ------------------
  |  Branch (780:22): [True: 5.15M, False: 236k]
  ------------------
  781|  5.15M|    size_t index = candidate.size() - 1 - i;
  782|  5.15M|    char tmpc = candidate[index];
  783|  5.15M|    candidate.erase(candidate.begin() + index);
  784|  5.15M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  785|  5.15M|    candidate.insert(candidate.begin() + index, tmpc);
  786|  5.15M|  }
  787|   236k|  return wlst.size();
  788|   255k|}
_ZN10SuggestMgr10forgotcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  793|   255k|                           int cpdsuggest, int& info) {
  794|   255k|  std::string candidate(word);
  795|   255k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  796|   255k|  int timer = MINTIMER;
  ------------------
  |  |  107|   255k|#define MINTIMER 100
  ------------------
  797|       |
  798|       |  // try inserting a tryme character before every letter (and the null
  799|       |  // terminator)
  800|   255k|  for (size_t k = 0; k < ctryl; ++k) {
  ------------------
  |  Branch (800:22): [True: 0, False: 255k]
  ------------------
  801|      0|    for (size_t i = 0; i <= candidate.size(); ++i) {
  ------------------
  |  Branch (801:24): [True: 0, False: 0]
  ------------------
  802|      0|      size_t index = candidate.size() - i;
  803|      0|      candidate.insert(candidate.begin() + index, ctry[k]);
  804|      0|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  805|      0|      if (!timer)
  ------------------
  |  Branch (805:11): [True: 0, False: 0]
  ------------------
  806|      0|        return wlst.size();
  807|      0|      candidate.erase(candidate.begin() + index);
  808|      0|    }
  809|      0|  }
  810|   255k|  return wlst.size();
  811|   255k|}
_ZN10SuggestMgr14forgotchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  816|   155k|                               int cpdsuggest, int& info) {
  817|   155k|  std::vector<w_char> candidate_utf(word);
  818|   155k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  819|   155k|  int timer = MINTIMER;
  ------------------
  |  |  107|   155k|#define MINTIMER 100
  ------------------
  820|       |
  821|       |  // try inserting a tryme character at the end of the word and before every
  822|       |  // letter
  823|   173k|  for (size_t k = 0; k < ctryl; ++k) {
  ------------------
  |  Branch (823:22): [True: 18.4k, False: 155k]
  ------------------
  824|   255k|    for (size_t i = 0; i <= candidate_utf.size(); ++i) {
  ------------------
  |  Branch (824:24): [True: 237k, False: 18.4k]
  ------------------
  825|   237k|      size_t index = candidate_utf.size() - i;
  826|   237k|      candidate_utf.insert(candidate_utf.begin() + index, ctry_utf[k]);
  827|   237k|      std::string candidate;
  828|   237k|      u16_u8(candidate, candidate_utf);
  829|   237k|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  830|   237k|      if (!timer)
  ------------------
  |  Branch (830:11): [True: 0, False: 237k]
  ------------------
  831|      0|        return wlst.size();
  832|   237k|      candidate_utf.erase(candidate_utf.begin() + index);
  833|   237k|    }
  834|  18.4k|  }
  835|   155k|  return wlst.size();
  836|   155k|}
_ZN10SuggestMgr8twowordsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_ibRi:
  846|   410k|                         bool good, int& info) {
  847|   410k|  int c2, forbidden = 0, cwrd, wl = word.size();
  848|   410k|  if (wl < 3)
  ------------------
  |  Branch (848:7): [True: 57.0k, False: 353k]
  ------------------
  849|  57.0k|    return false;
  850|       |
  851|   353k|  if (langnum == LANG_hu)
  ------------------
  |  Branch (851:7): [True: 14.4k, False: 338k]
  ------------------
  852|  14.4k|    forbidden = check_forbidden(word);
  853|       |
  854|   353k|  char* candidate = new char[wl + 2];
  855|   353k|  memcpy(candidate + 1, word.data(), wl);
  856|   353k|  candidate[wl + 1] = 0;
  857|       |
  858|       |  // split the string into two pieces after every char
  859|       |  // if both pieces are good words make them a suggestion
  860|  4.42M|  for (char* p = candidate + 1; p[1] != '\0'; p++) {
  ------------------
  |  Branch (860:33): [True: 4.10M, False: 317k]
  ------------------
  861|  4.10M|    p[-1] = *p;
  862|       |    // go to end of the UTF-8 character
  863|  4.36M|    while (utf8 && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (863:12): [True: 1.39M, False: 2.96M]
  |  Branch (863:20): [True: 254k, False: 1.14M]
  ------------------
  864|   254k|      *p = p[1];
  865|   254k|      p++;
  866|   254k|    }
  867|  4.10M|    if (utf8 && p[1] == '\0')
  ------------------
  |  Branch (867:9): [True: 1.14M, False: 2.96M]
  |  Branch (867:17): [True: 35.6k, False: 1.10M]
  ------------------
  868|  35.6k|      break;  // last UTF-8 character
  869|       |
  870|       |    // Suggest only word pairs, if they are listed in the dictionary.
  871|       |    // For example, adding "a lot" to the English dic file will
  872|       |    // result only "alot" -> "a lot" suggestion instead of
  873|       |    // "alto, slot, alt, lot, allot, aloft, aloe, clot, plot, blot, a lot".
  874|       |    // Note: using "ph:alot" keeps the other suggestions:
  875|       |    // a lot ph:alot
  876|       |    // alot -> a lot, alto, slot...
  877|  4.07M|    *p = ' ';
  878|  4.07M|    if (!cpdsuggest && checkword(candidate, cpdsuggest, nullptr, nullptr)) {
  ------------------
  |  Branch (878:9): [True: 1.35M, False: 2.71M]
  |  Branch (878:9): [True: 1.56k, False: 4.07M]
  |  Branch (878:24): [True: 1.56k, False: 1.35M]
  ------------------
  879|       |      // best solution
  880|  1.56k|      info |= SPELL_BEST_SUG;
  ------------------
  |  |   86|  1.56k|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  881|       |
  882|       |      // remove not word pair suggestions
  883|  1.56k|      if (!good) {
  ------------------
  |  Branch (883:11): [True: 152, False: 1.41k]
  ------------------
  884|    152|        good = true;
  885|    152|        wlst.clear();
  886|    152|      }
  887|       |
  888|  1.56k|      wlst.insert(wlst.begin(), candidate);
  889|  1.56k|    }
  890|       |
  891|       |    // word pairs with dash?
  892|  4.07M|    if (lang_with_dash_usage) {
  ------------------
  |  Branch (892:9): [True: 0, False: 4.07M]
  ------------------
  893|      0|      *p = '-';
  894|       |
  895|      0|      if (!cpdsuggest && checkword(candidate, cpdsuggest, nullptr, nullptr)) {
  ------------------
  |  Branch (895:11): [True: 0, False: 0]
  |  Branch (895:11): [True: 0, False: 0]
  |  Branch (895:26): [True: 0, False: 0]
  ------------------
  896|       |        // best solution
  897|      0|        info |= SPELL_BEST_SUG;
  ------------------
  |  |   86|      0|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  898|       |
  899|       |        // remove not word pair suggestions
  900|      0|        if (!good) {
  ------------------
  |  Branch (900:13): [True: 0, False: 0]
  ------------------
  901|      0|          good = true;
  902|      0|          wlst.clear();
  903|      0|        }
  904|      0|        wlst.insert(wlst.begin(), candidate);
  905|      0|      }
  906|      0|    }
  907|       |
  908|  4.07M|    if (wlst.size() < maxSug && !nosplitsugs && !good) {
  ------------------
  |  Branch (908:9): [True: 4.07M, False: 598]
  |  Branch (908:33): [True: 4.07M, False: 0]
  |  Branch (908:49): [True: 4.07M, False: 967]
  ------------------
  909|  4.07M|      *p = '\0';
  910|  4.07M|      int c1 = checkword(candidate, cpdsuggest, nullptr, nullptr);
  911|  4.07M|      if (c1) {
  ------------------
  |  Branch (911:11): [True: 19.4k, False: 4.05M]
  ------------------
  912|  19.4k|        c2 = checkword((p + 1), cpdsuggest, nullptr, nullptr);
  913|  19.4k|        if (c2) {
  ------------------
  |  Branch (913:13): [True: 678, False: 18.7k]
  ------------------
  914|       |          // spec. Hungarian code (TODO need a better compound word support)
  915|    678|          if ((langnum == LANG_hu) && !forbidden &&
  ------------------
  |  Branch (915:15): [True: 15, False: 663]
  |  Branch (915:39): [True: 15, False: 0]
  ------------------
  916|       |              // if 3 repeating letter, use - instead of space
  917|     15|              (((p[-1] == p[1]) &&
  ------------------
  |  Branch (917:17): [True: 3, False: 12]
  ------------------
  918|      3|              (((p > candidate + 1) && (p[-1] == p[-2])) || (p[-1] == p[2]))) ||
  ------------------
  |  Branch (918:17): [True: 1, False: 2]
  |  Branch (918:40): [True: 0, False: 1]
  |  Branch (918:61): [True: 0, False: 3]
  ------------------
  919|       |              // or multiple compounding, with more, than 6 syllables
  920|     15|              ((c1 == 3) && (c2 >= 2))))
  ------------------
  |  Branch (920:16): [True: 0, False: 15]
  |  Branch (920:29): [True: 0, False: 0]
  ------------------
  921|      0|            *p = '-';
  922|    678|          else
  923|    678|            *p = ' ';
  924|       |
  925|    678|          cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (925:18): [True: 16, False: 662]
  ------------------
  926|       |
  927|    678|          if (cwrd && (wlst.size() < maxSug))
  ------------------
  |  Branch (927:15): [True: 662, False: 16]
  |  Branch (927:23): [True: 662, False: 0]
  ------------------
  928|    662|              wlst.emplace_back(candidate);
  929|       |
  930|       |          // add two word suggestion with dash, depending on the language
  931|       |          // Note that cwrd doesn't modified for REP twoword sugg.
  932|    678|          if ( !nosplitsugs && lang_with_dash_usage &&
  ------------------
  |  Branch (932:16): [True: 678, False: 0]
  |  Branch (932:32): [True: 0, False: 678]
  ------------------
  933|      0|              mystrlen(p + 1) > 1 && mystrlen(candidate) - mystrlen(p) > 1) {
  ------------------
  |  Branch (933:15): [True: 0, False: 0]
  |  Branch (933:38): [True: 0, False: 0]
  ------------------
  934|      0|            *p = '-';
  935|      0|            for (auto& k : wlst) {
  ------------------
  |  Branch (935:26): [True: 0, False: 0]
  ------------------
  936|      0|              if (k == candidate) {
  ------------------
  |  Branch (936:19): [True: 0, False: 0]
  ------------------
  937|      0|                cwrd = 0;
  938|      0|                break;
  939|      0|              }
  940|      0|            }
  941|       |
  942|      0|            if ((wlst.size() < maxSug) && cwrd)
  ------------------
  |  Branch (942:17): [True: 0, False: 0]
  |  Branch (942:43): [True: 0, False: 0]
  ------------------
  943|      0|              wlst.emplace_back(candidate);
  944|      0|          }
  945|    678|        }
  946|  19.4k|      }
  947|  4.07M|    }
  948|  4.07M|  }
  949|   353k|  delete[] candidate;
  950|   353k|  return good;
  951|   410k|}
_ZN10SuggestMgr8swapcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  956|   255k|                         int cpdsuggest, int& info) {
  957|   255k|  if (word.size() < 2)
  ------------------
  |  Branch (957:7): [True: 18.7k, False: 236k]
  ------------------
  958|  18.7k|    return wlst.size();
  959|       |
  960|   236k|  std::string candidate(word);
  961|       |
  962|       |  // try swapping adjacent chars one by one
  963|  5.15M|  for (size_t i = 0; i < candidate.size() - 1; ++i) {
  ------------------
  |  Branch (963:22): [True: 4.91M, False: 236k]
  ------------------
  964|  4.91M|    std::swap(candidate[i], candidate[i+1]);
  965|  4.91M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  966|  4.91M|    std::swap(candidate[i], candidate[i+1]);
  967|  4.91M|  }
  968|       |
  969|       |  // try double swaps for short words
  970|       |  // ahev -> have, owudl -> would
  971|   236k|  if (candidate.size() == 4 || candidate.size() == 5) {
  ------------------
  |  Branch (971:7): [True: 16.3k, False: 220k]
  |  Branch (971:32): [True: 10.7k, False: 209k]
  ------------------
  972|  27.0k|    candidate[0] = word[1];
  973|  27.0k|    candidate[1] = word[0];
  974|  27.0k|    candidate[2] = word[2];
  975|  27.0k|    candidate[candidate.size() - 2] = word[candidate.size() - 1];
  976|  27.0k|    candidate[candidate.size() - 1] = word[candidate.size() - 2];
  977|  27.0k|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  978|  27.0k|    if (candidate.size() == 5) {
  ------------------
  |  Branch (978:9): [True: 10.7k, False: 16.3k]
  ------------------
  979|  10.7k|      candidate[0] = word[0];
  980|  10.7k|      candidate[1] = word[2];
  981|  10.7k|      candidate[2] = word[1];
  982|  10.7k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  983|  10.7k|    }
  984|  27.0k|  }
  985|       |
  986|   236k|  return wlst.size();
  987|   255k|}
_ZN10SuggestMgr12swapchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  992|   155k|                             int cpdsuggest, int& info) {
  993|   155k|  if (word.size() < 2)
  ------------------
  |  Branch (993:7): [True: 15.5k, False: 139k]
  ------------------
  994|  15.5k|    return wlst.size();
  995|       |
  996|   139k|  std::vector<w_char> candidate_utf(word);
  997|       |
  998|   139k|  std::string candidate;
  999|       |  // try swapping adjacent chars one by one
 1000|  1.81M|  for (size_t i = 0; i < candidate_utf.size() - 1; ++i) {
  ------------------
  |  Branch (1000:22): [True: 1.67M, False: 139k]
  ------------------
 1001|  1.67M|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|  1.67M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (1001:9): [True: 0, False: 1.67M]
  ------------------
 1002|      0|      return wlst.size();
 1003|  1.67M|    std::swap(candidate_utf[i], candidate_utf[i+1]);
 1004|  1.67M|    u16_u8(candidate, candidate_utf);
 1005|  1.67M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1006|  1.67M|    std::swap(candidate_utf[i], candidate_utf[i+1]);
 1007|  1.67M|  }
 1008|       |
 1009|       |  // try double swaps for short words
 1010|       |  // ahev -> have, owudl -> would, suodn -> sound
 1011|   139k|  if (candidate_utf.size() == 4 || candidate_utf.size() == 5) {
  ------------------
  |  Branch (1011:7): [True: 19.4k, False: 120k]
  |  Branch (1011:36): [True: 9.99k, False: 110k]
  ------------------
 1012|  29.4k|    candidate_utf[0] = word[1];
 1013|  29.4k|    candidate_utf[1] = word[0];
 1014|  29.4k|    candidate_utf[2] = word[2];
 1015|  29.4k|    candidate_utf[candidate_utf.size() - 2] = word[candidate_utf.size() - 1];
 1016|  29.4k|    candidate_utf[candidate_utf.size() - 1] = word[candidate_utf.size() - 2];
 1017|  29.4k|    u16_u8(candidate, candidate_utf);
 1018|  29.4k|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1019|  29.4k|    if (candidate_utf.size() == 5) {
  ------------------
  |  Branch (1019:9): [True: 9.99k, False: 19.4k]
  ------------------
 1020|  9.99k|      candidate_utf[0] = word[0];
 1021|  9.99k|      candidate_utf[1] = word[2];
 1022|  9.99k|      candidate_utf[2] = word[1];
 1023|  9.99k|      u16_u8(candidate, candidate_utf);
 1024|  9.99k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1025|  9.99k|    }
 1026|  29.4k|  }
 1027|   139k|  return wlst.size();
 1028|   139k|}
_ZN10SuggestMgr12longswapcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
 1033|   255k|                             int cpdsuggest, int& info) {
 1034|   255k|  std::string candidate(word);
 1035|       |  // try swapping not adjacent chars one by one
 1036|  5.42M|  for (auto p = candidate.begin(); p < candidate.end(); ++p) {
  ------------------
  |  Branch (1036:36): [True: 5.17M, False: 255k]
  ------------------
 1037|   190M|    for (auto q = candidate.begin(); q < candidate.end(); ++q) {
  ------------------
  |  Branch (1037:38): [True: 185M, False: 5.17M]
  ------------------
 1038|   185M|      const auto distance = std::abs(std::distance(q, p));
 1039|   185M|      if (distance > 1 && distance <= MAX_CHAR_DISTANCE && *p != *q) {
  ------------------
  |  |   84|   356M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1039:11): [True: 170M, False: 15.0M]
  |  Branch (1039:27): [True: 26.7M, False: 143M]
  |  Branch (1039:60): [True: 20.6M, False: 6.17M]
  ------------------
 1040|  20.6M|        std::swap(*p, *q);
 1041|  20.6M|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1042|  20.6M|        std::swap(*p, *q);
 1043|  20.6M|      }
 1044|   185M|    }
 1045|  5.17M|  }
 1046|   255k|  return wlst.size();
 1047|   255k|}
_ZN10SuggestMgr16longswapchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1052|   155k|                                 int cpdsuggest, int& info) {
 1053|   155k|  std::vector<w_char> candidate_utf(word);
 1054|       |  // try swapping not adjacent chars
 1055|  1.98M|  for (auto p = candidate_utf.begin(); p < candidate_utf.end(); ++p) {
  ------------------
  |  Branch (1055:40): [True: 1.82M, False: 155k]
  ------------------
 1056|  49.0M|    for (auto q = candidate_utf.begin(); q < candidate_utf.end(); ++q) {
  ------------------
  |  Branch (1056:42): [True: 47.2M, False: 1.82M]
  ------------------
 1057|  47.2M|      const auto distance = std::abs(std::distance(q, p));
 1058|  47.2M|      if (distance > 1 && distance <= MAX_CHAR_DISTANCE && *p != *q) {
  ------------------
  |  |   84|  89.2M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1058:11): [True: 42.0M, False: 5.17M]
  |  Branch (1058:27): [True: 8.45M, False: 33.5M]
  |  Branch (1058:60): [True: 6.04M, False: 2.40M]
  ------------------
 1059|  6.04M|        std::swap(*p, *q);
 1060|  6.04M|        std::string candidate;
 1061|  6.04M|        u16_u8(candidate, candidate_utf);
 1062|  6.04M|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1063|  6.04M|        std::swap(*p, *q);
 1064|  6.04M|      }
 1065|  47.2M|    }
 1066|  1.82M|  }
 1067|   155k|  return wlst.size();
 1068|   155k|}
_ZN10SuggestMgr8movecharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
 1073|   255k|                         int cpdsuggest, int& info) {
 1074|   255k|  if (word.size() < 2)
  ------------------
  |  Branch (1074:7): [True: 18.7k, False: 236k]
  ------------------
 1075|  18.7k|    return wlst.size();
 1076|       |
 1077|   236k|  std::string candidate(word);
 1078|       |
 1079|       |  // try moving a char
 1080|  5.39M|  for (auto p = candidate.begin(); p < candidate.end(); ++p) {
  ------------------
  |  Branch (1080:36): [True: 5.15M, False: 236k]
  ------------------
 1081|  23.4M|    for (auto q = p + 1; q < candidate.end() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  22.3M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1081:26): [True: 22.3M, False: 1.10M]
  |  Branch (1081:26): [True: 18.3M, False: 5.15M]
  |  Branch (1081:49): [True: 18.3M, False: 4.05M]
  ------------------
 1082|  18.3M|      std::swap(*q, *(q - 1));
 1083|  18.3M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1083:11): [True: 4.91M, False: 13.3M]
  ------------------
 1084|  4.91M|        continue;  // omit swap char
 1085|  13.3M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1086|  13.3M|    }
 1087|  5.15M|    const auto word_iter = word.begin();
 1088|  5.15M|    std::copy_n(word_iter, candidate.size(), candidate.begin());
 1089|  5.15M|  }
 1090|       |
 1091|  5.15M|  for (auto p = candidate.rbegin(), pEnd = candidate.rend() - 1; p != pEnd; ++p) {
  ------------------
  |  Branch (1091:66): [True: 4.91M, False: 236k]
  ------------------
 1092|  23.2M|    for (auto q = p + 1, qEnd = candidate.rend(); q != qEnd && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  22.3M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1092:51): [True: 22.3M, False: 865k]
  |  Branch (1092:64): [True: 18.3M, False: 4.05M]
  ------------------
 1093|  18.3M|      std::swap(*q, *(q - 1));
 1094|  18.3M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1094:11): [True: 4.91M, False: 13.3M]
  ------------------
 1095|  4.91M|        continue;  // omit swap char
 1096|  13.3M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1097|  13.3M|    }
 1098|  4.91M|    const auto word_iter = word.begin();
 1099|  4.91M|    std::copy_n(word_iter, candidate.size(), candidate.begin());
 1100|  4.91M|  }
 1101|       |
 1102|   236k|  return wlst.size();
 1103|   255k|}
_ZN10SuggestMgr12movechar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1108|   155k|                             int cpdsuggest, int& info) {
 1109|   155k|  if (word.size() < 2)
  ------------------
  |  Branch (1109:7): [True: 15.5k, False: 139k]
  ------------------
 1110|  15.5k|    return wlst.size();
 1111|       |
 1112|   139k|  std::vector<w_char> candidate_utf(word);
 1113|       |
 1114|       |  // try moving a char
 1115|  1.95M|  for (auto p = candidate_utf.begin(); p < candidate_utf.end(); ++p) {
  ------------------
  |  Branch (1115:40): [True: 1.81M, False: 139k]
  ------------------
 1116|  7.71M|    for (auto q = p + 1; q < candidate_utf.end() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  7.09M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1116:26): [True: 7.09M, False: 622k]
  |  Branch (1116:26): [True: 5.90M, False: 1.81M]
  |  Branch (1116:53): [True: 5.90M, False: 1.19M]
  ------------------
 1117|  5.90M|      std::swap(*q, *(q - 1));
 1118|  5.90M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1118:11): [True: 1.67M, False: 4.22M]
  ------------------
 1119|  1.67M|        continue;  // omit swap char
 1120|  4.22M|      std::string candidate;
 1121|  4.22M|      u16_u8(candidate, candidate_utf);
 1122|  4.22M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1123|  4.22M|    }
 1124|  1.81M|    const auto word_iter = word.begin();
 1125|  1.81M|    std::copy_n(word_iter, candidate_utf.size(), candidate_utf.begin());
 1126|  1.81M|  }
 1127|       |
 1128|  1.95M|  for (auto p = candidate_utf.rbegin(); p < candidate_utf.rend(); ++p) {
  ------------------
  |  Branch (1128:41): [True: 1.81M, False: 139k]
  ------------------
 1129|  7.71M|    for (auto q = p + 1; q < candidate_utf.rend() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  7.09M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1129:26): [True: 7.09M, False: 622k]
  |  Branch (1129:26): [True: 5.90M, False: 1.81M]
  |  Branch (1129:54): [True: 5.90M, False: 1.19M]
  ------------------
 1130|  5.90M|      std::swap(*q, *(q - 1));
 1131|  5.90M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1131:11): [True: 1.67M, False: 4.22M]
  ------------------
 1132|  1.67M|        continue;  // omit swap char
 1133|  4.22M|      std::string candidate;
 1134|  4.22M|      u16_u8(candidate, candidate_utf);
 1135|  4.22M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1136|  4.22M|    }
 1137|  1.81M|    const auto word_iter = word.begin();
 1138|  1.81M|    std::copy_n(word_iter, candidate_utf.size(), candidate_utf.begin());
 1139|  1.81M|  }
 1140|       |
 1141|   139k|  return wlst.size();
 1142|   155k|}
_ZN10SuggestMgr9ngsuggestERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEEPKcRKNS1_INS0_10unique_ptrI7HashMgrNS0_14default_deleteISE_EEEENS5_ISH_EEEEi:
 1177|  62.3k|                          int captype) {
 1178|  62.3k|  int lval, sc, lp, lpphon, nonbmp = 0;
 1179|       |
 1180|       |  // exhaustively search through all root words
 1181|       |  // keeping track of the MAX_ROOTS most similar root words
 1182|  62.3k|  struct hentry* roots[MAX_ROOTS];
 1183|  62.3k|  char* rootsphon[MAX_ROOTS];
 1184|  62.3k|  int scores[MAX_ROOTS];
 1185|  62.3k|  int scoresphon[MAX_ROOTS];
 1186|  6.29M|  for (int i = 0; i < MAX_ROOTS; i++) {
  ------------------
  |  |   74|  6.29M|#define MAX_ROOTS 100
  ------------------
  |  Branch (1186:19): [True: 6.23M, False: 62.3k]
  ------------------
 1187|  6.23M|    roots[i] = nullptr;
 1188|  6.23M|    scores[i] = -100 * i;
 1189|  6.23M|    rootsphon[i] = nullptr;
 1190|  6.23M|    scoresphon[i] = -100 * i;
 1191|  6.23M|  }
 1192|  62.3k|  bool has_roots = false;
 1193|  62.3k|  bool has_rootsphon = false;
 1194|  62.3k|  lp = MAX_ROOTS - 1;
  ------------------
  |  |   74|  62.3k|#define MAX_ROOTS 100
  ------------------
 1195|  62.3k|  lpphon = MAX_ROOTS - 1;
  ------------------
  |  |   74|  62.3k|#define MAX_ROOTS 100
  ------------------
 1196|  62.3k|  int low = NGRAM_LOWERING;
  ------------------
  |  |   83|  62.3k|#define NGRAM_LOWERING (1 << 2)
  ------------------
 1197|       |
 1198|  62.3k|  std::string w2;
 1199|  62.3k|  const char* word = w;
 1200|       |
 1201|  62.3k|  int nc;
 1202|       |  // word reversing wrapper for complex prefixes
 1203|  62.3k|  if (complexprefixes) {
  ------------------
  |  Branch (1203:7): [True: 3.57k, False: 58.7k]
  ------------------
 1204|  3.57k|    w2.assign(w);
 1205|  3.57k|    if (utf8)
  ------------------
  |  Branch (1205:9): [True: 0, False: 3.57k]
  ------------------
 1206|      0|      reverseword_utf(w2);
 1207|  3.57k|    else
 1208|  3.57k|      reverseword(w2);
 1209|  3.57k|    word = w2.c_str();
 1210|  3.57k|    nc = (int)w2.size();
 1211|  58.7k|  } else {
 1212|  58.7k|    nc = (int)strlen(word);
 1213|  58.7k|  }
 1214|       |
 1215|  62.3k|  std::vector<w_char> u8;
 1216|  62.3k|  int n = (utf8) ? u8_u16(u8, word) : nc;
  ------------------
  |  Branch (1216:11): [True: 26.0k, False: 36.3k]
  ------------------
 1217|       |
 1218|       |  // set character based ngram suggestion for words with non-BMP Unicode
 1219|       |  // characters
 1220|  62.3k|  const struct cs_info* origconv = csconv;
 1221|  62.3k|  if (n == -1) {
  ------------------
  |  Branch (1221:7): [True: 1.75k, False: 60.5k]
  ------------------
 1222|  1.75k|    utf8 = 0;  // XXX not state-free
 1223|  1.75k|    if (!csconv)
  ------------------
  |  Branch (1223:9): [True: 1.75k, False: 0]
  ------------------
 1224|  1.75k|      csconv = get_current_cs("iso88591"); // XXX not state-free
 1225|  1.75k|    n = nc;
 1226|  1.75k|    nonbmp = 1;
 1227|  1.75k|    low = 0;
 1228|  1.75k|  }
 1229|  62.3k|  ngsuggest_guard restore_state(nonbmp, origconv, &utf8, &csconv);
 1230|  62.3k|  int max_word_len = (utf8) ? MAXWORDUTF8LEN : MAXWORDLEN;
  ------------------
  |  |   85|  24.2k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   89|  24.2k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                int max_word_len = (utf8) ? MAXWORDUTF8LEN : MAXWORDLEN;
  ------------------
  |  |   89|  38.0k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1230:22): [True: 24.2k, False: 38.0k]
  ------------------
 1231|       |  // ofz#59067 a replist entry can generate a very long word, abandon
 1232|       |  // ngram if that odd-edge case arises
 1233|  62.3k|  if (n > max_word_len * 4)
  ------------------
  |  Branch (1233:7): [True: 0, False: 62.3k]
  ------------------
 1234|      0|      return;
 1235|       |
 1236|  62.3k|  struct hentry* hp = nullptr;
 1237|  62.3k|  int col = -1;
 1238|  62.3k|  phonetable* ph = (pAMgr) ? pAMgr->get_phonetable() : nullptr;
  ------------------
  |  Branch (1238:20): [True: 62.3k, False: 0]
  ------------------
 1239|  62.3k|  std::string target;
 1240|  62.3k|  std::string candidate;
 1241|  62.3k|  std::vector<w_char> w_candidate;
 1242|  62.3k|  if (ph) {
  ------------------
  |  Branch (1242:7): [True: 3.54k, False: 58.7k]
  ------------------
 1243|  3.54k|    if (utf8) {
  ------------------
  |  Branch (1243:9): [True: 0, False: 3.54k]
  ------------------
 1244|      0|      u8_u16(w_candidate, word);
 1245|      0|      mkallcap_utf(w_candidate, langnum);
 1246|      0|      u16_u8(candidate, w_candidate);
 1247|  3.54k|    } else {
 1248|  3.54k|      candidate.assign(word);
 1249|  3.54k|      if (!nonbmp)
  ------------------
  |  Branch (1249:11): [True: 3.54k, False: 0]
  ------------------
 1250|  3.54k|        mkallcap(candidate, csconv);
 1251|  3.54k|    }
 1252|  3.54k|    target = phonet(candidate, *ph);  // XXX phonet() is 8-bit (nc, not n)
 1253|  3.54k|  }
 1254|       |
 1255|  62.3k|  FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL;
  ------------------
  |  |   95|  62.3k|#define FLAG unsigned short
  ------------------
                FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL;
  ------------------
  |  |   96|  62.3k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1255:24): [True: 62.3k, False: 0]
  ------------------
 1256|  62.3k|  FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL;
  ------------------
  |  |   95|  62.3k|#define FLAG unsigned short
  ------------------
                FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL;
  ------------------
  |  |   96|  62.3k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1256:20): [True: 62.3k, False: 0]
  ------------------
 1257|  62.3k|  FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL;
  ------------------
  |  |   95|  62.3k|#define FLAG unsigned short
  ------------------
                FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL;
  ------------------
  |  |   96|  62.3k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1257:25): [True: 62.3k, False: 0]
  ------------------
 1258|  62.3k|  FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL;
  ------------------
  |  |   95|  62.3k|#define FLAG unsigned short
  ------------------
                FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL;
  ------------------
  |  |   96|  62.3k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1258:25): [True: 62.3k, False: 0]
  ------------------
 1259|       |
 1260|  62.3k|  std::vector<w_char> w_word, w_target;
 1261|  62.3k|  if (utf8) {
  ------------------
  |  Branch (1261:7): [True: 24.2k, False: 38.0k]
  ------------------
 1262|  24.2k|    u8_u16(w_word, word);
 1263|  24.2k|    u8_u16(w_target, target);
 1264|  24.2k|  }
 1265|       |
 1266|  62.3k|  std::string f;
 1267|  62.3k|  std::vector<w_char> w_f;
 1268|       |
 1269|  62.3k|  for (const auto& i : rHMgr) {
  ------------------
  |  Branch (1269:22): [True: 62.3k, False: 62.3k]
  ------------------
 1270|  2.08M|    while (nullptr != (hp = i->walk_hashtable(col, hp))) {
  ------------------
  |  Branch (1270:12): [True: 2.02M, False: 62.3k]
  ------------------
 1271|       |      // skip exceptions
 1272|  2.02M|      if (
 1273|       |           // skip it, if the word length different by 5 or
 1274|       |           // more characters (to avoid strange suggestions)
 1275|       |           // (except Unicode characters over BMP)
 1276|  2.02M|           (((abs(n - hp->clen) > 4) && !nonbmp)) ||
  ------------------
  |  Branch (1276:12): [True: 1.40M, False: 621k]
  |  Branch (1276:14): [True: 1.26M, False: 759k]
  |  Branch (1276:41): [True: 1.21M, False: 45.1k]
  ------------------
 1277|       |           // don't suggest capitalized dictionary words for
 1278|       |           // lower case misspellings in ngram suggestions, except
 1279|       |           // - PHONE usage, or
 1280|       |           // - in the case of German, where not only proper
 1281|       |           //   nouns are capitalized, or
 1282|       |           // - the capitalized word has special pronunciation
 1283|   805k|           ((captype == NOCAP) && (hp->var & H_OPT_INITCAP) &&
  ------------------
  |  |   92|   805k|#define NOCAP 0
  ------------------
                         ((captype == NOCAP) && (hp->var & H_OPT_INITCAP) &&
  ------------------
  |  |   50|   190k|#define H_OPT_INITCAP (1 << 3)  // is dictionary word capitalized?
  ------------------
  |  Branch (1283:13): [True: 190k, False: 614k]
  |  Branch (1283:35): [True: 84.5k, False: 106k]
  ------------------
 1284|  84.5k|              !ph && (langnum != LANG_de) && !(hp->var & H_OPT_PHON)) ||
  ------------------
  |  |   49|  82.3k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  |  Branch (1284:15): [True: 82.3k, False: 2.25k]
  |  Branch (1284:22): [True: 82.3k, False: 0]
  |  Branch (1284:46): [True: 82.3k, False: 0]
  ------------------
 1285|       |           // or it has one of the following special flags
 1286|   722k|           ((hp->astr) && (pAMgr) &&
  ------------------
  |  Branch (1286:13): [True: 200k, False: 522k]
  |  Branch (1286:27): [True: 200k, False: 0]
  ------------------
 1287|   200k|             (TESTAFF(hp->astr, forbiddenword, hp->alen) ||
  ------------------
  |  |   99|   400k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 2.15k, False: 198k]
  |  |  ------------------
  ------------------
 1288|   198k|             TESTAFF(hp->astr, ONLYUPCASEFLAG, hp->alen) ||
  ------------------
  |  |   99|   398k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 99.4k, False: 98.8k]
  |  |  ------------------
  ------------------
 1289|  98.8k|             TESTAFF(hp->astr, nosuggest, hp->alen) ||
  ------------------
  |  |   99|   299k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 98.8k]
  |  |  ------------------
  ------------------
 1290|  98.8k|             TESTAFF(hp->astr, nongramsuggest, hp->alen) ||
  ------------------
  |  |   99|   299k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 98.8k]
  |  |  ------------------
  ------------------
 1291|  98.8k|             TESTAFF(hp->astr, onlyincompound, hp->alen)))
  ------------------
  |  |   99|  98.8k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 98.8k]
  |  |  ------------------
  ------------------
 1292|  2.02M|         )
 1293|  1.40M|        continue;
 1294|       |
 1295|   621k|      if (utf8) {
  ------------------
  |  Branch (1295:11): [True: 270k, False: 350k]
  ------------------
 1296|   270k|        u8_u16(w_f, HENTRY_WORD(hp));
  ------------------
  |  |   54|   270k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1297|       |
 1298|   270k|        int leftcommon = leftcommonsubstring(w_word, w_f);
 1299|   270k|        if (low) {
  ------------------
  |  Branch (1299:13): [True: 270k, False: 0]
  ------------------
 1300|       |          // lowering dictionary word
 1301|   270k|          mkallsmall_utf(w_f, langnum);
 1302|   270k|        }
 1303|   270k|        sc = ngram(3, w_word, w_f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|   270k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1304|   350k|      } else {
 1305|   350k|        f.assign(HENTRY_WORD(hp));
  ------------------
  |  |   54|   350k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1306|       |
 1307|   350k|        int leftcommon = leftcommonsubstring(word, f.c_str());
 1308|   350k|        if (low) {
  ------------------
  |  Branch (1308:13): [True: 328k, False: 22.0k]
  ------------------
 1309|       |          // lowering dictionary word
 1310|   328k|          mkallsmall(f, csconv);
 1311|   328k|        }
 1312|   350k|        sc = ngram(3, word, f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|   350k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1313|   350k|      }
 1314|       |
 1315|       |      // check special pronunciation
 1316|   621k|      f.clear();
 1317|   621k|      if ((hp->var & H_OPT_PHON) &&
  ------------------
  |  |   49|   621k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  |  Branch (1317:11): [True: 826, False: 620k]
  |  Branch (1317:11): [True: 826, False: 620k]
  ------------------
 1318|    826|          copy_field(f, HENTRY_DATA(hp), MORPH_PHON)) {
  ------------------
  |  |  114|    826|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (1318:11): [True: 826, False: 0]
  ------------------
 1319|    826|        int sc2;
 1320|    826|        if (utf8) {
  ------------------
  |  Branch (1320:13): [True: 0, False: 826]
  ------------------
 1321|      0|          u8_u16(w_f, f);
 1322|       |
 1323|      0|          int leftcommon = leftcommonsubstring(w_word, w_f);
 1324|      0|          if (low) {
  ------------------
  |  Branch (1324:15): [True: 0, False: 0]
  ------------------
 1325|       |            // lowering dictionary word
 1326|      0|            mkallsmall_utf(w_f, langnum);
 1327|      0|          }
 1328|      0|          sc2 = ngram(3, w_word, w_f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|      0|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1329|    826|        } else {
 1330|    826|          int leftcommon = leftcommonsubstring(word, f.c_str());
 1331|    826|          if (low) {
  ------------------
  |  Branch (1331:15): [True: 826, False: 0]
  ------------------
 1332|       |            // lowering dictionary word
 1333|    826|            mkallsmall(f, csconv);
 1334|    826|          }
 1335|    826|          sc2 = ngram(3, word, f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|    826|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1336|    826|        }
 1337|    826|        if (sc2 > sc)
  ------------------
  |  Branch (1337:13): [True: 389, False: 437]
  ------------------
 1338|    389|          sc = sc2;
 1339|    826|      }
 1340|       |
 1341|   621k|      int scphon = -20000;
 1342|   621k|      if (ph && (sc > 2) && (abs(n - (int)hp->clen) <= 3)) {
  ------------------
  |  Branch (1342:11): [True: 36.7k, False: 584k]
  |  Branch (1342:17): [True: 8.70k, False: 28.0k]
  |  Branch (1342:29): [True: 7.38k, False: 1.31k]
  ------------------
 1343|  7.38k|        if (utf8) {
  ------------------
  |  Branch (1343:13): [True: 0, False: 7.38k]
  ------------------
 1344|      0|          u8_u16(w_candidate, HENTRY_WORD(hp));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1345|      0|          mkallcap_utf(w_candidate, langnum);
 1346|      0|          u16_u8(candidate, w_candidate);
 1347|  7.38k|        } else {
 1348|  7.38k|          candidate = HENTRY_WORD(hp);
  ------------------
  |  |   54|  7.38k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1349|  7.38k|          mkallcap(candidate, csconv);
 1350|  7.38k|        }
 1351|  7.38k|        f = phonet(candidate, *ph);
 1352|  7.38k|        if (utf8) {
  ------------------
  |  Branch (1352:13): [True: 0, False: 7.38k]
  ------------------
 1353|      0|          u8_u16(w_f, f);
 1354|      0|          scphon = 2 * ngram(3, w_target, w_f,
 1355|      0|                             NGRAM_LONGER_WORSE);
  ------------------
  |  |   81|      0|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1356|  7.38k|        } else {
 1357|  7.38k|          scphon = 2 * ngram(3, target, f,
 1358|  7.38k|                             NGRAM_LONGER_WORSE);
  ------------------
  |  |   81|  7.38k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1359|  7.38k|        }
 1360|  7.38k|      }
 1361|       |
 1362|   621k|      if (sc > scores[lp]) {
  ------------------
  |  Branch (1362:11): [True: 621k, False: 0]
  ------------------
 1363|   621k|        scores[lp] = sc;
 1364|   621k|        roots[lp] = hp;
 1365|   621k|        has_roots = true;
 1366|   621k|        lval = sc;
 1367|  62.7M|        for (int j = 0; j < MAX_ROOTS; j++)
  ------------------
  |  |   74|  62.7M|#define MAX_ROOTS 100
  ------------------
  |  Branch (1367:25): [True: 62.1M, False: 621k]
  ------------------
 1368|  62.1M|          if (scores[j] < lval) {
  ------------------
  |  Branch (1368:15): [True: 51.0M, False: 11.0M]
  ------------------
 1369|  51.0M|            lp = j;
 1370|  51.0M|            lval = scores[j];
 1371|  51.0M|          }
 1372|   621k|      }
 1373|       |
 1374|   621k|      if (scphon > scoresphon[lpphon]) {
  ------------------
  |  Branch (1374:11): [True: 7.38k, False: 613k]
  ------------------
 1375|  7.38k|        scoresphon[lpphon] = scphon;
 1376|  7.38k|        rootsphon[lpphon] = HENTRY_WORD(hp);
  ------------------
  |  |   54|  7.38k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1377|  7.38k|        has_rootsphon = true;
 1378|  7.38k|        lval = scphon;
 1379|   746k|        for (int j = 0; j < MAX_ROOTS; j++)
  ------------------
  |  |   74|   746k|#define MAX_ROOTS 100
  ------------------
  |  Branch (1379:25): [True: 738k, False: 7.38k]
  ------------------
 1380|   738k|          if (scoresphon[j] < lval) {
  ------------------
  |  Branch (1380:15): [True: 648k, False: 90.0k]
  ------------------
 1381|   648k|            lpphon = j;
 1382|   648k|            lval = scoresphon[j];
 1383|   648k|          }
 1384|  7.38k|      }
 1385|   621k|    }
 1386|  62.3k|  }
 1387|       |
 1388|  62.3k|  if (!has_roots && !has_rootsphon) {
  ------------------
  |  Branch (1388:7): [True: 13.8k, False: 48.4k]
  |  Branch (1388:21): [True: 13.8k, False: 0]
  ------------------
 1389|       |    // with no roots there will be no guesses and no point running
 1390|       |    // ngram
 1391|  13.8k|    return;
 1392|  13.8k|  }
 1393|       |
 1394|       |  // find minimum threshold for a passable suggestion
 1395|       |  // mangle original word three differnt ways
 1396|       |  // and score them to generate a minimum acceptable score
 1397|  48.4k|  std::vector<w_char> w_mw;
 1398|  48.4k|  int thresh = 0;
 1399|   193k|  for (int sp = 1; sp < 4; sp++) {
  ------------------
  |  Branch (1399:20): [True: 145k, False: 48.4k]
  ------------------
 1400|   145k|    if (utf8) {
  ------------------
  |  Branch (1400:9): [True: 59.5k, False: 85.9k]
  ------------------
 1401|  59.5k|      w_mw = w_word;
 1402|   110k|      for (int k = sp; k < n; k += 4) {
  ------------------
  |  Branch (1402:24): [True: 50.6k, False: 59.5k]
  ------------------
 1403|  50.6k|        w_mw[k].l = '*';
 1404|  50.6k|        w_mw[k].h = 0;
 1405|  50.6k|      }
 1406|       |
 1407|  59.5k|      if (low) {
  ------------------
  |  Branch (1407:11): [True: 59.5k, False: 0]
  ------------------
 1408|       |        // lowering dictionary word
 1409|  59.5k|        mkallsmall_utf(w_mw, langnum);
 1410|  59.5k|      }
 1411|       |
 1412|  59.5k|      thresh += ngram(n, w_word, w_mw, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  59.5k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1413|  85.9k|    } else {
 1414|  85.9k|      std::string mw = word;
 1415|   195k|      for (int k = sp; k < n; k += 4)
  ------------------
  |  Branch (1415:24): [True: 110k, False: 85.9k]
  ------------------
 1416|   110k|        mw[k] = '*';
 1417|       |
 1418|  85.9k|      if (low) {
  ------------------
  |  Branch (1418:11): [True: 80.6k, False: 5.27k]
  ------------------
 1419|       |        // lowering dictionary word
 1420|  80.6k|        mkallsmall(mw, csconv);
 1421|  80.6k|      }
 1422|       |
 1423|  85.9k|      thresh += ngram(n, word, mw, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  85.9k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1424|  85.9k|    }
 1425|   145k|  }
 1426|  48.4k|  thresh = thresh / 3;
 1427|  48.4k|  thresh--;
 1428|       |
 1429|       |  // now expand affixes on each of these root words and
 1430|       |  // and use length adjusted ngram scores to select
 1431|       |  // possible suggestions
 1432|  48.4k|  char* guess[MAX_GUESS];
 1433|  48.4k|  char* guessorig[MAX_GUESS];
 1434|  48.4k|  int gscore[MAX_GUESS];
 1435|  9.74M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.74M|#define MAX_GUESS 200
  ------------------
  |  Branch (1435:19): [True: 9.69M, False: 48.4k]
  ------------------
 1436|  9.69M|    guess[i] = nullptr;
 1437|  9.69M|    guessorig[i] = nullptr;
 1438|  9.69M|    gscore[i] = -100 * i;
 1439|  9.69M|  }
 1440|       |
 1441|  48.4k|  lp = MAX_GUESS - 1;
  ------------------
  |  |   76|  48.4k|#define MAX_GUESS 200
  ------------------
 1442|       |
 1443|  48.4k|  std::vector<guessword> glst(MAX_WORDS);
  ------------------
  |  |   75|  48.4k|#define MAX_WORDS 100
  ------------------
 1444|       |
 1445|  4.84M|  for (auto& root : roots) {
  ------------------
  |  Branch (1445:19): [True: 4.84M, False: 48.4k]
  ------------------
 1446|  4.84M|    if (root) {
  ------------------
  |  Branch (1446:9): [True: 621k, False: 4.22M]
  ------------------
 1447|   621k|      struct hentry* rp = root;
 1448|       |
 1449|   621k|      f.clear();
 1450|   621k|      const char* field = nullptr;
 1451|   621k|      if ((rp->var & H_OPT_PHON) && copy_field(f, HENTRY_DATA(rp), MORPH_PHON))
  ------------------
  |  |   49|   621k|#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|    826|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (1451:11): [True: 826, False: 620k]
  |  Branch (1451:11): [True: 826, False: 620k]
  |  Branch (1451:37): [True: 826, False: 0]
  ------------------
 1452|    826|          field = f.c_str();
 1453|   621k|      int nw = pAMgr->expand_rootword(
 1454|   621k|          glst.data(), MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word,
  ------------------
  |  |   75|   621k|#define MAX_WORDS 100
  ------------------
                        glst.data(), MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word,
  ------------------
  |  |   54|   621k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1455|   621k|          nc, field);
 1456|       |
 1457|  1.24M|      for (int k = 0; k < nw; k++) {
  ------------------
  |  Branch (1457:23): [True: 619k, False: 621k]
  ------------------
 1458|   619k|        if (utf8) {
  ------------------
  |  Branch (1458:13): [True: 270k, False: 349k]
  ------------------
 1459|   270k|          u8_u16(w_f, glst[k].word);
 1460|       |
 1461|   270k|          int leftcommon = leftcommonsubstring(w_word, w_f);
 1462|   270k|          if (low) {
  ------------------
  |  Branch (1462:15): [True: 270k, False: 0]
  ------------------
 1463|       |            // lowering dictionary word
 1464|   270k|            mkallsmall_utf(w_f, langnum);
 1465|   270k|          }
 1466|       |
 1467|   270k|          sc = ngram(n, w_word, w_f, NGRAM_ANY_MISMATCH) + leftcommon;
  ------------------
  |  |   82|   270k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1468|   349k|        } else {
 1469|   349k|          f = glst[k].word;
 1470|       |
 1471|   349k|          int leftcommon = leftcommonsubstring(word, f.c_str());
 1472|   349k|          if (low) {
  ------------------
  |  Branch (1472:15): [True: 326k, False: 22.0k]
  ------------------
 1473|       |            // lowering dictionary word
 1474|   326k|            mkallsmall(f, csconv);
 1475|   326k|          }
 1476|       |
 1477|   349k|          sc = ngram(n, word, f, NGRAM_ANY_MISMATCH) + leftcommon;
  ------------------
  |  |   82|   349k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1478|   349k|        }
 1479|       |
 1480|   619k|        if (sc > thresh) {
  ------------------
  |  Branch (1480:13): [True: 102k, False: 517k]
  ------------------
 1481|   102k|          if (sc > gscore[lp]) {
  ------------------
  |  Branch (1481:15): [True: 102k, False: 0]
  ------------------
 1482|   102k|            if (guess[lp]) {
  ------------------
  |  Branch (1482:17): [True: 0, False: 102k]
  ------------------
 1483|      0|              delete[] guess[lp];
 1484|      0|              if (guessorig[lp]) {
  ------------------
  |  Branch (1484:19): [True: 0, False: 0]
  ------------------
 1485|      0|                delete[] guessorig[lp];
 1486|      0|                guessorig[lp] = nullptr;
 1487|      0|              }
 1488|      0|            }
 1489|   102k|            gscore[lp] = sc;
 1490|   102k|            guess[lp] = glst[k].word;
 1491|   102k|            guessorig[lp] = glst[k].orig;
 1492|   102k|            lval = sc;
 1493|  20.5M|            for (int j = 0; j < MAX_GUESS; j++)
  ------------------
  |  |   76|  20.5M|#define MAX_GUESS 200
  ------------------
  |  Branch (1493:29): [True: 20.4M, False: 102k]
  ------------------
 1494|  20.4M|              if (gscore[j] < lval) {
  ------------------
  |  Branch (1494:19): [True: 19.5M, False: 913k]
  ------------------
 1495|  19.5M|                lp = j;
 1496|  19.5M|                lval = gscore[j];
 1497|  19.5M|              }
 1498|   102k|          } else {
 1499|      0|            delete[] glst[k].word;
 1500|      0|            delete[] glst[k].orig;
 1501|      0|          }
 1502|   517k|        } else {
 1503|   517k|          delete[] glst[k].word;
 1504|   517k|          delete[] glst[k].orig;
 1505|   517k|        }
 1506|   619k|      }
 1507|   621k|    }
 1508|  4.84M|  }
 1509|  48.4k|  glst.clear();
 1510|       |
 1511|       |  // now we are done generating guesses
 1512|       |  // sort in order of decreasing score
 1513|       |
 1514|  48.4k|  bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS);
  ------------------
  |  |   76|  48.4k|#define MAX_GUESS 200
  ------------------
 1515|  48.4k|  if (ph)
  ------------------
  |  Branch (1515:7): [True: 2.82k, False: 45.6k]
  ------------------
 1516|  2.82k|    bubblesort(&rootsphon[0], nullptr, &scoresphon[0], MAX_ROOTS);
  ------------------
  |  |   74|  2.82k|#define MAX_ROOTS 100
  ------------------
 1517|       |
 1518|       |  // weight suggestions with a similarity index, based on
 1519|       |  // the longest common subsequent algorithm and resort
 1520|       |
 1521|  48.4k|  int is_swap = 0;
 1522|  48.4k|  int re = 0;
 1523|  48.4k|  double fact = 1.0;
 1524|  48.4k|  if (pAMgr) {
  ------------------
  |  Branch (1524:7): [True: 48.4k, False: 0]
  ------------------
 1525|  48.4k|    int maxd = pAMgr->get_maxdiff();
 1526|  48.4k|    if (maxd >= 0)
  ------------------
  |  Branch (1526:9): [True: 0, False: 48.4k]
  ------------------
 1527|      0|      fact = (10.0 - maxd) / 5.0;
 1528|  48.4k|  }
 1529|       |
 1530|  48.4k|  std::vector<w_char> w_gl;
 1531|  9.30M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.30M|#define MAX_GUESS 200
  ------------------
  |  Branch (1531:19): [True: 9.25M, False: 46.2k]
  ------------------
 1532|  9.25M|    if (guess[i]) {
  ------------------
  |  Branch (1532:9): [True: 81.9k, False: 9.17M]
  ------------------
 1533|       |      // lowering guess[i]
 1534|  81.9k|      std::string gl;
 1535|  81.9k|      int len;
 1536|  81.9k|      if (utf8) {
  ------------------
  |  Branch (1536:11): [True: 23.8k, False: 58.1k]
  ------------------
 1537|  23.8k|        len = u8_u16(w_gl, guess[i]);
 1538|  23.8k|        mkallsmall_utf(w_gl, langnum);
 1539|  23.8k|        u16_u8(gl, w_gl);
 1540|  58.1k|      } else {
 1541|  58.1k|        gl.assign(guess[i]);
 1542|  58.1k|        if (!nonbmp)
  ------------------
  |  Branch (1542:13): [True: 58.1k, False: 0]
  ------------------
 1543|  58.1k|          mkallsmall(gl, csconv);
 1544|  58.1k|        len = strlen(guess[i]);
 1545|  58.1k|      }
 1546|       |
 1547|  81.9k|      int _lcs = lcslen(word, gl.c_str());
 1548|       |
 1549|       |      // same characters with different casing
 1550|  81.9k|      if ((n == len) && (n == _lcs)) {
  ------------------
  |  Branch (1550:11): [True: 17.9k, False: 64.0k]
  |  Branch (1550:25): [True: 2.23k, False: 15.7k]
  ------------------
 1551|  2.23k|        gscore[i] += 2000;
 1552|  2.23k|        break;
 1553|  2.23k|      }
 1554|       |      // using 2-gram instead of 3, and other weightening
 1555|       |
 1556|  79.7k|      if (utf8) {
  ------------------
  |  Branch (1556:11): [True: 22.0k, False: 57.6k]
  ------------------
 1557|  22.0k|        u8_u16(w_gl, gl);
 1558|       |        //w_gl is lowercase already at this point
 1559|  22.0k|        re = ngram(2, w_word, w_gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  22.0k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                      re = ngram(2, w_word, w_gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  22.0k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1560|  22.0k|        if (low) {
  ------------------
  |  Branch (1560:13): [True: 22.0k, False: 0]
  ------------------
 1561|  22.0k|          w_f = w_word;
 1562|       |          // lowering dictionary word
 1563|  22.0k|          mkallsmall_utf(w_f, langnum);
 1564|  22.0k|          re += ngram(2, w_gl, w_f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  22.0k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, w_gl, w_f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  22.0k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1565|  22.0k|        } else {
 1566|      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)
  ------------------
 1567|      0|        }
 1568|  57.6k|      } else {
 1569|       |        //gl is lowercase already at this point
 1570|  57.6k|        re = ngram(2, word, gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  57.6k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                      re = ngram(2, word, gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  57.6k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1571|  57.6k|        if (low) {
  ------------------
  |  Branch (1571:13): [True: 57.6k, False: 0]
  ------------------
 1572|  57.6k|          f = word;
 1573|       |          // lowering dictionary word
 1574|  57.6k|          mkallsmall(f, csconv);
 1575|  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)
  ------------------
 1576|  57.6k|        } else {
 1577|      0|          re += ngram(2, gl, word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|      0|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, gl, word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|      0|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1578|      0|        }
 1579|  57.6k|      }
 1580|       |
 1581|  79.7k|      int ngram_score, leftcommon_score;
 1582|  79.7k|      if (utf8) {
  ------------------
  |  Branch (1582:11): [True: 22.0k, False: 57.6k]
  ------------------
 1583|       |        //w_gl is lowercase already at this point
 1584|  22.0k|        ngram_score = ngram(4, w_word, w_gl, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  22.0k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1585|  22.0k|        leftcommon_score = leftcommonsubstring(w_word, w_gl);
 1586|  57.6k|      } else {
 1587|       |        //gl is lowercase already at this point
 1588|  57.6k|        ngram_score = ngram(4, word, gl, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  57.6k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1589|  57.6k|        leftcommon_score = leftcommonsubstring(word, gl.c_str());
 1590|  57.6k|      }
 1591|  79.7k|      gscore[i] =
 1592|       |          // length of longest common subsequent minus length difference
 1593|  79.7k|          2 * _lcs - abs((int)(n - len)) +
 1594|       |          // weight length of the left common substring
 1595|  79.7k|          leftcommon_score +
 1596|       |          // weight equal character positions
 1597|  79.7k|          (!nonbmp && commoncharacterpositions(word, gl.c_str(), &is_swap)
  ------------------
  |  Branch (1597:12): [True: 79.7k, False: 0]
  |  Branch (1597:23): [True: 65.8k, False: 13.9k]
  ------------------
 1598|  79.7k|               ? 1
 1599|  79.7k|               : 0) +
 1600|       |          // swap character (not neighboring)
 1601|  79.7k|          ((is_swap) ? 10 : 0) +
  ------------------
  |  Branch (1601:12): [True: 161, False: 79.5k]
  ------------------
 1602|       |          // ngram
 1603|  79.7k|          ngram_score +
 1604|       |          // weighted ngrams
 1605|  79.7k|          re +
 1606|       |          // different limit for dictionaries with PHONE rules
 1607|  79.7k|          (ph ? (re < len * fact ? -1000 : 0)
  ------------------
  |  Branch (1607:12): [True: 5.19k, False: 74.5k]
  |  Branch (1607:18): [True: 3.94k, False: 1.24k]
  ------------------
 1608|  79.7k|              : (re < (n + len) * fact ? -1000 : 0));
  ------------------
  |  Branch (1608:18): [True: 68.9k, False: 5.63k]
  ------------------
 1609|  79.7k|    }
 1610|  9.25M|  }
 1611|       |
 1612|  48.4k|  bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS);
  ------------------
  |  |   76|  48.4k|#define MAX_GUESS 200
  ------------------
 1613|       |
 1614|       |  // phonetic version
 1615|  48.4k|  if (ph)
  ------------------
  |  Branch (1615:7): [True: 2.82k, False: 45.6k]
  ------------------
 1616|   284k|    for (int i = 0; i < MAX_ROOTS; i++) {
  ------------------
  |  |   74|   284k|#define MAX_ROOTS 100
  ------------------
  |  Branch (1616:21): [True: 282k, False: 2.82k]
  ------------------
 1617|   282k|      if (rootsphon[i]) {
  ------------------
  |  Branch (1617:11): [True: 7.38k, False: 274k]
  ------------------
 1618|       |        // lowering rootphon[i]
 1619|  7.38k|        std::string gl;
 1620|  7.38k|        int len;
 1621|  7.38k|        if (utf8) {
  ------------------
  |  Branch (1621:13): [True: 0, False: 7.38k]
  ------------------
 1622|      0|          len = u8_u16(w_gl, rootsphon[i]);
 1623|      0|          mkallsmall_utf(w_gl, langnum);
 1624|      0|          u16_u8(gl, w_gl);
 1625|  7.38k|        } else {
 1626|  7.38k|          gl.assign(rootsphon[i]);
 1627|  7.38k|          if (!nonbmp)
  ------------------
  |  Branch (1627:15): [True: 7.38k, False: 0]
  ------------------
 1628|  7.38k|            mkallsmall(gl, csconv);
 1629|  7.38k|          len = strlen(rootsphon[i]);
 1630|  7.38k|        }
 1631|       |
 1632|       |        // weight length of the left common substring
 1633|  7.38k|        int leftcommon_score;
 1634|  7.38k|        if (utf8)
  ------------------
  |  Branch (1634:13): [True: 0, False: 7.38k]
  ------------------
 1635|      0|          leftcommon_score = leftcommonsubstring(w_word, w_gl);
 1636|  7.38k|        else
 1637|  7.38k|          leftcommon_score = leftcommonsubstring(word, gl.c_str());
 1638|       |        // heuristic weigthing of ngram scores
 1639|  7.38k|        scoresphon[i] += 2 * lcslen(word, gl) - abs((int)(n - len)) +
 1640|  7.38k|                         leftcommon_score;
 1641|  7.38k|      }
 1642|   282k|    }
 1643|       |
 1644|  48.4k|  if (ph)
  ------------------
  |  Branch (1644:7): [True: 2.82k, False: 45.6k]
  ------------------
 1645|  2.82k|    bubblesort(&rootsphon[0], nullptr, &scoresphon[0], MAX_ROOTS);
  ------------------
  |  |   74|  2.82k|#define MAX_ROOTS 100
  ------------------
 1646|       |
 1647|       |  // copy over
 1648|  48.4k|  size_t oldns = wlst.size();
 1649|       |
 1650|  48.4k|  int same = 0;
 1651|  9.74M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.74M|#define MAX_GUESS 200
  ------------------
  |  Branch (1651:19): [True: 9.69M, False: 48.4k]
  ------------------
 1652|  9.69M|    if (guess[i]) {
  ------------------
  |  Branch (1652:9): [True: 102k, False: 9.59M]
  ------------------
 1653|   102k|      if ((wlst.size() < oldns + maxngramsugs) && (wlst.size() < maxSug) &&
  ------------------
  |  Branch (1653:11): [True: 93.5k, False: 8.83k]
  |  Branch (1653:51): [True: 93.5k, False: 0]
  ------------------
 1654|  93.5k|          (!same || (gscore[i] > 1000))) {
  ------------------
  |  Branch (1654:12): [True: 15.7k, False: 77.7k]
  |  Branch (1654:21): [True: 0, False: 77.7k]
  ------------------
 1655|  15.7k|        int unique = 1;
 1656|       |        // leave only excellent suggestions, if exists
 1657|  15.7k|        if (gscore[i] > 1000)
  ------------------
  |  Branch (1657:13): [True: 2.23k, False: 13.5k]
  ------------------
 1658|  2.23k|          same = 1;
 1659|  13.5k|        else if (gscore[i] < -100) {
  ------------------
  |  Branch (1659:18): [True: 8.72k, False: 4.83k]
  ------------------
 1660|  8.72k|          same = 1;
 1661|       |          // keep the best ngram suggestions, unless in ONLYMAXDIFF mode
 1662|  8.72k|          if (wlst.size() > oldns || (pAMgr && pAMgr->get_onlymaxdiff())) {
  ------------------
  |  Branch (1662:15): [True: 1.15k, False: 7.56k]
  |  Branch (1662:39): [True: 7.56k, False: 0]
  |  Branch (1662:48): [True: 0, False: 7.56k]
  ------------------
 1663|  1.15k|            delete[] guess[i];
 1664|  1.15k|            delete[] guessorig[i];
 1665|  1.15k|            continue;
 1666|  1.15k|          }
 1667|  8.72k|        }
 1668|  14.6k|        for (auto& j : wlst) {
  ------------------
  |  Branch (1668:22): [True: 7.52k, False: 13.6k]
  ------------------
 1669|       |          // don't suggest previous suggestions or a previous suggestion with
 1670|       |          // prefixes or affixes
 1671|  7.52k|          if ((!guessorig[i] && strstr(guess[i], j.c_str())) || (guessorig[i] && strstr(guessorig[i], j.c_str())) ||
  ------------------
  |  Branch (1671:15): [True: 961, False: 6.56k]
  |  Branch (1671:16): [True: 7.52k, False: 0]
  |  Branch (1671:33): [True: 961, False: 6.56k]
  |  Branch (1671:66): [True: 0, False: 6.56k]
  |  Branch (1671:82): [True: 0, False: 0]
  ------------------
 1672|       |              // check forbidden words
 1673|  6.56k|              !checkword(guess[i], 0, nullptr, nullptr)) {
  ------------------
  |  Branch (1673:15): [True: 0, False: 6.56k]
  ------------------
 1674|    961|            unique = 0;
 1675|    961|            break;
 1676|    961|          }
 1677|  7.52k|        }
 1678|  14.6k|        if (unique) {
  ------------------
  |  Branch (1678:13): [True: 13.6k, False: 961]
  ------------------
 1679|  13.6k|          if (guessorig[i]) {
  ------------------
  |  Branch (1679:15): [True: 0, False: 13.6k]
  ------------------
 1680|      0|            wlst.emplace_back(guessorig[i]);
 1681|  13.6k|          } else {
 1682|  13.6k|            wlst.emplace_back(guess[i]);
 1683|  13.6k|          }
 1684|  13.6k|        }
 1685|  14.6k|        delete[] guess[i];
 1686|  14.6k|        delete[] guessorig[i];
 1687|  86.5k|      } else {
 1688|  86.5k|        delete[] guess[i];
 1689|  86.5k|        delete[] guessorig[i];
 1690|  86.5k|      }
 1691|   102k|    }
 1692|  9.69M|  }
 1693|       |
 1694|  48.4k|  oldns = wlst.size();
 1695|  48.4k|  if (ph)
  ------------------
  |  Branch (1695:7): [True: 2.82k, False: 45.6k]
  ------------------
 1696|   282k|    for (auto& i : rootsphon) {
  ------------------
  |  Branch (1696:18): [True: 282k, False: 2.82k]
  ------------------
 1697|   282k|      if (i) {
  ------------------
  |  Branch (1697:11): [True: 7.38k, False: 274k]
  ------------------
 1698|  7.38k|        if ((wlst.size() < oldns + MAXPHONSUGS) && (wlst.size() < maxSug)) {
  ------------------
  |  |   78|  7.38k|#define MAXPHONSUGS 2
  ------------------
  |  Branch (1698:13): [True: 1.84k, False: 5.54k]
  |  Branch (1698:52): [True: 1.84k, False: 0]
  ------------------
 1699|  1.84k|          int unique = 1;
 1700|  3.39k|          for (auto& j : wlst) {
  ------------------
  |  Branch (1700:24): [True: 3.39k, False: 997]
  ------------------
 1701|       |            // don't suggest previous suggestions or a previous suggestion with
 1702|       |            // prefixes or affixes
 1703|  3.39k|            if (strstr(i, j.c_str()) ||
  ------------------
  |  Branch (1703:17): [True: 847, False: 2.54k]
  |  Branch (1703:17): [True: 847, False: 2.54k]
  ------------------
 1704|       |                // check forbidden words
 1705|  2.54k|                !checkword(i, 0, nullptr, nullptr)) {
  ------------------
  |  Branch (1705:17): [True: 0, False: 2.54k]
  ------------------
 1706|    847|              unique = 0;
 1707|    847|              break;
 1708|    847|            }
 1709|  3.39k|          }
 1710|  1.84k|          if (unique) {
  ------------------
  |  Branch (1710:15): [True: 997, False: 847]
  ------------------
 1711|    997|            wlst.emplace_back(i);
 1712|    997|          }
 1713|  1.84k|        }
 1714|  7.38k|      }
 1715|   282k|    }
 1716|  48.4k|}
_ZN10SuggestMgr9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPiPNS0_6chrono10time_pointINSA_12steady_clockENSA_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1727|  86.1M|                          std::chrono::steady_clock::time_point* timelimit) {
 1728|       |  // check overall suggestion time limit
 1729|  86.1M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|  86.1M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (1729:7): [True: 2, False: 86.1M]
  ------------------
 1730|      2|    return 0;
 1731|       |
 1732|       |  // check time limit
 1733|  86.1M|  if (timer) {
  ------------------
  |  Branch (1733:7): [True: 639k, False: 85.4M]
  ------------------
 1734|   639k|    (*timer)--;
 1735|   639k|    if (!(*timer) && timelimit) {
  ------------------
  |  Branch (1735:9): [True: 1.81k, False: 637k]
  |  Branch (1735:22): [True: 1.81k, False: 0]
  ------------------
 1736|  1.81k|      if (std::chrono::steady_clock::now() - *timelimit > TIMELIMIT_MS)
  ------------------
  |  |  106|  1.81k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1736:11): [True: 2, False: 1.80k]
  ------------------
 1737|      2|        return 0;
 1738|  1.80k|      *timer = MAXPLUSTIMER;
  ------------------
  |  |  108|  1.80k|#define MAXPLUSTIMER 100
  ------------------
 1739|  1.80k|    }
 1740|   639k|  }
 1741|       |
 1742|  86.1M|  if (pAMgr) {
  ------------------
  |  Branch (1742:7): [True: 86.1M, False: 0]
  ------------------
 1743|  86.1M|    struct hentry* rv = nullptr;
 1744|  86.1M|    int nosuffix = 0;
 1745|       |
 1746|  86.1M|    if (cpdsuggest >= 1) {
  ------------------
  |  Branch (1746:9): [True: 56.4M, False: 29.6M]
  ------------------
 1747|  56.4M|      if (pAMgr->get_compound()) {
  ------------------
  |  Branch (1747:11): [True: 14.3M, False: 42.1M]
  ------------------
 1748|  14.3M|        struct hentry* rv2 = nullptr;
 1749|  14.3M|        struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
 1750|  14.3M|        int info = (cpdsuggest == 1) ? SPELL_COMPOUND_2 : 0;
  ------------------
  |  |   85|  7.16M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (1750:20): [True: 7.16M, False: 7.16M]
  ------------------
 1751|  14.3M|        AffixScratch scratch;
 1752|  14.3M|        rv = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 1, &info, scratch);  // EXT
 1753|       |        // TODO filter 3-word or more compound words, as in spell()
 1754|       |        // (it's too slow to call suggest() here for all possible compound words)
 1755|  14.3M|        if (rv &&
  ------------------
  |  Branch (1755:13): [True: 0, False: 14.3M]
  |  Branch (1755:13): [True: 0, False: 14.3M]
  ------------------
 1756|      0|            (!(rv2 = pAMgr->lookup(word.c_str(), word.size())) || !rv2->astr ||
  ------------------
  |  Branch (1756:14): [True: 0, False: 0]
  |  Branch (1756:67): [True: 0, False: 0]
  ------------------
 1757|      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]
  |  |  ------------------
  ------------------
 1758|      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]
  |  |  ------------------
  ------------------
 1759|      0|          return 3;  // XXX obsolote categorisation + only ICONV needs affix
 1760|       |                     // flag check?
 1761|  14.3M|      }
 1762|  56.4M|      return 0;
 1763|  56.4M|    }
 1764|       |
 1765|  29.6M|    rv = pAMgr->lookup(word.c_str(), word.size());
 1766|       |
 1767|  29.6M|    if (rv) {
  ------------------
  |  Branch (1767:9): [True: 32.2k, False: 29.6M]
  ------------------
 1768|  32.2k|      if ((rv->astr) &&
  ------------------
  |  Branch (1768:11): [True: 372, False: 31.8k]
  |  Branch (1768:11): [True: 0, False: 32.2k]
  ------------------
 1769|    372|          (TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |   99|    744|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 372]
  |  |  ------------------
  ------------------
 1770|    372|           TESTAFF(rv->astr, pAMgr->get_nosuggest(), rv->alen) ||
  ------------------
  |  |   99|    744|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 372]
  |  |  ------------------
  ------------------
 1771|    372|           TESTAFF(rv->astr, pAMgr->get_substandard(), rv->alen)))
  ------------------
  |  |   99|    372|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 372]
  |  |  ------------------
  ------------------
 1772|      0|        return 0;
 1773|  32.6k|      while (rv) {
  ------------------
  |  Branch (1773:14): [True: 32.2k, False: 362]
  ------------------
 1774|  32.2k|        if (rv->astr &&
  ------------------
  |  Branch (1774:13): [True: 372, False: 31.8k]
  |  Branch (1774:13): [True: 362, False: 31.8k]
  ------------------
 1775|    372|            (TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |   99|    744|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 372]
  |  |  ------------------
  ------------------
 1776|    372|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|    744|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 362, False: 10]
  |  |  ------------------
  ------------------
 1777|    362|             TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen))) {
  ------------------
  |  |   99|     10|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
 1778|    362|          rv = rv->next_homonym;
 1779|    362|        } else
 1780|  31.8k|          break;
 1781|  32.2k|      }
 1782|  29.6M|    } else {
 1783|  29.6M|      AffixScratch scratch;
 1784|  29.6M|      rv = pAMgr->prefix_check(word, 0, word.size(),
 1785|  29.6M|                               0, scratch);  // only prefix, and prefix + suffix XXX
 1786|  29.6M|    }
 1787|       |
 1788|  29.6M|    if (rv) {
  ------------------
  |  Branch (1788:9): [True: 31.8k, False: 29.6M]
  ------------------
 1789|  31.8k|      nosuffix = 1;
 1790|  29.6M|    } else {
 1791|  29.6M|      AffixScratch scratch;
 1792|  29.6M|      rv = pAMgr->suffix_check(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // only suffix
  ------------------
  |  |   96|  29.6M|#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|  29.6M|#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|  29.6M|#define IN_CPD_NOT 0
  ------------------
 1793|  29.6M|    }
 1794|       |
 1795|  29.6M|    if (!rv && pAMgr->have_contclass()) {
  ------------------
  |  Branch (1795:9): [True: 29.6M, False: 31.8k]
  |  Branch (1795:16): [True: 10.7M, False: 18.8M]
  ------------------
 1796|  10.7M|      AffixScratch scratch;
 1797|  10.7M|      rv = pAMgr->suffix_check_twosfx(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL);
  ------------------
  |  |   96|  10.7M|#define FLAG_NULL 0x00
  ------------------
 1798|  10.7M|      if (!rv)
  ------------------
  |  Branch (1798:11): [True: 10.7M, False: 0]
  ------------------
 1799|  10.7M|        rv = pAMgr->prefix_check_twosfx(word, 0, word.size(), 0, scratch, FLAG_NULL);
  ------------------
  |  |   96|  10.7M|#define FLAG_NULL 0x00
  ------------------
 1800|  10.7M|    }
 1801|       |
 1802|       |    // check forbidden words
 1803|  29.6M|    if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1803:9): [True: 31.8k, False: 29.6M]
  |  Branch (1803:9): [True: 0, False: 29.6M]
  |  Branch (1803:17): [True: 12, False: 31.8k]
  ------------------
 1804|     12|        (TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |   99|     24|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 12]
  |  |  ------------------
  ------------------
 1805|     12|         TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|     24|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 12]
  |  |  ------------------
  ------------------
 1806|     12|         TESTAFF(rv->astr, pAMgr->get_nosuggest(), rv->alen) ||
  ------------------
  |  |   99|     24|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 12]
  |  |  ------------------
  ------------------
 1807|     12|         TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen)))
  ------------------
  |  |   99|     12|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 12]
  |  |  ------------------
  ------------------
 1808|      0|      return 0;
 1809|       |
 1810|  29.6M|    if (rv) {  // XXX obsolote
  ------------------
  |  Branch (1810:9): [True: 31.8k, False: 29.6M]
  ------------------
 1811|  31.8k|      if ((pAMgr->get_compoundflag()) &&
  ------------------
  |  Branch (1811:11): [True: 7.38k, False: 24.5k]
  |  Branch (1811:11): [True: 8, False: 31.8k]
  ------------------
 1812|  7.38k|          TESTAFF(rv->astr, pAMgr->get_compoundflag(), rv->alen))
  ------------------
  |  |   99|  7.38k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 8, False: 7.37k]
  |  |  ------------------
  ------------------
 1813|      8|        return 2 + nosuffix;
 1814|  31.8k|      return 1;
 1815|  31.8k|    }
 1816|  29.6M|  }
 1817|  29.6M|  return 0;
 1818|  86.1M|}
_ZN10SuggestMgr15check_forbiddenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1820|  14.4k|int SuggestMgr::check_forbidden(const std::string& word) {
 1821|  14.4k|  if (pAMgr) {
  ------------------
  |  Branch (1821:7): [True: 14.4k, False: 0]
  ------------------
 1822|  14.4k|    struct hentry* rv = pAMgr->lookup(word.c_str(), word.size());
 1823|  14.4k|    if (rv && rv->astr &&
  ------------------
  |  Branch (1823:9): [True: 0, False: 14.4k]
  |  Branch (1823:9): [True: 0, False: 14.4k]
  |  Branch (1823:15): [True: 0, False: 0]
  ------------------
 1824|      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]
  |  |  ------------------
  ------------------
 1825|      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]
  |  |  ------------------
  ------------------
 1826|      0|      rv = nullptr;
 1827|  14.4k|    size_t len = word.size();
 1828|  14.4k|    AffixScratch scratch;
 1829|  14.4k|    if (!(pAMgr->prefix_check(word, 0, len, 1, scratch)))
  ------------------
  |  Branch (1829:9): [True: 14.4k, False: 0]
  ------------------
 1830|  14.4k|      rv = pAMgr->suffix_check(word, 0, len, 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // prefix+suffix, suffix
  ------------------
  |  |   96|  14.4k|#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.4k|#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.4k|#define IN_CPD_NOT 0
  ------------------
 1831|       |    // check forbidden words
 1832|  14.4k|    if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1832:9): [True: 0, False: 14.4k]
  |  Branch (1832:9): [True: 0, False: 14.4k]
  |  Branch (1832:17): [True: 0, False: 0]
  ------------------
 1833|      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]
  |  |  ------------------
  ------------------
 1834|      0|      return 1;
 1835|  14.4k|  }
 1836|  14.4k|  return 0;
 1837|  14.4k|}
_ZN10SuggestMgr13suggest_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1839|  12.7k|std::string SuggestMgr::suggest_morph(const std::string& in_w) {
 1840|  12.7k|  std::string result;
 1841|       |
 1842|  12.7k|  struct hentry* rv = nullptr;
 1843|       |
 1844|  12.7k|  if (!pAMgr)
  ------------------
  |  Branch (1844:7): [True: 0, False: 12.7k]
  ------------------
 1845|      0|    return {};
 1846|       |
 1847|  12.7k|  std::string w(in_w);
 1848|       |
 1849|       |  // word reversing wrapper for complex prefixes
 1850|  12.7k|  if (complexprefixes) {
  ------------------
  |  Branch (1850:7): [True: 648, False: 12.0k]
  ------------------
 1851|    648|    if (utf8)
  ------------------
  |  Branch (1851:9): [True: 0, False: 648]
  ------------------
 1852|      0|      reverseword_utf(w);
 1853|    648|    else
 1854|    648|      reverseword(w);
 1855|    648|  }
 1856|       |
 1857|  12.7k|  rv = pAMgr->lookup(w.c_str(), w.size());
 1858|       |
 1859|  15.4k|  while (rv) {
  ------------------
  |  Branch (1859:10): [True: 2.73k, False: 12.7k]
  ------------------
 1860|  2.73k|    if ((!rv->astr) ||
  ------------------
  |  Branch (1860:9): [True: 2.43k, False: 304]
  |  Branch (1860:9): [True: 2.73k, False: 0]
  ------------------
 1861|    304|        !(TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |   99|    608|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 304]
  |  |  ------------------
  ------------------
 1862|    304|          TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |   99|    608|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 304]
  |  |  ------------------
  ------------------
 1863|  2.73k|          TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen))) {
  ------------------
  |  |   99|    304|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 304]
  |  |  ------------------
  ------------------
 1864|  2.73k|      if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|  2.73k|#define MORPH_STEM "st:"
  ------------------
  |  Branch (1864:11): [True: 2.73k, False: 0]
  ------------------
 1865|  2.73k|        result.push_back(MSEP_FLD);
  ------------------
  |  |  121|  2.73k|#define MSEP_FLD ' '
  ------------------
 1866|  2.73k|        result.append(MORPH_STEM);
  ------------------
  |  |  103|  2.73k|#define MORPH_STEM "st:"
  ------------------
 1867|  2.73k|        result.append(w);
 1868|  2.73k|      }
 1869|  2.73k|      if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (1869:11): [True: 0, False: 2.73k]
  ------------------
 1870|      0|        result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 1871|      0|        result.append(HENTRY_DATA2(rv));
 1872|      0|      }
 1873|  2.73k|      result.push_back(MSEP_REC);
  ------------------
  |  |  122|  2.73k|#define MSEP_REC '\n'
  ------------------
 1874|  2.73k|    }
 1875|  2.73k|    rv = rv->next_homonym;
 1876|  2.73k|  }
 1877|       |
 1878|  12.7k|  AffixScratch scratch;
 1879|  12.7k|  std::string st = pAMgr->affix_check_morph(w, 0, w.size(), scratch);
 1880|  12.7k|  if (!st.empty()) {
  ------------------
  |  Branch (1880:7): [True: 0, False: 12.7k]
  ------------------
 1881|      0|    result.append(st);
 1882|      0|  }
 1883|       |
 1884|  12.7k|  if (pAMgr->get_compound() && result.empty()) {
  ------------------
  |  Branch (1884:7): [True: 2.64k, False: 10.0k]
  |  Branch (1884:32): [True: 2.06k, False: 582]
  ------------------
 1885|  2.06k|    struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
 1886|  2.06k|    pAMgr->compound_check_morph(w, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, result, nullptr, scratch);
 1887|  2.06k|  }
 1888|       |
 1889|  12.7k|  line_uniq(result, MSEP_REC);
  ------------------
  |  |  122|  12.7k|#define MSEP_REC '\n'
  ------------------
 1890|       |
 1891|  12.7k|  return result;
 1892|  12.7k|}
_ZN10SuggestMgr18suggest_hentry_genEP6hentryPKc:
 1917|   558k|std::string SuggestMgr::suggest_hentry_gen(hentry* rv, const char* pattern) {
 1918|   558k|  std::string result;
 1919|   558k|  int sfxcount = get_sfxcount(pattern);
 1920|       |
 1921|   558k|  if (get_sfxcount(HENTRY_DATA(rv)) > sfxcount)
  ------------------
  |  Branch (1921:7): [True: 0, False: 558k]
  ------------------
 1922|      0|    return result;
 1923|       |
 1924|   558k|  if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (1924:7): [True: 0, False: 558k]
  ------------------
 1925|      0|    std::string aff = pAMgr->morphgen(HENTRY_WORD(rv), rv->blen, rv->astr, rv->alen,
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1926|      0|                                      HENTRY_DATA(rv), pattern, 0);
 1927|      0|    if (!aff.empty()) {
  ------------------
  |  Branch (1927:9): [True: 0, False: 0]
  ------------------
 1928|      0|      result.append(aff);
 1929|      0|      result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1930|      0|    }
 1931|      0|  }
 1932|       |
 1933|       |  // check all allomorphs
 1934|   558k|  char* p = nullptr;
 1935|   558k|  if (HENTRY_DATA(rv))
  ------------------
  |  Branch (1935:7): [True: 0, False: 558k]
  ------------------
 1936|      0|    p = (char*)strstr(HENTRY_DATA2(rv), MORPH_ALLOMORPH);
  ------------------
  |  |  104|      0|#define MORPH_ALLOMORPH "al:"
  ------------------
 1937|   558k|  while (p) {
  ------------------
  |  Branch (1937:10): [True: 0, False: 558k]
  ------------------
 1938|      0|    p += MORPH_TAG_LEN;
  ------------------
  |  |  119|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
 1939|      0|    int plen = fieldlen(p);
 1940|      0|    std::string allomorph(p, plen);
 1941|      0|    struct hentry* rv2 = pAMgr->lookup(allomorph.c_str(), allomorph.size());
 1942|      0|    while (rv2) {
  ------------------
  |  Branch (1942:12): [True: 0, False: 0]
  ------------------
 1943|       |      //            if (HENTRY_DATA(rv2) && get_sfxcount(HENTRY_DATA(rv2)) <=
 1944|       |      //            sfxcount) {
 1945|      0|      if (HENTRY_DATA(rv2)) {
  ------------------
  |  Branch (1945:11): [True: 0, False: 0]
  ------------------
 1946|      0|        char* st = (char*)strstr(HENTRY_DATA2(rv2), MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 1947|      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 (1947:13): [True: 0, False: 0]
  |  Branch (1947:19): [True: 0, False: 0]
  ------------------
 1948|      0|                           fieldlen(st + MORPH_TAG_LEN)) == 0)) {
  ------------------
  |  |  119|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
 1949|      0|          std::string aff = pAMgr->morphgen(HENTRY_WORD(rv2), rv2->blen, rv2->astr,
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1950|      0|                                            rv2->alen, HENTRY_DATA(rv2), pattern, 0);
 1951|      0|          if (!aff.empty()) {
  ------------------
  |  Branch (1951:15): [True: 0, False: 0]
  ------------------
 1952|      0|            result.append(aff);
 1953|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1954|      0|          }
 1955|      0|        }
 1956|      0|      }
 1957|      0|      rv2 = rv2->next_homonym;
 1958|      0|    }
 1959|      0|    p = strstr(p + plen, MORPH_ALLOMORPH);
  ------------------
  |  |  104|      0|#define MORPH_ALLOMORPH "al:"
  ------------------
 1960|      0|  }
 1961|       |
 1962|   558k|  return result;
 1963|   558k|}
_ZN10SuggestMgr11suggest_genERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_NS0_6chrono10time_pointINSE_12steady_clockENSE_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1966|   371k|                                    std::chrono::steady_clock::time_point start_time) {
 1967|   371k|  if (desc.empty() || !pAMgr)
  ------------------
  |  Branch (1967:7): [True: 208k, False: 163k]
  |  Branch (1967:23): [True: 0, False: 163k]
  ------------------
 1968|   208k|    return {};
 1969|       |
 1970|   163k|  const char* pattern = in_pattern.c_str();
 1971|   163k|  std::string result2;
 1972|   163k|  std::string newpattern;
 1973|   163k|  struct hentry* rv = nullptr;
 1974|       |
 1975|       |  // search affixed forms with and without derivational suffixes
 1976|   262k|  while (true) {
  ------------------
  |  Branch (1976:10): [True: 262k, Folded]
  ------------------
 1977|   278k|    for (const auto& k : desc) {
  ------------------
  |  Branch (1977:24): [True: 278k, False: 262k]
  ------------------
 1978|   278k|      if (std::chrono::steady_clock::now() - start_time > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|   278k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1978:11): [True: 0, False: 278k]
  ------------------
 1979|      0|        return result2;
 1980|   278k|      std::string result;
 1981|       |
 1982|       |      // add compound word parts (except the last one)
 1983|   278k|      const char* s = k.c_str();
 1984|   278k|      const char* part = strstr(s, MORPH_PART);
  ------------------
  |  |  116|   278k|#define MORPH_PART "pa:"
  ------------------
 1985|   278k|      if (part) {
  ------------------
  |  Branch (1985:11): [True: 0, False: 278k]
  ------------------
 1986|      0|        const char* nextpart = strstr(part + 1, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1987|      0|        while (nextpart) {
  ------------------
  |  Branch (1987:16): [True: 0, False: 0]
  ------------------
 1988|      0|          std::string field;
 1989|      0|          copy_field(field, part, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1990|      0|          result.append(field);
 1991|      0|          part = nextpart;
 1992|      0|          nextpart = strstr(part + 1, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1993|      0|        }
 1994|      0|        s = part;
 1995|      0|      }
 1996|       |
 1997|   278k|      std::string tok(s);
 1998|   278k|      size_t pos = tok.find(" | ");
 1999|   278k|      while (pos != std::string::npos) {
  ------------------
  |  Branch (1999:14): [True: 0, False: 278k]
  ------------------
 2000|      0|        tok[pos + 1] = MSEP_ALT;
  ------------------
  |  |  123|      0|#define MSEP_ALT '\v'
  ------------------
 2001|      0|        pos = tok.find(" | ", pos);
 2002|      0|      }
 2003|   278k|      std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  123|   278k|#define MSEP_ALT '\v'
  ------------------
 2004|   278k|      for (auto& i : pl) {
  ------------------
  |  Branch (2004:20): [True: 278k, False: 278k]
  ------------------
 2005|       |        // remove inflectional and terminal suffixes
 2006|   278k|        size_t is = i.find(MORPH_INFL_SFX);
  ------------------
  |  |  110|   278k|#define MORPH_INFL_SFX "is:"
  ------------------
 2007|   278k|        if (is != std::string::npos)
  ------------------
  |  Branch (2007:13): [True: 0, False: 278k]
  ------------------
 2008|      0|          i.resize(is);
 2009|   278k|        size_t ts = i.find(MORPH_TERM_SFX);
  ------------------
  |  |  111|   278k|#define MORPH_TERM_SFX "ts:"
  ------------------
 2010|   278k|        while (ts != std::string::npos) {
  ------------------
  |  Branch (2010:16): [True: 0, False: 278k]
  ------------------
 2011|      0|          i[ts] = '_';
 2012|      0|          ts = i.find(MORPH_TERM_SFX);
  ------------------
  |  |  111|      0|#define MORPH_TERM_SFX "ts:"
  ------------------
 2013|      0|        }
 2014|   278k|        const char* st = strstr(s, MORPH_STEM);
  ------------------
  |  |  103|   278k|#define MORPH_STEM "st:"
  ------------------
 2015|   278k|        if (st) {
  ------------------
  |  Branch (2015:13): [True: 263k, False: 14.7k]
  ------------------
 2016|   263k|          copy_field(tok, st, MORPH_STEM);
  ------------------
  |  |  103|   263k|#define MORPH_STEM "st:"
  ------------------
 2017|   263k|          rv = pAMgr->lookup(tok.c_str(), tok.size());
 2018|   542k|          while (rv) {
  ------------------
  |  Branch (2018:18): [True: 279k, False: 263k]
  ------------------
 2019|   279k|            if (std::chrono::steady_clock::now() - start_time > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|   279k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (2019:17): [True: 0, False: 279k]
  ------------------
 2020|      0|              return result2;
 2021|   279k|            std::string newpat(i);
 2022|   279k|            newpat.append(pattern);
 2023|   279k|            std::string sg = suggest_hentry_gen(rv, newpat.c_str());
 2024|   279k|            if (sg.empty())
  ------------------
  |  Branch (2024:17): [True: 279k, False: 0]
  ------------------
 2025|   279k|              sg = suggest_hentry_gen(rv, pattern);
 2026|   279k|            if (!sg.empty()) {
  ------------------
  |  Branch (2026:17): [True: 0, False: 279k]
  ------------------
 2027|      0|              std::vector<std::string> gen = line_tok(sg, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2028|      0|              for (auto& j : gen) {
  ------------------
  |  Branch (2028:28): [True: 0, False: 0]
  ------------------
 2029|      0|                result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2030|      0|                result2.append(result);
 2031|      0|                if (i.find(MORPH_SURF_PFX) != std::string::npos) {
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
  |  Branch (2031:21): [True: 0, False: 0]
  ------------------
 2032|      0|                  std::string field;
 2033|      0|                  copy_field(field, i, MORPH_SURF_PFX);
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
 2034|      0|                  result2.append(field);
 2035|      0|                }
 2036|      0|                result2.append(j);
 2037|      0|              }
 2038|      0|            }
 2039|   279k|            rv = rv->next_homonym;
 2040|   279k|          }
 2041|   263k|        }
 2042|   278k|      }
 2043|   278k|    }
 2044|       |
 2045|   262k|    if (!result2.empty() || !strstr(pattern, MORPH_DERI_SFX))
  ------------------
  |  |  109|   262k|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (2045:9): [True: 0, False: 262k]
  |  Branch (2045:29): [True: 163k, False: 99.1k]
  ------------------
 2046|   163k|      break;
 2047|       |
 2048|  99.1k|    newpattern.assign(pattern);
 2049|  99.1k|    mystrrep(newpattern, MORPH_DERI_SFX, MORPH_TERM_SFX);
  ------------------
  |  |  109|  99.1k|#define MORPH_DERI_SFX "ds:"
  ------------------
                  mystrrep(newpattern, MORPH_DERI_SFX, MORPH_TERM_SFX);
  ------------------
  |  |  111|  99.1k|#define MORPH_TERM_SFX "ts:"
  ------------------
 2050|  99.1k|    pattern = newpattern.c_str();
 2051|  99.1k|  }
 2052|   163k|  return result2;
 2053|   163k|}
_ZN10SuggestMgr5ngramEiRKNSt3__16vectorI6w_charNS0_9allocatorIS2_EEEES7_i:
 2059|   667k|                      int opt) {
 2060|   667k|  int nscore = 0, ns, l1 = su1.size(), l2 = su2.size();
 2061|       |
 2062|   667k|  if (l2 == 0)
  ------------------
  |  Branch (2062:7): [True: 6.50k, False: 660k]
  ------------------
 2063|  6.50k|    return 0;
 2064|  1.01M|  for (int j = 1; j <= n; j++) {
  ------------------
  |  Branch (2064:19): [True: 964k, False: 53.0k]
  ------------------
 2065|   964k|    ns = 0;
 2066|  4.53M|    for (int i = 0; i <= (l1 - j); i++) {
  ------------------
  |  Branch (2066:21): [True: 3.57M, False: 964k]
  ------------------
 2067|  3.57M|      int k = 0;
 2068|  14.7M|      for (int l = 0; l <= (l2 - j); l++) {
  ------------------
  |  Branch (2068:23): [True: 12.3M, False: 2.41M]
  ------------------
 2069|  14.7M|        for (k = 0; k < j; k++) {
  ------------------
  |  Branch (2069:21): [True: 13.5M, False: 1.15M]
  ------------------
 2070|  13.5M|          if (su1[i + k] != su2[l + k])
  ------------------
  |  Branch (2070:15): [True: 11.2M, False: 2.33M]
  ------------------
 2071|  11.2M|            break;
 2072|  13.5M|        }
 2073|  12.3M|        if (k == j) {
  ------------------
  |  Branch (2073:13): [True: 1.15M, False: 11.2M]
  ------------------
 2074|  1.15M|          ns++;
 2075|  1.15M|          break;
 2076|  1.15M|        }
 2077|  12.3M|      }
 2078|  3.57M|      if (k != j && opt & NGRAM_WEIGHTED) {
  ------------------
  |  |   84|  2.41M|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2078:11): [True: 2.41M, False: 1.15M]
  |  Branch (2078:21): [True: 94.8k, False: 2.31M]
  ------------------
 2079|  94.8k|        ns--;
 2080|  94.8k|        if (i == 0 || i == l1 - j)
  ------------------
  |  Branch (2080:13): [True: 22.9k, False: 71.8k]
  |  Branch (2080:23): [True: 37.5k, False: 34.3k]
  ------------------
 2081|  60.4k|          ns--;  // side weight
 2082|  94.8k|      }
 2083|  3.57M|    }
 2084|   964k|    nscore = nscore + ns;
 2085|   964k|    if (ns < 2 && !(opt & NGRAM_WEIGHTED))
  ------------------
  |  |   84|   672k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2085:9): [True: 672k, False: 292k]
  |  Branch (2085:19): [True: 607k, False: 64.5k]
  ------------------
 2086|   607k|      break;
 2087|   964k|  }
 2088|       |
 2089|   660k|  ns = 0;
 2090|   660k|  if (opt & NGRAM_LONGER_WORSE)
  ------------------
  |  |   81|   660k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
  |  Branch (2090:7): [True: 270k, False: 390k]
  ------------------
 2091|   270k|    ns = (l2 - l1) - 2;
 2092|   660k|  if (opt & NGRAM_ANY_MISMATCH)
  ------------------
  |  |   82|   660k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
  |  Branch (2092:7): [True: 390k, False: 270k]
  ------------------
 2093|   390k|    ns = abs(l2 - l1) - 2;
 2094|   660k|  ns = (nscore - ((ns > 0) ? ns : 0));
  ------------------
  |  Branch (2094:19): [True: 113k, False: 547k]
  ------------------
 2095|   660k|  return ns;
 2096|   667k|}
_ZN10SuggestMgr5ngramEiRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 2102|   966k|                      int opt) {
 2103|   966k|  int nscore = 0, ns, l1, l2 = s2.size();
 2104|       |
 2105|   966k|  if (l2 == 0)
  ------------------
  |  Branch (2105:7): [True: 13.4k, False: 953k]
  ------------------
 2106|  13.4k|    return 0;
 2107|   953k|  l1 = s1.size();
 2108|  1.77M|  for (int j = 1; j <= n; j++) {
  ------------------
  |  Branch (2108:19): [True: 1.62M, False: 151k]
  ------------------
 2109|  1.62M|    ns = 0;
 2110|  11.3M|    for (int i = 0; i <= (l1 - j); i++) {
  ------------------
  |  Branch (2110:21): [True: 9.68M, False: 1.62M]
  ------------------
 2111|       |      //s2 is haystack, s1[i..i+j) is needle
 2112|  9.68M|      if (s2.find(s1.c_str()+i, 0, j) != std::string::npos) {
  ------------------
  |  Branch (2112:11): [True: 3.65M, False: 6.02M]
  ------------------
 2113|  3.65M|        ns++;
 2114|  6.02M|      } else if (opt & NGRAM_WEIGHTED) {
  ------------------
  |  |   84|  6.02M|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2114:18): [True: 398k, False: 5.63M]
  ------------------
 2115|   398k|        ns--;
 2116|   398k|        if (i == 0 || i == l1 - j)
  ------------------
  |  Branch (2116:13): [True: 45.9k, False: 353k]
  |  Branch (2116:23): [True: 124k, False: 228k]
  ------------------
 2117|   170k|          ns--;  // side weight
 2118|   398k|      }
 2119|  9.68M|    }
 2120|  1.62M|    nscore = nscore + ns;
 2121|  1.62M|    if (ns < 2 && !(opt & NGRAM_WEIGHTED))
  ------------------
  |  |   84|   955k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2121:9): [True: 955k, False: 665k]
  |  Branch (2121:19): [True: 801k, False: 154k]
  ------------------
 2122|   801k|      break;
 2123|  1.62M|  }
 2124|       |
 2125|   953k|  ns = 0;
 2126|   953k|  if (opt & NGRAM_LONGER_WORSE)
  ------------------
  |  |   81|   953k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
  |  Branch (2126:7): [True: 356k, False: 596k]
  ------------------
 2127|   356k|    ns = (l2 - l1) - 2;
 2128|   953k|  if (opt & NGRAM_ANY_MISMATCH)
  ------------------
  |  |   82|   953k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
  |  Branch (2128:7): [True: 596k, False: 356k]
  ------------------
 2129|   596k|    ns = abs(l2 - l1) - 2;
 2130|   953k|  ns = (nscore - ((ns > 0) ? ns : 0));
  ------------------
  |  Branch (2130:19): [True: 214k, False: 738k]
  ------------------
 2131|   953k|  return ns;
 2132|   966k|}
_ZN10SuggestMgr19leftcommonsubstringERKNSt3__16vectorI6w_charNS0_9allocatorIS2_EEEES7_:
 2137|   563k|    const std::vector<w_char>& su2) {
 2138|   563k|  int l1 = su1.size(), l2 = su2.size();
 2139|       |  // decapitalize dictionary word
 2140|   563k|  if (complexprefixes) {
  ------------------
  |  Branch (2140:7): [True: 0, False: 563k]
  ------------------
 2141|      0|    if (l1 && l2 && su1[l1 - 1] == su2[l2 - 1])
  ------------------
  |  Branch (2141:9): [True: 0, False: 0]
  |  Branch (2141:15): [True: 0, False: 0]
  |  Branch (2141:21): [True: 0, False: 0]
  ------------------
 2142|      0|      return 1;
 2143|   563k|  } else {
 2144|   563k|    unsigned short idx = su2.empty() ? 0 : (unsigned short)(su2[0]),
  ------------------
  |  Branch (2144:26): [True: 0, False: 563k]
  ------------------
 2145|   563k|                   otheridx = su1.empty() ? 0 : (unsigned short)(su1[0]);
  ------------------
  |  Branch (2145:31): [True: 20.1k, False: 543k]
  ------------------
 2146|   563k|    if (otheridx != idx && (otheridx != unicodetolower(idx, langnum)))
  ------------------
  |  Branch (2146:9): [True: 527k, False: 35.8k]
  |  Branch (2146:28): [True: 383k, False: 143k]
  ------------------
 2147|   383k|      return 0;
 2148|   179k|    int i;
 2149|   261k|    for (i = 1; (i < l1) && (i < l2) && (su1[i] == su2[i]);
  ------------------
  |  Branch (2149:17): [True: 250k, False: 11.0k]
  |  Branch (2149:29): [True: 238k, False: 11.3k]
  |  Branch (2149:41): [True: 81.7k, False: 157k]
  ------------------
 2150|   179k|         i++)
 2151|  81.7k|      ;
 2152|   179k|    return i;
 2153|   563k|  }
 2154|      0|  return 0;
 2155|   563k|}
_ZN10SuggestMgr19leftcommonsubstringEPKcS1_:
 2160|   765k|    const char* s2) {
 2161|   765k|  if (complexprefixes) {
  ------------------
  |  Branch (2161:7): [True: 64.6k, False: 700k]
  ------------------
 2162|  64.6k|    int l1 = strlen(s1), l2 = strlen(s2);
 2163|  64.6k|    if (l1 && l1 <= l2 && s1[l1 - 1] == s2[l2 - 1])
  ------------------
  |  Branch (2163:9): [True: 62.1k, False: 2.42k]
  |  Branch (2163:15): [True: 30.6k, False: 31.5k]
  |  Branch (2163:27): [True: 2.66k, False: 28.0k]
  ------------------
 2164|  2.66k|      return 1;
 2165|   700k|  } else if (csconv) {
  ------------------
  |  Branch (2165:14): [True: 700k, False: 0]
  ------------------
 2166|   700k|    const char* olds = s1;
 2167|       |    // decapitalise dictionary word
 2168|   700k|    if ((*s1 != *s2) && (((unsigned char)*s1) != csconv[((unsigned char)*s2)].clower))
  ------------------
  |  Branch (2168:9): [True: 633k, False: 67.0k]
  |  Branch (2168:25): [True: 446k, False: 187k]
  ------------------
 2169|   446k|      return 0;
 2170|   515k|    do {
 2171|   515k|      s1++;
 2172|   515k|      s2++;
 2173|   515k|    } while ((*s1 == *s2) && (*s1 != '\0'));
  ------------------
  |  Branch (2173:14): [True: 261k, False: 253k]
  |  Branch (2173:30): [True: 261k, False: 381]
  ------------------
 2174|   254k|    return (int)(s1 - olds);
 2175|   700k|  }
 2176|  61.9k|  return 0;
 2177|   765k|}
_ZN10SuggestMgr24commoncharacterpositionsEPKcS1_Pi:
 2181|  79.7k|                                         int* is_swap) {
 2182|  79.7k|  int num = 0, diff = 0, diffpos[2];
 2183|  79.7k|  *is_swap = 0;
 2184|  79.7k|  if (utf8) {
  ------------------
  |  Branch (2184:7): [True: 22.0k, False: 57.6k]
  ------------------
 2185|  22.0k|    std::vector<w_char> su1;
 2186|  22.0k|    std::vector<w_char> su2;
 2187|  22.0k|    int l1 = u8_u16(su1, s1), l2 = u8_u16(su2, s2);
 2188|       |
 2189|  22.0k|    if (l1 <= 0 || l2 <= 0)
  ------------------
  |  Branch (2189:9): [True: 3.72k, False: 18.3k]
  |  Branch (2189:20): [True: 0, False: 18.3k]
  ------------------
 2190|  3.72k|      return 0;
 2191|       |
 2192|       |    // decapitalize dictionary word
 2193|  18.3k|    if (complexprefixes) {
  ------------------
  |  Branch (2193:9): [True: 0, False: 18.3k]
  ------------------
 2194|      0|      su2[l2 - 1] = lower_utf(su2[l2 - 1], langnum);
 2195|  18.3k|    } else {
 2196|  18.3k|      su2[0] = lower_utf(su2[0], langnum);
 2197|  18.3k|    }
 2198|  67.5k|    for (int i = 0; (i < l1) && (i < l2); i++) {
  ------------------
  |  Branch (2198:21): [True: 54.1k, False: 13.3k]
  |  Branch (2198:33): [True: 49.1k, False: 4.97k]
  ------------------
 2199|  49.1k|      if (su1[i] == su2[i]) {
  ------------------
  |  Branch (2199:11): [True: 26.9k, False: 22.2k]
  ------------------
 2200|  26.9k|        num++;
 2201|  26.9k|      } else {
 2202|  22.2k|        if (diff < 2)
  ------------------
  |  Branch (2202:13): [True: 20.3k, False: 1.96k]
  ------------------
 2203|  20.3k|          diffpos[diff] = i;
 2204|  22.2k|        diff++;
 2205|  22.2k|      }
 2206|  49.1k|    }
 2207|  18.3k|    if ((diff == 2) && (l1 == l2) &&
  ------------------
  |  Branch (2207:9): [True: 3.88k, False: 14.4k]
  |  Branch (2207:24): [True: 1.22k, False: 2.65k]
  ------------------
 2208|  1.22k|        (su1[diffpos[0]] == su2[diffpos[1]]) &&
  ------------------
  |  Branch (2208:9): [True: 197, False: 1.02k]
  ------------------
 2209|    197|        (su1[diffpos[1]] == su2[diffpos[0]]))
  ------------------
  |  Branch (2209:9): [True: 71, False: 126]
  ------------------
 2210|     71|      *is_swap = 1;
 2211|  57.6k|  } else {
 2212|  57.6k|    size_t i;
 2213|  57.6k|    std::string t(s2);
 2214|       |    // decapitalize dictionary word
 2215|  57.6k|    if (complexprefixes) {
  ------------------
  |  Branch (2215:9): [True: 3.45k, False: 54.2k]
  ------------------
 2216|  3.45k|      size_t l2 = t.size();
 2217|  3.45k|      t[l2 - 1] = csconv[(unsigned char)t[l2 - 1]].clower;
 2218|  54.2k|    } else {
 2219|  54.2k|      mkallsmall(t, csconv);
 2220|  54.2k|    }
 2221|   295k|    for (i = 0; i < t.size() && (*(s1 + i) != 0); ++i) {
  ------------------
  |  Branch (2221:17): [True: 267k, False: 27.4k]
  |  Branch (2221:33): [True: 237k, False: 30.1k]
  ------------------
 2222|   237k|      if (*(s1 + i) == t[i]) {
  ------------------
  |  Branch (2222:11): [True: 129k, False: 108k]
  ------------------
 2223|   129k|        num++;
 2224|   129k|      } else {
 2225|   108k|        if (diff < 2)
  ------------------
  |  Branch (2225:13): [True: 71.0k, False: 37.2k]
  ------------------
 2226|  71.0k|          diffpos[diff] = i;
 2227|   108k|        diff++;
 2228|   108k|      }
 2229|   237k|    }
 2230|  57.6k|    if ((diff == 2) && (*(s1 + i) == 0) && i == t.size() &&
  ------------------
  |  Branch (2230:9): [True: 13.8k, False: 43.7k]
  |  Branch (2230:24): [True: 10.7k, False: 3.10k]
  |  Branch (2230:44): [True: 3.67k, False: 7.09k]
  ------------------
 2231|  3.67k|        (*(s1 + diffpos[0]) == t[diffpos[1]]) &&
  ------------------
  |  Branch (2231:9): [True: 610, False: 3.06k]
  ------------------
 2232|    610|        (*(s1 + diffpos[1]) == t[diffpos[0]]))
  ------------------
  |  Branch (2232:9): [True: 90, False: 520]
  ------------------
 2233|     90|      *is_swap = 1;
 2234|  57.6k|  }
 2235|  76.0k|  return num;
 2236|  79.7k|}
_ZN10SuggestMgr10bubblesortEPPcS1_Pii:
 2247|   102k|void SuggestMgr::bubblesort(char** rword, char** rword2, int* rsc, int n) {
 2248|   102k|  int m = 1;
 2249|  19.9M|  while (m < n) {
  ------------------
  |  Branch (2249:10): [True: 19.8M, False: 102k]
  ------------------
 2250|  19.8M|    int j = m;
 2251|  40.3M|    while (j > 0) {
  ------------------
  |  Branch (2251:12): [True: 40.2M, False: 28.2k]
  ------------------
 2252|  40.2M|      if (rsc[j - 1] < rsc[j]) {
  ------------------
  |  Branch (2252:11): [True: 20.4M, False: 19.8M]
  ------------------
 2253|  20.4M|        int sctmp = rsc[j - 1];
 2254|  20.4M|        char* wdtmp = rword[j - 1];
 2255|  20.4M|        rsc[j - 1] = rsc[j];
 2256|  20.4M|        rword[j - 1] = rword[j];
 2257|  20.4M|        rsc[j] = sctmp;
 2258|  20.4M|        rword[j] = wdtmp;
 2259|  20.4M|        if (rword2) {
  ------------------
  |  Branch (2259:13): [True: 19.8M, False: 602k]
  ------------------
 2260|  19.8M|          wdtmp = rword2[j - 1];
 2261|  19.8M|          rword2[j - 1] = rword2[j];
 2262|  19.8M|          rword2[j] = wdtmp;
 2263|  19.8M|        }
 2264|  20.4M|        j--;
 2265|  20.4M|      } else
 2266|  19.8M|        break;
 2267|  40.2M|    }
 2268|  19.8M|    m++;
 2269|  19.8M|  }
 2270|   102k|}
_ZN10SuggestMgr3lcsEPKcS1_PiS2_:
 2276|  89.3k|                      int* l2) {
 2277|  89.3k|  int n, m, i, j;
 2278|  89.3k|  std::vector<w_char> su;
 2279|  89.3k|  std::vector<w_char> su2;
 2280|  89.3k|  if (utf8) {
  ------------------
  |  Branch (2280:7): [True: 23.8k, False: 65.5k]
  ------------------
 2281|  23.8k|    m = u8_u16(su, s);
 2282|  23.8k|    n = u8_u16(su2, s2);
 2283|  65.5k|  } else {
 2284|  65.5k|    m = strlen(s);
 2285|  65.5k|    n = strlen(s2);
 2286|  65.5k|  }
 2287|  89.3k|  if (m <= 0 || n <= 0) {
  ------------------
  |  Branch (2287:7): [True: 8.79k, False: 80.5k]
  |  Branch (2287:17): [True: 0, False: 80.5k]
  ------------------
 2288|  8.79k|    *l1 = 0;
 2289|  8.79k|    *l2 = 0;
 2290|  8.79k|    return nullptr;
 2291|  8.79k|  }
 2292|  80.5k|  char* c = new char[(m + 1) * (n + 1)]();
 2293|  80.5k|  char* b = new char[(m + 1) * (n + 1)]();
 2294|   462k|  for (i = 1; i <= m; i++) {
  ------------------
  |  Branch (2294:15): [True: 381k, False: 80.5k]
  ------------------
 2295|  3.46M|    for (j = 1; j <= n; j++) {
  ------------------
  |  Branch (2295:17): [True: 3.08M, False: 381k]
  ------------------
 2296|  3.08M|      if (((utf8) && (su[i - 1] == su2[j - 1])) ||
  ------------------
  |  Branch (2296:12): [True: 236k, False: 2.84M]
  |  Branch (2296:22): [True: 55.7k, False: 180k]
  ------------------
 2297|  3.02M|          ((!utf8) && (s[i - 1] == s2[j - 1]))) {
  ------------------
  |  Branch (2297:12): [True: 2.84M, False: 180k]
  |  Branch (2297:23): [True: 465k, False: 2.38M]
  ------------------
 2298|   521k|        c[i * (n + 1) + j] = c[(i - 1) * (n + 1) + j - 1] + 1;
 2299|   521k|        b[i * (n + 1) + j] = LCS_UPLEFT;
 2300|  2.56M|      } else if (c[(i - 1) * (n + 1) + j] >= c[i * (n + 1) + j - 1]) {
  ------------------
  |  Branch (2300:18): [True: 1.76M, False: 791k]
  ------------------
 2301|  1.76M|        c[i * (n + 1) + j] = c[(i - 1) * (n + 1) + j];
 2302|  1.76M|        b[i * (n + 1) + j] = LCS_UP;
 2303|  1.76M|      } else {
 2304|   791k|        c[i * (n + 1) + j] = c[i * (n + 1) + j - 1];
 2305|   791k|        b[i * (n + 1) + j] = LCS_LEFT;
 2306|   791k|      }
 2307|  3.08M|    }
 2308|   381k|  }
 2309|  80.5k|  delete[] c;
 2310|  80.5k|  *l1 = m;
 2311|  80.5k|  *l2 = n;
 2312|  80.5k|  return b;
 2313|  89.3k|}
_ZN10SuggestMgr6lcslenEPKcS1_:
 2315|  89.3k|int SuggestMgr::lcslen(const char* s, const char* s2) {
 2316|  89.3k|  int m, n, len = 0;
 2317|  89.3k|  char* result = lcs(s, s2, &m, &n);
 2318|  89.3k|  if (!result)
  ------------------
  |  Branch (2318:7): [True: 8.79k, False: 80.5k]
  ------------------
 2319|  8.79k|    return 0;
 2320|  80.5k|  int i = m, j = n;
 2321|   618k|  while ((i != 0) && (j != 0)) {
  ------------------
  |  Branch (2321:10): [True: 545k, False: 73.0k]
  |  Branch (2321:22): [True: 537k, False: 7.50k]
  ------------------
 2322|   537k|    if (result[i * (n + 1) + j] == LCS_UPLEFT) {
  ------------------
  |  Branch (2322:9): [True: 217k, False: 320k]
  ------------------
 2323|   217k|      len++;
 2324|   217k|      i--;
 2325|   217k|      j--;
 2326|   320k|    } else if (result[i * (n + 1) + j] == LCS_UP) {
  ------------------
  |  Branch (2326:16): [True: 151k, False: 169k]
  ------------------
 2327|   151k|      i--;
 2328|   151k|    } else
 2329|   169k|      j--;
 2330|   537k|  }
 2331|  80.5k|  delete[] result;
 2332|  80.5k|  return len;
 2333|  89.3k|}
_ZN10SuggestMgr6lcslenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 2335|  7.38k|int SuggestMgr::lcslen(const std::string& s, const std::string& s2) {
 2336|  7.38k|  return lcslen(s.c_str(), s2.c_str());
 2337|  7.38k|}
suggestmgr.cxx:_ZN12_GLOBAL__N_115ngsuggest_guardC2EbPK7cs_infoPiPS3_:
 1156|  62.3k|      : m_nonbmp(nonbmp)
 1157|  62.3k|      , m_origconv(origconv)
 1158|  62.3k|      , m_utf8(utf8)
 1159|  62.3k|      , m_csconv(csconv)
 1160|  62.3k|    {
 1161|  62.3k|    }
suggestmgr.cxx:_ZN12_GLOBAL__N_115ngsuggest_guardD2Ev:
 1164|  62.3k|    {
 1165|  62.3k|      if (m_nonbmp) {
  ------------------
  |  Branch (1165:11): [True: 1.75k, False: 60.5k]
  ------------------
 1166|  1.75k|        *m_csconv = m_origconv;
 1167|  1.75k|        *m_utf8 = 1;
 1168|  1.75k|      }
 1169|  62.3k|    }
suggestmgr.cxx:_ZL12get_sfxcountPKc:
 1894|  1.11M|static int get_sfxcount(const char* morph) {
 1895|  1.11M|  if (!morph || !*morph)
  ------------------
  |  Branch (1895:7): [True: 558k, False: 558k]
  |  Branch (1895:17): [True: 0, False: 558k]
  ------------------
 1896|   558k|    return 0;
 1897|   558k|  int n = 0;
 1898|   558k|  const char* old = morph;
 1899|   558k|  morph = strstr(morph, MORPH_DERI_SFX);
  ------------------
  |  |  109|   558k|#define MORPH_DERI_SFX "ds:"
  ------------------
 1900|   558k|  if (!morph)
  ------------------
  |  Branch (1900:7): [True: 347k, False: 211k]
  ------------------
 1901|   347k|    morph = strstr(old, MORPH_INFL_SFX);
  ------------------
  |  |  110|   347k|#define MORPH_INFL_SFX "is:"
  ------------------
 1902|   558k|  if (!morph)
  ------------------
  |  Branch (1902:7): [True: 346k, False: 211k]
  ------------------
 1903|   346k|    morph = strstr(old, MORPH_TERM_SFX);
  ------------------
  |  |  111|   346k|#define MORPH_TERM_SFX "ts:"
  ------------------
 1904|  1.16M|  while (morph) {
  ------------------
  |  Branch (1904:10): [True: 603k, False: 558k]
  ------------------
 1905|   603k|    n++;
 1906|   603k|    old = morph;
 1907|   603k|    morph = strstr(morph + 1, MORPH_DERI_SFX);
  ------------------
  |  |  109|   603k|#define MORPH_DERI_SFX "ds:"
  ------------------
 1908|   603k|    if (!morph)
  ------------------
  |  Branch (1908:9): [True: 513k, False: 90.3k]
  ------------------
 1909|   513k|      morph = strstr(old + 1, MORPH_INFL_SFX);
  ------------------
  |  |  110|   513k|#define MORPH_INFL_SFX "is:"
  ------------------
 1910|   603k|    if (!morph)
  ------------------
  |  Branch (1910:9): [True: 513k, False: 90.5k]
  ------------------
 1911|   513k|      morph = strstr(old + 1, MORPH_TERM_SFX);
  ------------------
  |  |  111|   513k|#define MORPH_TERM_SFX "ts:"
  ------------------
 1912|   603k|  }
 1913|   558k|  return n;
 1914|  1.11M|}

_ZNK6w_charcvtEv:
   57|   207M|  {
   58|   207M|#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|   207M|    unsigned short u;
   64|   207M|    memcpy(&u, this, sizeof(unsigned short));
   65|   207M|    return u;
   66|   207M|#endif
   67|       |
   68|       |#else
   69|       |    return ((unsigned short)h << 8) | (unsigned short)l;
   70|       |#endif
   71|   207M|  }
_Zlt6w_charS_:
   73|  13.0M|  friend bool operator<(const w_char a, const w_char b) {
   74|  13.0M|    return (unsigned short)a < (unsigned short)b;
   75|  13.0M|  }
_Zeq6w_charS_:
   77|  77.9M|  friend bool operator==(const w_char a, const w_char b) {
   78|  77.9M|    return (unsigned short)a == (unsigned short)b;
   79|  77.9M|  }
_Zne6w_charS_:
   81|  75.7M|  friend bool operator!=(const w_char a, const w_char b) {
   82|  75.7M|    return !(a == b);
   83|  75.7M|  }

_Z8endswithRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_:
   40|    199|{
   41|    199|    return str.size() >= suffix.size() &&
  ------------------
  |  Branch (41:12): [True: 191, False: 8]
  ------------------
   42|    191|           str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0;
  ------------------
  |  Branch (42:12): [True: 38, False: 153]
  ------------------
   43|    199|}
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|    201|    while ((direntry = readdir(d)) != NULL)
  ------------------
  |  Branch (54:12): [True: 199, False: 2]
  ------------------
   55|    199|    {
   56|    199|        std::string entry(direntry->d_name);
   57|    199|        if (endswith(entry, ".aff"))
  ------------------
  |  Branch (57:13): [True: 38, False: 161]
  ------------------
   58|     38|            affs.push_back(std::move(entry));
   59|    199|    }
   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.17k|{
   77|  3.17k|    std::string word(data, size);
   78|  3.17k|    for (auto& dict : dictionaries)
  ------------------
  |  Branch (78:21): [True: 60.3k, False: 3.17k]
  ------------------
   79|  60.3k|    {
   80|  60.3k|        if (!dict->spell(word))
  ------------------
  |  Branch (80:13): [True: 59.9k, False: 367]
  ------------------
   81|  59.9k|            dict->suggest(word);
   82|  60.3k|    }
   83|  3.17k|    return 0;
   84|  3.17k|}

