_ZN8PfxEntryC2EP8AffixMgr:
   90|      8|    : pmyMgr(pmgr)
   91|      8|    , next(nullptr)
   92|      8|    , nexteq(nullptr)
   93|      8|    , nextne(nullptr)
   94|      8|    , flgnxt(nullptr) {}
_ZN8PfxEntry3addEPKcm:
   97|      3|std::string PfxEntry::add(const char* word, size_t len) {
   98|      3|  std::string result;
   99|      3|  if ((len > strip.size() || (len == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (99:7): [True: 3, False: 0]
  |  Branch (99:8): [True: 3, False: 0]
  |  Branch (99:31): [True: 0, False: 0]
  |  Branch (99:43): [True: 0, False: 0]
  ------------------
  100|      3|      (len >= numconds) && test_condition(word) &&
  ------------------
  |  Branch (100:7): [True: 3, False: 0]
  |  Branch (100:28): [True: 3, False: 0]
  ------------------
  101|      3|      (strip.empty() ||
  ------------------
  |  Branch (101:8): [True: 3, False: 0]
  ------------------
  102|      3|      (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|      3|    result.assign(appnd);
  105|      3|    result.append(word + strip.size());
  106|      3|  }
  107|      3|  return result;
  108|      3|}
_ZN8PfxEntry9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  213|  1.41M|                                   AffixScratch& scratch) {
  214|  1.41M|  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.41M|  int tmpl = len - appnd.size(); // length of tmpword
  222|       |
  223|  1.41M|  if (tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) {
  ------------------
  |  Branch (223:7): [True: 1.41M, False: 2.49k]
  |  Branch (223:20): [True: 2.49k, False: 0]
  |  Branch (223:33): [True: 0, False: 2.49k]
  ------------------
  224|       |    // generate new root word by removing prefix and adding
  225|       |    // back any characters that would have been stripped
  226|       |
  227|  1.41M|    std::string& tmpword = scratch.pfx_check_word;
  228|  1.41M|    tmpword.assign(strip);
  229|  1.41M|    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.41M|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (239:9): [True: 15.2k, False: 1.39M]
  ------------------
  240|  15.2k|      tmpl += strip.size();
  241|  15.2k|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (241:11): [True: 17, False: 15.2k]
  ------------------
  242|     17|        do {
  243|     17|          if (TESTAFF(he->astr, aflag, he->alen) &&
  ------------------
  |  |   99|     34|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 17]
  |  |  ------------------
  ------------------
  |  Branch (243:15): [True: 0, False: 17]
  ------------------
  244|       |              // forbid single prefixes with needaffix flag
  245|      0|              !TESTAFF(contclass, pmyMgr->get_needaffix(), contclasslen) &&
  ------------------
  |  |   99|     17|#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|     17|          he = he->next_homonym;  // check homonyms
  251|     17|        } while (he);
  ------------------
  |  Branch (251:18): [True: 0, False: 17]
  ------------------
  252|     17|      }
  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|  15.2k|      if ((opts & aeXPRODUCT)) {
  ------------------
  |  |   65|  15.2k|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (259:11): [True: 15.2k, False: 0]
  ------------------
  260|  15.2k|        he = pmyMgr->suffix_check(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|  15.2k|#define aeXPRODUCT (1 << 0)
  ------------------
  261|  15.2k|                                  scratch, FLAG_NULL, needflag, in_compound);
  ------------------
  |  |   96|  15.2k|#define FLAG_NULL 0x00
  ------------------
  262|  15.2k|        if (he)
  ------------------
  |  Branch (262:13): [True: 0, False: 15.2k]
  ------------------
  263|      0|          return he;
  264|  15.2k|      }
  265|  15.2k|    }
  266|  1.41M|  }
  267|  1.41M|  return nullptr;
  268|  1.41M|}
_ZN8PfxEntry12check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  276|  1.41M|                                      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.41M|  int tmpl = len - appnd.size(); // length of tmpword
  283|       |
  284|  1.41M|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (284:8): [True: 1.41M, False: 2.44k]
  |  Branch (284:21): [True: 2.44k, False: 0]
  |  Branch (284:34): [True: 0, False: 2.44k]
  ------------------
  285|  1.41M|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (285:7): [True: 1.36M, False: 50.2k]
  ------------------
  286|       |    // generate new root word by removing prefix and adding
  287|       |    // back any characters that would have been stripped
  288|       |
  289|  1.36M|    std::string& tmpword = scratch.pfx_check_twosfx;
  290|  1.36M|    tmpword.assign(strip);
  291|  1.36M|    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.36M|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (301:9): [True: 12.4k, False: 1.34M]
  ------------------
  302|  12.4k|      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.4k|      if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   65|  12.4k|#define aeXPRODUCT (1 << 0)
  ------------------
                    if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   73|  12.4k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (308:11): [True: 12.4k, False: 0]
  |  Branch (308:34): [True: 12.4k, False: 0]
  ------------------
  309|       |        // hash entry of root word or NULL
  310|  12.4k|        struct hentry* he = pmyMgr->suffix_check_twosfx(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|  12.4k|#define aeXPRODUCT (1 << 0)
  ------------------
  311|  12.4k|                                                        scratch, needflag);
  312|  12.4k|        if (he)
  ------------------
  |  Branch (312:13): [True: 0, False: 12.4k]
  ------------------
  313|      0|          return he;
  314|  12.4k|      }
  315|  12.4k|    }
  316|  1.36M|  }
  317|  1.41M|  return nullptr;
  318|  1.41M|}
_ZN8PfxEntry18check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  326|    719|                                         AffixScratch& scratch) {
  327|    719|  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|    719|  int tmpl = len - appnd.size(); // length of tmpword
  333|       |
  334|    719|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (334:8): [True: 719, False: 0]
  |  Branch (334:21): [True: 0, False: 0]
  |  Branch (334:34): [True: 0, False: 0]
  ------------------
  335|    719|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (335:7): [True: 639, False: 80]
  ------------------
  336|       |    // generate new root word by removing prefix and adding
  337|       |    // back any characters that would have been stripped
  338|       |
  339|    639|    std::string& tmpword = scratch.pfx_check_twosfx;
  340|    639|    tmpword.assign(strip);
  341|    639|    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|    639|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (351:9): [True: 0, False: 639]
  ------------------
  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|    639|  }
  365|    719|  return result;
  366|    719|}
_ZN8PfxEntry11check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  374|    719|                                  AffixScratch& scratch) {
  375|    719|  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|    719|  int tmpl = len - appnd.size(); // length of tmpword
  383|       |
  384|    719|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (384:8): [True: 719, False: 0]
  |  Branch (384:21): [True: 0, False: 0]
  |  Branch (384:34): [True: 0, False: 0]
  ------------------
  385|    719|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (385:7): [True: 639, False: 80]
  ------------------
  386|       |    // generate new root word by removing prefix and adding
  387|       |    // back any characters that would have been stripped
  388|       |
  389|    639|    std::string& tmpword = scratch.pfx_check_word;
  390|    639|    tmpword.assign(strip);
  391|    639|    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|    639|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (401:9): [True: 0, False: 639]
  ------------------
  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|    639|  }
  452|       |
  453|    719|  return result;
  454|    719|}
_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|     34|std::string SfxEntry::add(const char* word, size_t len) {
  468|     34|  std::string result;
  469|       |  /* make sure all conditions match */
  470|     34|  if ((len > strip.size() || (len == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (470:8): [True: 34, False: 0]
  |  Branch (470:31): [True: 0, False: 0]
  |  Branch (470:43): [True: 0, False: 0]
  ------------------
  471|     34|      (len >= numconds) && test_condition(word + len, word) &&
  ------------------
  |  Branch (471:7): [True: 34, False: 0]
  |  Branch (471:28): [True: 34, False: 0]
  ------------------
  472|     34|      (strip.empty() ||
  ------------------
  |  Branch (472:8): [True: 34, False: 0]
  ------------------
  473|     34|       (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|     34|    result.assign(word, len);
  475|       |    /* we have a match so add suffix */
  476|     34|    result.replace(len - strip.size(), std::string::npos, appnd);
  477|     34|  }
  478|     34|  return result;
  479|     34|}
_ZN8SfxEntry9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntrytttR12AffixScratch:
  621|  81.4k|                                   AffixScratch& scratch) {
  622|  81.4k|  struct hentry* he;  // hash entry pointer
  623|  81.4k|  PfxEntry* ep = ppfx;
  624|       |
  625|       |  // if this suffix is being cross checked with a prefix
  626|       |  // but it does not support cross products skip it
  627|       |
  628|  81.4k|  if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0))
  ------------------
  |  |   65|  81.4k|#define aeXPRODUCT (1 << 0)
  ------------------
                if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0))
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (628:7): [True: 0, False: 81.4k]
  |  Branch (628:41): [True: 0, False: 0]
  ------------------
  629|      0|    return nullptr;
  630|       |
  631|       |  // upon entry suffix is 0 length or already matches the end of the word.
  632|       |  // So if the remaining root word has positive length
  633|       |  // and if there are enough chars in root word and added back strip chars
  634|       |  // to meet the number of characters conditions, then test it
  635|       |
  636|  81.4k|  int tmpl = len - appnd.size(); // length of tmpword
  637|       |  // the second condition is not enough for UTF-8 strings
  638|       |  // it checked in test_condition()
  639|       |
  640|  81.4k|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (640:8): [True: 80.8k, False: 545]
  |  Branch (640:21): [True: 545, False: 0]
  |  Branch (640:34): [True: 0, False: 545]
  ------------------
  641|  80.8k|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (641:7): [True: 80.8k, False: 1]
  ------------------
  642|       |    // generate new root word by removing suffix and adding
  643|       |    // back any characters that would have been stripped or
  644|       |    // or null terminating the shorter string
  645|       |
  646|  80.8k|    std::string& tmpword = scratch.sfx_check_word;
  647|  80.8k|    tmpword.assign(word, start, tmpl);
  648|  80.8k|    if (!strip.empty()) {
  ------------------
  |  Branch (648:9): [True: 1, False: 80.8k]
  ------------------
  649|      1|      tmpword.append(strip);
  650|      1|    }
  651|       |
  652|  80.8k|    const char* beg = tmpword.c_str();
  653|  80.8k|    const char* end = beg + tmpword.size();
  654|       |
  655|       |    // now make sure all of the conditions on characters
  656|       |    // are met.  Please see the appendix at the end of
  657|       |    // this file for more info on exactly what is being
  658|       |    // tested
  659|       |
  660|       |    // if all conditions are met then check if resulting
  661|       |    // root word in the dictionary
  662|       |
  663|  80.8k|    if (test_condition(end, beg)) {
  ------------------
  |  Branch (663:9): [True: 80.8k, False: 3]
  ------------------
  664|       |#ifdef SZOSZABLYA_POSSIBLE_ROOTS
  665|       |      fprintf(stdout, "%s %s %c\n", word.c_str() + start, beg, aflag);
  666|       |#endif
  667|  80.8k|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (667:11): [True: 13, False: 80.8k]
  ------------------
  668|     13|        do {
  669|       |          // check conditional suffix (enabled by prefix)
  670|     13|          if ((TESTAFF(he->astr, aflag, he->alen) ||
  ------------------
  |  |   99|     26|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 2, False: 11]
  |  |  ------------------
  ------------------
  |  Branch (670:15): [True: 2, False: 11]
  ------------------
  671|     11|               (ep && ep->getCont() &&
  ------------------
  |  Branch (671:17): [True: 0, False: 11]
  |  Branch (671:23): [True: 0, False: 0]
  ------------------
  672|      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]
  |  |  ------------------
  ------------------
  673|      2|              (((optflags & aeXPRODUCT) == 0) ||
  ------------------
  |  |   65|      2|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (673:16): [True: 2, False: 0]
  ------------------
  674|      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 (674:17): [True: 0, False: 0]
  ------------------
  675|       |               // enabled by prefix
  676|      0|               ((contclass) &&
  ------------------
  |  Branch (676:17): [True: 0, False: 0]
  ------------------
  677|      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 (677:18): [True: 0, False: 0]
  ------------------
  678|       |              // handle cont. class
  679|      2|              ((!cclass) ||
  ------------------
  |  Branch (679:16): [True: 2, False: 0]
  ------------------
  680|      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 (680:17): [True: 0, False: 0]
  ------------------
  681|       |              // check only in compound homonyms (bad flags)
  682|      2|              (!badflag || !TESTAFF(he->astr, badflag, he->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (682:16): [True: 2, False: 0]
  |  Branch (682:28): [True: 0, False: 0]
  ------------------
  683|       |              // handle required flag
  684|      2|              ((!needflag) ||
  ------------------
  |  Branch (684:16): [True: 2, False: 0]
  ------------------
  685|      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]
  |  |  ------------------
  ------------------
  686|      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 (686:18): [True: 0, False: 0]
  ------------------
  687|      2|            return he;
  688|     11|          he = he->next_homonym;  // check homonyms
  689|     11|        } while (he);
  ------------------
  |  Branch (689:18): [True: 0, False: 11]
  ------------------
  690|     13|      }
  691|  80.8k|    }
  692|  80.8k|  }
  693|  81.4k|  return nullptr;
  694|  81.4k|}
_ZN8SfxEntry12check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntrytR12AffixScratch:
  703|  19.2k|                                      AffixScratch& scratch) {
  704|  19.2k|  PfxEntry* ep = ppfx;
  705|       |
  706|       |  // if this suffix is being cross checked with a prefix
  707|       |  // but it does not support cross products skip it
  708|       |
  709|  19.2k|  if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0)
  ------------------
  |  |   65|  19.2k|#define aeXPRODUCT (1 << 0)
  ------------------
                if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0)
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (709:7): [True: 0, False: 19.2k]
  |  Branch (709:39): [True: 0, False: 0]
  ------------------
  710|      0|    return nullptr;
  711|       |
  712|       |  // upon entry suffix is 0 length or already matches the end of the word.
  713|       |  // So if the remaining root word has positive length
  714|       |  // and if there are enough chars in root word and added back strip chars
  715|       |  // to meet the number of characters conditions, then test it
  716|       |
  717|  19.2k|  int tmpl = len - appnd.size(); // length of tmpword
  718|       |
  719|  19.2k|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (719:8): [True: 19.1k, False: 25]
  |  Branch (719:21): [True: 25, False: 0]
  |  Branch (719:34): [True: 0, False: 25]
  ------------------
  720|  19.1k|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (720:7): [True: 19.1k, False: 0]
  ------------------
  721|       |    // generate new root word by removing suffix and adding
  722|       |    // back any characters that would have been stripped or
  723|       |    // or null terminating the shorter string
  724|       |
  725|  19.1k|    std::string& tmpword = scratch.sfx_check_twosfx;
  726|  19.1k|    tmpword.assign(word, start);
  727|  19.1k|    tmpword.resize(tmpl);
  728|  19.1k|    tmpword.append(strip);
  729|  19.1k|    tmpl += strip.size();
  730|       |
  731|  19.1k|    const char* beg = tmpword.c_str();
  732|  19.1k|    const char* end = beg + tmpl;
  733|       |
  734|       |    // now make sure all of the conditions on characters
  735|       |    // are met.  Please see the appendix at the end of
  736|       |    // this file for more info on exactly what is being
  737|       |    // tested
  738|       |
  739|       |    // if all conditions are met then recall suffix_check
  740|       |
  741|  19.1k|    if (test_condition(end, beg)) {
  ------------------
  |  Branch (741:9): [True: 19.1k, False: 0]
  ------------------
  742|  19.1k|      struct hentry* he;  // hash entry pointer
  743|  19.1k|      if (ppfx) {
  ------------------
  |  Branch (743:11): [True: 0, False: 19.1k]
  ------------------
  744|       |        // handle conditional suffix
  745|      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 (745:13): [True: 0, False: 0]
  |  Branch (745:13): [True: 0, False: 0]
  ------------------
  746|      0|          he = pmyMgr->suffix_check(tmpword, 0, tmpl, 0, nullptr, scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   72|      0|#define IN_CPD_NOT 0
  ------------------
  747|      0|        else
  748|      0|          he = pmyMgr->suffix_check(tmpword, 0, tmpl, optflags, ppfx,
  749|      0|                                    scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   72|      0|#define IN_CPD_NOT 0
  ------------------
  750|  19.1k|      } else {
  751|  19.1k|        he = pmyMgr->suffix_check(tmpword, 0, tmpl, 0, nullptr, scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   72|  19.1k|#define IN_CPD_NOT 0
  ------------------
  752|  19.1k|      }
  753|  19.1k|      if (he)
  ------------------
  |  Branch (753:11): [True: 0, False: 19.1k]
  ------------------
  754|      0|        return he;
  755|  19.1k|    }
  756|  19.1k|  }
  757|  19.2k|  return nullptr;
  758|  19.2k|}
_ZN8SfxEntry15initReverseWordEv:
  869|     34|void SfxEntry::initReverseWord() {
  870|     34|  rappnd = appnd;
  871|     34|  reverseword(rappnd);
  872|     34|}
_ZN8PfxEntry14test_conditionERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  125|  2.77M|inline int PfxEntry::test_condition(const std::string& s) {
  126|  2.77M|  size_t st = 0;
  127|  2.77M|  size_t pos = std::string::npos;  // group with pos input position
  128|  2.77M|  bool neg = false;        // complementer
  129|  2.77M|  bool ingroup = false;    // character in the group
  130|  2.77M|  if (numconds == 0)
  ------------------
  |  Branch (130:7): [True: 2.84k, False: 2.77M]
  ------------------
  131|  2.84k|    return 1;
  132|  2.77M|  char* p = c.conds;
  133|  2.89M|  while (true) {
  ------------------
  |  Branch (133:10): [True: 2.89M, Folded]
  ------------------
  134|  2.89M|    switch (*p) {
  135|      0|      case '\0':
  ------------------
  |  Branch (135:7): [True: 0, False: 2.89M]
  ------------------
  136|      0|        return 1;
  137|  24.8k|      case '[': {
  ------------------
  |  Branch (137:7): [True: 24.8k, False: 2.87M]
  ------------------
  138|  24.8k|        neg = false;
  139|  24.8k|        ingroup = false;
  140|  24.8k|        p = nextchar(p);
  141|  24.8k|        pos = st;
  142|  24.8k|        break;
  143|      0|      }
  144|  24.8k|      case '^': {
  ------------------
  |  Branch (144:7): [True: 24.8k, False: 2.87M]
  ------------------
  145|  24.8k|        p = nextchar(p);
  146|  24.8k|        neg = true;
  147|  24.8k|        break;
  148|      0|      }
  149|  24.8k|      case ']': {
  ------------------
  |  Branch (149:7): [True: 24.8k, False: 2.87M]
  ------------------
  150|  24.8k|        if (bool(neg) == bool(ingroup))
  ------------------
  |  Branch (150:13): [True: 0, False: 24.8k]
  ------------------
  151|      0|          return 0;
  152|  24.8k|        pos = std::string::npos;
  153|  24.8k|        p = nextchar(p);
  154|       |        // skip the next character
  155|  24.8k|        if (!ingroup && st < s.size())
  ------------------
  |  Branch (155:13): [True: 24.8k, False: 0]
  |  Branch (155:25): [True: 23.5k, False: 1.31k]
  ------------------
  156|  23.5k|          st = (opts & aeUTF8) ? utf8_next(s, st) : st + 1;
  ------------------
  |  |   66|  23.5k|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (156:16): [True: 23.5k, False: 0]
  ------------------
  157|  24.8k|        if (st == s.size() && p)
  ------------------
  |  Branch (157:13): [True: 3.65k, False: 21.1k]
  |  Branch (157:31): [True: 0, False: 3.65k]
  ------------------
  158|      0|          return 0;  // word <= condition
  159|  24.8k|        break;
  160|  24.8k|      }
  161|  24.8k|      case '.':
  ------------------
  |  Branch (161:7): [True: 0, False: 2.89M]
  ------------------
  162|      0|        if (pos == std::string::npos) {  // dots are not metacharacters in groups: [.]
  ------------------
  |  Branch (162:13): [True: 0, False: 0]
  ------------------
  163|      0|          if (st == s.size())
  ------------------
  |  Branch (163:15): [True: 0, False: 0]
  ------------------
  164|      0|            return 0;  // dot has no character to match
  165|      0|          p = nextchar(p);
  166|       |          // skip the next character
  167|      0|          st = (opts & aeUTF8) ? utf8_next(s, st) : st + 1;
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (167:16): [True: 0, False: 0]
  ------------------
  168|      0|          break;
  169|      0|        }
  170|       |      /* FALLTHROUGH */
  171|  2.82M|      default: {
  ------------------
  |  Branch (171:7): [True: 2.82M, False: 74.4k]
  ------------------
  172|  2.82M|        if (st < s.size() && s[st] == *p) {
  ------------------
  |  Branch (172:13): [True: 2.82M, False: 2.63k]
  |  Branch (172:30): [True: 24.9k, False: 2.79M]
  ------------------
  173|  24.9k|          ++st;
  174|  24.9k|          p = nextchar(p);
  175|  24.9k|          if ((opts & aeUTF8) && (s[st - 1] & 0x80)) {  // multibyte
  ------------------
  |  |   66|  24.9k|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (175:15): [True: 24.9k, False: 0]
  |  Branch (175:34): [True: 24.9k, False: 0]
  ------------------
  176|  49.7k|            while (p && is_utf8_cont(*p)) {             // character
  ------------------
  |  Branch (176:20): [True: 49.7k, False: 0]
  |  Branch (176:25): [True: 24.9k, False: 24.8k]
  ------------------
  177|  24.9k|              if (st >= s.size() || *p != s[st]) {
  ------------------
  |  Branch (177:19): [True: 0, False: 24.9k]
  |  Branch (177:37): [True: 132, False: 24.8k]
  ------------------
  178|    132|                if (pos == std::string::npos)
  ------------------
  |  Branch (178:21): [True: 116, False: 16]
  ------------------
  179|    116|                  return 0;
  180|     16|                st = pos;
  181|     16|                break;
  182|    132|              }
  183|  24.8k|              p = nextchar(p);
  184|  24.8k|              ++st;
  185|  24.8k|            }
  186|  24.8k|            if (pos != std::string::npos && st != pos) {
  ------------------
  |  Branch (186:17): [True: 16, False: 24.8k]
  |  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.8k|          } else if (pos != std::string::npos) {
  ------------------
  |  Branch (191:22): [True: 0, False: 0]
  ------------------
  192|      0|            ingroup = true;
  193|      0|            while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (193:20): [True: 0, False: 0]
  |  Branch (193:25): [True: 0, False: 0]
  |  Branch (193:38): [True: 0, False: 0]
  ------------------
  194|      0|            }
  195|      0|          }
  196|  2.79M|        } else if (pos != std::string::npos) {  // group
  ------------------
  |  Branch (196:20): [True: 49.6k, False: 2.75M]
  ------------------
  197|  49.6k|          p = nextchar(p);
  198|  49.6k|        } else
  199|  2.75M|          return 0;
  200|  2.82M|      }
  201|  2.89M|    }
  202|   148k|    if (!p)
  ------------------
  |  Branch (202:9): [True: 24.8k, False: 124k]
  ------------------
  203|  24.8k|      return 1;
  204|   148k|  }
  205|  2.77M|}
_ZN8PfxEntry8nextcharEPc:
  110|   173k|inline char* PfxEntry::nextchar(char* p) {
  111|   173k|  if (p) {
  ------------------
  |  Branch (111:7): [True: 173k, False: 0]
  ------------------
  112|   173k|    p++;
  113|   173k|    if (opts & aeLONGCOND) {
  ------------------
  |  |   69|   173k|#define aeLONGCOND (1 << 4)
  ------------------
  |  Branch (113:9): [True: 0, False: 173k]
  ------------------
  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|   173k|    } else if (p == c.conds + MAXCONDLEN)
  ------------------
  |  |   90|   173k|#define MAXCONDLEN 20
  ------------------
  |  Branch (118:16): [True: 0, False: 173k]
  ------------------
  119|      0|      return nullptr;
  120|   173k|    return *p ? p : nullptr;
  ------------------
  |  Branch (120:12): [True: 149k, False: 24.8k]
  ------------------
  121|   173k|  }
  122|      0|  return nullptr;
  123|   173k|}
_ZN8SfxEntry14test_conditionEPKcS1_:
  496|   100k|inline int SfxEntry::test_condition(const char* st, const char* beg) {
  497|   100k|  const char* pos = nullptr;  // group with pos input position
  498|   100k|  bool neg = false;        // complementer
  499|   100k|  bool ingroup = false;    // character in the group
  500|   100k|  if (numconds == 0)
  ------------------
  |  Branch (500:7): [True: 100k, False: 3]
  ------------------
  501|   100k|    return 1;
  502|      3|  char* p = c.conds;
  503|      3|  st--;
  504|      3|  int i = 1;
  505|     17|  while (true) {
  ------------------
  |  Branch (505:10): [True: 17, Folded]
  ------------------
  506|     17|    switch (*p) {
  507|      0|      case '\0':
  ------------------
  |  Branch (507:7): [True: 0, False: 17]
  ------------------
  508|      0|        return 1;
  509|      2|      case '[':
  ------------------
  |  Branch (509:7): [True: 2, False: 15]
  ------------------
  510|      2|        p = nextchar(p);
  511|      2|        pos = st;
  512|      2|        break;
  513|      0|      case '^':
  ------------------
  |  Branch (513:7): [True: 0, False: 17]
  ------------------
  514|      0|        p = nextchar(p);
  515|      0|        neg = true;
  516|      0|        break;
  517|      2|      case ']':
  ------------------
  |  Branch (517:7): [True: 2, False: 15]
  ------------------
  518|      2|        if (!neg && !ingroup)
  ------------------
  |  Branch (518:13): [True: 2, False: 0]
  |  Branch (518:21): [True: 2, False: 0]
  ------------------
  519|      2|          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: 17]
  ------------------
  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 one character to the left. Walk back over any UTF-8
  539|       |          // continuation bytes of that character to its leading byte first,
  540|       |          // then step past it, so a single-byte match preceded by a
  541|       |          // multibyte character does not consume the multibyte character.
  542|      0|          for (; (opts & aeUTF8) && (st >= beg) && is_utf8_cont(*st); st--)
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (542:18): [True: 0, False: 0]
  |  Branch (542:37): [True: 0, False: 0]
  |  Branch (542:52): [True: 0, False: 0]
  ------------------
  543|      0|            ;
  544|      0|          st--;
  545|      0|          if (st < beg) {  // word <= condition
  ------------------
  |  Branch (545:15): [True: 0, False: 0]
  ------------------
  546|      0|            if (p)
  ------------------
  |  Branch (546:17): [True: 0, False: 0]
  ------------------
  547|      0|              return 0;
  548|      0|            else
  549|      0|              return 1;
  550|      0|          }
  551|      0|          break;
  552|      0|        }
  553|       |      /* FALLTHROUGH */
  554|     13|      default: {
  ------------------
  |  Branch (554:7): [True: 13, False: 4]
  ------------------
  555|     13|        if (*st == *p) {
  ------------------
  |  Branch (555:13): [True: 0, False: 13]
  ------------------
  556|      0|          p = nextchar(p);
  557|      0|          if ((opts & aeUTF8) && (*st & 0x80)) {
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (557:15): [True: 0, False: 0]
  |  Branch (557:34): [True: 0, False: 0]
  ------------------
  558|      0|            st--;
  559|      0|            while (p && (st >= beg)) {
  ------------------
  |  Branch (559:20): [True: 0, False: 0]
  |  Branch (559:25): [True: 0, False: 0]
  ------------------
  560|      0|              if (*p != *st) {
  ------------------
  |  Branch (560:19): [True: 0, False: 0]
  ------------------
  561|      0|                if (!pos)
  ------------------
  |  Branch (561:21): [True: 0, False: 0]
  ------------------
  562|      0|                  return 0;
  563|      0|                st = pos;
  564|      0|                break;
  565|      0|              }
  566|       |              // first byte of the UTF-8 multibyte character
  567|      0|              if (!is_utf8_cont(*p))
  ------------------
  |  Branch (567:19): [True: 0, False: 0]
  ------------------
  568|      0|                break;
  569|      0|              p = nextchar(p);
  570|      0|              st--;
  571|      0|            }
  572|      0|            if (pos && st != pos) {
  ------------------
  |  Branch (572:17): [True: 0, False: 0]
  |  Branch (572:24): [True: 0, False: 0]
  ------------------
  573|      0|              if (neg)
  ------------------
  |  Branch (573:19): [True: 0, False: 0]
  ------------------
  574|      0|                return 0;
  575|      0|              else if (i == numconds)
  ------------------
  |  Branch (575:24): [True: 0, False: 0]
  ------------------
  576|      0|                return 1;
  577|      0|              ingroup = true;
  578|      0|              while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (578:22): [True: 0, False: 0]
  |  Branch (578:27): [True: 0, False: 0]
  |  Branch (578:40): [True: 0, False: 0]
  ------------------
  579|      0|              }
  580|      0|              st--;
  581|      0|            }
  582|      0|            if (p && *p != ']')
  ------------------
  |  Branch (582:17): [True: 0, False: 0]
  |  Branch (582:22): [True: 0, False: 0]
  ------------------
  583|      0|              p = nextchar(p);
  584|      0|          } else if (pos) {
  ------------------
  |  Branch (584:22): [True: 0, False: 0]
  ------------------
  585|      0|            if (neg)
  ------------------
  |  Branch (585:17): [True: 0, False: 0]
  ------------------
  586|      0|              return 0;
  587|      0|            else if (i == numconds)
  ------------------
  |  Branch (587:22): [True: 0, False: 0]
  ------------------
  588|      0|              return 1;
  589|      0|            ingroup = true;
  590|      0|            while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (590:20): [True: 0, False: 0]
  |  Branch (590:25): [True: 0, False: 0]
  |  Branch (590:38): [True: 0, False: 0]
  ------------------
  591|      0|            }
  592|       |            // if (p && *p != ']') p = nextchar(p);
  593|      0|            st--;
  594|      0|          }
  595|      0|          if (!pos) {
  ------------------
  |  Branch (595:15): [True: 0, False: 0]
  ------------------
  596|      0|            i++;
  597|      0|            st--;
  598|      0|          }
  599|      0|          if (st < beg && p && *p != ']')
  ------------------
  |  Branch (599:15): [True: 0, False: 0]
  |  Branch (599:27): [True: 0, False: 0]
  |  Branch (599:32): [True: 0, False: 0]
  ------------------
  600|      0|            return 0;      // word <= condition
  601|     13|        } else if (pos) {  // group
  ------------------
  |  Branch (601:20): [True: 12, False: 1]
  ------------------
  602|     12|          p = nextchar(p);
  603|     12|        } else
  604|      1|          return 0;
  605|     13|      }
  606|     17|    }
  607|     14|    if (!p)
  ------------------
  |  Branch (607:9): [True: 0, False: 14]
  ------------------
  608|      0|      return 1;
  609|     14|  }
  610|      3|}
_ZN8SfxEntry8nextcharEPc:
  481|     14|inline char* SfxEntry::nextchar(char* p) {
  482|     14|  if (p) {
  ------------------
  |  Branch (482:7): [True: 14, False: 0]
  ------------------
  483|     14|    p++;
  484|     14|    if (opts & aeLONGCOND) {
  ------------------
  |  |   69|     14|#define aeLONGCOND (1 << 4)
  ------------------
  |  Branch (484:9): [True: 0, False: 14]
  ------------------
  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|     14|    } else if (p == c.conds + MAXCONDLEN)
  ------------------
  |  |   90|     14|#define MAXCONDLEN 20
  ------------------
  |  Branch (489:16): [True: 0, False: 14]
  ------------------
  490|      0|      return nullptr;
  491|     14|    return *p ? p : nullptr;
  ------------------
  |  Branch (491:12): [True: 14, False: 0]
  ------------------
  492|     14|  }
  493|      0|  return nullptr;
  494|     14|}

_ZN8PfxEntry7getNextEv:
  134|  2.78M|  inline PfxEntry* getNext() { return next; }
_ZN8SfxEntry7getNextEv:
  216|    228|  inline SfxEntry* getNext() { return next; }
_ZN8PfxEntry6getKeyEv:
  124|  67.8k|  const char* getKey() { return appnd.c_str(); }
_ZN8PfxEntry7getFlagEv:
  123|    779|  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|  49.4k|  inline PfxEntry* getNextEQ() { return nexteq; }
_ZN8PfxEntry9getNextNEEv:
  135|  17.5k|  inline PfxEntry* getNextNE() { return nextne; }
_ZN8SfxEntry6getKeyEv:
  205|   668k|  const char* getKey() { return rappnd.c_str(); }
_ZN8SfxEntry7getFlagEv:
  204|   140k|  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|   563k|  inline SfxEntry* getNextEQ() { return nexteq; }
_ZN8SfxEntry9getNextNEEv:
  217|   105k|  inline SfxEntry* getNextNE() { return nextne; }
_ZN8PfxEntry7getContEv:
  131|  4.24M|  inline const unsigned short* getCont() { return contclass; }
_ZN8PfxEntry10getContLenEv:
  132|  1.41M|  inline unsigned short getContLen() { return contclasslen; }
_ZN8SfxEntry7getContEv:
  210|   792k|  inline const unsigned short* getCont() { return contclass; }
_ZN8SfxEntry10getContLenEv:
  211|   112k|  inline unsigned short getContLen() { return contclasslen; }
_ZN8SfxEntry9getKeyLenEv:
  214|   167k|  inline int getKeyLen() { return appnd.size(); }
_ZN8SfxEntry9getFlgNxtEv:
  223|  65.4k|  inline SfxEntry* getFlgNxt() { return flgnxt; }
_ZN8SfxEntry8getAffixEv:
  212|  36.8k|  inline const char* getAffix() { return appnd.c_str(); }
_ZNK8SfxEntry10allowCrossEv:
  171|     34|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|     34|#define aeXPRODUCT (1 << 0)
  ------------------
_ZNK8PfxEntry10allowCrossEv:
   94|      3|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|      3|#define aeXPRODUCT (1 << 0)
  ------------------
_ZN8PfxEntry9getKeyLenEv:
  127|  2.31k|  inline int getKeyLen() { return appnd.size(); }
_ZN8PfxEntry9getFlgNxtEv:
  137|    771|  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|   603M|                                      const FLAG needflag) {
 1084|   603M|  struct hentry* rv = nullptr;
 1085|       |
 1086|   603M|  pfx = nullptr;
 1087|   603M|  pfxappnd = nullptr;
 1088|   603M|  sfxappnd = nullptr;
 1089|   603M|  sfxextra = 0;
 1090|       |
 1091|       |  // first handle the special case of 0 length prefixes
 1092|   603M|  PfxEntry* pe = pStart[0];
 1093|   604M|  while (pe) {
  ------------------
  |  Branch (1093:10): [True: 1.39M, False: 603M]
  ------------------
 1094|  1.39M|    if (
 1095|       |        // fogemorpheme
 1096|  1.39M|        ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   72|  1.39M|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1096:10): [True: 0, False: 1.39M]
  ------------------
 1097|  1.39M|         !(pe->getCont() &&
  ------------------
  |  Branch (1097:12): [True: 1.39M, False: 0]
  ------------------
 1098|  1.39M|           (TESTAFF(pe->getCont(), onlyincompound, pe->getContLen())))) &&
  ------------------
  |  |   99|  1.39M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1098:12): [True: 0, False: 1.39M]
  ------------------
 1099|       |        // permit prefixes in compounds
 1100|  1.39M|        ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   74|  1.39M|#define IN_CPD_END 2
  ------------------
  |  Branch (1100:10): [True: 1.39M, False: 0]
  ------------------
 1101|      0|         (pe->getCont() &&
  ------------------
  |  Branch (1101:11): [True: 0, False: 0]
  ------------------
 1102|  1.39M|          (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.39M|      rv = pe->checkword(word, start, len, in_compound, needflag, scratch);
 1105|  1.39M|      if (rv) {
  ------------------
  |  Branch (1105:11): [True: 0, False: 1.39M]
  ------------------
 1106|      0|        pfx = pe;  // BUG: pfx not stateless
 1107|      0|        return rv;
 1108|      0|      }
 1109|  1.39M|    }
 1110|  1.39M|    pe = pe->getNext();
 1111|  1.39M|  }
 1112|       |
 1113|       |  // now handle the general case
 1114|   603M|  unsigned char sp = word[start];
 1115|   603M|  PfxEntry* pptr = pStart[sp];
 1116|       |
 1117|   603M|  while (pptr) {
  ------------------
  |  Branch (1117:10): [True: 34.9k, False: 603M]
  ------------------
 1118|  34.9k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1118:9): [True: 26.1k, False: 8.76k]
  ------------------
 1119|  26.1k|      if (
 1120|       |          // fogemorpheme
 1121|  26.1k|          ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   72|  26.1k|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1121:12): [True: 0, False: 26.1k]
  ------------------
 1122|  26.1k|           !(pptr->getCont() &&
  ------------------
  |  Branch (1122:14): [True: 23.3k, False: 2.89k]
  ------------------
 1123|  23.3k|             (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen())))) &&
  ------------------
  |  |   99|  23.3k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1123:14): [True: 0, False: 23.3k]
  ------------------
 1124|       |          // permit prefixes in compounds
 1125|  26.1k|          ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   74|  26.1k|#define IN_CPD_END 2
  ------------------
  |  Branch (1125:12): [True: 26.1k, 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|  26.1k|                                        pptr->getContLen()))))) {
 1128|       |        // check prefix
 1129|  26.1k|        rv = pptr->checkword(word, start, len, in_compound, needflag, scratch);
 1130|  26.1k|        if (rv) {
  ------------------
  |  Branch (1130:13): [True: 0, False: 26.1k]
  ------------------
 1131|      0|          pfx = pptr;  // BUG: pfx not stateless
 1132|      0|          return rv;
 1133|      0|        }
 1134|  26.1k|      }
 1135|  26.1k|      pptr = pptr->getNextEQ();
 1136|  26.1k|    } else {
 1137|  8.76k|      pptr = pptr->getNextNE();
 1138|  8.76k|    }
 1139|  34.9k|  }
 1140|       |
 1141|   603M|  return nullptr;
 1142|   603M|}
_ZN8AffixMgr19prefix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1150|  16.2M|                                             const FLAG needflag) {
 1151|  16.2M|  struct hentry* rv = nullptr;
 1152|       |
 1153|  16.2M|  pfx = nullptr;
 1154|  16.2M|  sfxappnd = nullptr;
 1155|  16.2M|  sfxextra = 0;
 1156|       |
 1157|       |  // first handle the special case of 0 length prefixes
 1158|  16.2M|  PfxEntry* pe = pStart[0];
 1159|       |
 1160|  17.6M|  while (pe) {
  ------------------
  |  Branch (1160:10): [True: 1.39M, False: 16.2M]
  ------------------
 1161|  1.39M|    rv = pe->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1162|  1.39M|    if (rv)
  ------------------
  |  Branch (1162:9): [True: 0, False: 1.39M]
  ------------------
 1163|      0|      return rv;
 1164|  1.39M|    pe = pe->getNext();
 1165|  1.39M|  }
 1166|       |
 1167|       |  // now handle the general case
 1168|  16.2M|  unsigned char sp = word[start];
 1169|  16.2M|  PfxEntry* pptr = pStart[sp];
 1170|       |
 1171|  16.2M|  while (pptr) {
  ------------------
  |  Branch (1171:10): [True: 32.0k, False: 16.2M]
  ------------------
 1172|  32.0k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1172:9): [True: 23.3k, False: 8.76k]
  ------------------
 1173|  23.3k|      rv = pptr->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1174|  23.3k|      if (rv) {
  ------------------
  |  Branch (1174:11): [True: 0, False: 23.3k]
  ------------------
 1175|      0|        pfx = pptr;
 1176|      0|        return rv;
 1177|      0|      }
 1178|  23.3k|      pptr = pptr->getNextEQ();
 1179|  23.3k|    } else {
 1180|  8.76k|      pptr = pptr->getNextNE();
 1181|  8.76k|    }
 1182|  32.0k|  }
 1183|       |
 1184|  16.2M|  return nullptr;
 1185|  16.2M|}
_ZN8AffixMgr18prefix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1193|  13.6k|                                         const FLAG needflag) {
 1194|       |
 1195|  13.6k|  std::string result;
 1196|       |
 1197|  13.6k|  pfx = nullptr;
 1198|  13.6k|  sfxappnd = nullptr;
 1199|  13.6k|  sfxextra = 0;
 1200|       |
 1201|       |  // first handle the special case of 0 length prefixes
 1202|  13.6k|  PfxEntry* pe = pStart[0];
 1203|  14.3k|  while (pe) {
  ------------------
  |  Branch (1203:10): [True: 719, False: 13.6k]
  ------------------
 1204|    719|    std::string st = pe->check_morph(word, start, len, in_compound, needflag, scratch);
 1205|    719|    if (!st.empty()) {
  ------------------
  |  Branch (1205:9): [True: 0, False: 719]
  ------------------
 1206|      0|      result.append(st);
 1207|      0|    }
 1208|    719|    pe = pe->getNext();
 1209|    719|  }
 1210|       |
 1211|       |  // now handle the general case
 1212|  13.6k|  unsigned char sp = word[start];
 1213|  13.6k|  PfxEntry* pptr = pStart[sp];
 1214|       |
 1215|  13.6k|  while (pptr) {
  ------------------
  |  Branch (1215:10): [True: 2, False: 13.6k]
  ------------------
 1216|      2|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1216:9): [True: 0, False: 2]
  ------------------
 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|      2|    } else {
 1229|      2|      pptr = pptr->getNextNE();
 1230|      2|    }
 1231|      2|  }
 1232|       |
 1233|  13.6k|  return result;
 1234|  13.6k|}
_ZN8AffixMgr25prefix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1242|  4.24k|                                                const FLAG needflag) {
 1243|  4.24k|  std::string result;
 1244|       |
 1245|  4.24k|  pfx = nullptr;
 1246|  4.24k|  sfxappnd = nullptr;
 1247|  4.24k|  sfxextra = 0;
 1248|       |
 1249|       |  // first handle the special case of 0 length prefixes
 1250|  4.24k|  PfxEntry* pe = pStart[0];
 1251|  4.96k|  while (pe) {
  ------------------
  |  Branch (1251:10): [True: 719, False: 4.24k]
  ------------------
 1252|    719|    std::string st = pe->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1253|    719|    if (!st.empty()) {
  ------------------
  |  Branch (1253:9): [True: 0, False: 719]
  ------------------
 1254|      0|      result.append(st);
 1255|      0|    }
 1256|    719|    pe = pe->getNext();
 1257|    719|  }
 1258|       |
 1259|       |  // now handle the general case
 1260|  4.24k|  unsigned char sp = word[start];
 1261|  4.24k|  PfxEntry* pptr = pStart[sp];
 1262|       |
 1263|  4.25k|  while (pptr) {
  ------------------
  |  Branch (1263:10): [True: 2, False: 4.24k]
  ------------------
 1264|      2|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1264:9): [True: 0, False: 2]
  ------------------
 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|      2|    } else {
 1272|      2|      pptr = pptr->getNextNE();
 1273|      2|    }
 1274|      2|  }
 1275|       |
 1276|  4.24k|  return result;
 1277|  4.24k|}
_ZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1553|    388|short AffixMgr::get_syllable(const std::string& word) {
 1554|    388|  if (cpdmaxsyllable == 0)
  ------------------
  |  Branch (1554:7): [True: 0, False: 388]
  ------------------
 1555|      0|    return 0;
 1556|       |
 1557|    388|  short num = 0;
 1558|       |
 1559|    388|  if (!utf8) {
  ------------------
  |  Branch (1559:7): [True: 0, False: 388]
  ------------------
 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|    388|  } else if (!cpdvowels_utf16.empty()) {
  ------------------
  |  Branch (1564:14): [True: 388, False: 0]
  ------------------
 1565|    388|    std::vector<w_char> w;
 1566|    388|    u8_u16(w, word);
 1567|    388|    num = (short)std::count_if(w.begin(), w.end(),
 1568|    388|          [&](w_char wc) {
 1569|    388|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1570|    388|          });
 1571|    388|  }
 1572|       |
 1573|    388|  return num;
 1574|    388|}
_ZN8AffixMgr10setcminmaxEPmS0_PKcm:
 1576|  21.9M|void AffixMgr::setcminmax(size_t* cmin, size_t* cmax, const char* word, size_t len) {
 1577|  21.9M|  if (utf8) {
  ------------------
  |  Branch (1577:7): [True: 1.70M, False: 20.2M]
  ------------------
 1578|  1.70M|    int i;
 1579|  5.10M|    for (*cmin = 0, i = 0; (i < cpdmin) && *cmin < len; i++) {
  ------------------
  |  Branch (1579:28): [True: 3.41M, False: 1.68M]
  |  Branch (1579:44): [True: 3.39M, False: 24.4k]
  ------------------
 1580|  3.86M|      for ((*cmin)++; *cmin < len && is_utf8_cont(word[*cmin]); (*cmin)++)
  ------------------
  |  Branch (1580:23): [True: 3.82M, False: 42.5k]
  |  Branch (1580:38): [True: 473k, False: 3.34M]
  ------------------
 1581|   473k|        ;
 1582|  3.39M|    }
 1583|  3.41M|    for (*cmax = len, i = 0; (i < (cpdmin - 1)) && *cmax > 0; i++) {
  ------------------
  |  Branch (1583:30): [True: 1.70M, False: 1.70M]
  |  Branch (1583:52): [True: 1.70M, False: 2.82k]
  ------------------
 1584|  2.86M|      for ((*cmax)--; *cmax > 0 && is_utf8_cont(word[*cmax]); (*cmax)--)
  ------------------
  |  Branch (1584:23): [True: 2.84M, False: 21.6k]
  |  Branch (1584:36): [True: 1.15M, False: 1.68M]
  ------------------
 1585|  1.15M|        ;
 1586|  1.70M|    }
 1587|  20.2M|  } else {
 1588|  20.2M|    *cmin = cpdmin;
 1589|  20.2M|    *cmax = len - cpdmin + 1;
 1590|  20.2M|  }
 1591|  21.9M|}
_ZN8AffixMgr14compound_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEssssPP6hentrySB_ccPiR12AffixScratch:
 1605|  21.9M|                                        AffixScratch& scratch) {
 1606|  21.9M|  short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2;
 1607|  21.9M|  hentry *rv = nullptr, *rv_first;
 1608|  21.9M|  std::string st;
 1609|  21.9M|  char ch = '\0', affixed;
 1610|  21.9M|  size_t cmin, cmax;
 1611|  21.9M|  int striple = 0, soldi = 0, oldcmin = 0, oldcmax = 0, oldlen = 0, checkedstriple = 0;
 1612|  21.9M|  hentry** oldwords = words;
 1613|  21.9M|  size_t scpd = 0, len = word.size();
 1614|       |
 1615|       |  // protect subsequent words[wnum + 1] reads and any recursion
 1616|  21.9M|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (1616:7): [True: 0, False: 21.9M]
  ------------------
 1617|      0|    return nullptr;
 1618|       |
 1619|  21.9M|  int checked_prefix;
 1620|       |
 1621|       |  // add a time limit to handle possible
 1622|       |  // combinatorical explosion of the overlapping words
 1623|       |
 1624|  21.9M|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  21.9M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1625|  21.9M|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  21.9M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1626|       |
 1627|       |  // get the current time
 1628|  21.9M|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 1629|       |
 1630|  21.9M|  if (wnum == 0) {
  ------------------
  |  Branch (1630:7): [True: 21.9M, False: 120]
  ------------------
 1631|       |      // set the start time
 1632|  21.9M|      clock_time_start = clock_now;
 1633|  21.9M|      timelimit_exceeded = false;
 1634|  21.9M|  }
 1635|    120|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  106|    120|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1635:12): [True: 0, False: 120]
  ------------------
 1636|      0|      timelimit_exceeded = true;
 1637|       |
 1638|  21.9M|  setcminmax(&cmin, &cmax, word.c_str(), len);
 1639|       |
 1640|  21.9M|  st.assign(word);
 1641|       |
 1642|   579M|  for (size_t i = cmin; i < cmax; ++i) {
  ------------------
  |  Branch (1642:25): [True: 558M, False: 21.1M]
  ------------------
 1643|       |    // go to end of the UTF-8 character
 1644|   558M|    if (utf8) {
  ------------------
  |  Branch (1644:9): [True: 39.3M, False: 518M]
  ------------------
 1645|  49.1M|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (1645:14): [True: 9.77M, False: 39.3M]
  ------------------
 1646|  9.77M|        ;
 1647|  39.3M|      if (i >= cmax)
  ------------------
  |  Branch (1647:11): [True: 187k, False: 39.1M]
  ------------------
 1648|   187k|        return nullptr;
 1649|  39.3M|    }
 1650|       |
 1651|   557M|    words = oldwords;
 1652|   557M|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (1652:23): [True: 0, False: 557M]
  ------------------
 1653|       |
 1654|   557M|    do {  // onlycpdrule loop
 1655|       |
 1656|   557M|      oldnumsyllable = numsyllable;
 1657|   557M|      oldwordnum = wordnum;
 1658|   557M|      checked_prefix = 0;
 1659|       |
 1660|   557M|      do {  // simplified checkcompoundpattern loop
 1661|       |
 1662|   557M|        if (timelimit_exceeded ||
  ------------------
  |  Branch (1662:13): [True: 0, False: 557M]
  |  Branch (1662:13): [True: 0, False: 557M]
  ------------------
 1663|   557M|            std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  106|   557M|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1663:13): [True: 0, False: 557M]
  ------------------
 1664|      0|          timelimit_exceeded = true;
 1665|      0|          return nullptr;
 1666|      0|        }
 1667|       |
 1668|   557M|        if (scpd > 0) {
  ------------------
  |  Branch (1668:13): [True: 0, False: 557M]
  ------------------
 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|   557M|        if (i >= st.size())
  ------------------
  |  Branch (1696:13): [True: 664k, False: 557M]
  ------------------
 1697|   664k|          return nullptr;
 1698|       |
 1699|   557M|        ch = st[i];
 1700|   557M|        st[i] = '\0';
 1701|       |
 1702|   557M|        sfx = nullptr;
 1703|   557M|        pfx = nullptr;
 1704|       |
 1705|       |        // FIRST WORD
 1706|       |
 1707|   557M|        affixed = 1;
 1708|   557M|        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|   557M|        if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (1712:13): [True: 1.88M, False: 555M]
  |  Branch (1712:21): [True: 98.4k, False: 1.78M]
  ------------------
 1713|  98.4k|                TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule) {
  ------------------
  |  |   99|   557M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 98.4k]
  |  |  ------------------
  ------------------
  |  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|   559M|        while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1733:16): [True: 1.88M, False: 557M]
  |  Branch (1733:24): [True: 1.88M, False: 149]
  ------------------
 1734|  1.88M|               ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |   99|   597k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 597k]
  |  |  ------------------
  ------------------
  |  Branch (1734:18): [True: 597k, False: 1.29M]
  ------------------
 1735|  1.88M|                !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (1735:20): [True: 1.88M, False: 0]
  |  Branch (1735:36): [True: 1.88M, False: 0]
  |  Branch (1735:46): [True: 1.88M, False: 0]
  ------------------
 1736|  1.88M|                   TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|  1.88M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 164, False: 1.88M]
  |  |  ------------------
  ------------------
 1737|  1.88M|                  (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (1737:20): [True: 0, False: 1.88M]
  |  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|  1.88M|                  (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (1739:20): [True: 0, False: 1.88M]
  |  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|  1.88M|                  (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (1741:20): [True: 0, False: 1.88M]
  |  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|    164|                (scpd != 0 && checkcpdtable[scpd - 1].cond != FLAG_NULL &&
  ------------------
  |  |   96|    164|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1746:18): [True: 0, False: 164]
  |  Branch (1746:31): [True: 0, False: 0]
  ------------------
 1747|  1.88M|                 !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|  1.88M|          rv = rv->next_homonym;
 1749|  1.88M|        }
 1750|       |
 1751|   557M|        if (rv)
  ------------------
  |  Branch (1751:13): [True: 313, False: 557M]
  ------------------
 1752|    313|          affixed = 0;
 1753|       |
 1754|   557M|        if (!rv) {
  ------------------
  |  Branch (1754:13): [True: 557M, False: 313]
  ------------------
 1755|   557M|          if (onlycpdrule)
  ------------------
  |  Branch (1755:15): [True: 0, False: 557M]
  ------------------
 1756|      0|            break;
 1757|   557M|          if (compoundflag &&
  ------------------
  |  Branch (1757:15): [True: 557M, False: 0]
  ------------------
 1758|   557M|              !(rv = prefix_check(st, 0, i,
  ------------------
  |  Branch (1758:15): [True: 557M, False: 0]
  ------------------
 1759|   557M|                                  hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   75|  71.2k|#define IN_CPD_OTHER 3
  ------------------
                                                hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   73|  1.11G|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1759:35): [True: 71.2k, False: 557M]
  ------------------
 1760|   557M|                                  scratch, compoundflag))) {
 1761|   557M|            if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   96|   557M|#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|  71.2k|#define IN_CPD_OTHER 3
  ------------------
                          if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   73|  1.11G|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1761:18): [True: 0, False: 557M]
  |  Branch (1761:93): [True: 71.2k, False: 557M]
  ------------------
 1762|   557M|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (1762:19): [True: 0, False: 557M]
  |  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|   557M|          }
 1769|       |
 1770|   557M|          if (rv ||
  ------------------
  |  Branch (1770:15): [True: 0, False: 557M]
  ------------------
 1771|   557M|              (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (1771:17): [True: 557M, False: 72.0k]
  |  Branch (1771:35): [True: 0, False: 557M]
  ------------------
 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|   557M|               ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (1776:17): [True: 612, False: 557M]
  |  Branch (1776:34): [True: 0, False: 612]
  ------------------
 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|   557M|        } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|    406|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 203]
  |  |  ------------------
  ------------------
  |  Branch (1783:20): [True: 203, False: 110]
  |  Branch (1783:20): [True: 1, False: 312]
  ------------------
 1784|    203|                                TESTAFF(rv->astr, needaffix, rv->alen) ||
  ------------------
  |  |   99|    406|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 203]
  |  |  ------------------
  ------------------
 1785|    203|                                TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|    406|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 1, False: 202]
  |  |  ------------------
  ------------------
 1786|    202|                                (is_sug && nosuggest &&
  ------------------
  |  Branch (1786:34): [True: 0, False: 202]
  |  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|   557M|        if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1794:13): [True: 312, False: 557M]
  |  Branch (1794:21): [True: 164, False: 148]
  ------------------
 1795|    164|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1795:15): [True: 0, False: 164]
  |  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|    164|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1797:15): [True: 0, False: 164]
  |  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|    164|                      sfx->getContLen())))) {
 1800|      0|          rv = nullptr;
 1801|      0|        }
 1802|       |
 1803|       |        // check compoundend flag in suffix and prefix
 1804|   557M|        if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (1804:13): [True: 312, False: 557M]
  |  Branch (1804:21): [True: 312, False: 0]
  |  Branch (1804:40): [True: 0, False: 312]
  |  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|   557M|        if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (1813:13): [True: 312, False: 557M]
  |  Branch (1813:21): [True: 312, False: 0]
  |  Branch (1813:40): [True: 164, False: 148]
  |  Branch (1813:58): [True: 0, False: 164]
  ------------------
 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|   557M|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1823:13): [True: 312, False: 557M]
  |  Branch (1823:13): [True: 0, False: 557M]
  |  Branch (1823:21): [True: 202, False: 110]
  ------------------
 1824|    202|            (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |   99|    404|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 202]
  |  |  ------------------
  ------------------
 1825|    202|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|    404|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 202]
  |  |  ------------------
  ------------------
 1826|    202|             (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: 202]
  |  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|   557M|        if ((rv) && compoundroot &&
  ------------------
  |  Branch (1831:13): [True: 312, False: 557M]
  |  Branch (1831:21): [True: 0, False: 312]
  ------------------
 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|   557M|        if (((rv) &&
  ------------------
  |  Branch (1837:13): [True: 202, False: 557M]
  |  Branch (1837:14): [True: 312, False: 557M]
  ------------------
 1838|    312|             (checked_prefix || (words && words[wnum]) ||
  ------------------
  |  Branch (1838:15): [True: 0, False: 312]
  |  Branch (1838:34): [True: 0, False: 312]
  |  Branch (1838:43): [True: 0, False: 0]
  ------------------
 1839|    312|              (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|    312|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 202, False: 110]
  |  |  ------------------
  ------------------
  |  Branch (1839:16): [True: 312, False: 0]
  ------------------
 1840|    110|              ((oldwordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (1840:16): [True: 0, False: 110]
  |  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|    110|              ((oldwordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (1842:16): [True: 0, False: 110]
  |  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|    110|              || ((langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (1846:19): [True: 110, False: 0]
  |  Branch (1846:43): [True: 110, False: 0]
  ------------------
 1847|    110|                  (TESTAFF(
  ------------------
  |  |   99|    220|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 110]
  |  |  ------------------
  ------------------
 1848|    110|                       rv->astr, 'F',
 1849|    110|                       rv->alen) ||  // XXX hardwired Hungarian dictionary codes
 1850|    110|                   TESTAFF(rv->astr, 'G', rv->alen) ||
  ------------------
  |  |   99|    220|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 110]
  |  |  ------------------
  ------------------
 1851|    110|                   TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |   99|    110|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 110]
  |  |  ------------------
  ------------------
 1852|       |              // END of LANG_hu section
 1853|    312|              ) &&
 1854|    202|             (
 1855|       |                 // test CHECKCOMPOUNDPATTERN conditions
 1856|    202|                 scpd == 0 || checkcpdtable[scpd - 1].cond == FLAG_NULL ||
  ------------------
  |  |   96|    202|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1856:18): [True: 202, 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|    202|             !((checkcompoundtriple && scpd == 0 &&
  ------------------
  |  Branch (1858:17): [True: 0, False: 202]
  |  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|    202|               (checkcompoundcase && scpd == 0 && !words && i < word.size() &&
  ------------------
  |  Branch (1864:17): [True: 0, False: 202]
  |  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|   557M|            || ((!rv) && (langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (1867:17): [True: 557M, False: 110]
  |  Branch (1867:26): [True: 39.1M, False: 518M]
  |  Branch (1867:50): [True: 71.2k, False: 39.0M]
  ------------------
 1868|  71.2k|                (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (1868:17): [True: 0, False: 71.2k]
  ------------------
 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|    202|                         sfx->getContLen()))))) {  // first word is ok condition
 1876|       |
 1877|       |          // LANG_hu section: spec. Hungarian rule
 1878|    202|          if (langnum == LANG_hu) {
  ------------------
  |  Branch (1878:15): [True: 194, False: 8]
  ------------------
 1879|       |            // calculate syllable number of the word
 1880|    194|            numsyllable += get_syllable(st.substr(0, i));
 1881|       |            // + 1 word, if syllable number of the prefix > 1 (hungarian
 1882|       |            // convention)
 1883|    194|            if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (1883:17): [True: 0, False: 194]
  |  Branch (1883:17): [True: 0, False: 194]
  |  Branch (1883:24): [True: 0, False: 0]
  ------------------
 1884|      0|              wordnum++;
 1885|    194|          }
 1886|       |          // END of LANG_hu section
 1887|       |
 1888|       |          // NEXT WORD(S)
 1889|    202|          rv_first = rv;
 1890|    202|          st[i] = ch;
 1891|       |
 1892|    202|          do {  // striple loop
 1893|       |
 1894|       |            // check simplifiedtriple
 1895|    202|            if (simplifiedtriple) {
  ------------------
  |  Branch (1895:17): [True: 0, False: 202]
  ------------------
 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|    202|            rv = lookup(st.c_str() + i, st.size() - i);  // perhaps without prefix
 1904|       |
 1905|       |            // search homonym with compound flag
 1906|    202|            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: 202]
  |  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|    202|            if (rv && forceucase &&
  ------------------
  |  Branch (1916:17): [True: 0, False: 202]
  |  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|    202|            if (rv && words && words[wnum + 1])
  ------------------
  |  Branch (1921:17): [True: 0, False: 202]
  |  Branch (1921:23): [True: 0, False: 0]
  |  Branch (1921:32): [True: 0, False: 0]
  ------------------
 1922|      0|              return rv_first;
 1923|       |
 1924|    202|            oldnumsyllable2 = numsyllable;
 1925|    202|            oldwordnum2 = wordnum;
 1926|       |
 1927|       |            // LANG_hu section: spec. Hungarian rule, XXX hardwired dictionary
 1928|       |            // code
 1929|    202|            if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (1929:17): [True: 0, False: 202]
  |  Branch (1929:17): [True: 0, False: 202]
  |  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|    202|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (1937:17): [True: 0, False: 202]
  |  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|    202|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1943:17): [True: 0, False: 202]
  |  Branch (1943:17): [True: 0, False: 202]
  |  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|    202|            if ((rv) &&
  ------------------
  |  Branch (1955:17): [True: 0, False: 202]
  |  Branch (1955:17): [True: 0, False: 202]
  ------------------
 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|    202|            numsyllable = oldnumsyllable2;
 1980|    202|            wordnum = oldwordnum2;
 1981|       |
 1982|       |            // perhaps second word has prefix or/and suffix
 1983|    202|            sfx = nullptr;
 1984|    202|            sfxflag = FLAG_NULL;
  ------------------
  |  |   96|    202|#define FLAG_NULL 0x00
  ------------------
 1985|    202|            rv = (compoundflag && !onlycpdrule && i < word.size()) ? affix_check(word, i, word.size() - i, scratch, compoundflag, IN_CPD_END)
  ------------------
  |  |   74|    202|#define IN_CPD_END 2
  ------------------
  |  Branch (1985:19): [True: 202, False: 0]
  |  Branch (1985:35): [True: 202, False: 0]
  |  Branch (1985:51): [True: 202, False: 0]
  ------------------
 1986|    202|                                                                   : nullptr;
 1987|    202|            if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (1987:17): [True: 202, False: 0]
  |  Branch (1987:24): [True: 0, False: 202]
  |  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|    202|            if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (1994:17): [True: 202, False: 0]
  |  Branch (1994:24): [True: 0, False: 202]
  |  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|    202|            if (rv &&
  ------------------
  |  Branch (2003:17): [True: 0, False: 202]
  ------------------
 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|    202|            if (rv && !checkcpdtable.empty() && scpd == 0 &&
  ------------------
  |  Branch (2009:17): [True: 0, False: 202]
  |  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|    202|            if ((rv) && ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2014:17): [True: 0, False: 202]
  |  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|    202|            if (rv && forceucase &&
  ------------------
  |  Branch (2024:17): [True: 0, False: 202]
  |  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|    202|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2030:17): [True: 0, False: 202]
  |  Branch (2030:17): [True: 0, False: 202]
  |  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|    202|            if (langnum == LANG_hu) {
  ------------------
  |  Branch (2042:17): [True: 194, False: 8]
  ------------------
 2043|    194|              if (i < word.size()) {
  ------------------
  |  Branch (2043:19): [True: 194, False: 0]
  ------------------
 2044|       |                // calculate syllable number of the word
 2045|    194|                numsyllable += get_syllable(word.substr(i));
 2046|    194|              }
 2047|       |
 2048|       |              // - affix syllable num.
 2049|       |              // XXX only second suffix (inflections, not derivations)
 2050|    194|              if (sfxappnd) {
  ------------------
  |  Branch (2050:19): [True: 0, False: 194]
  ------------------
 2051|      0|                std::string tmp(sfxappnd);
 2052|      0|                reverseword(tmp);
 2053|      0|                numsyllable -= short(get_syllable(tmp) + sfxextra);
 2054|    194|              } else {
 2055|    194|                numsyllable -= short(sfxextra);
 2056|    194|              }
 2057|       |
 2058|       |              // + 1 word, if syllable number of the prefix > 1 (hungarian
 2059|       |              // convention)
 2060|    194|              if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2060:19): [True: 0, False: 194]
  |  Branch (2060:19): [True: 0, False: 194]
  |  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|    194|              if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2066:19): [True: 0, False: 194]
  ------------------
 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|    194|            }
 2084|       |
 2085|       |            // increment word number, if the second word has a compoundroot flag
 2086|    202|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2086:17): [True: 0, False: 202]
  |  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|    202|            if ((rv) &&
  ------------------
  |  Branch (2094:17): [True: 0, False: 202]
  ------------------
 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|    202|            numsyllable = oldnumsyllable2;
 2107|    202|            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|    202|            if ((!info || !(*info & SPELL_COMPOUND_2)) && wordnum + 2 < maxwordnum && wnum + 1 < maxwordnum) {
  ------------------
  |  |   85|    202|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (2111:18): [True: 0, False: 202]
  |  Branch (2111:27): [True: 120, False: 82]
  |  Branch (2111:59): [True: 120, False: 0]
  |  Branch (2111:87): [True: 120, False: 0]
  ------------------
 2112|    120|              rv = compound_check(st.substr(i), wordnum + 1,
 2113|    120|                                  numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2114|    120|                                  is_sug, info, scratch);
 2115|       |
 2116|    120|              if (rv && !checkcpdtable.empty() && i < word.size() &&
  ------------------
  |  Branch (2116:19): [True: 0, False: 120]
  |  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|    120|            } else {
 2123|     82|              rv = nullptr;
 2124|     82|            }
 2125|    202|            if (rv) {
  ------------------
  |  Branch (2125:17): [True: 0, False: 202]
  ------------------
 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|    202|          } while (striple && !checkedstriple);  // end of striple loop
  ------------------
  |  Branch (2162:20): [True: 0, False: 202]
  |  Branch (2162:31): [True: 0, False: 0]
  ------------------
 2163|       |
 2164|    202|          if (checkedstriple) {
  ------------------
  |  Branch (2164:15): [True: 0, False: 202]
  ------------------
 2165|      0|            i++;
 2166|      0|            checkedstriple = 0;
 2167|      0|            striple = 0;
 2168|      0|          }
 2169|       |
 2170|    202|        }  // first word is ok condition
 2171|       |
 2172|   557M|        if (soldi != 0) {
  ------------------
  |  Branch (2172:13): [True: 0, False: 557M]
  ------------------
 2173|      0|          i = soldi;
 2174|      0|          soldi = 0;
 2175|      0|          len = oldlen;
 2176|      0|          cmin = oldcmin;
 2177|      0|          cmax = oldcmax;
 2178|      0|        }
 2179|   557M|        scpd++;
 2180|       |
 2181|   557M|      } while (!onlycpdrule && simplifiedcpd &&
  ------------------
  |  Branch (2181:16): [True: 557M, False: 0]
  |  Branch (2181:32): [True: 0, False: 557M]
  ------------------
 2182|      0|               scpd <= checkcpdtable.size());  // end of simplifiedcpd loop
  ------------------
  |  Branch (2182:16): [True: 0, False: 0]
  ------------------
 2183|       |
 2184|   557M|      scpd = 0;
 2185|   557M|      wordnum = oldwordnum;
 2186|   557M|      numsyllable = oldnumsyllable;
 2187|       |
 2188|   557M|      if (soldi != 0) {
  ------------------
  |  Branch (2188:11): [True: 0, False: 557M]
  ------------------
 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|   557M|        st[i] = ch;
 2197|       |
 2198|   557M|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2198:14): [True: 0, False: 557M]
  |  Branch (2198:38): [True: 0, False: 0]
  ------------------
 2199|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2199:14): [True: 0, False: 0]
  ------------------
 2200|   557M|  }
 2201|       |
 2202|  21.1M|  return nullptr;
 2203|  21.9M|}
_ZN8AffixMgr20compound_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEssssPP6hentrySB_cRS6_PS7_R12AffixScratch:
 2217|  2.05k|                                   AffixScratch& scratch) {
 2218|  2.05k|  short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2;
 2219|  2.05k|  hentry *rv = nullptr, *rv_first;
 2220|  2.05k|  std::string st, presult;
 2221|  2.05k|  char ch, affixed = 0;
 2222|  2.05k|  int checked_prefix, ok = 0;
 2223|  2.05k|  size_t cmin, cmax;
 2224|  2.05k|  hentry** oldwords = words;
 2225|  2.05k|  size_t len = word.size();
 2226|       |
 2227|       |  // protect subsequent words[wnum + 1] reads and any recursion
 2228|  2.05k|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (2228:7): [True: 0, False: 2.05k]
  ------------------
 2229|      0|    return 0;
 2230|       |
 2231|       |  // add a time limit to handle possible
 2232|       |  // combinatorical explosion of the overlapping words
 2233|       |
 2234|  2.05k|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  2.05k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2235|  2.05k|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  2.05k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2236|       |
 2237|       |  // get the current time
 2238|  2.05k|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 2239|       |
 2240|  2.05k|  if (wnum == 0) {
  ------------------
  |  Branch (2240:7): [True: 2.05k, False: 0]
  ------------------
 2241|       |      // set the start time
 2242|  2.05k|      clock_time_start = clock_now;
 2243|  2.05k|      timelimit_exceeded = false;
 2244|  2.05k|  }
 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.05k|  setcminmax(&cmin, &cmax, word.c_str(), len);
 2249|       |
 2250|  2.05k|  st.assign(word);
 2251|       |
 2252|  25.7k|  for (size_t i = cmin; i < cmax; ++i) {
  ------------------
  |  Branch (2252:25): [True: 23.9k, False: 1.82k]
  ------------------
 2253|       |    // go to end of the UTF-8 character
 2254|  23.9k|    if (utf8) {
  ------------------
  |  Branch (2254:9): [True: 8.92k, False: 15.0k]
  ------------------
 2255|  9.95k|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (2255:14): [True: 1.03k, False: 8.92k]
  ------------------
 2256|  1.03k|        ;
 2257|  8.92k|      if (i >= cmax)
  ------------------
  |  Branch (2257:11): [True: 75, False: 8.84k]
  ------------------
 2258|     75|        return 0;
 2259|  8.92k|    }
 2260|       |
 2261|  23.8k|    words = oldwords;
 2262|  23.8k|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (2262:23): [True: 0, False: 23.8k]
  ------------------
 2263|       |
 2264|  23.8k|    do {  // onlycpdrule loop
 2265|       |
 2266|  23.8k|      if (timelimit_exceeded ||
  ------------------
  |  Branch (2266:11): [True: 0, False: 23.8k]
  |  Branch (2266:11): [True: 0, False: 23.8k]
  ------------------
 2267|  23.8k|          std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  106|  23.8k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2267:11): [True: 0, False: 23.8k]
  ------------------
 2268|      0|        timelimit_exceeded = true;
 2269|      0|        return 0;
 2270|      0|      }
 2271|       |
 2272|  23.8k|      if (result.size() > MAXMORPHRESULT)
  ------------------
  |  |  111|  23.8k|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (2272:11): [True: 0, False: 23.8k]
  ------------------
 2273|      0|        return 0;
 2274|       |
 2275|  23.8k|      oldnumsyllable = numsyllable;
 2276|  23.8k|      oldwordnum = wordnum;
 2277|  23.8k|      checked_prefix = 0;
 2278|       |
 2279|  23.8k|      if (i >= st.size())
  ------------------
  |  Branch (2279:11): [True: 162, False: 23.7k]
  ------------------
 2280|    162|        return 0;
 2281|       |
 2282|  23.7k|      ch = st[i];
 2283|  23.7k|      st[i] = '\0';
 2284|  23.7k|      sfx = nullptr;
 2285|       |
 2286|       |      // FIRST WORD
 2287|       |
 2288|  23.7k|      affixed = 1;
 2289|       |
 2290|  23.7k|      presult.clear();
 2291|  23.7k|      if (partresult)
  ------------------
  |  Branch (2291:11): [True: 0, False: 23.7k]
  ------------------
 2292|      0|        presult.append(*partresult);
 2293|       |
 2294|  23.7k|      rv = lookup(st.c_str(), i);  // perhaps without prefix
 2295|       |
 2296|       |      // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 2297|       |      // compound words, overriding the effect of COMPOUNDPERMITFLAG
 2298|  23.7k|      if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (2298:11): [True: 156, False: 23.5k]
  |  Branch (2298:19): [True: 42, False: 114]
  ------------------
 2299|     42|              TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule)
  ------------------
  |  |   99|  23.7k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 42]
  |  |  ------------------
  ------------------
  |  Branch (2299:66): [True: 0, False: 0]
  ------------------
 2300|      0|          continue;
 2301|       |
 2302|       |      // search homonym with compound flag
 2303|  23.8k|      while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2303:14): [True: 156, False: 23.7k]
  |  Branch (2303:22): [True: 156, False: 0]
  ------------------
 2304|    156|             ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |   99|     38|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 38]
  |  |  ------------------
  ------------------
  |  Branch (2304:16): [True: 38, False: 118]
  ------------------
 2305|    156|              !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (2305:18): [True: 156, False: 0]
  |  Branch (2305:34): [True: 156, False: 0]
  |  Branch (2305:44): [True: 156, False: 0]
  ------------------
 2306|    156|                 TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |   99|    156|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 156]
  |  |  ------------------
  ------------------
 2307|    156|                (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (2307:18): [True: 0, False: 156]
  |  Branch (2307:35): [True: 0, False: 0]
  |  Branch (2307:47): [True: 0, False: 0]
  ------------------
 2308|      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]
  |  |  ------------------
  ------------------
 2309|    156|                (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (2309:18): [True: 0, False: 156]
  |  Branch (2309:36): [True: 0, False: 0]
  |  Branch (2309:47): [True: 0, False: 0]
  |  Branch (2309:57): [True: 0, False: 0]
  ------------------
 2310|      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]
  |  |  ------------------
  ------------------
 2311|    156|                (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (2311:18): [True: 0, False: 156]
  |  Branch (2311:42): [True: 0, False: 0]
  ------------------
 2312|      0|                 ((!words && !wordnum &&
  ------------------
  |  Branch (2312:20): [True: 0, False: 0]
  |  Branch (2312:30): [True: 0, False: 0]
  ------------------
 2313|      0|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (2313:20): [True: 0, False: 0]
  ------------------
 2314|      0|                  (words &&
  ------------------
  |  Branch (2314:20): [True: 0, False: 0]
  ------------------
 2315|    156|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))))) {
  ------------------
  |  Branch (2315:20): [True: 0, False: 0]
  ------------------
 2316|    156|        rv = rv->next_homonym;
 2317|    156|      }
 2318|       |
 2319|       |
 2320|  23.7k|      if (rv)
  ------------------
  |  Branch (2320:11): [True: 0, False: 23.7k]
  ------------------
 2321|      0|        affixed = 0;
 2322|       |
 2323|  23.7k|      if (rv) {
  ------------------
  |  Branch (2323:11): [True: 0, False: 23.7k]
  ------------------
 2324|      0|        presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2325|      0|        presult.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2326|      0|        presult.append(st, 0, i);
 2327|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2327:13): [True: 0, False: 0]
  ------------------
 2328|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2329|      0|          presult.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2330|      0|          presult.append(st, 0, i);
 2331|      0|        }
 2332|      0|        if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2332:13): [True: 0, False: 0]
  ------------------
 2333|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2334|      0|          presult.append(HENTRY_DATA2(rv));
 2335|      0|        }
 2336|      0|      }
 2337|       |
 2338|  23.7k|      if (!rv) {
  ------------------
  |  Branch (2338:11): [True: 23.7k, False: 0]
  ------------------
 2339|  23.7k|        if (compoundflag &&
  ------------------
  |  Branch (2339:13): [True: 23.7k, False: 0]
  ------------------
 2340|  23.7k|            !(rv =
  ------------------
  |  Branch (2340:13): [True: 23.7k, False: 0]
  ------------------
 2341|  23.7k|                  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|  47.4k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2341:42): [True: 0, False: 23.7k]
  ------------------
 2342|  23.7k|                               scratch, compoundflag))) {
 2343|  23.7k|          if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   96|  23.7k|#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|  47.4k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2343:16): [True: 0, False: 23.7k]
  |  Branch (2343:91): [True: 0, False: 23.7k]
  ------------------
 2344|  23.7k|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (2344:17): [True: 0, False: 23.7k]
  |  Branch (2344:41): [True: 0, False: 0]
  ------------------
 2345|      0|              !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (2345:15): [True: 0, False: 0]
  |  Branch (2345:31): [True: 0, False: 0]
  ------------------
 2346|      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 (2346:17): [True: 0, False: 0]
  ------------------
 2347|      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 (2347:17): [True: 0, False: 0]
  ------------------
 2348|      0|            rv = nullptr;
 2349|      0|          }
 2350|  23.7k|        }
 2351|       |
 2352|  23.7k|        if (rv ||
  ------------------
  |  Branch (2352:13): [True: 0, False: 23.7k]
  ------------------
 2353|  23.7k|            (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (2353:15): [True: 23.7k, False: 0]
  |  Branch (2353:33): [True: 0, False: 23.7k]
  ------------------
 2354|      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 (2354:16): [True: 0, False: 0]
  |  Branch (2354:92): [True: 0, False: 0]
  ------------------
 2355|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2355:17): [True: 0, False: 0]
  |  Branch (2355:41): [True: 0, False: 0]
  ------------------
 2356|      0|                                                                  compoundbegin))) ||  // twofold suffix+compound
 2357|      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 (2357:16): [True: 0, False: 0]
  |  Branch (2357:45): [True: 0, False: 0]
  ------------------
 2358|  23.7k|             ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (2358:15): [True: 0, False: 23.7k]
  |  Branch (2358:32): [True: 0, False: 0]
  ------------------
 2359|      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 (2359:16): [True: 0, False: 0]
  |  Branch (2359:93): [True: 0, False: 0]
  ------------------
 2360|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2360:17): [True: 0, False: 0]
  |  Branch (2360:41): [True: 0, False: 0]
  ------------------
 2361|      0|                                                                  compoundmiddle))) ||  // twofold suffix+compound
 2362|      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 (2362:16): [True: 0, False: 0]
  |  Branch (2362:45): [True: 0, False: 0]
  ------------------
 2363|      0|          std::string p;
 2364|      0|          if (compoundflag)
  ------------------
  |  Branch (2364:15): [True: 0, False: 0]
  ------------------
 2365|      0|            p = affix_check_morph(st, 0, i, scratch, compoundflag);
 2366|      0|          if (p.empty()) {
  ------------------
  |  Branch (2366:15): [True: 0, False: 0]
  ------------------
 2367|      0|            if ((wordnum == 0) && compoundbegin) {
  ------------------
  |  Branch (2367:17): [True: 0, False: 0]
  |  Branch (2367:35): [True: 0, False: 0]
  ------------------
 2368|      0|              p = affix_check_morph(st, 0, i, scratch, compoundbegin);
 2369|      0|            } else if ((wordnum > 0) && compoundmiddle) {
  ------------------
  |  Branch (2369:24): [True: 0, False: 0]
  |  Branch (2369:41): [True: 0, False: 0]
  ------------------
 2370|      0|              p = affix_check_morph(st, 0, i, scratch, compoundmiddle);
 2371|      0|            }
 2372|      0|          }
 2373|      0|          if (!p.empty()) {
  ------------------
  |  Branch (2373:15): [True: 0, False: 0]
  ------------------
 2374|      0|            presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2375|      0|            presult.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2376|      0|            presult.append(st, 0, i);
 2377|      0|            line_uniq_app(p, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2378|      0|            if (!p.empty() && p[0] != MSEP_FLD)
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  |  Branch (2378:17): [True: 0, False: 0]
  |  Branch (2378:31): [True: 0, False: 0]
  ------------------
 2379|      0|              presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2380|      0|            presult.append(p);
 2381|      0|          }
 2382|      0|          checked_prefix = 1;
 2383|      0|        }
 2384|       |        // else check forbiddenwords
 2385|  23.7k|      } 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 (2385:18): [True: 0, False: 0]
  |  Branch (2385:18): [True: 0, False: 0]
  ------------------
 2386|      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]
  |  |  ------------------
  ------------------
 2387|      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]
  |  |  ------------------
  ------------------
 2388|      0|        st[i] = ch;
 2389|      0|        continue;
 2390|      0|      }
 2391|       |
 2392|       |      // check non_compound flag in suffix and prefix
 2393|  23.7k|      if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2393:11): [True: 0, False: 23.7k]
  |  Branch (2393:19): [True: 0, False: 0]
  ------------------
 2394|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2394:13): [True: 0, False: 0]
  |  Branch (2394:20): [True: 0, False: 0]
  ------------------
 2395|      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]
  |  |  ------------------
  ------------------
 2396|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2396:13): [True: 0, False: 0]
  |  Branch (2396:20): [True: 0, False: 0]
  ------------------
 2397|      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]
  |  |  ------------------
  ------------------
 2398|      0|        continue;
 2399|      0|      }
 2400|       |
 2401|       |      // check compoundend flag in suffix and prefix
 2402|  23.7k|      if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (2402:11): [True: 0, False: 23.7k]
  |  Branch (2402:19): [True: 0, False: 0]
  |  Branch (2402:38): [True: 0, False: 0]
  |  Branch (2402:53): [True: 0, False: 0]
  ------------------
 2403|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2403:13): [True: 0, False: 0]
  |  Branch (2403:20): [True: 0, False: 0]
  ------------------
 2404|      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]
  |  |  ------------------
  ------------------
 2405|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2405:13): [True: 0, False: 0]
  |  Branch (2405:20): [True: 0, False: 0]
  ------------------
 2406|      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]
  |  |  ------------------
  ------------------
 2407|      0|        continue;
 2408|      0|      }
 2409|       |
 2410|       |      // check compoundmiddle flag in suffix and prefix
 2411|  23.7k|      if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (2411:11): [True: 0, False: 23.7k]
  |  Branch (2411:19): [True: 0, False: 0]
  |  Branch (2411:38): [True: 0, False: 0]
  |  Branch (2411:56): [True: 0, False: 0]
  ------------------
 2412|      0|          !hu_mov_rule &&
  ------------------
  |  Branch (2412:11): [True: 0, False: 0]
  ------------------
 2413|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2413:13): [True: 0, False: 0]
  |  Branch (2413:20): [True: 0, False: 0]
  ------------------
 2414|      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]
  |  |  ------------------
  ------------------
 2415|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2415:13): [True: 0, False: 0]
  |  Branch (2415:20): [True: 0, False: 0]
  ------------------
 2416|      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]
  |  |  ------------------
  ------------------
 2417|      0|        rv = nullptr;
 2418|      0|      }
 2419|       |
 2420|       |      // check forbiddenwords
 2421|  23.7k|      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 (2421:11): [True: 0, False: 23.7k]
  |  Branch (2421:11): [True: 0, False: 23.7k]
  |  Branch (2421:19): [True: 0, False: 0]
  ------------------
 2422|      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]
  |  |  ------------------
  ------------------
 2423|      0|        continue;
 2424|       |
 2425|       |      // increment word number, if the second root has a compoundroot flag
 2426|  23.7k|      if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2426:11): [True: 0, False: 23.7k]
  |  Branch (2426:19): [True: 0, False: 0]
  ------------------
 2427|      0|          (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2427:11): [True: 0, False: 0]
  ------------------
 2428|      0|        wordnum++;
 2429|      0|      }
 2430|       |
 2431|       |      // first word is acceptable in compound words?
 2432|  23.7k|      if (((rv) &&
  ------------------
  |  Branch (2432:11): [True: 0, False: 23.7k]
  |  Branch (2432:12): [True: 0, False: 23.7k]
  ------------------
 2433|      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 (2433:13): [True: 0, False: 0]
  |  Branch (2433:32): [True: 0, False: 0]
  |  Branch (2433:41): [True: 0, False: 0]
  |  Branch (2433:58): [True: 0, False: 0]
  ------------------
 2434|      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 (2434:14): [True: 0, False: 0]
  |  Branch (2434:35): [True: 0, False: 0]
  ------------------
 2435|      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 (2435:14): [True: 0, False: 0]
  |  Branch (2435:34): [True: 0, False: 0]
  ------------------
 2436|       |            // LANG_hu section: spec. Hungarian rule
 2437|      0|            || ((langnum == LANG_hu) &&  // hu_mov_rule
  ------------------
  |  Branch (2437:17): [True: 0, False: 0]
  ------------------
 2438|      0|                hu_mov_rule &&
  ------------------
  |  Branch (2438:17): [True: 0, False: 0]
  ------------------
 2439|      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]
  |  |  ------------------
  ------------------
 2440|       |            // END of LANG_hu section
 2441|      0|            ) &&
 2442|      0|           !((checkcompoundtriple && !words &&  // test triple letters
  ------------------
  |  Branch (2442:15): [True: 0, False: 0]
  |  Branch (2442:38): [True: 0, False: 0]
  ------------------
 2443|      0|              (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (2443:15): [True: 0, False: 0]
  ------------------
 2444|      0|              (((i > 1) && (word[i - 1] == word[i - 2])) || ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (2444:17): [True: 0, False: 0]
  |  Branch (2444:28): [True: 0, False: 0]
  |  Branch (2444:61): [True: 0, False: 0]
  ------------------
 2445|      0|               )) ||
 2446|      0|             (
 2447|       |                 // test CHECKCOMPOUNDPATTERN
 2448|      0|                 !checkcpdtable.empty() && !words && cpdpat_check(word, i, rv, nullptr, affixed)) ||
  ------------------
  |  Branch (2448:18): [True: 0, False: 0]
  |  Branch (2448:44): [True: 0, False: 0]
  |  Branch (2448:54): [True: 0, False: 0]
  ------------------
 2449|      0|             (checkcompoundcase && !words && cpdcase_check(word, i))))
  ------------------
  |  Branch (2449:15): [True: 0, False: 0]
  |  Branch (2449:36): [True: 0, False: 0]
  |  Branch (2449:46): [True: 0, False: 0]
  ------------------
 2450|       |          // LANG_hu section: spec. Hungarian rule
 2451|  23.7k|          || ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (2451:15): [True: 23.7k, False: 0]
  |  Branch (2451:24): [True: 8.84k, False: 14.8k]
  |  Branch (2451:48): [True: 0, False: 8.84k]
  |  Branch (2451:63): [True: 0, False: 0]
  ------------------
 2452|      0|              (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2452:16): [True: 0, False: 0]
  |  Branch (2452:23): [True: 0, False: 0]
  ------------------
 2453|      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]
  |  |  ------------------
  ------------------
 2454|      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]
  |  |  ------------------
  ------------------
 2455|       |          // END of LANG_hu section
 2456|  23.7k|      ) {
 2457|       |        // LANG_hu section: spec. Hungarian rule
 2458|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2458:13): [True: 0, False: 0]
  ------------------
 2459|       |          // calculate syllable number of the word
 2460|      0|          numsyllable += get_syllable(st.substr(0, i));
 2461|       |
 2462|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2463|       |          // convention)
 2464|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2464:15): [True: 0, False: 0]
  |  Branch (2464:15): [True: 0, False: 0]
  |  Branch (2464:22): [True: 0, False: 0]
  ------------------
 2465|      0|            wordnum++;
 2466|      0|        }
 2467|       |        // END of LANG_hu section
 2468|       |
 2469|       |        // NEXT WORD(S)
 2470|      0|        rv_first = rv;
 2471|      0|        rv = lookup(word.c_str() + i, word.size() - i);  // perhaps without prefix
 2472|       |
 2473|       |        // search homonym with compound flag
 2474|      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 (2474:16): [True: 0, False: 0]
  |  Branch (2474:26): [True: 0, False: 0]
  ------------------
 2475|      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 (2475:28): [True: 0, False: 0]
  |  Branch (2475:44): [True: 0, False: 0]
  ------------------
 2476|      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 (2476:28): [True: 0, False: 0]
  |  Branch (2476:43): [True: 0, False: 0]
  ------------------
 2477|      0|                          (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))))) {
  ------------------
  |  Branch (2477:28): [True: 0, False: 0]
  |  Branch (2477:52): [True: 0, False: 0]
  |  Branch (2477:61): [True: 0, False: 0]
  ------------------
 2478|      0|          rv = rv->next_homonym;
 2479|      0|        }
 2480|       |
 2481|      0|        if (rv && words && words[wnum + 1]) {
  ------------------
  |  Branch (2481:13): [True: 0, False: 0]
  |  Branch (2481:19): [True: 0, False: 0]
  |  Branch (2481:28): [True: 0, False: 0]
  ------------------
 2482|      0|          result.append(presult);
 2483|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2484|      0|          result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2485|      0|          result.append(word, i, word.size());
 2486|      0|          if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (2486:15): [True: 0, False: 0]
  |  Branch (2486:34): [True: 0, False: 0]
  ------------------
 2487|      0|            result.append(HENTRY_DATA2(rv));
 2488|      0|          if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2488:15): [True: 0, False: 0]
  ------------------
 2489|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2490|      0|            result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2491|      0|            result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2492|      0|          }
 2493|       |          // store the pointer of the hash entry
 2494|      0|          if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2494:15): [True: 0, False: 0]
  |  Branch (2494:35): [True: 0, False: 0]
  ------------------
 2495|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2496|      0|            result.append(HENTRY_DATA2(rv));
 2497|      0|          }
 2498|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2499|      0|          return 0;
 2500|      0|        }
 2501|       |
 2502|      0|        oldnumsyllable2 = numsyllable;
 2503|      0|        oldwordnum2 = wordnum;
 2504|       |
 2505|       |        // LANG_hu section: spec. Hungarian rule
 2506|      0|        if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (2506:13): [True: 0, False: 0]
  |  Branch (2506:13): [True: 0, False: 0]
  |  Branch (2506:21): [True: 0, False: 0]
  ------------------
 2507|      0|            (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2507:13): [True: 0, False: 0]
  ------------------
 2508|      0|            !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2508:13): [True: 0, False: 0]
  ------------------
 2509|      0|          numsyllable--;
 2510|      0|        }
 2511|       |        // END of LANG_hu section
 2512|       |        // increment word number, if the second root has a compoundroot flag
 2513|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2513:13): [True: 0, False: 0]
  |  Branch (2513:21): [True: 0, False: 0]
  ------------------
 2514|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2514:13): [True: 0, False: 0]
  ------------------
 2515|      0|          wordnum++;
 2516|      0|        }
 2517|       |
 2518|       |        // check forbiddenwords
 2519|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2519:13): [True: 0, False: 0]
  |  Branch (2519:13): [True: 0, False: 0]
  |  Branch (2519:21): [True: 0, False: 0]
  ------------------
 2520|      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]
  |  |  ------------------
  ------------------
 2521|      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]
  |  |  ------------------
  ------------------
 2522|      0|          st[i] = ch;
 2523|      0|          continue;
 2524|      0|        }
 2525|       |
 2526|       |        // second word is acceptable, as a root?
 2527|       |        // hungarian conventions: compounding is acceptable,
 2528|       |        // when compound forms consist of 2 words, or if more,
 2529|       |        // then the syllable number of root words must be 6, or lesser.
 2530|      0|        if ((rv) &&
  ------------------
  |  Branch (2530:13): [True: 0, False: 0]
  |  Branch (2530:13): [True: 0, False: 0]
  ------------------
 2531|      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 (2531:15): [True: 0, False: 0]
  ------------------
 2532|      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 (2532:15): [True: 0, False: 0]
  ------------------
 2533|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2533:15): [True: 0, False: 0]
  |  Branch (2533:37): [True: 0, False: 0]
  ------------------
 2534|      0|             ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (2534:15): [True: 0, False: 0]
  ------------------
 2535|      0|              (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (2535:15): [True: 0, False: 0]
  ------------------
 2536|      0|               cpdmaxsyllable))) &&
 2537|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2537:15): [True: 0, False: 0]
  |  Branch (2537:36): [True: 0, False: 0]
  ------------------
 2538|       |          // bad compound word
 2539|      0|          result.append(presult);
 2540|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2541|      0|          result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2542|      0|          result.append(word, i, word.size());
 2543|       |
 2544|      0|          if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2544:15): [True: 0, False: 0]
  ------------------
 2545|      0|            if (complexprefixes)
  ------------------
  |  Branch (2545:17): [True: 0, False: 0]
  ------------------
 2546|      0|              result.append(HENTRY_DATA2(rv));
 2547|      0|            if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2547:17): [True: 0, False: 0]
  ------------------
 2548|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2549|      0|              result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2550|      0|              result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2551|      0|            }
 2552|       |            // store the pointer of the hash entry
 2553|      0|            if (!complexprefixes) {
  ------------------
  |  Branch (2553:17): [True: 0, False: 0]
  ------------------
 2554|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2555|      0|              result.append(HENTRY_DATA2(rv));
 2556|      0|            }
 2557|      0|          }
 2558|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2559|      0|          ok = 1;
 2560|      0|        }
 2561|       |
 2562|      0|        numsyllable = oldnumsyllable2;
 2563|      0|        wordnum = oldwordnum2;
 2564|       |
 2565|       |        // perhaps second word has prefix or/and suffix
 2566|      0|        sfx = nullptr;
 2567|      0|        sfxflag = FLAG_NULL;
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
 2568|       |
 2569|      0|        if (compoundflag && !onlycpdrule)
  ------------------
  |  Branch (2569:13): [True: 0, False: 0]
  |  Branch (2569:29): [True: 0, False: 0]
  ------------------
 2570|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundflag);
 2571|      0|        else
 2572|      0|          rv = nullptr;
 2573|       |
 2574|      0|        if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (2574:13): [True: 0, False: 0]
  |  Branch (2574:20): [True: 0, False: 0]
  |  Branch (2574:35): [True: 0, False: 0]
  ------------------
 2575|      0|          sfx = nullptr;
 2576|      0|          pfx = nullptr;
 2577|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundend);
 2578|      0|        }
 2579|       |
 2580|      0|        if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (2580:13): [True: 0, False: 0]
  |  Branch (2580:20): [True: 0, False: 0]
  |  Branch (2580:44): [True: 0, False: 0]
  ------------------
 2581|      0|          rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   74|      0|#define IN_CPD_END 2
  ------------------
 2582|      0|          if (rv && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1)) {
  ------------------
  |  Branch (2582:15): [True: 0, False: 0]
  |  Branch (2582:21): [True: 0, False: 0]
  |  Branch (2582:30): [True: 0, False: 0]
  ------------------
 2583|      0|            std::string m;
 2584|      0|            if (compoundflag)
  ------------------
  |  Branch (2584:17): [True: 0, False: 0]
  ------------------
 2585|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag);
 2586|      0|            if (m.empty() && compoundend) {
  ------------------
  |  Branch (2586:17): [True: 0, False: 0]
  |  Branch (2586:30): [True: 0, False: 0]
  ------------------
 2587|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundend);
 2588|      0|            }
 2589|      0|            result.append(presult);
 2590|      0|            if (!m.empty()) {
  ------------------
  |  Branch (2590:17): [True: 0, False: 0]
  ------------------
 2591|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2592|      0|              result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2593|      0|              result.append(word, i, word.size());
 2594|      0|              line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2595|      0|              result.append(m);
 2596|      0|            }
 2597|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2598|      0|            ok = 1;
 2599|      0|          }
 2600|      0|        }
 2601|       |
 2602|       |        // check non_compound flag in suffix and prefix
 2603|      0|        if ((rv) &&
  ------------------
  |  Branch (2603:13): [True: 0, False: 0]
  ------------------
 2604|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2604:15): [True: 0, False: 0]
  |  Branch (2604:22): [True: 0, False: 0]
  ------------------
 2605|      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]
  |  |  ------------------
  ------------------
 2606|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2606:15): [True: 0, False: 0]
  |  Branch (2606:22): [True: 0, False: 0]
  ------------------
 2607|      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]
  |  |  ------------------
  ------------------
 2608|      0|                      sfx->getContLen())))) {
 2609|      0|          rv = nullptr;
 2610|      0|        }
 2611|       |
 2612|       |        // check forbiddenwords
 2613|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2613:13): [True: 0, False: 0]
  |  Branch (2613:13): [True: 0, False: 0]
  |  Branch (2613:21): [True: 0, False: 0]
  ------------------
 2614|      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]
  |  |  ------------------
  ------------------
 2615|      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]
  |  |  ------------------
  ------------------
 2616|      0|            (!TESTAFF(rv->astr, needaffix, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2616:13): [True: 0, False: 0]
  ------------------
 2617|      0|          st[i] = ch;
 2618|      0|          continue;
 2619|      0|        }
 2620|       |
 2621|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2621:13): [True: 0, False: 0]
  ------------------
 2622|       |          // calculate syllable number of the word
 2623|      0|          numsyllable += get_syllable(word.c_str() + i);
 2624|       |
 2625|       |          // - affix syllable num.
 2626|       |          // XXX only second suffix (inflections, not derivations)
 2627|      0|          if (sfxappnd) {
  ------------------
  |  Branch (2627:15): [True: 0, False: 0]
  ------------------
 2628|      0|            std::string tmp(sfxappnd);
 2629|      0|            reverseword(tmp);
 2630|      0|            numsyllable -= short(get_syllable(tmp) + sfxextra);
 2631|      0|          } else {
 2632|      0|            numsyllable -= short(sfxextra);
 2633|      0|          }
 2634|       |
 2635|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2636|       |          // convention)
 2637|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2637:15): [True: 0, False: 0]
  |  Branch (2637:15): [True: 0, False: 0]
  |  Branch (2637:22): [True: 0, False: 0]
  ------------------
 2638|      0|            wordnum++;
 2639|       |
 2640|       |          // increment syllable num, if last word has a SYLLABLENUM flag
 2641|       |          // and the suffix is beginning `s'
 2642|       |
 2643|      0|          if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2643:15): [True: 0, False: 0]
  ------------------
 2644|      0|            switch (sfxflag) {
  ------------------
  |  Branch (2644:21): [True: 0, False: 0]
  ------------------
 2645|      0|              case 'c': {
  ------------------
  |  Branch (2645:15): [True: 0, False: 0]
  ------------------
 2646|      0|                numsyllable += 2;
 2647|      0|                break;
 2648|      0|              }
 2649|      0|              case 'J': {
  ------------------
  |  Branch (2649:15): [True: 0, False: 0]
  ------------------
 2650|      0|                numsyllable += 1;
 2651|      0|                break;
 2652|      0|              }
 2653|      0|              case 'I': {
  ------------------
  |  Branch (2653:15): [True: 0, False: 0]
  ------------------
 2654|      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 (2654:21): [True: 0, False: 0]
  |  Branch (2654:21): [True: 0, False: 0]
  ------------------
 2655|      0|                  numsyllable += 1;
 2656|      0|                break;
 2657|      0|              }
 2658|      0|            }
 2659|      0|          }
 2660|      0|        }
 2661|       |
 2662|       |        // increment word number, if the second word has a compoundroot flag
 2663|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2663:13): [True: 0, False: 0]
  |  Branch (2663:21): [True: 0, False: 0]
  ------------------
 2664|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2664:13): [True: 0, False: 0]
  ------------------
 2665|      0|          wordnum++;
 2666|      0|        }
 2667|       |        // second word is acceptable, as a word with prefix or/and suffix?
 2668|       |        // hungarian conventions: compounding is acceptable,
 2669|       |        // when compound forms consist 2 word, otherwise
 2670|       |        // the syllable number of root words is 6, or lesser.
 2671|      0|        if ((rv) &&
  ------------------
  |  Branch (2671:13): [True: 0, False: 0]
  ------------------
 2672|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2672:15): [True: 0, False: 0]
  |  Branch (2672:37): [True: 0, False: 0]
  ------------------
 2673|      0|             ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2673:15): [True: 0, False: 0]
  |  Branch (2673:40): [True: 0, False: 0]
  ------------------
 2674|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2674:15): [True: 0, False: 0]
  |  Branch (2674:36): [True: 0, False: 0]
  ------------------
 2675|      0|          std::string m;
 2676|      0|          if (compoundflag)
  ------------------
  |  Branch (2676:15): [True: 0, False: 0]
  ------------------
 2677|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag);
 2678|      0|          if (m.empty() && compoundend) {
  ------------------
  |  Branch (2678:15): [True: 0, False: 0]
  |  Branch (2678:28): [True: 0, False: 0]
  ------------------
 2679|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundend);
 2680|      0|          }
 2681|      0|          result.append(presult);
 2682|      0|          if (!m.empty()) {
  ------------------
  |  Branch (2682:15): [True: 0, False: 0]
  ------------------
 2683|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2684|      0|            result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2685|      0|            result.append(word, i, word.size());
 2686|      0|            line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2687|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2688|      0|            result.append(m);
 2689|      0|          }
 2690|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2691|      0|          ok = 1;
 2692|      0|        }
 2693|       |
 2694|      0|        numsyllable = oldnumsyllable2;
 2695|      0|        wordnum = oldwordnum2;
 2696|       |
 2697|       |        // perhaps second word is a compound word (recursive call)
 2698|      0|        if ((wordnum + 2 < maxwordnum) && (wnum + 1 < maxwordnum) && (ok == 0)) {
  ------------------
  |  Branch (2698:13): [True: 0, False: 0]
  |  Branch (2698:43): [True: 0, False: 0]
  |  Branch (2698:70): [True: 0, False: 0]
  ------------------
 2699|      0|          compound_check_morph(word.substr(i), wordnum + 1,
 2700|      0|                               numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2701|      0|                               result, &presult, scratch);
 2702|      0|        } else {
 2703|      0|          rv = nullptr;
 2704|      0|        }
 2705|      0|      }
 2706|  23.7k|      st[i] = ch;
 2707|  23.7k|      wordnum = oldwordnum;
 2708|  23.7k|      numsyllable = oldnumsyllable;
 2709|       |
 2710|  23.7k|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2710:14): [True: 0, False: 23.7k]
  |  Branch (2710:38): [True: 0, False: 0]
  ------------------
 2711|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2711:14): [True: 0, False: 0]
  ------------------
 2712|  23.8k|  }
 2713|  1.82k|  return 0;
 2714|  2.05k|}
_ZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttc:
 2737|   603M|                                      char in_compound) {
 2738|   603M|  struct hentry* rv = nullptr;
 2739|   603M|  PfxEntry* ep = ppfx;
 2740|       |
 2741|       |  // first handle the special case of 0 length suffixes
 2742|   603M|  SfxEntry* se = sStart[0];
 2743|       |
 2744|   603M|  while (se) {
  ------------------
  |  Branch (2744:10): [True: 0, False: 603M]
  ------------------
 2745|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (2745:9): [True: 0, False: 0]
  |  Branch (2745:20): [True: 0, False: 0]
  ------------------
 2746|       |      // suffixes are not allowed in beginning of compounds
 2747|      0|      if ((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2747:12): [True: 0, False: 0]
  ------------------
 2748|       |           // except when signed with compoundpermitflag flag
 2749|      0|           (se->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2749:13): [True: 0, False: 0]
  |  Branch (2749:30): [True: 0, False: 0]
  ------------------
 2750|      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]
  |  |  ------------------
  ------------------
 2751|      0|          (!circumfix ||
  ------------------
  |  Branch (2751:12): [True: 0, False: 0]
  ------------------
 2752|       |           // no circumfix flag in prefix and suffix
 2753|      0|           ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (2753:14): [True: 0, False: 0]
  |  Branch (2753:23): [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 (2754:14): [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|       |           // circumfix flag in prefix AND suffix
 2758|      0|           ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (2758:14): [True: 0, False: 0]
  |  Branch (2758:22): [True: 0, False: 0]
  ------------------
 2759|      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]
  |  |  ------------------
  ------------------
 2760|      0|            (se->getCont() &&
  ------------------
  |  Branch (2760:14): [True: 0, False: 0]
  ------------------
 2761|      0|             (TESTAFF(se->getCont(), circumfix, se->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2761:14): [True: 0, False: 0]
  ------------------
 2762|       |          // fogemorpheme
 2763|      0|          (in_compound ||
  ------------------
  |  Branch (2763:12): [True: 0, False: 0]
  ------------------
 2764|      0|           !(se->getCont() &&
  ------------------
  |  Branch (2764:14): [True: 0, False: 0]
  ------------------
 2765|      0|             (TESTAFF(se->getCont(), onlyincompound, se->getContLen())))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2765:14): [True: 0, False: 0]
  ------------------
 2766|       |          // needaffix on prefix or first suffix
 2767|      0|          (cclass ||
  ------------------
  |  Branch (2767:12): [True: 0, False: 0]
  ------------------
 2768|      0|           !(se->getCont() &&
  ------------------
  |  Branch (2768:14): [True: 0, False: 0]
  ------------------
 2769|      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]
  |  |  ------------------
  ------------------
 2770|      0|           (ppfx &&
  ------------------
  |  Branch (2770:13): [True: 0, False: 0]
  ------------------
 2771|      0|            !((ep->getCont()) &&
  ------------------
  |  Branch (2771:15): [True: 0, False: 0]
  ------------------
 2772|      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]
  |  |  ------------------
  ------------------
 2773|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx,
 2774|      0|                           (FLAG)cclass, needflag,
 2775|      0|                           (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (2775:29): [True: 0, False: 0]
  ------------------
 2776|      0|                           scratch);
 2777|      0|        if (rv) {
  ------------------
  |  Branch (2777:13): [True: 0, False: 0]
  ------------------
 2778|      0|          sfx = se;  // BUG: sfx not stateless
 2779|      0|          return rv;
 2780|      0|        }
 2781|      0|      }
 2782|      0|    }
 2783|      0|    se = se->getNext();
 2784|      0|  }
 2785|       |
 2786|       |  // now handle the general case
 2787|   603M|  if (len == 0)
  ------------------
  |  Branch (2787:7): [True: 38.5k, False: 603M]
  ------------------
 2788|  38.5k|    return nullptr;  // FULLSTRIP
 2789|   603M|  unsigned char sp = word[start + len - 1];
 2790|   603M|  SfxEntry* sptr = sStart[sp];
 2791|       |
 2792|   603M|  while (sptr) {
  ------------------
  |  Branch (2792:10): [True: 547k, False: 603M]
  ------------------
 2793|   547k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (2793:9): [True: 488k, False: 58.8k]
  ------------------
 2794|       |      // suffixes are not allowed in beginning of compounds
 2795|   488k|      if ((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|   488k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2795:12): [True: 81.4k, False: 406k]
  ------------------
 2796|       |           // except when signed with compoundpermitflag flag
 2797|   406k|           (sptr->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2797:13): [True: 406k, False: 0]
  |  Branch (2797:32): [True: 0, False: 406k]
  ------------------
 2798|      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]
  |  |  ------------------
  ------------------
 2799|   406k|                    sptr->getContLen()))) &&
 2800|  81.4k|          (!circumfix ||
  ------------------
  |  Branch (2800:12): [True: 81.4k, False: 0]
  ------------------
 2801|       |           // no circumfix flag in prefix and suffix
 2802|      0|           ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (2802:14): [True: 0, False: 0]
  |  Branch (2802:23): [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 (2803:14): [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|       |           // circumfix flag in prefix AND suffix
 2807|      0|           ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (2807:14): [True: 0, False: 0]
  |  Branch (2807:22): [True: 0, False: 0]
  ------------------
 2808|      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]
  |  |  ------------------
  ------------------
 2809|      0|            (sptr->getCont() &&
  ------------------
  |  Branch (2809:14): [True: 0, False: 0]
  ------------------
 2810|      0|             (TESTAFF(sptr->getCont(), circumfix, sptr->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2810:14): [True: 0, False: 0]
  ------------------
 2811|       |          // fogemorpheme
 2812|  81.4k|          (in_compound ||
  ------------------
  |  Branch (2812:12): [True: 0, False: 81.4k]
  ------------------
 2813|  81.4k|           !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound,
  ------------------
  |  |   99|  56.2k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2813:15): [True: 56.2k, False: 25.1k]
  |  Branch (2813:34): [True: 0, False: 56.2k]
  ------------------
 2814|  56.2k|                                          sptr->getContLen()))))) &&
 2815|       |          // needaffix on prefix or first suffix
 2816|  81.4k|          (cclass ||
  ------------------
  |  Branch (2816:12): [True: 1.42k, False: 79.9k]
  ------------------
 2817|  79.9k|           !(sptr->getCont() &&
  ------------------
  |  Branch (2817:14): [True: 55.8k, False: 24.1k]
  ------------------
 2818|  55.8k|             TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) ||
  ------------------
  |  |   99|  55.8k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 55.8k]
  |  |  ------------------
  ------------------
 2819|      0|           (ppfx &&
  ------------------
  |  Branch (2819:13): [True: 0, False: 0]
  ------------------
 2820|      0|            !((ep->getCont()) &&
  ------------------
  |  Branch (2820:15): [True: 0, False: 0]
  ------------------
 2821|      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]
  |  |  ------------------
  ------------------
 2822|  81.4k|        if (in_compound != IN_CPD_END || ppfx ||
  ------------------
  |  |   74|   162k|#define IN_CPD_END 2
  ------------------
  |  Branch (2822:13): [True: 81.4k, False: 0]
  |  Branch (2822:42): [True: 0, False: 0]
  ------------------
 2823|      0|            !(sptr->getCont() &&
  ------------------
  |  Branch (2823:15): [True: 0, False: 0]
  ------------------
 2824|  81.4k|              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]
  |  |  ------------------
  ------------------
 2825|  81.4k|          rv = sptr->checkword(word, start, len, sfxopts, ppfx,
 2826|  81.4k|                               cclass, needflag,
 2827|  81.4k|                               (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (2827:33): [True: 0, False: 81.4k]
  ------------------
 2828|  81.4k|                               scratch);
 2829|  81.4k|          if (rv) {
  ------------------
  |  Branch (2829:15): [True: 2, False: 81.4k]
  ------------------
 2830|      2|            sfx = sptr;                 // BUG: sfx not stateless
 2831|      2|            sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 2832|      2|            if (!sptr->getCont())
  ------------------
  |  Branch (2832:17): [True: 1, False: 1]
  ------------------
 2833|      1|              sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 2834|       |            // LANG_hu section: spec. Hungarian rule
 2835|      1|            else if (langnum == LANG_hu && sptr->getKeyLen() &&
  ------------------
  |  Branch (2835:22): [True: 0, False: 1]
  |  Branch (2835:44): [True: 0, False: 0]
  ------------------
 2836|      0|                     sptr->getKey()[0] == 'i' && sptr->getKey()[1] != 'y' &&
  ------------------
  |  Branch (2836:22): [True: 0, False: 0]
  |  Branch (2836:50): [True: 0, False: 0]
  ------------------
 2837|      0|                     sptr->getKey()[1] != 't') {
  ------------------
  |  Branch (2837:22): [True: 0, False: 0]
  ------------------
 2838|      0|              sfxextra = 1;
 2839|      0|            }
 2840|       |            // END of LANG_hu section
 2841|      2|            return rv;
 2842|      2|          }
 2843|  81.4k|        }
 2844|   488k|      sptr = sptr->getNextEQ();
 2845|   488k|    } else {
 2846|  58.8k|      sptr = sptr->getNextNE();
 2847|  58.8k|    }
 2848|   547k|  }
 2849|       |
 2850|   603M|  return nullptr;
 2851|   603M|}
_ZN8AffixMgr19suffix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratcht:
 2860|  16.2M|                                             const FLAG needflag) {
 2861|  16.2M|  struct hentry* rv = nullptr;
 2862|       |
 2863|       |  // first handle the special case of 0 length suffixes
 2864|  16.2M|  SfxEntry* se = sStart[0];
 2865|  16.2M|  while (se) {
  ------------------
  |  Branch (2865:10): [True: 0, False: 16.2M]
  ------------------
 2866|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (2866:9): [True: 0, False: 0]
  ------------------
 2867|      0|      rv = se->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 2868|      0|      if (rv)
  ------------------
  |  Branch (2868:11): [True: 0, False: 0]
  ------------------
 2869|      0|        return rv;
 2870|      0|    }
 2871|      0|    se = se->getNext();
 2872|      0|  }
 2873|       |
 2874|       |  // now handle the general case
 2875|  16.2M|  if (len == 0)
  ------------------
  |  Branch (2875:7): [True: 12.1k, False: 16.2M]
  ------------------
 2876|  12.1k|    return nullptr;  // FULLSTRIP
 2877|  16.2M|  unsigned char sp = word[start + len - 1];
 2878|  16.2M|  SfxEntry* sptr = sStart[sp];
 2879|       |
 2880|  16.3M|  while (sptr) {
  ------------------
  |  Branch (2880:10): [True: 121k, False: 16.2M]
  ------------------
 2881|   121k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (2881:9): [True: 75.0k, False: 46.4k]
  ------------------
 2882|  75.0k|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (2882:11): [True: 19.2k, False: 55.8k]
  ------------------
 2883|  19.2k|        rv = sptr->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 2884|  19.2k|        if (rv) {
  ------------------
  |  Branch (2884:13): [True: 0, False: 19.2k]
  ------------------
 2885|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 2886|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (2886:15): [True: 0, False: 0]
  ------------------
 2887|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 2888|      0|          return rv;
 2889|      0|        }
 2890|  19.2k|      }
 2891|  75.0k|      sptr = sptr->getNextEQ();
 2892|  75.0k|    } else {
 2893|  46.4k|      sptr = sptr->getNextNE();
 2894|  46.4k|    }
 2895|   121k|  }
 2896|       |
 2897|  16.2M|  return nullptr;
 2898|  16.2M|}
_ZN8AffixMgr25suffix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratcht:
 2907|  4.24k|                                                const FLAG needflag) {
 2908|  4.24k|  std::string result;
 2909|  4.24k|  std::string result2;
 2910|  4.24k|  std::string result3;
 2911|       |
 2912|       |  // first handle the special case of 0 length suffixes
 2913|  4.24k|  SfxEntry* se = sStart[0];
 2914|  4.24k|  while (se) {
  ------------------
  |  Branch (2914:10): [True: 0, False: 4.24k]
  ------------------
 2915|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (2915:9): [True: 0, False: 0]
  ------------------
 2916|      0|      std::string st = se->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 2917|      0|      if (!st.empty()) {
  ------------------
  |  Branch (2917:11): [True: 0, False: 0]
  ------------------
 2918|      0|        if (ppfx) {
  ------------------
  |  Branch (2918:13): [True: 0, False: 0]
  ------------------
 2919|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (2919:15): [True: 0, False: 0]
  ------------------
 2920|      0|            result.append(ppfx->getMorph());
 2921|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2922|      0|          } else
 2923|      0|            debugflag(result, ppfx->getFlag());
 2924|      0|        }
 2925|      0|        result.append(st);
 2926|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (2926:13): [True: 0, False: 0]
  ------------------
 2927|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2928|      0|          result.append(se->getMorph());
 2929|      0|        } else
 2930|      0|          debugflag(result, se->getFlag());
 2931|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2932|      0|      }
 2933|      0|    }
 2934|      0|    se = se->getNext();
 2935|      0|  }
 2936|       |
 2937|       |  // now handle the general case
 2938|  4.24k|  if (len == 0)
  ------------------
  |  Branch (2938:7): [True: 3, False: 4.24k]
  ------------------
 2939|      3|    return { };  // FULLSTRIP
 2940|  4.24k|  unsigned char sp = word[start + len - 1];
 2941|  4.24k|  SfxEntry* sptr = sStart[sp];
 2942|       |
 2943|  4.25k|  while (sptr) {
  ------------------
  |  Branch (2943:10): [True: 5, False: 4.24k]
  ------------------
 2944|      5|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (2944:9): [True: 0, False: 5]
  ------------------
 2945|      0|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (2945:11): [True: 0, False: 0]
  ------------------
 2946|      0|        std::string st = sptr->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 2947|      0|        if (!st.empty()) {
  ------------------
  |  Branch (2947:13): [True: 0, False: 0]
  ------------------
 2948|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 2949|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (2949:15): [True: 0, False: 0]
  ------------------
 2950|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 2951|      0|          result2.assign(st);
 2952|       |
 2953|      0|          result3.clear();
 2954|       |
 2955|      0|          if (sptr->getMorph()) {
  ------------------
  |  Branch (2955:15): [True: 0, False: 0]
  ------------------
 2956|      0|            result3.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2957|      0|            result3.append(sptr->getMorph());
 2958|      0|          } else
 2959|      0|            debugflag(result3, sptr->getFlag());
 2960|      0|          strlinecat(result2, result3);
 2961|      0|          result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2962|      0|          result.append(result2);
 2963|      0|        }
 2964|      0|      }
 2965|      0|      sptr = sptr->getNextEQ();
 2966|      5|    } else {
 2967|      5|      sptr = sptr->getNextNE();
 2968|      5|    }
 2969|      5|  }
 2970|       |
 2971|  4.24k|  return result;
 2972|  4.24k|}
_ZN8AffixMgr18suffix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttc:
 2982|  13.6k|                                         char in_compound) {
 2983|  13.6k|  std::string result;
 2984|       |
 2985|  13.6k|  struct hentry* rv = nullptr;
 2986|       |
 2987|  13.6k|  PfxEntry* ep = ppfx;
 2988|       |
 2989|       |  // first handle the special case of 0 length suffixes
 2990|  13.6k|  SfxEntry* se = sStart[0];
 2991|  13.6k|  while (se) {
  ------------------
  |  Branch (2991:10): [True: 0, False: 13.6k]
  ------------------
 2992|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (2992:9): [True: 0, False: 0]
  |  Branch (2992:20): [True: 0, False: 0]
  ------------------
 2993|       |      // suffixes are not allowed in beginning of compounds
 2994|      0|      if (((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2994:13): [True: 0, False: 0]
  ------------------
 2995|       |            // except when signed with compoundpermitflag flag
 2996|      0|            (se->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2996:14): [True: 0, False: 0]
  |  Branch (2996:31): [True: 0, False: 0]
  ------------------
 2997|      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]
  |  |  ------------------
  ------------------
 2998|      0|           (!circumfix ||
  ------------------
  |  Branch (2998:13): [True: 0, False: 0]
  ------------------
 2999|       |            // no circumfix flag in prefix and suffix
 3000|      0|            ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (3000:15): [True: 0, False: 0]
  |  Branch (3000:24): [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 (3001:15): [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|       |            // circumfix flag in prefix AND suffix
 3005|      0|            ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (3005:15): [True: 0, False: 0]
  |  Branch (3005:23): [True: 0, False: 0]
  ------------------
 3006|      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]
  |  |  ------------------
  ------------------
 3007|      0|             (se->getCont() &&
  ------------------
  |  Branch (3007:15): [True: 0, False: 0]
  ------------------
 3008|      0|              (TESTAFF(se->getCont(), circumfix, se->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3008:15): [True: 0, False: 0]
  ------------------
 3009|       |           // fogemorpheme
 3010|      0|           (in_compound ||
  ------------------
  |  Branch (3010:13): [True: 0, False: 0]
  ------------------
 3011|      0|            !((se->getCont() &&
  ------------------
  |  Branch (3011:16): [True: 0, False: 0]
  ------------------
 3012|      0|               (TESTAFF(se->getCont(), onlyincompound, se->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3012:16): [True: 0, False: 0]
  ------------------
 3013|       |           // needaffix on prefix or first suffix
 3014|      0|           (cclass ||
  ------------------
  |  Branch (3014:13): [True: 0, False: 0]
  ------------------
 3015|      0|            !(se->getCont() &&
  ------------------
  |  Branch (3015:15): [True: 0, False: 0]
  ------------------
 3016|      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]
  |  |  ------------------
  ------------------
 3017|      0|            (ppfx &&
  ------------------
  |  Branch (3017:14): [True: 0, False: 0]
  ------------------
 3018|      0|             !((ep->getCont()) &&
  ------------------
  |  Branch (3018:16): [True: 0, False: 0]
  ------------------
 3019|      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]
  |  |  ------------------
  ------------------
 3020|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx, cclass,
 3021|      0|                           needflag, FLAG_NULL, scratch);
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
 3022|      0|      while (rv) {
  ------------------
  |  Branch (3022:14): [True: 0, False: 0]
  ------------------
 3023|      0|        if (ppfx) {
  ------------------
  |  Branch (3023:13): [True: 0, False: 0]
  ------------------
 3024|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3024:15): [True: 0, False: 0]
  ------------------
 3025|      0|            result.append(ppfx->getMorph());
 3026|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3027|      0|          } else
 3028|      0|            debugflag(result, ppfx->getFlag());
 3029|      0|        }
 3030|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3030:13): [True: 0, False: 0]
  |  Branch (3030:32): [True: 0, False: 0]
  ------------------
 3031|      0|          result.append(HENTRY_DATA2(rv));
 3032|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (3032:13): [True: 0, False: 0]
  ------------------
 3033|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3034|      0|          result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 3035|      0|          result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 3036|      0|        }
 3037|       |
 3038|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3038:13): [True: 0, False: 0]
  |  Branch (3038:33): [True: 0, False: 0]
  ------------------
 3039|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3040|      0|          result.append(HENTRY_DATA2(rv));
 3041|      0|        }
 3042|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (3042:13): [True: 0, False: 0]
  ------------------
 3043|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3044|      0|          result.append(se->getMorph());
 3045|      0|        } else
 3046|      0|          debugflag(result, se->getFlag());
 3047|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 3048|      0|        rv = se->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3049|      0|      }
 3050|      0|    }
 3051|      0|    se = se->getNext();
 3052|      0|  }
 3053|       |
 3054|       |  // now handle the general case
 3055|  13.6k|  if (len == 0)
  ------------------
  |  Branch (3055:7): [True: 3, False: 13.6k]
  ------------------
 3056|      3|    return { };  // FULLSTRIP
 3057|  13.6k|  unsigned char sp = word[start + len - 1];
 3058|  13.6k|  SfxEntry* sptr = sStart[sp];
 3059|       |
 3060|  13.6k|  while (sptr) {
  ------------------
  |  Branch (3060:10): [True: 5, False: 13.6k]
  ------------------
 3061|      5|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3061:9): [True: 0, False: 5]
  ------------------
 3062|       |      // suffixes are not allowed in beginning of compounds
 3063|      0|      if (((((in_compound != IN_CPD_BEGIN)) ||  // && !cclass
  ------------------
  |  |   73|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (3063:13): [True: 0, False: 0]
  ------------------
 3064|       |            // except when signed with compoundpermitflag flag
 3065|      0|            (sptr->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (3065:14): [True: 0, False: 0]
  |  Branch (3065:33): [True: 0, False: 0]
  ------------------
 3066|      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]
  |  |  ------------------
  ------------------
 3067|      0|                     sptr->getContLen()))) &&
 3068|      0|           (!circumfix ||
  ------------------
  |  Branch (3068:13): [True: 0, False: 0]
  ------------------
 3069|       |            // no circumfix flag in prefix and suffix
 3070|      0|            ((!ppfx || !(ep->getCont()) ||
  ------------------
  |  Branch (3070:15): [True: 0, False: 0]
  |  Branch (3070:24): [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 (3071:15): [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|       |            // circumfix flag in prefix AND suffix
 3075|      0|            ((ppfx && (ep->getCont()) &&
  ------------------
  |  Branch (3075:15): [True: 0, False: 0]
  |  Branch (3075:23): [True: 0, False: 0]
  ------------------
 3076|      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]
  |  |  ------------------
  ------------------
 3077|      0|             (sptr->getCont() &&
  ------------------
  |  Branch (3077:15): [True: 0, False: 0]
  ------------------
 3078|      0|              (TESTAFF(sptr->getCont(), circumfix, sptr->getContLen()))))) &&
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3078:15): [True: 0, False: 0]
  ------------------
 3079|       |           // fogemorpheme
 3080|      0|           (in_compound ||
  ------------------
  |  Branch (3080:13): [True: 0, False: 0]
  ------------------
 3081|      0|            !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound,
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (3081:16): [True: 0, False: 0]
  |  Branch (3081:35): [True: 0, False: 0]
  ------------------
 3082|      0|                                           sptr->getContLen()))))) &&
 3083|       |           // needaffix on first suffix
 3084|      0|           (cclass ||
  ------------------
  |  Branch (3084:13): [True: 0, False: 0]
  ------------------
 3085|      0|            !(sptr->getCont() &&
  ------------------
  |  Branch (3085:15): [True: 0, False: 0]
  ------------------
 3086|      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]
  |  |  ------------------
  ------------------
 3087|      0|        rv = sptr->checkword(word, start, len, sfxopts, ppfx, cclass,
 3088|      0|                             needflag, FLAG_NULL, scratch);
  ------------------
  |  |   96|      0|#define FLAG_NULL 0x00
  ------------------
 3089|      0|      while (rv) {
  ------------------
  |  Branch (3089:14): [True: 0, False: 0]
  ------------------
 3090|      0|        if (ppfx) {
  ------------------
  |  Branch (3090:13): [True: 0, False: 0]
  ------------------
 3091|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3091:15): [True: 0, False: 0]
  ------------------
 3092|      0|            result.append(ppfx->getMorph());
 3093|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3094|      0|          } else
 3095|      0|            debugflag(result, ppfx->getFlag());
 3096|      0|        }
 3097|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3097:13): [True: 0, False: 0]
  |  Branch (3097:32): [True: 0, False: 0]
  ------------------
 3098|      0|          result.append(HENTRY_DATA2(rv));
 3099|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (3099:13): [True: 0, False: 0]
  ------------------
 3100|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3101|      0|          result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 3102|      0|          result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 3103|      0|        }
 3104|       |
 3105|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3105:13): [True: 0, False: 0]
  |  Branch (3105:33): [True: 0, False: 0]
  ------------------
 3106|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3107|      0|          result.append(HENTRY_DATA2(rv));
 3108|      0|        }
 3109|       |
 3110|      0|        if (sptr->getMorph()) {
  ------------------
  |  Branch (3110:13): [True: 0, False: 0]
  ------------------
 3111|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3112|      0|          result.append(sptr->getMorph());
 3113|      0|        } else
 3114|      0|          debugflag(result, sptr->getFlag());
 3115|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 3116|      0|        rv = sptr->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3117|      0|      }
 3118|      0|      sptr = sptr->getNextEQ();
 3119|      5|    } else {
 3120|      5|      sptr = sptr->getNextNE();
 3121|      5|    }
 3122|      5|  }
 3123|       |
 3124|  13.6k|  return result;
 3125|  13.6k|}
_ZN8AffixMgr11affix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtc:
 3133|  13.3M|                                     char in_compound) {
 3134|       |
 3135|       |  // check all prefixes (also crossed with suffixes if allowed)
 3136|  13.3M|  struct hentry* rv = prefix_check(word, start, len, in_compound, scratch, needflag);
 3137|  13.3M|  if (rv)
  ------------------
  |  Branch (3137:7): [True: 0, False: 13.3M]
  ------------------
 3138|      0|    return rv;
 3139|       |
 3140|       |  // if still not found check all suffixes
 3141|  13.3M|  rv = suffix_check(word, start, len, 0, nullptr, scratch, FLAG_NULL, needflag, in_compound);
  ------------------
  |  |   96|  13.3M|#define FLAG_NULL 0x00
  ------------------
 3142|       |
 3143|  13.3M|  if (havecontclass) {
  ------------------
  |  Branch (3143:7): [True: 4.65M, False: 8.73M]
  ------------------
 3144|  4.65M|    sfx = nullptr;
 3145|  4.65M|    pfx = nullptr;
 3146|       |
 3147|  4.65M|    if (rv)
  ------------------
  |  Branch (3147:9): [True: 0, False: 4.65M]
  ------------------
 3148|      0|      return rv;
 3149|       |    // if still not found check all two-level suffixes
 3150|  4.65M|    rv = suffix_check_twosfx(word, start, len, 0, nullptr, scratch, needflag);
 3151|       |
 3152|  4.65M|    if (rv)
  ------------------
  |  Branch (3152:9): [True: 0, False: 4.65M]
  ------------------
 3153|      0|      return rv;
 3154|       |    // if still not found check all two-level suffixes
 3155|  4.65M|    rv = prefix_check_twosfx(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   72|  4.65M|#define IN_CPD_NOT 0
  ------------------
 3156|  4.65M|  }
 3157|       |
 3158|  13.3M|  return rv;
 3159|  13.3M|}
_ZN8AffixMgr17affix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtc:
 3167|  13.6k|                                  char in_compound) {
 3168|  13.6k|  std::string result;
 3169|       |
 3170|       |  // check all prefixes (also crossed with suffixes if allowed)
 3171|  13.6k|  std::string st = prefix_check_morph(word, start, len, in_compound, scratch);
 3172|  13.6k|  if (!st.empty()) {
  ------------------
  |  Branch (3172:7): [True: 0, False: 13.6k]
  ------------------
 3173|      0|    result.append(st);
 3174|      0|  }
 3175|       |
 3176|       |  // if still not found check all suffixes
 3177|  13.6k|  st = suffix_check_morph(word, start, len, 0, nullptr, scratch, '\0', needflag, in_compound);
 3178|  13.6k|  if (!st.empty()) {
  ------------------
  |  Branch (3178:7): [True: 0, False: 13.6k]
  ------------------
 3179|      0|    result.append(st);
 3180|      0|  }
 3181|       |
 3182|  13.6k|  if (havecontclass) {
  ------------------
  |  Branch (3182:7): [True: 4.24k, False: 9.38k]
  ------------------
 3183|  4.24k|    sfx = nullptr;
 3184|  4.24k|    pfx = nullptr;
 3185|       |    // if still not found check all two-level suffixes
 3186|  4.24k|    st = suffix_check_twosfx_morph(word, start, len, 0, nullptr, scratch, needflag);
 3187|  4.24k|    if (!st.empty()) {
  ------------------
  |  Branch (3187:9): [True: 0, False: 4.24k]
  ------------------
 3188|      0|      result.append(st);
 3189|      0|    }
 3190|       |
 3191|       |    // if still not found check all two-level suffixes
 3192|  4.24k|    st = prefix_check_twosfx_morph(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   72|  4.24k|#define IN_CPD_NOT 0
  ------------------
 3193|  4.24k|    if (!st.empty()) {
  ------------------
  |  Branch (3193:9): [True: 0, False: 4.24k]
  ------------------
 3194|      0|      result.append(st);
 3195|      0|    }
 3196|  4.24k|  }
 3197|       |
 3198|  13.6k|  return result;
 3199|  13.6k|}
_ZN8AffixMgr15expand_rootwordEP9guesswordiPKciPKttS3_iS3_:
 3387|   602k|                              const char* phon) {
 3388|   602k|  int nh = 0;
 3389|       |  // first add root word to list
 3390|   602k|  if ((nh < maxn) &&
  ------------------
  |  Branch (3390:7): [True: 602k, False: 0]
  ------------------
 3391|   602k|      !(al && ((needaffix && TESTAFF(ap, needaffix, al)) ||
  ------------------
  |  |   99|  4.62k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 2.31k, False: 2.31k]
  |  |  ------------------
  ------------------
  |  Branch (3391:9): [True: 98.1k, False: 504k]
  |  Branch (3391:17): [True: 4.62k, False: 93.5k]
  ------------------
 3392|   600k|               (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 (3392:17): [True: 0, False: 95.8k]
  ------------------
 3393|   600k|    wlst[nh].word = mystrdup(ts);
 3394|   600k|    wlst[nh].allow = false;
 3395|   600k|    wlst[nh].orig = nullptr;
 3396|   600k|    nh++;
 3397|       |    // add special phonetic version
 3398|   600k|    if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3398:9): [True: 753, False: 599k]
  |  Branch (3398:17): [True: 753, False: 0]
  ------------------
 3399|    753|      wlst[nh].word = mystrdup(phon);
 3400|    753|      wlst[nh].allow = false;
 3401|    753|      wlst[nh].orig = mystrdup(ts);
 3402|    753|      nh++;
 3403|    753|    }
 3404|   600k|  }
 3405|       |
 3406|       |  // handle suffixes
 3407|   712k|  for (int i = 0; i < al; i++) {
  ------------------
  |  Branch (3407:19): [True: 110k, False: 602k]
  ------------------
 3408|   110k|    const auto c = (unsigned char)(ap[i] & 0x00FF);
 3409|   110k|    SfxEntry* sptr = sFlag[c];
 3410|   175k|    while (sptr) {
  ------------------
  |  Branch (3410:12): [True: 65.4k, False: 110k]
  ------------------
 3411|  65.4k|      if ((sptr->getFlag() == ap[i]) &&
  ------------------
  |  Branch (3411:11): [True: 65.4k, False: 0]
  ------------------
 3412|  65.4k|          (!sptr->getKeyLen() ||
  ------------------
  |  Branch (3412:12): [True: 0, False: 65.4k]
  ------------------
 3413|  65.4k|           ((badl > sptr->getKeyLen()) &&
  ------------------
  |  Branch (3413:13): [True: 36.8k, False: 28.5k]
  ------------------
 3414|  36.8k|            (strcmp(sptr->getAffix(), bad + badl - sptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3414:13): [True: 34, False: 36.8k]
  ------------------
 3415|       |          // check needaffix flag
 3416|     34|          !(sptr->getCont() &&
  ------------------
  |  Branch (3416:13): [True: 18, False: 16]
  ------------------
 3417|     18|            ((needaffix &&
  ------------------
  |  Branch (3417:15): [True: 12, False: 6]
  ------------------
 3418|     12|              TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) ||
  ------------------
  |  |   99|     12|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 12]
  |  |  ------------------
  ------------------
 3419|     18|             (circumfix &&
  ------------------
  |  Branch (3419:15): [True: 0, False: 18]
  ------------------
 3420|      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]
  |  |  ------------------
  ------------------
 3421|     18|             (onlyincompound &&
  ------------------
  |  Branch (3421:15): [True: 0, False: 18]
  ------------------
 3422|     34|              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]
  |  |  ------------------
  ------------------
 3423|     34|        std::string newword = sptr->add(ts, wl);
 3424|     34|        if (!newword.empty()) {
  ------------------
  |  Branch (3424:13): [True: 34, False: 0]
  ------------------
 3425|     34|          if (nh < maxn) {
  ------------------
  |  Branch (3425:15): [True: 34, False: 0]
  ------------------
 3426|     34|            wlst[nh].word = mystrdup(newword.c_str());
 3427|     34|            wlst[nh].allow = sptr->allowCross();
 3428|     34|            wlst[nh].orig = nullptr;
 3429|     34|            nh++;
 3430|       |            // add special phonetic version
 3431|     34|            if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3431:17): [True: 0, False: 34]
  |  Branch (3431:25): [True: 0, False: 0]
  ------------------
 3432|      0|              std::string prefix(phon);
 3433|      0|              std::string key(sptr->getKey());
 3434|      0|              reverseword(key);
 3435|      0|              prefix.append(key);
 3436|      0|              wlst[nh].word = mystrdup(prefix.c_str());
 3437|      0|              wlst[nh].allow = false;
 3438|      0|              wlst[nh].orig = mystrdup(newword.c_str());
 3439|      0|              nh++;
 3440|      0|            }
 3441|     34|          }
 3442|     34|        }
 3443|     34|      }
 3444|  65.4k|      sptr = sptr->getFlgNxt();
 3445|  65.4k|    }
 3446|   110k|  }
 3447|       |
 3448|   602k|  int n = nh;
 3449|       |
 3450|       |  // handle cross products of prefixes and suffixes
 3451|   603k|  for (int j = 1; j < n; j++)
  ------------------
  |  Branch (3451:19): [True: 775, False: 602k]
  ------------------
 3452|    775|    if (wlst[j].allow) {
  ------------------
  |  Branch (3452:9): [True: 22, False: 753]
  ------------------
 3453|     66|      for (int k = 0; k < al; k++) {
  ------------------
  |  Branch (3453:23): [True: 44, False: 22]
  ------------------
 3454|     44|        const auto c = (unsigned char)(ap[k] & 0x00FF);
 3455|     44|        PfxEntry* cptr = pFlag[c];
 3456|     44|        while (cptr) {
  ------------------
  |  Branch (3456:16): [True: 0, False: 44]
  ------------------
 3457|      0|          if ((cptr->getFlag() == ap[k]) && cptr->allowCross() &&
  ------------------
  |  Branch (3457:15): [True: 0, False: 0]
  |  Branch (3457:45): [True: 0, False: 0]
  ------------------
 3458|      0|              (!cptr->getKeyLen() ||
  ------------------
  |  Branch (3458:16): [True: 0, False: 0]
  ------------------
 3459|      0|               ((badl > cptr->getKeyLen()) &&
  ------------------
  |  Branch (3459:17): [True: 0, False: 0]
  ------------------
 3460|      0|                (strncmp(cptr->getKey(), bad, cptr->getKeyLen()) == 0)))) {
  ------------------
  |  Branch (3460:17): [True: 0, False: 0]
  ------------------
 3461|      0|            int l1 = strlen(wlst[j].word);
 3462|      0|            std::string newword = cptr->add(wlst[j].word, l1);
 3463|      0|            if (!newword.empty()) {
  ------------------
  |  Branch (3463:17): [True: 0, False: 0]
  ------------------
 3464|      0|              if (nh < maxn) {
  ------------------
  |  Branch (3464:19): [True: 0, False: 0]
  ------------------
 3465|      0|                wlst[nh].word = mystrdup(newword.c_str());
 3466|      0|                wlst[nh].allow = cptr->allowCross();
 3467|      0|                wlst[nh].orig = nullptr;
 3468|      0|                nh++;
 3469|      0|              }
 3470|      0|            }
 3471|      0|          }
 3472|      0|          cptr = cptr->getFlgNxt();
 3473|      0|        }
 3474|     44|      }
 3475|     22|    }
 3476|       |
 3477|       |  // now handle pure prefixes
 3478|   712k|  for (int m = 0; m < al; m++) {
  ------------------
  |  Branch (3478:19): [True: 110k, False: 602k]
  ------------------
 3479|   110k|    const auto c = (unsigned char)(ap[m] & 0x00FF);
 3480|   110k|    PfxEntry* ptr = pFlag[c];
 3481|   111k|    while (ptr) {
  ------------------
  |  Branch (3481:12): [True: 771, False: 110k]
  ------------------
 3482|    771|      if ((ptr->getFlag() == ap[m]) &&
  ------------------
  |  Branch (3482:11): [True: 771, False: 0]
  ------------------
 3483|    771|          (!ptr->getKeyLen() ||
  ------------------
  |  Branch (3483:12): [True: 0, False: 771]
  ------------------
 3484|    771|           ((badl > ptr->getKeyLen()) &&
  ------------------
  |  Branch (3484:13): [True: 771, False: 0]
  ------------------
 3485|    771|            (strncmp(ptr->getKey(), bad, ptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3485:13): [True: 3, False: 768]
  ------------------
 3486|       |          // check needaffix flag
 3487|      3|          !(ptr->getCont() &&
  ------------------
  |  Branch (3487:13): [True: 0, False: 3]
  ------------------
 3488|      0|            ((needaffix &&
  ------------------
  |  Branch (3488:15): [True: 0, False: 0]
  ------------------
 3489|      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]
  |  |  ------------------
  ------------------
 3490|      0|             (circumfix &&
  ------------------
  |  Branch (3490:15): [True: 0, False: 0]
  ------------------
 3491|      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]
  |  |  ------------------
  ------------------
 3492|      0|             (onlyincompound &&
  ------------------
  |  Branch (3492:15): [True: 0, False: 0]
  ------------------
 3493|      3|              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]
  |  |  ------------------
  ------------------
 3494|      3|        std::string newword = ptr->add(ts, wl);
 3495|      3|        if (!newword.empty()) {
  ------------------
  |  Branch (3495:13): [True: 3, False: 0]
  ------------------
 3496|      3|          if (nh < maxn) {
  ------------------
  |  Branch (3496:15): [True: 3, False: 0]
  ------------------
 3497|      3|            wlst[nh].word = mystrdup(newword.c_str());
 3498|      3|            wlst[nh].allow = ptr->allowCross();
 3499|      3|            wlst[nh].orig = nullptr;
 3500|      3|            nh++;
 3501|      3|          }
 3502|      3|        }
 3503|      3|      }
 3504|    771|      ptr = ptr->getFlgNxt();
 3505|    771|    }
 3506|   110k|  }
 3507|       |
 3508|   602k|  return nh;
 3509|   602k|}
_ZNK8AffixMgr12get_reptableEv:
 3512|   386k|const std::vector<replentry>& AffixMgr::get_reptable() const {
 3513|   386k|  return pHMgr->get_reptable();
 3514|   386k|}
_ZNK8AffixMgr14get_iconvtableEv:
 3517|  11.8M|RepList* AffixMgr::get_iconvtable() const {
 3518|  11.8M|  if (!iconvtable)
  ------------------
  |  Branch (3518:7): [True: 11.4M, False: 365k]
  ------------------
 3519|  11.4M|    return nullptr;
 3520|   365k|  return iconvtable;
 3521|  11.8M|}
_ZNK8AffixMgr14get_oconvtableEv:
 3524|  98.1k|RepList* AffixMgr::get_oconvtable() const {
 3525|  98.1k|  if (!oconvtable)
  ------------------
  |  Branch (3525:7): [True: 92.9k, False: 5.23k]
  ------------------
 3526|  92.9k|    return nullptr;
 3527|  5.23k|  return oconvtable;
 3528|  98.1k|}
_ZNK8AffixMgr14get_phonetableEv:
 3531|  62.4k|struct phonetable* AffixMgr::get_phonetable() const {
 3532|  62.4k|  if (!phone)
  ------------------
  |  Branch (3532:7): [True: 58.8k, False: 3.59k]
  ------------------
 3533|  58.8k|    return nullptr;
 3534|  3.59k|  return phone;
 3535|  62.4k|}
_ZNK8AffixMgr12get_maptableEv:
 3538|   386k|const std::vector<mapentry>& AffixMgr::get_maptable() const {
 3539|   386k|  return maptable;
 3540|   386k|}
_ZNK8AffixMgr14get_breaktableEv:
 3543|     38|const std::vector<std::string>& AffixMgr::get_breaktable() const {
 3544|     38|  return breaktable;
 3545|     38|}
_ZN8AffixMgr12get_encodingEv:
 3548|     78|const std::string& AffixMgr::get_encoding() {
 3549|     78|  if (encoding.empty())
  ------------------
  |  Branch (3549:7): [True: 20, False: 58]
  ------------------
 3550|     20|    encoding = SPELL_ENCODING;
  ------------------
  |  |   99|     20|#define SPELL_ENCODING "ISO8859-1"
  ------------------
 3551|     78|  return encoding;
 3552|     78|}
_ZNK8AffixMgr11get_langnumEv:
 3555|     76|int AffixMgr::get_langnum() const {
 3556|     76|  return langnum;
 3557|     76|}
_ZNK8AffixMgr19get_complexprefixesEv:
 3560|     76|int AffixMgr::get_complexprefixes() const {
 3561|     76|  return complexprefixes;
 3562|     76|}
_ZNK8AffixMgr13get_fullstripEv:
 3565|  5.50k|int AffixMgr::get_fullstrip() const {
 3566|  5.50k|  return fullstrip;
 3567|  5.50k|}
_ZNK8AffixMgr12get_keepcaseEv:
 3569|   101k|FLAG AffixMgr::get_keepcase() const {
 3570|   101k|  return keepcase;
 3571|   101k|}
_ZNK8AffixMgr14get_forceucaseEv:
 3573|  20.1k|FLAG AffixMgr::get_forceucase() const {
 3574|  20.1k|  return forceucase;
 3575|  20.1k|}
_ZNK8AffixMgr8get_warnEv:
 3577|  35.7k|FLAG AffixMgr::get_warn() const {
 3578|  35.7k|  return warn;
 3579|  35.7k|}
_ZNK8AffixMgr14get_forbidwarnEv:
 3581|      1|int AffixMgr::get_forbidwarn() const {
 3582|      1|  return forbidwarn;
 3583|      1|}
_ZNK8AffixMgr15get_checksharpsEv:
 3585|   187k|int AffixMgr::get_checksharps() const {
 3586|   187k|  return checksharps;
 3587|   187k|}
_ZNK8AffixMgr10get_ignoreEv:
 3594|  25.2M|const char* AffixMgr::get_ignore() const {
 3595|  25.2M|  if (ignorechars.empty())
  ------------------
  |  Branch (3595:7): [True: 22.6M, False: 2.56M]
  ------------------
 3596|  22.6M|    return nullptr;
 3597|  2.56M|  return ignorechars.c_str();
 3598|  25.2M|}
_ZNK8AffixMgr16get_ignore_utf16Ev:
 3601|   600k|const std::vector<w_char>& AffixMgr::get_ignore_utf16() const {
 3602|   600k|  return ignorechars_utf16;
 3603|   600k|}
_ZN8AffixMgr14get_key_stringEv:
 3606|     38|const std::string& AffixMgr::get_key_string() {
 3607|     38|  if (keystring.empty())
  ------------------
  |  Branch (3607:7): [True: 38, False: 0]
  ------------------
 3608|     38|    keystring = SPELL_KEYSTRING;
  ------------------
  |  |  100|     38|#define SPELL_KEYSTRING "qwertyuiop|asdfghjkl|zxcvbnm"
  ------------------
 3609|     38|  return keystring;
 3610|     38|}
_ZNK8AffixMgr14get_try_stringEv:
 3613|     38|const std::string& AffixMgr::get_try_string() const {
 3614|     38|  return trystring;
 3615|     38|}
_ZNK8AffixMgr12get_compoundEv:
 3627|  74.7M|int AffixMgr::get_compound() const {
 3628|  74.7M|  return compoundflag || compoundbegin || !defcpdtable.empty();
  ------------------
  |  Branch (3628:10): [True: 18.7M, False: 56.0M]
  |  Branch (3628:26): [True: 0, False: 56.0M]
  |  Branch (3628:43): [True: 0, False: 56.0M]
  ------------------
 3629|  74.7M|}
_ZNK8AffixMgr16get_compoundflagEv:
 3632|  46.4k|FLAG AffixMgr::get_compoundflag() const {
 3633|  46.4k|  return compoundflag;
 3634|  46.4k|}
_ZNK8AffixMgr17get_forbiddenwordEv:
 3637|   160k|FLAG AffixMgr::get_forbiddenword() const {
 3638|   160k|  return forbiddenword;
 3639|   160k|}
_ZNK8AffixMgr13get_nosuggestEv:
 3642|  62.7k|FLAG AffixMgr::get_nosuggest() const {
 3643|  62.7k|  return nosuggest;
 3644|  62.7k|}
_ZNK8AffixMgr18get_nongramsuggestEv:
 3647|  62.4k|FLAG AffixMgr::get_nongramsuggest() const {
 3648|  62.4k|  return nongramsuggest;
 3649|  62.4k|}
_ZNK8AffixMgr15get_substandardEv:
 3652|    224|FLAG AffixMgr::get_substandard() const {
 3653|    224|  return substandard;
 3654|    224|}
_ZNK8AffixMgr13get_needaffixEv:
 3657|  1.33k|FLAG AffixMgr::get_needaffix() const {
 3658|  1.33k|  return needaffix;
 3659|  1.33k|}
_ZNK8AffixMgr18get_onlyincompoundEv:
 3662|  63.5k|FLAG AffixMgr::get_onlyincompound() const {
 3663|  63.5k|  return onlyincompound;
 3664|  63.5k|}
_ZN8AffixMgr6lookupEPKcm:
 3672|   590M|struct hentry* AffixMgr::lookup(const char* word, size_t len) {
 3673|   590M|  struct hentry* he = nullptr;
 3674|  1.18G|  for (size_t i = 0; i < alldic.size() && !he; ++i) {
  ------------------
  |  Branch (3674:22): [True: 590M, False: 590M]
  |  Branch (3674:43): [True: 590M, False: 0]
  ------------------
 3675|   590M|    he = alldic[i]->lookup(word, len);
 3676|   590M|  }
 3677|   590M|  return he;
 3678|   590M|}
_ZNK8AffixMgr14have_contclassEv:
 3681|  32.2M|int AffixMgr::have_contclass() const {
 3682|  32.2M|  return havecontclass;
 3683|  32.2M|}
_ZNK8AffixMgr8get_utf8Ev:
 3686|     76|int AffixMgr::get_utf8() const {
 3687|     76|  return utf8;
 3688|     76|}
_ZNK8AffixMgr16get_maxngramsugsEv:
 3690|  70.0k|int AffixMgr::get_maxngramsugs() const {
 3691|  70.0k|  return maxngramsugs;
 3692|  70.0k|}
_ZNK8AffixMgr14get_maxcpdsugsEv:
 3694|     38|int AffixMgr::get_maxcpdsugs() const {
 3695|     38|  return maxcpdsugs;
 3696|     38|}
_ZNK8AffixMgr11get_maxdiffEv:
 3698|  48.4k|int AffixMgr::get_maxdiff() const {
 3699|  48.4k|  return maxdiff;
 3700|  48.4k|}
_ZNK8AffixMgr15get_onlymaxdiffEv:
 3702|  7.43k|int AffixMgr::get_onlymaxdiff() const {
 3703|  7.43k|  return onlymaxdiff;
 3704|  7.43k|}
_ZNK8AffixMgr15get_nosplitsugsEv:
 3707|     38|int AffixMgr::get_nosplitsugs() const {
 3708|     38|  return nosplitsugs;
 3709|     38|}
_ZNK8AffixMgr16get_sugswithdotsEv:
 3712|  3.39k|int AffixMgr::get_sugswithdots() const {
 3713|  3.39k|  return sugswithdots;
 3714|  3.39k|}
_ZN8AffixMgr10parse_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPtP7FileMgr:
 3717|     22|bool AffixMgr::parse_flag(const std::string& line, unsigned short* out, FileMgr* af) {
 3718|     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 (3718:7): [True: 2, False: 20]
  |  Branch (3718:28): [True: 0, False: 2]
  ------------------
 3719|      0|    HUNSPELL_WARNING(
 3720|      0|        stderr,
 3721|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 3722|      0|        af->getlinenum());
 3723|      0|    return false;
 3724|      0|  }
 3725|     22|  std::string s;
 3726|     22|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (3726:7): [True: 0, False: 22]
  ------------------
 3727|      0|    return false;
 3728|     22|  *out = pHMgr->decode_flag(s);
 3729|     22|  return true;
 3730|     22|}
_ZN8AffixMgr9parse_numERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiP7FileMgr:
 3733|     10|bool AffixMgr::parse_num(const std::string& line, int* out, FileMgr* af) {
 3734|     10|  if (*out != -1) {
  ------------------
  |  Branch (3734:7): [True: 0, False: 10]
  ------------------
 3735|      0|    HUNSPELL_WARNING(
 3736|      0|        stderr,
 3737|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 3738|      0|        af->getlinenum());
 3739|      0|    return false;
 3740|      0|  }
 3741|     10|  std::string s;
 3742|     10|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (3742:7): [True: 0, False: 10]
  ------------------
 3743|      0|    return false;
 3744|     10|  *out = atoi(s.c_str());
 3745|     10|  return true;
 3746|     10|}
_ZN8AffixMgr17parse_cpdsyllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 3749|      2|bool AffixMgr::parse_cpdsyllable(const std::string& line, FileMgr* af) {
 3750|      2|  int i = 0;
 3751|      2|  int np = 0;
 3752|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3753|      8|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3753:10): [True: 6, False: 2]
  ------------------
 3754|      6|    switch (i) {
 3755|      2|      case 0: {
  ------------------
  |  Branch (3755:7): [True: 2, False: 4]
  ------------------
 3756|      2|        np++;
 3757|      2|        break;
 3758|      0|      }
 3759|      2|      case 1: {
  ------------------
  |  Branch (3759:7): [True: 2, False: 4]
  ------------------
 3760|      2|        cpdmaxsyllable = atoi(std::string(start_piece, iter).c_str());
 3761|      2|        np++;
 3762|      2|        break;
 3763|      0|      }
 3764|      2|      case 2: {
  ------------------
  |  Branch (3764:7): [True: 2, False: 4]
  ------------------
 3765|      2|        if (!utf8) {
  ------------------
  |  Branch (3765:13): [True: 0, False: 2]
  ------------------
 3766|      0|          cpdvowels.assign(start_piece, iter);
 3767|      0|          std::sort(cpdvowels.begin(), cpdvowels.end());
 3768|      2|        } else {
 3769|      2|          std::string piece(start_piece, iter);
 3770|      2|          u8_u16(cpdvowels_utf16, piece);
 3771|      2|          std::sort(cpdvowels_utf16.begin(), cpdvowels_utf16.end());
 3772|      2|        }
 3773|      2|        np++;
 3774|      2|        break;
 3775|      0|      }
 3776|      0|      default:
  ------------------
  |  Branch (3776:7): [True: 0, False: 6]
  ------------------
 3777|      0|        break;
 3778|      6|    }
 3779|      6|    ++i;
 3780|      6|    start_piece = mystrsep(line, iter);
 3781|      6|  }
 3782|      2|  if (np < 2) {
  ------------------
  |  Branch (3782:7): [True: 0, False: 2]
  ------------------
 3783|      0|    HUNSPELL_WARNING(stderr,
 3784|      0|                     "error: line %d: missing compoundsyllable information\n",
 3785|      0|                     af->getlinenum());
 3786|      0|    return false;
 3787|      0|  }
 3788|      2|  if (np == 2)
  ------------------
  |  Branch (3788:7): [True: 0, False: 2]
  ------------------
 3789|      0|    cpdvowels = "AEIOUaeiou";
 3790|      2|  return true;
 3791|      2|}
_ZN8AffixMgr15parse_convtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgrPP7RepListS8_:
 3796|      4|                              const std::string& keyword) {
 3797|      4|  if (*rl) {
  ------------------
  |  Branch (3797:7): [True: 0, False: 4]
  ------------------
 3798|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 3799|      0|                     af->getlinenum());
 3800|      0|    return false;
 3801|      0|  }
 3802|      4|  int i = 0;
 3803|      4|  int np = 0;
 3804|      4|  int numrl = 0;
 3805|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3806|     18|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3806:10): [True: 14, False: 4]
  ------------------
 3807|     14|    switch (i) {
 3808|      4|      case 0: {
  ------------------
  |  Branch (3808:7): [True: 4, False: 10]
  ------------------
 3809|      4|        np++;
 3810|      4|        break;
 3811|      0|      }
 3812|      4|      case 1: {
  ------------------
  |  Branch (3812:7): [True: 4, False: 10]
  ------------------
 3813|      4|        numrl = atoi(std::string(start_piece, iter).c_str());
 3814|      4|        if (numrl < 1) {
  ------------------
  |  Branch (3814:13): [True: 0, False: 4]
  ------------------
 3815|      0|          HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n",
 3816|      0|                           af->getlinenum());
 3817|      0|          return false;
 3818|      0|        }
 3819|      4|        *rl = new RepList(numrl);
 3820|      4|        if (!*rl)
  ------------------
  |  Branch (3820:13): [True: 0, False: 4]
  ------------------
 3821|      0|          return false;
 3822|      4|        np++;
 3823|      4|        break;
 3824|      4|      }
 3825|      6|      default:
  ------------------
  |  Branch (3825:7): [True: 6, False: 8]
  ------------------
 3826|      6|        break;
 3827|     14|    }
 3828|     14|    ++i;
 3829|     14|    start_piece = mystrsep(line, iter);
 3830|     14|  }
 3831|      4|  if (np != 2) {
  ------------------
  |  Branch (3831:7): [True: 0, False: 4]
  ------------------
 3832|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 3833|      0|                     af->getlinenum());
 3834|      0|    return false;
 3835|      0|  }
 3836|       |
 3837|       |  /* now parse the num lines to read in the remainder of the table */
 3838|     26|  for (int j = 0; j < numrl; j++) {
  ------------------
  |  Branch (3838:19): [True: 22, False: 4]
  ------------------
 3839|     22|    std::string nl;
 3840|     22|    if (!af->getline(nl))
  ------------------
  |  Branch (3840:9): [True: 0, False: 22]
  ------------------
 3841|      0|      return false;
 3842|     22|    mychomp(nl);
 3843|     22|    i = 0;
 3844|     22|    std::string pattern;
 3845|     22|    std::string pattern2;
 3846|     22|    iter = nl.begin();
 3847|     22|    start_piece = mystrsep(nl, iter);
 3848|    130|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (3848:12): [True: 108, False: 22]
  ------------------
 3849|    108|      {
 3850|    108|        switch (i) {
 3851|     22|          case 0: {
  ------------------
  |  Branch (3851:11): [True: 22, False: 86]
  ------------------
 3852|     22|            if (nl.compare(start_piece - nl.begin(), keyword.size(), keyword, 0, keyword.size()) != 0) {
  ------------------
  |  Branch (3852:17): [True: 0, False: 22]
  ------------------
 3853|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3854|      0|                               af->getlinenum());
 3855|      0|              delete *rl;
 3856|      0|              *rl = nullptr;
 3857|      0|              return false;
 3858|      0|            }
 3859|     22|            break;
 3860|     22|          }
 3861|     22|          case 1: {
  ------------------
  |  Branch (3861:11): [True: 22, False: 86]
  ------------------
 3862|     22|            pattern.assign(start_piece, iter);
 3863|     22|            break;
 3864|     22|          }
 3865|     22|          case 2: {
  ------------------
  |  Branch (3865:11): [True: 22, False: 86]
  ------------------
 3866|     22|            pattern2.assign(start_piece, iter);
 3867|     22|            break;
 3868|     22|          }
 3869|     42|          default:
  ------------------
  |  Branch (3869:11): [True: 42, False: 66]
  ------------------
 3870|     42|            break;
 3871|    108|        }
 3872|    108|        ++i;
 3873|    108|      }
 3874|      0|      start_piece = mystrsep(nl, iter);
 3875|    108|    }
 3876|     22|    if (pattern.empty() || pattern2.empty()) {
  ------------------
  |  Branch (3876:9): [True: 0, False: 22]
  |  Branch (3876:28): [True: 0, False: 22]
  ------------------
 3877|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3878|      0|                       af->getlinenum());
 3879|      0|      return false;
 3880|      0|    }
 3881|       |
 3882|     22|    (*rl)->add(pattern, pattern2);
 3883|     22|  }
 3884|      4|  return true;
 3885|      4|}
_ZN8AffixMgr16parse_phonetableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 3888|      2|bool AffixMgr::parse_phonetable(const std::string& line, FileMgr* af) {
 3889|      2|  if (phone) {
  ------------------
  |  Branch (3889:7): [True: 0, False: 2]
  ------------------
 3890|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 3891|      0|                     af->getlinenum());
 3892|      0|    return false;
 3893|      0|  }
 3894|      2|  std::unique_ptr<phonetable> new_phone;
 3895|      2|  int num = -1;
 3896|      2|  int i = 0;
 3897|      2|  int np = 0;
 3898|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3899|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3899:10): [True: 4, False: 2]
  ------------------
 3900|      4|    switch (i) {
 3901|      2|      case 0: {
  ------------------
  |  Branch (3901:7): [True: 2, False: 2]
  ------------------
 3902|      2|        np++;
 3903|      2|        break;
 3904|      0|      }
 3905|      2|      case 1: {
  ------------------
  |  Branch (3905:7): [True: 2, False: 2]
  ------------------
 3906|      2|        num = atoi(std::string(start_piece, iter).c_str());
 3907|      2|        if (num < 1) {
  ------------------
  |  Branch (3907:13): [True: 0, False: 2]
  ------------------
 3908|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 3909|      0|                           af->getlinenum());
 3910|      0|          return false;
 3911|      0|        }
 3912|      2|        new_phone = std::make_unique<phonetable>();
 3913|      2|        new_phone->utf8 = (char)utf8;
 3914|      2|        np++;
 3915|      2|        break;
 3916|      2|      }
 3917|      0|      default:
  ------------------
  |  Branch (3917:7): [True: 0, False: 4]
  ------------------
 3918|      0|        break;
 3919|      4|    }
 3920|      4|    ++i;
 3921|      4|    start_piece = mystrsep(line, iter);
 3922|      4|  }
 3923|      2|  if (np != 2) {
  ------------------
  |  Branch (3923:7): [True: 0, False: 2]
  ------------------
 3924|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 3925|      0|                     af->getlinenum());
 3926|      0|    return false;
 3927|      0|  }
 3928|       |
 3929|       |  /* now parse the phone->num lines to read in the remainder of the table */
 3930|    212|  for (int j = 0; j < num; ++j) {
  ------------------
  |  Branch (3930:19): [True: 210, False: 2]
  ------------------
 3931|    210|    std::string nl;
 3932|    210|    if (!af->getline(nl))
  ------------------
  |  Branch (3932:9): [True: 0, False: 210]
  ------------------
 3933|      0|      return false;
 3934|    210|    mychomp(nl);
 3935|    210|    i = 0;
 3936|    210|    const size_t old_size = new_phone->rules.size();
 3937|    210|    iter = nl.begin();
 3938|    210|    start_piece = mystrsep(nl, iter);
 3939|    840|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (3939:12): [True: 630, False: 210]
  ------------------
 3940|    630|      {
 3941|    630|        switch (i) {
 3942|    210|          case 0: {
  ------------------
  |  Branch (3942:11): [True: 210, False: 420]
  ------------------
 3943|    210|            if (nl.compare(start_piece - nl.begin(), 5, "PHONE", 5) != 0) {
  ------------------
  |  Branch (3943:17): [True: 0, False: 210]
  ------------------
 3944|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3945|      0|                               af->getlinenum());
 3946|      0|              return false;
 3947|      0|            }
 3948|    210|            break;
 3949|    210|          }
 3950|    210|          case 1: {
  ------------------
  |  Branch (3950:11): [True: 210, False: 420]
  ------------------
 3951|    210|            new_phone->rules.emplace_back(start_piece, iter);
 3952|    210|            break;
 3953|    210|          }
 3954|    210|          case 2: {
  ------------------
  |  Branch (3954:11): [True: 210, False: 420]
  ------------------
 3955|    210|            new_phone->rules.emplace_back(start_piece, iter);
 3956|    210|            mystrrep(new_phone->rules.back(), "_", "");
 3957|    210|            break;
 3958|    210|          }
 3959|      0|          default:
  ------------------
  |  Branch (3959:11): [True: 0, False: 630]
  ------------------
 3960|      0|            break;
 3961|    630|        }
 3962|    630|        ++i;
 3963|    630|      }
 3964|      0|      start_piece = mystrsep(nl, iter);
 3965|    630|    }
 3966|    210|    if (new_phone->rules.size() != old_size + 2) {
  ------------------
  |  Branch (3966:9): [True: 0, False: 210]
  ------------------
 3967|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 3968|      0|                       af->getlinenum());
 3969|      0|      return false;
 3970|      0|    }
 3971|    210|  }
 3972|      2|  new_phone->rules.emplace_back("");
 3973|      2|  new_phone->rules.emplace_back("");
 3974|      2|  init_phonet_hash(*new_phone);
 3975|      2|  phone = new_phone.release();
 3976|      2|  return true;
 3977|      2|}
_ZN8AffixMgr19parse_checkcpdtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 3980|      2|bool AffixMgr::parse_checkcpdtable(const std::string& line, FileMgr* af) {
 3981|      2|  if (parsedcheckcpd) {
  ------------------
  |  Branch (3981:7): [True: 0, False: 2]
  ------------------
 3982|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 3983|      0|                     af->getlinenum());
 3984|      0|    return false;
 3985|      0|  }
 3986|      2|  parsedcheckcpd = true;
 3987|      2|  int numcheckcpd = -1;
 3988|      2|  int i = 0;
 3989|      2|  int np = 0;
 3990|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3991|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3991:10): [True: 4, False: 2]
  ------------------
 3992|      4|    switch (i) {
 3993|      2|      case 0: {
  ------------------
  |  Branch (3993:7): [True: 2, False: 2]
  ------------------
 3994|      2|        np++;
 3995|      2|        break;
 3996|      0|      }
 3997|      2|      case 1: {
  ------------------
  |  Branch (3997:7): [True: 2, False: 2]
  ------------------
 3998|      2|        numcheckcpd = atoi(std::string(start_piece, iter).c_str());
 3999|      2|        if (numcheckcpd < 1) {
  ------------------
  |  Branch (3999:13): [True: 0, False: 2]
  ------------------
 4000|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4001|      0|                           af->getlinenum());
 4002|      0|          return false;
 4003|      0|        }
 4004|      2|        checkcpdtable.reserve(std::min(numcheckcpd, 16384));
 4005|      2|        np++;
 4006|      2|        break;
 4007|      2|      }
 4008|      0|      default:
  ------------------
  |  Branch (4008:7): [True: 0, False: 4]
  ------------------
 4009|      0|        break;
 4010|      4|    }
 4011|      4|    ++i;
 4012|      4|    start_piece = mystrsep(line, iter);
 4013|      4|  }
 4014|      2|  if (np != 2) {
  ------------------
  |  Branch (4014:7): [True: 0, False: 2]
  ------------------
 4015|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4016|      0|                     af->getlinenum());
 4017|      0|    return false;
 4018|      0|  }
 4019|       |
 4020|       |  /* now parse the numcheckcpd lines to read in the remainder of the table */
 4021|      6|  for (int j = 0; j < numcheckcpd; ++j) {
  ------------------
  |  Branch (4021:19): [True: 4, False: 2]
  ------------------
 4022|      4|    std::string nl;
 4023|      4|    if (!af->getline(nl))
  ------------------
  |  Branch (4023:9): [True: 0, False: 4]
  ------------------
 4024|      0|      return false;
 4025|      4|    mychomp(nl);
 4026|      4|    i = 0;
 4027|      4|    checkcpdtable.emplace_back();
 4028|      4|    iter = nl.begin();
 4029|      4|    start_piece = mystrsep(nl, iter);
 4030|     16|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4030:12): [True: 12, False: 4]
  ------------------
 4031|     12|      switch (i) {
 4032|      4|        case 0: {
  ------------------
  |  Branch (4032:9): [True: 4, False: 8]
  ------------------
 4033|      4|          if (nl.compare(start_piece - nl.begin(), 20, "CHECKCOMPOUNDPATTERN", 20) != 0) {
  ------------------
  |  Branch (4033:15): [True: 0, False: 4]
  ------------------
 4034|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4035|      0|                             af->getlinenum());
 4036|      0|            checkcpdtable.clear();
 4037|      0|            return false;
 4038|      0|          }
 4039|      4|          break;
 4040|      4|        }
 4041|      4|        case 1: {
  ------------------
  |  Branch (4041:9): [True: 4, False: 8]
  ------------------
 4042|      4|          checkcpdtable.back().pattern.assign(start_piece, iter);
 4043|      4|          size_t slash_pos = checkcpdtable.back().pattern.find('/');
 4044|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4044:15): [True: 0, False: 4]
  ------------------
 4045|      0|            std::string chunk(checkcpdtable.back().pattern, slash_pos + 1);
 4046|      0|            checkcpdtable.back().pattern.resize(slash_pos);
 4047|      0|            checkcpdtable.back().cond = pHMgr->decode_flag(chunk);
 4048|      0|          }
 4049|      4|          break;
 4050|      4|        }
 4051|      4|        case 2: {
  ------------------
  |  Branch (4051:9): [True: 4, False: 8]
  ------------------
 4052|      4|          checkcpdtable.back().pattern2.assign(start_piece, iter);
 4053|      4|          size_t slash_pos = checkcpdtable.back().pattern2.find('/');
 4054|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4054:15): [True: 0, False: 4]
  ------------------
 4055|      0|            std::string chunk(checkcpdtable.back().pattern2, slash_pos + 1);
 4056|      0|            checkcpdtable.back().pattern2.resize(slash_pos);
 4057|      0|            checkcpdtable.back().cond2 = pHMgr->decode_flag(chunk);
 4058|      0|          }
 4059|      4|          break;
 4060|      4|        }
 4061|      0|        case 3: {
  ------------------
  |  Branch (4061:9): [True: 0, False: 12]
  ------------------
 4062|      0|          checkcpdtable.back().pattern3.assign(start_piece, iter);
 4063|      0|          simplifiedcpd = 1;
 4064|      0|          break;
 4065|      4|        }
 4066|      0|        default:
  ------------------
  |  Branch (4066:9): [True: 0, False: 12]
  ------------------
 4067|      0|          break;
 4068|     12|      }
 4069|     12|      i++;
 4070|     12|      start_piece = mystrsep(nl, iter);
 4071|     12|    }
 4072|      4|  }
 4073|      2|  return true;
 4074|      2|}
_ZN8AffixMgr14parse_maptableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4178|      2|bool AffixMgr::parse_maptable(const std::string& line, FileMgr* af) {
 4179|      2|  if (parsedmaptable) {
  ------------------
  |  Branch (4179:7): [True: 0, False: 2]
  ------------------
 4180|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4181|      0|                     af->getlinenum());
 4182|      0|    return false;
 4183|      0|  }
 4184|      2|  parsedmaptable = true;
 4185|      2|  int nummap = -1;
 4186|      2|  int i = 0;
 4187|      2|  int np = 0;
 4188|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4189|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4189:10): [True: 4, False: 2]
  ------------------
 4190|      4|    switch (i) {
 4191|      2|      case 0: {
  ------------------
  |  Branch (4191:7): [True: 2, False: 2]
  ------------------
 4192|      2|        np++;
 4193|      2|        break;
 4194|      0|      }
 4195|      2|      case 1: {
  ------------------
  |  Branch (4195:7): [True: 2, False: 2]
  ------------------
 4196|      2|        nummap = atoi(std::string(start_piece, iter).c_str());
 4197|      2|        if (nummap < 1) {
  ------------------
  |  Branch (4197:13): [True: 0, False: 2]
  ------------------
 4198|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4199|      0|                           af->getlinenum());
 4200|      0|          return false;
 4201|      0|        }
 4202|      2|        maptable.reserve(std::min(nummap, 16384));
 4203|      2|        np++;
 4204|      2|        break;
 4205|      2|      }
 4206|      0|      default:
  ------------------
  |  Branch (4206:7): [True: 0, False: 4]
  ------------------
 4207|      0|        break;
 4208|      4|    }
 4209|      4|    ++i;
 4210|      4|    start_piece = mystrsep(line, iter);
 4211|      4|  }
 4212|      2|  if (np != 2) {
  ------------------
  |  Branch (4212:7): [True: 0, False: 2]
  ------------------
 4213|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4214|      0|                     af->getlinenum());
 4215|      0|    return false;
 4216|      0|  }
 4217|       |
 4218|       |  /* now parse the nummap lines to read in the remainder of the table */
 4219|      8|  for (int j = 0; j < nummap; ++j) {
  ------------------
  |  Branch (4219:19): [True: 6, False: 2]
  ------------------
 4220|      6|    std::string nl;
 4221|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4221:9): [True: 0, False: 6]
  ------------------
 4222|      0|      return false;
 4223|      6|    mychomp(nl);
 4224|      6|    i = 0;
 4225|      6|    maptable.emplace_back();
 4226|      6|    iter = nl.begin();
 4227|      6|    start_piece = mystrsep(nl, iter);
 4228|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4228:12): [True: 12, False: 6]
  ------------------
 4229|     12|      switch (i) {
 4230|      6|        case 0: {
  ------------------
  |  Branch (4230:9): [True: 6, False: 6]
  ------------------
 4231|      6|          if (nl.compare(start_piece - nl.begin(), 3, "MAP", 3) != 0) {
  ------------------
  |  Branch (4231:15): [True: 0, False: 6]
  ------------------
 4232|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4233|      0|                             af->getlinenum());
 4234|      0|            nummap = 0;
 4235|      0|            return false;
 4236|      0|          }
 4237|      6|          break;
 4238|      6|        }
 4239|      6|        case 1: {
  ------------------
  |  Branch (4239:9): [True: 6, False: 6]
  ------------------
 4240|     22|          for (auto k = start_piece; k != iter; ++k) {
  ------------------
  |  Branch (4240:38): [True: 16, False: 6]
  ------------------
 4241|     16|            auto chb = k, che = k + 1;
 4242|     16|            if (*k == '(') {
  ------------------
  |  Branch (4242:17): [True: 2, False: 14]
  ------------------
 4243|      2|              auto parpos = std::find(k, iter, ')');
 4244|      2|              if (parpos != iter) {
  ------------------
  |  Branch (4244:19): [True: 2, False: 0]
  ------------------
 4245|      2|                chb = k + 1;
 4246|      2|                che = parpos;
 4247|      2|                k = parpos;
 4248|      2|              }
 4249|     14|            } else {
 4250|     14|              if (utf8 && (*k & 0xc0) == 0xc0) {
  ------------------
  |  Branch (4250:19): [True: 14, False: 0]
  |  Branch (4250:27): [True: 10, False: 4]
  ------------------
 4251|     10|                ++k;
 4252|     20|                while (k != iter && is_utf8_cont(*k))
  ------------------
  |  Branch (4252:24): [True: 18, False: 2]
  |  Branch (4252:37): [True: 10, False: 8]
  ------------------
 4253|     10|                    ++k;
 4254|     10|                che = k;
 4255|     10|                --k;
 4256|     10|              }
 4257|     14|            }
 4258|     16|            if (chb == che) {
  ------------------
  |  Branch (4258:17): [True: 0, False: 16]
  ------------------
 4259|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4260|      0|                              af->getlinenum());
 4261|      0|            }
 4262|       |
 4263|     16|            maptable.back().emplace_back(chb, che);
 4264|     16|          }
 4265|      6|          break;
 4266|      6|        }
 4267|      0|        default:
  ------------------
  |  Branch (4267:9): [True: 0, False: 12]
  ------------------
 4268|      0|          break;
 4269|     12|      }
 4270|     12|      ++i;
 4271|     12|      start_piece = mystrsep(nl, iter);
 4272|     12|    }
 4273|      6|    if (maptable.back().empty()) {
  ------------------
  |  Branch (4273:9): [True: 0, False: 6]
  ------------------
 4274|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4275|      0|                       af->getlinenum());
 4276|      0|      return false;
 4277|      0|    }
 4278|      6|  }
 4279|      2|  return true;
 4280|      2|}
_ZN8AffixMgr16parse_breaktableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4283|      4|bool AffixMgr::parse_breaktable(const std::string& line, FileMgr* af) {
 4284|      4|  if (parsedbreaktable) {
  ------------------
  |  Branch (4284:7): [True: 0, False: 4]
  ------------------
 4285|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4286|      0|                     af->getlinenum());
 4287|      0|    return false;
 4288|      0|  }
 4289|      4|  parsedbreaktable = true;
 4290|      4|  int numbreak = -1;
 4291|      4|  int i = 0;
 4292|      4|  int np = 0;
 4293|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4294|     12|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4294:10): [True: 8, False: 4]
  ------------------
 4295|      8|    switch (i) {
 4296|      4|      case 0: {
  ------------------
  |  Branch (4296:7): [True: 4, False: 4]
  ------------------
 4297|      4|        np++;
 4298|      4|        break;
 4299|      0|      }
 4300|      4|      case 1: {
  ------------------
  |  Branch (4300:7): [True: 4, False: 4]
  ------------------
 4301|      4|        numbreak = atoi(std::string(start_piece, iter).c_str());
 4302|      4|        if (numbreak < 0) {
  ------------------
  |  Branch (4302:13): [True: 0, False: 4]
  ------------------
 4303|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4304|      0|                           af->getlinenum());
 4305|      0|          return false;
 4306|      0|        }
 4307|      4|        if (numbreak == 0)
  ------------------
  |  Branch (4307:13): [True: 0, False: 4]
  ------------------
 4308|      0|          return true;
 4309|      4|        breaktable.reserve(std::min(numbreak, 16384));
 4310|      4|        np++;
 4311|      4|        break;
 4312|      4|      }
 4313|      0|      default:
  ------------------
  |  Branch (4313:7): [True: 0, False: 8]
  ------------------
 4314|      0|        break;
 4315|      8|    }
 4316|      8|    ++i;
 4317|      8|    start_piece = mystrsep(line, iter);
 4318|      8|  }
 4319|      4|  if (np != 2) {
  ------------------
  |  Branch (4319:7): [True: 0, False: 4]
  ------------------
 4320|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4321|      0|                     af->getlinenum());
 4322|      0|    return false;
 4323|      0|  }
 4324|       |
 4325|       |  /* now parse the numbreak lines to read in the remainder of the table */
 4326|     10|  for (int j = 0; j < numbreak; ++j) {
  ------------------
  |  Branch (4326:19): [True: 6, False: 4]
  ------------------
 4327|      6|    std::string nl;
 4328|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4328:9): [True: 0, False: 6]
  ------------------
 4329|      0|      return false;
 4330|      6|    mychomp(nl);
 4331|      6|    i = 0;
 4332|      6|    iter = nl.begin();
 4333|      6|    start_piece = mystrsep(nl, iter);
 4334|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4334:12): [True: 12, False: 6]
  ------------------
 4335|     12|      switch (i) {
 4336|      6|        case 0: {
  ------------------
  |  Branch (4336:9): [True: 6, False: 6]
  ------------------
 4337|      6|          if (nl.compare(start_piece - nl.begin(), 5, "BREAK", 5) != 0) {
  ------------------
  |  Branch (4337:15): [True: 0, False: 6]
  ------------------
 4338|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4339|      0|                             af->getlinenum());
 4340|      0|            numbreak = 0;
 4341|      0|            return false;
 4342|      0|          }
 4343|      6|          break;
 4344|      6|        }
 4345|      6|        case 1: {
  ------------------
  |  Branch (4345:9): [True: 6, False: 6]
  ------------------
 4346|      6|          breaktable.emplace_back(start_piece, iter);
 4347|      6|          break;
 4348|      6|        }
 4349|      0|        default:
  ------------------
  |  Branch (4349:9): [True: 0, False: 12]
  ------------------
 4350|      0|          break;
 4351|     12|      }
 4352|     12|      ++i;
 4353|     12|      start_piece = mystrsep(nl, iter);
 4354|     12|    }
 4355|      6|  }
 4356|       |
 4357|      4|  if (breaktable.size() != static_cast<size_t>(numbreak)) {
  ------------------
  |  Branch (4357:7): [True: 0, False: 4]
  ------------------
 4358|      0|    HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4359|      0|                     af->getlinenum());
 4360|      0|    return false;
 4361|      0|  }
 4362|       |
 4363|      4|  return true;
 4364|      4|}
_ZN8AffixMgr17reverse_conditionERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 4366|     38|void AffixMgr::reverse_condition(std::string& piece) {
 4367|     38|  if (piece.empty())
  ------------------
  |  Branch (4367:7): [True: 0, False: 38]
  ------------------
 4368|      0|      return;
 4369|       |
 4370|     38|  int neg = 0;
 4371|       |  // iterate backwards; k wraps to npos (SIZE_MAX) when decremented past 0
 4372|     92|  for (size_t k = piece.size() - 1; k != std::string::npos; --k) {
  ------------------
  |  Branch (4372:37): [True: 54, False: 38]
  ------------------
 4373|     54|    switch (piece[k]) {
 4374|      2|      case '[': {
  ------------------
  |  Branch (4374:7): [True: 2, False: 52]
  ------------------
 4375|      2|        if (neg)
  ------------------
  |  Branch (4375:13): [True: 0, False: 2]
  ------------------
 4376|      0|          piece[k + 1] = '[';
 4377|      2|        else
 4378|      2|          piece[k] = ']';
 4379|      2|        break;
 4380|      0|      }
 4381|      2|      case ']': {
  ------------------
  |  Branch (4381:7): [True: 2, False: 52]
  ------------------
 4382|      2|        piece[k] = '[';
 4383|      2|        if (neg)
  ------------------
  |  Branch (4383:13): [True: 0, False: 2]
  ------------------
 4384|      0|          piece[k + 1] = '^';
 4385|      2|        neg = 0;
 4386|      2|        break;
 4387|      0|      }
 4388|      0|      case '^': {
  ------------------
  |  Branch (4388:7): [True: 0, False: 54]
  ------------------
 4389|      0|        if (piece[k + 1] == ']')
  ------------------
  |  Branch (4389:13): [True: 0, False: 0]
  ------------------
 4390|      0|          neg = 1;
 4391|      0|        else if (neg)
  ------------------
  |  Branch (4391:18): [True: 0, False: 0]
  ------------------
 4392|      0|          piece[k + 1] = piece[k];
 4393|      0|        break;
 4394|      0|      }
 4395|     50|      default: {
  ------------------
  |  Branch (4395:7): [True: 50, False: 4]
  ------------------
 4396|     50|        if (neg)
  ------------------
  |  Branch (4396:13): [True: 0, False: 50]
  ------------------
 4397|      0|          piece[k + 1] = piece[k];
 4398|     50|      }
 4399|     54|    }
 4400|     54|  }
 4401|     38|}
_ZN8AffixMgr11parse_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEcP7FileMgrPc:
 4455|     26|                          char* dupflags) {
 4456|     26|  int numents = 0;  // number of AffEntry structures to parse
 4457|       |
 4458|     26|  unsigned short aflag = 0;  // affix char identifier
 4459|       |
 4460|     26|  char ff = 0;
 4461|     26|  entries_container affentries(at, this);
 4462|       |
 4463|     26|  int i = 0;
 4464|       |
 4465|       |// checking lines with bad syntax
 4466|       |#ifdef DEBUG
 4467|       |  int basefieldnum = 0;
 4468|       |#endif
 4469|       |
 4470|       |  // split affix header line into pieces
 4471|       |
 4472|     26|  int np = 0;
 4473|     26|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4474|    130|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4474:10): [True: 104, False: 26]
  ------------------
 4475|    104|    switch (i) {
 4476|       |      // piece 1 - is type of affix
 4477|     26|      case 0: {
  ------------------
  |  Branch (4477:7): [True: 26, False: 78]
  ------------------
 4478|     26|        np++;
 4479|     26|        break;
 4480|      0|      }
 4481|       |
 4482|       |      // piece 2 - is affix char
 4483|     26|      case 1: {
  ------------------
  |  Branch (4483:7): [True: 26, False: 78]
  ------------------
 4484|     26|        np++;
 4485|     26|        aflag = pHMgr->decode_flag(std::string(start_piece, iter));
 4486|     26|        if (((at == 'S') && (dupflags[aflag] & dupSFX)) ||
  ------------------
  |  |   88|     18|#define dupSFX (1 << 0)
  ------------------
  |  Branch (4486:14): [True: 18, False: 8]
  |  Branch (4486:29): [True: 0, False: 18]
  ------------------
 4487|     26|            ((at == 'P') && (dupflags[aflag] & dupPFX))) {
  ------------------
  |  |   89|      8|#define dupPFX (1 << 1)
  ------------------
  |  Branch (4487:14): [True: 8, False: 18]
  |  Branch (4487:29): [True: 0, False: 8]
  ------------------
 4488|      0|          HUNSPELL_WARNING(
 4489|      0|              stderr,
 4490|      0|              "error: line %d: multiple definitions of an affix flag\n",
 4491|      0|              af->getlinenum());
 4492|      0|        }
 4493|     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 (4493:35): [True: 18, False: 8]
  ------------------
 4494|     26|        break;
 4495|      0|      }
 4496|       |      // piece 3 - is cross product indicator
 4497|     26|      case 2: {
  ------------------
  |  Branch (4497:7): [True: 26, False: 78]
  ------------------
 4498|     26|        np++;
 4499|     26|        if (*start_piece == 'Y')
  ------------------
  |  Branch (4499:13): [True: 26, False: 0]
  ------------------
 4500|     26|          ff = aeXPRODUCT;
  ------------------
  |  |   65|     26|#define aeXPRODUCT (1 << 0)
  ------------------
 4501|     26|        break;
 4502|      0|      }
 4503|       |
 4504|       |      // piece 4 - is number of affentries
 4505|     26|      case 3: {
  ------------------
  |  Branch (4505:7): [True: 26, False: 78]
  ------------------
 4506|     26|        np++;
 4507|     26|        numents = atoi(std::string(start_piece, iter).c_str());
 4508|     26|        if ((numents <= 0) || ((std::numeric_limits<size_t>::max() /
  ------------------
  |  Branch (4508:13): [True: 0, False: 26]
  |  Branch (4508:31): [True: 0, False: 26]
  ------------------
 4509|     26|                                sizeof(AffEntry)) < static_cast<size_t>(numents))) {
 4510|      0|          std::string err = pHMgr->encode_flag(aflag);
 4511|      0|          HUNSPELL_WARNING(stderr, "error: line %d: affix %s: bad entry number\n",
 4512|      0|                           af->getlinenum(), err.c_str());
 4513|      0|          return false;
 4514|      0|        }
 4515|       |
 4516|     26|        char opts = ff;
 4517|     26|        if (utf8)
  ------------------
  |  Branch (4517:13): [True: 6, False: 20]
  ------------------
 4518|      6|          opts |= aeUTF8;
  ------------------
  |  |   66|      6|#define aeUTF8 (1 << 1)
  ------------------
 4519|     26|        if (pHMgr->is_aliasf())
  ------------------
  |  Branch (4519:13): [True: 4, False: 22]
  ------------------
 4520|      4|          opts |= aeALIASF;
  ------------------
  |  |   67|      4|#define aeALIASF (1 << 2)
  ------------------
 4521|     26|        if (pHMgr->is_aliasm())
  ------------------
  |  Branch (4521:13): [True: 0, False: 26]
  ------------------
 4522|      0|          opts |= aeALIASM;
  ------------------
  |  |   68|      0|#define aeALIASM (1 << 3)
  ------------------
 4523|     26|        affentries.initialize(numents, opts, aflag);
 4524|     26|      }
 4525|       |
 4526|     26|      default:
  ------------------
  |  Branch (4526:7): [True: 0, False: 104]
  ------------------
 4527|     26|        break;
 4528|    104|    }
 4529|    104|    ++i;
 4530|    104|    start_piece = mystrsep(line, iter);
 4531|    104|  }
 4532|       |  // check to make sure we parsed enough pieces
 4533|     26|  if (np != 4) {
  ------------------
  |  Branch (4533:7): [True: 0, False: 26]
  ------------------
 4534|      0|    std::string err = pHMgr->encode_flag(aflag);
 4535|      0|    HUNSPELL_WARNING(stderr, "error: line %d: affix %s: missing data\n",
 4536|      0|                     af->getlinenum(), err.c_str());
 4537|      0|    return false;
 4538|      0|  }
 4539|       |
 4540|       |  // now parse numents affentries for this affix
 4541|     26|  AffEntry* entry = affentries.first_entry();
 4542|     68|  for (int ent = 0; ent < numents; ++ent) {
  ------------------
  |  Branch (4542:21): [True: 42, False: 26]
  ------------------
 4543|     42|    std::string nl;
 4544|     42|    if (!af->getline(nl))
  ------------------
  |  Branch (4544:9): [True: 0, False: 42]
  ------------------
 4545|      0|      return false;
 4546|     42|    mychomp(nl);
 4547|       |
 4548|     42|    iter = nl.begin();
 4549|     42|    i = 0;
 4550|     42|    np = 0;
 4551|       |
 4552|       |    // split line into pieces
 4553|     42|    start_piece = mystrsep(nl, iter);
 4554|    258|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4554:12): [True: 216, False: 42]
  ------------------
 4555|    216|      switch (i) {
 4556|       |        // piece 1 - is type
 4557|     42|        case 0: {
  ------------------
  |  Branch (4557:9): [True: 42, False: 174]
  ------------------
 4558|     42|          np++;
 4559|     42|          if (ent != 0)
  ------------------
  |  Branch (4559:15): [True: 16, False: 26]
  ------------------
 4560|     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)
  ------------------
 4561|     42|          break;
 4562|      0|        }
 4563|       |
 4564|       |        // piece 2 - is affix char
 4565|     42|        case 1: {
  ------------------
  |  Branch (4565:9): [True: 42, False: 174]
  ------------------
 4566|     42|          np++;
 4567|     42|          std::string chunk(start_piece, iter);
 4568|     42|          if (pHMgr->decode_flag(chunk) != aflag) {
  ------------------
  |  Branch (4568:15): [True: 0, False: 42]
  ------------------
 4569|      0|            std::string err = pHMgr->encode_flag(aflag);
 4570|      0|            HUNSPELL_WARNING(stderr,
 4571|      0|                             "error: line %d: affix %s is corrupt\n",
 4572|      0|                             af->getlinenum(), err.c_str());
 4573|      0|            return false;
 4574|      0|          }
 4575|       |
 4576|     42|          if (ent != 0) {
  ------------------
  |  Branch (4576:15): [True: 16, False: 26]
  ------------------
 4577|     16|            AffEntry* start_entry = affentries.first_entry();
 4578|     16|            entry->aflag = start_entry->aflag;
 4579|     16|          }
 4580|     42|          break;
 4581|     42|        }
 4582|       |
 4583|       |        // piece 3 - is string to strip or 0 for null
 4584|     42|        case 2: {
  ------------------
  |  Branch (4584:9): [True: 42, False: 174]
  ------------------
 4585|     42|          np++;
 4586|     42|          entry->strip = std::string(start_piece, iter);
 4587|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4587:15): [True: 4, False: 38]
  ------------------
 4588|      4|            if (utf8)
  ------------------
  |  Branch (4588:17): [True: 0, False: 4]
  ------------------
 4589|      0|              reverseword_utf(entry->strip);
 4590|      4|            else
 4591|      4|              reverseword(entry->strip);
 4592|      4|          }
 4593|     42|          if (entry->strip.compare("0") == 0) {
  ------------------
  |  Branch (4593:15): [True: 36, False: 6]
  ------------------
 4594|     36|            entry->strip.clear();
 4595|     36|          }
 4596|     42|          break;
 4597|     42|        }
 4598|       |
 4599|       |        // piece 4 - is affix string or 0 for null
 4600|     42|        case 3: {
  ------------------
  |  Branch (4600:9): [True: 42, False: 174]
  ------------------
 4601|     42|          entry->morphcode = nullptr;
 4602|     42|          entry->contclass = nullptr;
 4603|     42|          entry->contclasslen = 0;
 4604|     42|          np++;
 4605|     42|          std::string::const_iterator dash = std::find(start_piece, iter, '/');
 4606|     42|          if (dash != iter) {
  ------------------
  |  Branch (4606:15): [True: 18, False: 24]
  ------------------
 4607|     18|            entry->appnd = std::string(start_piece, dash);
 4608|     18|            std::string dash_str(dash + 1, iter);
 4609|       |
 4610|     18|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4610:17): [True: 2, False: 16]
  |  Branch (4610:41): [True: 0, False: 2]
  ------------------
 4611|      0|              if (utf8) {
  ------------------
  |  Branch (4611:19): [True: 0, False: 0]
  ------------------
 4612|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4613|      0|              } else {
 4614|      0|                remove_ignored_chars(entry->appnd, ignorechars);
 4615|      0|              }
 4616|      0|            }
 4617|       |
 4618|     18|            if (complexprefixes) {
  ------------------
  |  Branch (4618:17): [True: 2, False: 16]
  ------------------
 4619|      2|              if (utf8)
  ------------------
  |  Branch (4619:19): [True: 0, False: 2]
  ------------------
 4620|      0|                reverseword_utf(entry->appnd);
 4621|      2|              else
 4622|      2|                reverseword(entry->appnd);
 4623|      2|            }
 4624|       |
 4625|     18|            if (pHMgr->is_aliasf()) {
  ------------------
  |  Branch (4625:17): [True: 2, False: 16]
  ------------------
 4626|      2|              int index = atoi(dash_str.c_str());
 4627|      2|              entry->contclasslen = (unsigned short)pHMgr->get_aliasf(
 4628|      2|                  index, &(entry->contclass), af);
 4629|      2|              if (!entry->contclasslen)
  ------------------
  |  Branch (4629:19): [True: 0, False: 2]
  ------------------
 4630|      0|                HUNSPELL_WARNING(stderr,
 4631|      0|                                 "error: bad affix flag alias: \"%s\"\n",
 4632|      0|                                 dash_str.c_str());
 4633|     16|            } else {
 4634|     16|              entry->contclasslen = (unsigned short)pHMgr->decode_flags(
 4635|     16|                  &(entry->contclass), dash_str, af);
 4636|     16|              std::sort(entry->contclass, entry->contclass + entry->contclasslen);
 4637|     16|            }
 4638|       |
 4639|     18|            havecontclass = 1;
 4640|     44|            for (unsigned short _i = 0; _i < entry->contclasslen; _i++) {
  ------------------
  |  Branch (4640:41): [True: 26, False: 18]
  ------------------
 4641|     26|              contclasses[(entry->contclass)[_i]] = 1;
 4642|     26|            }
 4643|     24|          } else {
 4644|     24|            entry->appnd = std::string(start_piece, iter);
 4645|       |
 4646|     24|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4646:17): [True: 2, False: 22]
  |  Branch (4646:41): [True: 2, False: 0]
  ------------------
 4647|      2|              if (utf8) {
  ------------------
  |  Branch (4647:19): [True: 0, False: 2]
  ------------------
 4648|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4649|      2|              } else {
 4650|      2|                remove_ignored_chars(entry->appnd, ignorechars);
 4651|      2|              }
 4652|      2|            }
 4653|       |
 4654|     24|            if (complexprefixes) {
  ------------------
  |  Branch (4654:17): [True: 2, False: 22]
  ------------------
 4655|      2|              if (utf8)
  ------------------
  |  Branch (4655:19): [True: 0, False: 2]
  ------------------
 4656|      0|                reverseword_utf(entry->appnd);
 4657|      2|              else
 4658|      2|                reverseword(entry->appnd);
 4659|      2|            }
 4660|     24|          }
 4661|       |
 4662|     42|          if (entry->appnd.compare("0") == 0) {
  ------------------
  |  Branch (4662:15): [True: 2, False: 40]
  ------------------
 4663|      2|            entry->appnd.clear();
 4664|      2|          }
 4665|     42|          break;
 4666|     42|        }
 4667|       |
 4668|       |        // piece 5 - is the conditions descriptions
 4669|     42|        case 4: {
  ------------------
  |  Branch (4669:9): [True: 42, False: 174]
  ------------------
 4670|     42|          std::string chunk(start_piece, iter);
 4671|     42|          np++;
 4672|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4672:15): [True: 4, False: 38]
  ------------------
 4673|      4|            if (utf8)
  ------------------
  |  Branch (4673:17): [True: 0, False: 4]
  ------------------
 4674|      0|              reverseword_utf(chunk);
 4675|      4|            else
 4676|      4|              reverseword(chunk);
 4677|      4|            reverse_condition(chunk);
 4678|      4|          }
 4679|     42|          if (!entry->strip.empty() && chunk != "." &&
  ------------------
  |  Branch (4679:15): [True: 6, False: 36]
  |  Branch (4679:40): [True: 6, False: 0]
  ------------------
 4680|      6|              redundant_condition(at, entry->strip, chunk,
  ------------------
  |  Branch (4680:15): [True: 6, False: 0]
  ------------------
 4681|      6|                                  af->getlinenum()))
 4682|      6|            chunk = ".";
 4683|     42|          if (at == 'S') {
  ------------------
  |  Branch (4683:15): [True: 34, False: 8]
  ------------------
 4684|     34|            reverseword(chunk);
 4685|     34|            reverse_condition(chunk);
 4686|     34|          }
 4687|     42|          if (encodeit(*entry, chunk))
  ------------------
  |  Branch (4687:15): [True: 0, False: 42]
  ------------------
 4688|      0|            return false;
 4689|     42|          break;
 4690|     42|        }
 4691|       |
 4692|     42|        case 5: {
  ------------------
  |  Branch (4692:9): [True: 6, False: 210]
  ------------------
 4693|      6|          std::string chunk(start_piece, iter);
 4694|      6|          np++;
 4695|      6|          if (pHMgr->is_aliasm()) {
  ------------------
  |  Branch (4695:15): [True: 0, False: 6]
  ------------------
 4696|      0|            int index = atoi(chunk.c_str());
 4697|      0|            entry->morphcode = pHMgr->get_aliasm(index);
 4698|      6|          } else {
 4699|      6|            if (complexprefixes) {  // XXX - fix me for morph. gen.
  ------------------
  |  Branch (4699:17): [True: 0, False: 6]
  ------------------
 4700|      0|              if (utf8)
  ------------------
  |  Branch (4700:19): [True: 0, False: 0]
  ------------------
 4701|      0|                reverseword_utf(chunk);
 4702|      0|              else
 4703|      0|                reverseword(chunk);
 4704|      0|            }
 4705|       |            // add the remaining of the line
 4706|      6|            std::string::const_iterator end = nl.end();
 4707|      6|            if (iter != end) {
  ------------------
  |  Branch (4707:17): [True: 0, False: 6]
  ------------------
 4708|      0|              chunk.append(iter, end);
 4709|      0|            }
 4710|      6|            entry->morphcode = mystrdup(chunk.c_str());
 4711|      6|          }
 4712|      6|          break;
 4713|     42|        }
 4714|      0|        default:
  ------------------
  |  Branch (4714:9): [True: 0, False: 216]
  ------------------
 4715|      0|          break;
 4716|    216|      }
 4717|    216|      i++;
 4718|    216|      start_piece = mystrsep(nl, iter);
 4719|    216|    }
 4720|       |    // check to make sure we parsed enough pieces
 4721|     42|    if (np < 4) {
  ------------------
  |  Branch (4721:9): [True: 0, False: 42]
  ------------------
 4722|      0|      std::string err = pHMgr->encode_flag(aflag);
 4723|      0|      HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n",
 4724|      0|                       af->getlinenum(), err.c_str());
 4725|      0|      return false;
 4726|      0|    }
 4727|       |
 4728|       |#ifdef DEBUG
 4729|       |    // detect unnecessary fields, excepting comments
 4730|       |    if (basefieldnum) {
 4731|       |      int fieldnum =
 4732|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 4733|       |      if (fieldnum != basefieldnum)
 4734|       |        HUNSPELL_WARNING(stderr, "warning: line %d: bad field number\n",
 4735|       |                         af->getlinenum());
 4736|       |    } else {
 4737|       |      basefieldnum =
 4738|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 4739|       |    }
 4740|       |#endif
 4741|     42|  }
 4742|       |
 4743|       |  // now create SfxEntry or PfxEntry objects and use links to
 4744|       |  // build an ordered (sorted by affix string) list
 4745|     26|  auto start = affentries.begin(), end = affentries.end();
 4746|     68|  for (auto affentry = start; affentry != end; ++affentry) {
  ------------------
  |  Branch (4746:31): [True: 42, False: 26]
  ------------------
 4747|     42|    if (at == 'P') {
  ------------------
  |  Branch (4747:9): [True: 8, False: 34]
  ------------------
 4748|      8|      build_pfxtree(static_cast<PfxEntry*>(*affentry));
 4749|     34|    } else {
 4750|     34|      build_sfxtree(static_cast<SfxEntry*>(*affentry));
 4751|     34|    }
 4752|     42|  }
 4753|       |
 4754|       |  //contents belong to AffixMgr now
 4755|     26|  affentries.release();
 4756|       |
 4757|     26|  return true;
 4758|     26|}
_ZN8AffixMgr19redundant_conditionEcRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 4763|      6|                                  int linenum) {
 4764|      6|  int stripl = strip.size(), condl = cond.size(), i, j, neg, in;
 4765|      6|  if (ft == 'P') {  // prefix
  ------------------
  |  Branch (4765:7): [True: 0, False: 6]
  ------------------
 4766|      0|    if (strip.compare(0, condl, cond) == 0)
  ------------------
  |  Branch (4766:9): [True: 0, False: 0]
  ------------------
 4767|      0|      return 1;
 4768|      0|    if (utf8) {
  ------------------
  |  Branch (4768:9): [True: 0, False: 0]
  ------------------
 4769|      0|    } else {
 4770|      0|      for (i = 0, j = 0; (i < stripl) && (j < condl); i++, j++) {
  ------------------
  |  Branch (4770:26): [True: 0, False: 0]
  |  Branch (4770:42): [True: 0, False: 0]
  ------------------
 4771|      0|        if (cond[j] != '[') {
  ------------------
  |  Branch (4771:13): [True: 0, False: 0]
  ------------------
 4772|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (4772:15): [True: 0, False: 0]
  ------------------
 4773|      0|            HUNSPELL_WARNING(stderr,
 4774|      0|                             "warning: line %d: incompatible stripping "
 4775|      0|                             "characters and condition\n",
 4776|      0|                             linenum);
 4777|      0|            return 0;
 4778|      0|          }
 4779|      0|        } else {
 4780|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (4780:17): [True: 0, False: 0]
  ------------------
 4781|      0|          in = 0;
 4782|      0|          do {
 4783|      0|            j++;
 4784|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (4784:17): [True: 0, False: 0]
  ------------------
 4785|      0|              in = 1;
 4786|      0|          } while ((j < (condl - 1)) && (cond[j] != ']'));
  ------------------
  |  Branch (4786:20): [True: 0, False: 0]
  |  Branch (4786:41): [True: 0, False: 0]
  ------------------
 4787|      0|          if (j == (condl - 1) && (cond[j] != ']')) {
  ------------------
  |  Branch (4787:15): [True: 0, False: 0]
  |  Branch (4787:35): [True: 0, False: 0]
  ------------------
 4788|      0|            HUNSPELL_WARNING(stderr,
 4789|      0|                             "error: line %d: missing ] in condition:\n%s\n",
 4790|      0|                             linenum, cond.c_str());
 4791|      0|            return 0;
 4792|      0|          }
 4793|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (4793:16): [True: 0, False: 0]
  |  Branch (4793:24): [True: 0, False: 0]
  |  Branch (4793:33): [True: 0, False: 0]
  |  Branch (4793:40): [True: 0, False: 0]
  ------------------
 4794|      0|            HUNSPELL_WARNING(stderr,
 4795|      0|                             "warning: line %d: incompatible stripping "
 4796|      0|                             "characters and condition\n",
 4797|      0|                             linenum);
 4798|      0|            return 0;
 4799|      0|          }
 4800|      0|        }
 4801|      0|      }
 4802|      0|      if (j >= condl)
  ------------------
  |  Branch (4802:11): [True: 0, False: 0]
  ------------------
 4803|      0|        return 1;
 4804|      0|    }
 4805|      6|  } else {  // suffix
 4806|      6|    if ((stripl >= condl) && strip.compare(stripl - condl, std::string::npos, cond) == 0)
  ------------------
  |  Branch (4806:9): [True: 6, False: 0]
  |  Branch (4806:30): [True: 6, False: 0]
  ------------------
 4807|      6|      return 1;
 4808|      0|    if (utf8) {
  ------------------
  |  Branch (4808:9): [True: 0, False: 0]
  ------------------
 4809|      0|    } else {
 4810|      0|      for (i = stripl - 1, j = condl - 1; (i >= 0) && (j >= 0); i--, j--) {
  ------------------
  |  Branch (4810:43): [True: 0, False: 0]
  |  Branch (4810:55): [True: 0, False: 0]
  ------------------
 4811|      0|        if (cond[j] != ']') {
  ------------------
  |  Branch (4811:13): [True: 0, False: 0]
  ------------------
 4812|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (4812:15): [True: 0, False: 0]
  ------------------
 4813|      0|            HUNSPELL_WARNING(stderr,
 4814|      0|                             "warning: line %d: incompatible stripping "
 4815|      0|                             "characters and condition\n",
 4816|      0|                             linenum);
 4817|      0|            return 0;
 4818|      0|          }
 4819|      0|        } else if (j > 0) {
  ------------------
  |  Branch (4819:20): [True: 0, False: 0]
  ------------------
 4820|      0|          in = 0;
 4821|      0|          do {
 4822|      0|            j--;
 4823|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (4823:17): [True: 0, False: 0]
  ------------------
 4824|      0|              in = 1;
 4825|      0|          } while ((j > 0) && (cond[j] != '['));
  ------------------
  |  Branch (4825:20): [True: 0, False: 0]
  |  Branch (4825:31): [True: 0, False: 0]
  ------------------
 4826|      0|          if ((j == 0) && (cond[j] != '[')) {
  ------------------
  |  Branch (4826:15): [True: 0, False: 0]
  |  Branch (4826:27): [True: 0, False: 0]
  ------------------
 4827|      0|            HUNSPELL_WARNING(stderr,
 4828|      0|                             "error: line: %d: missing ] in condition:\n%s\n",
 4829|      0|                             linenum, cond.c_str());
 4830|      0|            return 0;
 4831|      0|          }
 4832|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (4832:17): [True: 0, False: 0]
  ------------------
 4833|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (4833:16): [True: 0, False: 0]
  |  Branch (4833:24): [True: 0, False: 0]
  |  Branch (4833:33): [True: 0, False: 0]
  |  Branch (4833:40): [True: 0, False: 0]
  ------------------
 4834|      0|            HUNSPELL_WARNING(stderr,
 4835|      0|                             "warning: line %d: incompatible stripping "
 4836|      0|                             "characters and condition\n",
 4837|      0|                             linenum);
 4838|      0|            return 0;
 4839|      0|          }
 4840|      0|        }
 4841|      0|      }
 4842|      0|      if (j < 0)
  ------------------
  |  Branch (4842:11): [True: 0, False: 0]
  ------------------
 4843|      0|        return 1;
 4844|      0|    }
 4845|      0|  }
 4846|      0|  return 0;
 4847|      6|}
_ZN8AffixMgr8isSubsetEPKcS1_:
 1069|  67.0k|inline int AffixMgr::isSubset(const char* s1, const char* s2) {
 1070|  87.6k|  while (((*s1 == *s2) || (*s1 == '.')) && (*s1 != '\0') && (*s2 != '\0')) {
  ------------------
  |  Branch (1070:11): [True: 67.2k, False: 20.3k]
  |  Branch (1070:27): [True: 0, False: 20.3k]
  |  Branch (1070:44): [True: 20.5k, False: 46.7k]
  |  Branch (1070:61): [True: 20.5k, False: 0]
  ------------------
 1071|  20.5k|    s1++;
 1072|  20.5k|    s2++;
 1073|  20.5k|  }
 1074|  67.0k|  return (*s1 == '\0');
 1075|  67.0k|}
_ZN8AffixMgr11isRevSubsetEPKcS1_i:
 2719|   668k|                                 int len) {
 2720|  1.35M|  while ((len > 0) && (*s1 != '\0') && ((*s1 == *end_of_s2) || (*s1 == '.'))) {
  ------------------
  |  Branch (2720:10): [True: 1.35M, False: 2.01k]
  |  Branch (2720:23): [True: 791k, False: 562k]
  |  Branch (2720:41): [True: 686k, False: 104k]
  |  Branch (2720:64): [True: 0, False: 104k]
  ------------------
 2721|   686k|    s1++;
 2722|   686k|    end_of_s2--;
 2723|   686k|    len--;
 2724|   686k|  }
 2725|   668k|  return (*s1 == '\0');
 2726|   668k|}
affixmgr.cxx:_ZN12_GLOBAL__N_18mystrdupEPKc:
 3368|   601k|  char* mystrdup(const char* s) {
 3369|   601k|    char* d = nullptr;
 3370|   601k|    if (s) {
  ------------------
  |  Branch (3370:9): [True: 601k, False: 0]
  ------------------
 3371|   601k|      size_t sl = strlen(s) + 1;
 3372|   601k|      d = new char[sl];
 3373|   601k|      memcpy(d, s, sl);
 3374|   601k|    }
 3375|   601k|    return d;
 3376|   601k|  }
_ZN17entries_containerC2EcP8AffixMgr:
 4409|     26|    : m_mgr(mgr)
 4410|     26|    , m_at(at) {
 4411|     26|  }
_ZN17entries_container10initializeEict:
 4416|     26|                  char opts, unsigned short aflag) {
 4417|     26|    entries.reserve(std::min(numents, 16384));
 4418|       |
 4419|     26|    if (m_at == 'P') {
  ------------------
  |  Branch (4419:9): [True: 8, False: 18]
  ------------------
 4420|      8|      entries.push_back(new PfxEntry(m_mgr));
 4421|     18|    } else {
 4422|     18|      entries.push_back(new SfxEntry(m_mgr));
 4423|     18|    }
 4424|       |
 4425|     26|    entries.back()->opts = opts;
 4426|     26|    entries.back()->aflag = aflag;
 4427|     26|  }
_ZN17entries_container11first_entryEv:
 4440|     42|  AffEntry* first_entry() { return entries.empty() ? nullptr : entries[0]; }
  ------------------
  |  Branch (4440:36): [True: 0, False: 42]
  ------------------
_ZN17entries_container9add_entryEc:
 4429|     16|  AffEntry* add_entry(char opts) {
 4430|     16|    if (m_at == 'P') {
  ------------------
  |  Branch (4430:9): [True: 0, False: 16]
  ------------------
 4431|      0|      entries.push_back(new PfxEntry(m_mgr));
 4432|     16|    } else {
 4433|     16|      entries.push_back(new SfxEntry(m_mgr));
 4434|     16|    }
 4435|     16|    AffEntry* ret = entries.back();
 4436|     16|    ret->opts = entries[0]->opts & opts;
 4437|     16|    return ret;
 4438|     16|  }
_ZN17entries_container5beginEv:
 4448|     26|  std::vector<AffEntry*>::iterator begin() { return entries.begin(); }
_ZN17entries_container3endEv:
 4449|     26|  std::vector<AffEntry*>::iterator end() { return entries.end(); }
_ZN17entries_container7releaseEv:
 4412|     26|  void release() {
 4413|     26|    entries.clear();
 4414|     26|  }
_ZN17entries_containerD2Ev:
 4442|     26|  ~entries_container() {
 4443|     26|    for (auto& entry : entries) {
  ------------------
  |  Branch (4443:22): [True: 0, False: 26]
  ------------------
 4444|      0|      delete entry;
 4445|      0|    }
 4446|     26|  }
affixmgr.cxx:_ZZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEENK3$_1clE6w_char:
 1568|  2.22k|          [&](w_char wc) {
 1569|  2.22k|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1570|  2.22k|          });

_ZN9guesswordC2Ev:
  118|  4.84M|    : word(nullptr)
  119|  4.84M|    , allow(false)
  120|  4.84M|    , orig(nullptr)
  121|  4.84M|  {
  122|  4.84M|  }
_ZN8patentryC2Ev:
  135|      4|    : cond(FLAG_NULL)
  ------------------
  |  |   96|      4|#define FLAG_NULL 0x00
  ------------------
  136|      4|    , cond2(FLAG_NULL) {
  ------------------
  |  |   96|      4|#define FLAG_NULL 0x00
  ------------------
  137|      4|  }
csutil.cxx:_ZL16HUNSPELL_WARNINGP8_IO_FILEPKcz:
   48|  1.58M|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|  22.6M|std::string& u16_u8(std::string& dest, const std::vector<w_char>& src) {
  135|  22.6M|  dest.clear();
  136|  22.6M|  dest.reserve(src.size());
  137|   600M|  for (const w_char& wc : src) {
  ------------------
  |  Branch (137:25): [True: 600M, False: 22.6M]
  ------------------
  138|   600M|    uint16_t cp = (static_cast<uint16_t>(wc.h) << 8) | wc.l;
  139|   600M|    if (cp < 0x80) {
  ------------------
  |  Branch (139:9): [True: 519M, False: 81.5M]
  ------------------
  140|   519M|      dest.push_back(static_cast<char>(cp));
  141|   519M|    } else if (cp < 0x800) {
  ------------------
  |  Branch (141:16): [True: 3.08M, False: 78.4M]
  ------------------
  142|  3.08M|      dest.push_back(static_cast<char>(0xc0 | (cp >> 6)));
  143|  3.08M|      dest.push_back(static_cast<char>(0x80 | (cp & 0x3f)));
  144|  78.4M|    } else {
  145|  78.4M|      dest.push_back(static_cast<char>(0xe0 | (cp >> 12)));
  146|  78.4M|      dest.push_back(static_cast<char>(0x80 | ((cp >> 6) & 0x3f)));
  147|  78.4M|      dest.push_back(static_cast<char>(0x80 | (cp & 0x3f)));
  148|  78.4M|    }
  149|   600M|  }
  150|  22.6M|  return dest;
  151|  22.6M|}
_Z6u8_u16RNSt3__16vectorI6w_charNS_9allocatorIS1_EEEERKNS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEb:
  169|  3.86M|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.86M|  dest.resize(only_convert_first_letter ? 1 : src.size());
  ------------------
  |  Branch (172:15): [True: 0, False: 3.86M]
  ------------------
  173|  3.86M|  auto out = dest.begin();
  174|  3.86M|  auto p = src.begin(), end = src.end();
  175|       |
  176|  31.9M|  while (p < end) {
  ------------------
  |  Branch (176:10): [True: 28.3M, False: 3.66M]
  ------------------
  177|  28.3M|    uint8_t b0 = static_cast<uint8_t>(*p);
  178|  28.3M|    uint16_t cp;
  179|       |
  180|  28.3M|    if (b0 < 0x80) {
  ------------------
  |  Branch (180:9): [True: 24.2M, False: 4.09M]
  ------------------
  181|       |      // 1-byte ASCII
  182|  24.2M|      cp = b0;
  183|  24.2M|    } else if (b0 < 0xc0) {
  ------------------
  |  Branch (183:16): [True: 565k, False: 3.52M]
  ------------------
  184|       |      // continuation byte at lead position
  185|   565k|      HUNSPELL_WARNING(stderr,
  186|   565k|                       "UTF-8 encoding error. Unexpected continuation bytes "
  187|   565k|                       "in %ld. character position\n%s\n",
  188|   565k|                       static_cast<long>(std::distance(src.begin(), p)),
  189|   565k|                       src.c_str());
  190|   565k|      cp = 0xfffd;
  191|  3.52M|    } else if (b0 < 0xe0) {
  ------------------
  |  Branch (191:16): [True: 910k, False: 2.61M]
  ------------------
  192|       |      // 2-byte sequence: 110xxxxx 10yyyyyy
  193|   910k|      if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (193:11): [True: 790k, False: 119k]
  |  Branch (193:11): [True: 211k, False: 698k]
  |  Branch (193:26): [True: 211k, False: 579k]
  ------------------
  194|   211k|        cp = ((b0 & 0x1f) << 6) | (static_cast<uint8_t>(p[1]) & 0x3f);
  195|   211k|        ++p;  // step past lead; loop bottom steps past cont
  196|   698k|      } else {
  197|   698k|        warn_missing_cont(src, p);
  198|   698k|        cp = 0xfffd;
  199|   698k|      }
  200|  2.61M|    } else if (b0 < 0xf0) {
  ------------------
  |  Branch (200:16): [True: 2.42M, False: 196k]
  ------------------
  201|       |      // 3-byte sequence: 1110xxxx 10yyyyyy 10zzzzzz
  202|  2.42M|      if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (202:11): [True: 2.39M, False: 22.5k]
  |  Branch (202:11): [True: 2.31M, False: 104k]
  |  Branch (202:26): [True: 2.31M, False: 81.9k]
  ------------------
  203|  2.31M|        uint8_t b1 = static_cast<uint8_t>(p[1]);
  204|  2.31M|        ++p;  // step past lead
  205|  2.31M|        if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (205:13): [True: 2.31M, False: 1.39k]
  |  Branch (205:13): [True: 2.29M, False: 16.2k]
  |  Branch (205:28): [True: 2.29M, False: 14.8k]
  ------------------
  206|  2.29M|          cp = ((b0 & 0x0f) << 12) | ((b1 & 0x3f) << 6) | (static_cast<uint8_t>(p[1]) & 0x3f);
  207|  2.29M|          ++p;  // step past first cont; loop bottom steps past second cont
  208|  2.29M|        } else {
  209|  16.2k|          warn_missing_cont(src, p);
  210|  16.2k|          cp = 0xfffd;
  211|  16.2k|        }
  212|  2.31M|      } else {
  213|   104k|        warn_missing_cont(src, p);
  214|   104k|        cp = 0xfffd;
  215|   104k|      }
  216|  2.42M|    } else {
  217|       |      // 4+ byte lead: codepoint >= U+10000, can't fit in w_char
  218|   196k|      HUNSPELL_WARNING(stderr,
  219|   196k|                       "This UTF-8 encoding can't convert to UTF-16:\n%s\n",
  220|   196k|                       src.c_str());
  221|   196k|      out->h = 0xff;
  222|   196k|      out->l = 0xfd;
  223|   196k|      ++out;
  224|   196k|      dest.resize(out - dest.begin());
  225|   196k|      return -1;
  226|   196k|    }
  227|       |
  228|  28.1M|    out->h = static_cast<unsigned char>(cp >> 8);
  229|  28.1M|    out->l = static_cast<unsigned char>(cp);
  230|  28.1M|    ++out;
  231|  28.1M|    if (only_convert_first_letter)
  ------------------
  |  Branch (231:9): [True: 0, False: 28.1M]
  ------------------
  232|      0|      break;
  233|  28.1M|    ++p;  // consume lead byte
  234|  28.1M|  }
  235|       |
  236|  3.66M|  int size = static_cast<int>(out - dest.begin());
  237|  3.66M|  dest.resize(size);
  238|  3.66M|  return size;
  239|  3.86M|}
_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|   260k|std::vector<std::string> line_tok(const std::string& text, char breakchar) {
  285|   260k|  std::vector<std::string> ret;
  286|   260k|  if (text.empty()) {
  ------------------
  |  Branch (286:7): [True: 10.5k, False: 249k]
  ------------------
  287|  10.5k|    return ret;
  288|  10.5k|  }
  289|       |
  290|   249k|  std::stringstream ss(text);
  291|   249k|  std::string tok;
  292|   500k|  while(std::getline(ss, tok, breakchar)) {
  ------------------
  |  Branch (292:9): [True: 251k, False: 249k]
  ------------------
  293|   251k|    if (!tok.empty()) {
  ------------------
  |  Branch (293:9): [True: 250k, False: 95]
  ------------------
  294|   250k|      ret.push_back(tok);
  295|   250k|    }
  296|   251k|  }
  297|       |
  298|   249k|  return ret;
  299|   260k|}
_Z9line_uniqRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEc:
  303|  13.6k|{
  304|  13.6k|  std::vector<std::string> lines = line_tok(text, breakchar);
  305|  13.6k|  text.clear();
  306|  13.6k|  if (lines.empty()) {
  ------------------
  |  Branch (306:7): [True: 10.5k, False: 3.06k]
  ------------------
  307|  10.5k|    return;
  308|  10.5k|  }
  309|  3.06k|  text = lines[0];
  310|  3.71k|  for (size_t i = 1; i < lines.size(); ++i) {
  ------------------
  |  Branch (310:22): [True: 648, False: 3.06k]
  ------------------
  311|    648|    bool dup = false;
  312|    648|    for (size_t j = 0; j < i; ++j) {
  ------------------
  |  Branch (312:24): [True: 648, False: 0]
  ------------------
  313|    648|      if (lines[i] == lines[j]) {
  ------------------
  |  Branch (313:11): [True: 648, False: 0]
  ------------------
  314|    648|        dup = true;
  315|    648|        break;
  316|    648|      }
  317|    648|    }
  318|    648|    if (!dup) {
  ------------------
  |  Branch (318:9): [True: 0, False: 648]
  ------------------
  319|      0|      if (!text.empty())
  ------------------
  |  Branch (319:11): [True: 0, False: 0]
  ------------------
  320|      0|        text.push_back(breakchar);
  321|      0|      text.append(lines[i]);
  322|      0|    }
  323|    648|  }
  324|  3.06k|}
_Z10copy_fieldRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_S8_:
  388|   233k|                const std::string& var) {
  389|   233k|  if (morph.empty())
  ------------------
  |  Branch (389:7): [True: 0, False: 233k]
  ------------------
  390|      0|    return false;
  391|   233k|  size_t pos = morph.find(var);
  392|   233k|  if (pos == std::string::npos)
  ------------------
  |  Branch (392:7): [True: 6, False: 233k]
  ------------------
  393|      6|    return false;
  394|   233k|  dest.clear();
  395|   233k|  std::string beg(morph.substr(pos + MORPH_TAG_LEN, std::string::npos));
  ------------------
  |  |  119|   233k|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|   233k|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
  396|       |
  397|   677k|  for (const char c : beg) {
  ------------------
  |  Branch (397:21): [True: 677k, False: 233k]
  ------------------
  398|   677k|    if (c == ' ' || c == '\t' || c == '\n')
  ------------------
  |  Branch (398:9): [True: 0, False: 677k]
  |  Branch (398:21): [True: 0, False: 677k]
  |  Branch (398:34): [True: 0, False: 677k]
  ------------------
  399|      0|      break;
  400|   677k|    dest.push_back(c);
  401|   677k|  }
  402|       |
  403|   233k|  return true;
  404|   233k|}
_Z8mystrrepRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_S8_:
  408|   799k|                      const std::string& replace) {
  409|   799k|  size_t pos = 0;
  410|   888k|  while ((pos = str.find(search, pos)) != std::string::npos) {
  ------------------
  |  Branch (410:10): [True: 89.0k, False: 799k]
  ------------------
  411|  89.0k|    str.replace(pos, search.length(), replace);
  412|  89.0k|    pos += replace.length();
  413|  89.0k|  }
  414|   799k|  return str;
  415|   799k|}
_Z11reversewordRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  418|  1.07M|size_t reverseword(std::string& word) {
  419|  1.07M|  std::reverse(word.begin(), word.end());
  420|  1.07M|  return word.size();
  421|  1.07M|}
_Z8uniqlistRNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE:
  498|  6.21k|void uniqlist(std::vector<std::string>& list) {
  499|  6.21k|  if (list.size() < 2)
  ------------------
  |  Branch (499:7): [True: 6.20k, False: 8]
  ------------------
  500|  6.20k|    return;
  501|       |
  502|      8|  std::vector<std::string> ret;
  503|      8|  ret.push_back(list[0]);
  504|       |
  505|     16|  for (size_t i = 1; i < list.size(); ++i) {
  ------------------
  |  Branch (505:22): [True: 8, False: 8]
  ------------------
  506|      8|    if (std::find(ret.begin(), ret.end(), list[i]) == ret.end())
  ------------------
  |  Branch (506:9): [True: 8, False: 0]
  ------------------
  507|      8|        ret.push_back(list[i]);
  508|      8|  }
  509|       |
  510|      8|  list.swap(ret);
  511|      8|}
_Z9upper_utf6w_chari:
  530|  4.15M|w_char upper_utf(w_char u, int langnum) {
  531|       |
  532|  4.15M|#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|  4.15M|  const auto us = unicodetoupper((unsigned short)u, langnum);
  542|  4.15M|  memcpy(&u, &us, sizeof(unsigned short));
  543|  4.15M|  return u;
  544|  4.15M|#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|  4.15M|}
_Z9lower_utf6w_chari:
  554|  6.49M|w_char lower_utf(w_char u, int langnum) {
  555|       |
  556|  6.49M|#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|  6.49M|  const auto us = unicodetolower((unsigned short)u, langnum);
  566|  6.49M|  memcpy(&u, &us, sizeof(unsigned short));
  567|  6.49M|  return u;
  568|  6.49M|#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|  6.49M|}
_Z8mkallcapRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  579|   276k|std::string& mkallcap(std::string& s, const struct cs_info* csconv) {
  580|  5.64M|  for (char& aI : s) {
  ------------------
  |  Branch (580:17): [True: 5.64M, False: 276k]
  ------------------
  581|  5.64M|    aI = cupper(csconv, static_cast<unsigned char>(aI));
  582|  5.64M|  }
  583|   276k|  return s;
  584|   276k|}
_Z10mkallsmallRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  587|  1.65M|std::string& mkallsmall(std::string& s, const struct cs_info* csconv) {
  588|  17.6M|  for (char& aI : s) {
  ------------------
  |  Branch (588:17): [True: 17.6M, False: 1.65M]
  ------------------
  589|  17.6M|    aI = clower(csconv, static_cast<unsigned char>(aI));
  590|  17.6M|  }
  591|  1.65M|  return s;
  592|  1.65M|}
_Z14mkallsmall_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  594|   922k|std::vector<w_char>& mkallsmall_utf(std::vector<w_char>& u, int langnum) {
  595|  6.47M|  for (auto& i : u) {
  ------------------
  |  Branch (595:16): [True: 6.47M, False: 922k]
  ------------------
  596|  6.47M|    i = lower_utf(i, langnum);
  597|  6.47M|  }
  598|   922k|  return u;
  599|   922k|}
_Z12mkallcap_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  601|   159k|std::vector<w_char>& mkallcap_utf(std::vector<w_char>& u, int langnum) {
  602|  1.95M|  for (auto& i : u) {
  ------------------
  |  Branch (602:16): [True: 1.95M, False: 159k]
  ------------------
  603|  1.95M|    i = upper_utf(i, langnum);
  604|  1.95M|  }
  605|   159k|  return u;
  606|   159k|}
_Z9mkinitcapRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  608|   816k|std::string& mkinitcap(std::string& s, const struct cs_info* csconv) {
  609|   816k|  if (!s.empty()) {
  ------------------
  |  Branch (609:7): [True: 816k, False: 215]
  ------------------
  610|   816k|    s[0] = cupper(csconv, static_cast<unsigned char>(s[0]));
  611|   816k|  }
  612|   816k|  return s;
  613|   816k|}
_Z13mkinitcap_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  615|   244k|std::vector<w_char>& mkinitcap_utf(std::vector<w_char>& u, int langnum) {
  616|   244k|  if (!u.empty()) {
  ------------------
  |  Branch (616:7): [True: 244k, False: 0]
  ------------------
  617|   244k|    u[0] = upper_utf(u[0], langnum);
  618|   244k|  }
  619|   244k|  return u;
  620|   244k|}
_Z11mkinitsmallRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  622|  11.0k|std::string& mkinitsmall(std::string& s, const struct cs_info* csconv) {
  623|  11.0k|  if (!s.empty()) {
  ------------------
  |  Branch (623:7): [True: 11.0k, False: 0]
  ------------------
  624|  11.0k|    s[0] = clower(csconv, static_cast<unsigned char>(s[0]));
  625|  11.0k|  }
  626|  11.0k|  return s;
  627|  11.0k|}
_Z15mkinitsmall_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  629|  3.28k|std::vector<w_char>& mkinitsmall_utf(std::vector<w_char>& u, int langnum) {
  630|  3.28k|  if (!u.empty()) {
  ------------------
  |  Branch (630:7): [True: 3.28k, False: 0]
  ------------------
  631|  3.28k|    u[0] = lower_utf(u[0], langnum);
  632|  3.28k|  }
  633|  3.28k|  return u;
  634|  3.28k|}
_Z14get_current_csRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 2292|  1.82k|const struct cs_info* get_current_cs(const std::string& es) {
 2293|  1.82k|  char* normalized_encoding = new char[es.size() + 1];
 2294|  1.82k|  toAsciiLowerAndRemoveNonAlphanumeric(es.c_str(), normalized_encoding);
 2295|       |
 2296|  1.82k|  const struct cs_info* ccs = nullptr;
 2297|  1.82k|  for (const auto& encd : encds) {
  ------------------
  |  Branch (2297:25): [True: 1.82k, False: 0]
  ------------------
 2298|  1.82k|    if (strcmp(normalized_encoding, encd.enc_name) == 0) {
  ------------------
  |  Branch (2298:9): [True: 1.82k, False: 0]
  ------------------
 2299|  1.82k|      ccs = encd.cs_table;
 2300|  1.82k|      break;
 2301|  1.82k|    }
 2302|  1.82k|  }
 2303|       |
 2304|  1.82k|  delete[] normalized_encoding;
 2305|       |
 2306|  1.82k|  if (!ccs) {
  ------------------
  |  Branch (2306:7): [True: 0, False: 1.82k]
  ------------------
 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.82k|  return ccs;
 2314|  1.82k|}
_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|  23.6M|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|  23.6M|  if (c == 0x0069 && ((langnum == LANG_az) || (langnum == LANG_tr) || (langnum == LANG_crh)))
  ------------------
  |  Branch (2457:7): [True: 53.8k, False: 23.5M]
  |  Branch (2457:23): [True: 0, False: 53.8k]
  |  Branch (2457:47): [True: 0, False: 53.8k]
  |  Branch (2457:71): [True: 0, False: 53.8k]
  ------------------
 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|  23.6M|  unsigned short up = utf_pages[utf_page_index[c >> 8]][c & 0xFF].cupper;
 2466|  23.6M|  return up ? up : c;
  ------------------
  |  Branch (2466:10): [True: 5.29M, False: 18.3M]
  ------------------
 2467|  23.6M|#endif
 2468|  23.6M|#endif
 2469|  23.6M|}
_Z14unicodetolowerti:
 2471|  26.8M|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|  26.8M|  if (c == 0x0049 && ((langnum == LANG_az) || (langnum == LANG_tr) || (langnum == LANG_crh)))
  ------------------
  |  Branch (2475:7): [True: 8.76k, False: 26.8M]
  |  Branch (2475:23): [True: 0, False: 8.76k]
  |  Branch (2475:47): [True: 0, False: 8.76k]
  |  Branch (2475:71): [True: 0, False: 8.76k]
  ------------------
 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|  26.8M|  unsigned short lo = utf_pages[utf_page_index[c >> 8]][c & 0xFF].clower;
 2484|  26.8M|  return lo ? lo : c;
  ------------------
  |  Branch (2484:10): [True: 2.40M, False: 24.4M]
  ------------------
 2485|  26.8M|#endif
 2486|  26.8M|#endif
 2487|  26.8M|}
_Z11get_captypeRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
 2498|  8.81M|int get_captype(const std::string& word, const cs_info* csconv) {
 2499|       |  // now determine the capitalization type of the first nl letters
 2500|  8.81M|  size_t ncap = 0;
 2501|  8.81M|  size_t nneutral = 0;
 2502|  8.81M|  size_t firstcap = 0;
 2503|  8.81M|  if (csconv == nullptr)
  ------------------
  |  Branch (2503:7): [True: 0, False: 8.81M]
  ------------------
 2504|      0|    return NOCAP;
  ------------------
  |  |   92|      0|#define NOCAP 0
  ------------------
 2505|   120M|  for (char q : word) {
  ------------------
  |  Branch (2505:15): [True: 120M, False: 8.81M]
  ------------------
 2506|   120M|    const auto nIndex = static_cast<unsigned char>(q);
 2507|   120M|    if (ccase(csconv, nIndex))
  ------------------
  |  Branch (2507:9): [True: 5.29M, False: 115M]
  ------------------
 2508|  5.29M|      ncap++;
 2509|   120M|    if (cupper(csconv, nIndex) == clower(csconv, nIndex))
  ------------------
  |  Branch (2509:9): [True: 92.9M, False: 27.3M]
  ------------------
 2510|  92.9M|      nneutral++;
 2511|   120M|  }
 2512|  8.81M|  if (ncap) {
  ------------------
  |  Branch (2512:7): [True: 1.58M, False: 7.22M]
  ------------------
 2513|  1.58M|    const auto nIndex = static_cast<unsigned char>(word[0]);
 2514|  1.58M|    firstcap = csconv[nIndex].ccase;
 2515|  1.58M|  }
 2516|       |
 2517|       |  // now finally set the captype
 2518|  8.81M|  if (ncap == 0) {
  ------------------
  |  Branch (2518:7): [True: 7.22M, False: 1.58M]
  ------------------
 2519|  7.22M|    return NOCAP;
  ------------------
  |  |   92|  7.22M|#define NOCAP 0
  ------------------
 2520|  7.22M|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (2520:14): [True: 803k, False: 782k]
  |  Branch (2520:29): [True: 428k, False: 374k]
  ------------------
 2521|   428k|    return INITCAP;
  ------------------
  |  |   93|   428k|#define INITCAP 1
  ------------------
 2522|  1.15M|  } else if ((ncap == word.size()) || ((ncap + nneutral) == word.size())) {
  ------------------
  |  Branch (2522:14): [True: 8.72k, False: 1.14M]
  |  Branch (2522:39): [True: 129k, False: 1.01M]
  ------------------
 2523|   138k|    return ALLCAP;
  ------------------
  |  |   94|   138k|#define ALLCAP 2
  ------------------
 2524|  1.01M|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (2524:14): [True: 700k, False: 318k]
  |  Branch (2524:28): [True: 294k, False: 405k]
  ------------------
 2525|   294k|    return HUHINITCAP;
  ------------------
  |  |   96|   294k|#define HUHINITCAP 4
  ------------------
 2526|   294k|  }
 2527|   724k|  return HUHCAP;
  ------------------
  |  |   95|   724k|#define HUHCAP 3
  ------------------
 2528|  8.81M|}
_Z16get_captype_utf8RKNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
 2530|  2.39M|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.39M|  size_t ncap = 0;
 2533|  2.39M|  size_t nneutral = 0;
 2534|  2.39M|  size_t firstcap = 0;
 2535|       |
 2536|  2.39M|  auto it = word.begin(), it_end = word.end();
 2537|  21.7M|  while (it != it_end) {
  ------------------
  |  Branch (2537:10): [True: 19.3M, False: 2.39M]
  ------------------
 2538|  19.3M|    const auto idx = (unsigned short)*it;
 2539|  19.3M|    const auto lwridx = unicodetolower(idx, langnum);
 2540|  19.3M|    if (idx != lwridx)
  ------------------
  |  Branch (2540:9): [True: 1.01M, False: 18.3M]
  ------------------
 2541|  1.01M|      ncap++;
 2542|  19.3M|    if (unicodetoupper(idx, langnum) == lwridx)
  ------------------
  |  Branch (2542:9): [True: 14.0M, False: 5.24M]
  ------------------
 2543|  14.0M|      nneutral++;
 2544|  19.3M|    ++it;
 2545|  19.3M|  }
 2546|  2.39M|  if (ncap) {
  ------------------
  |  Branch (2546:7): [True: 381k, False: 2.00M]
  ------------------
 2547|   381k|    const auto idx = (unsigned short)word[0];
 2548|   381k|    firstcap = (idx != unicodetolower(idx, langnum));
 2549|   381k|  }
 2550|       |
 2551|       |  // now finally set the captype
 2552|  2.39M|  if (ncap == 0) {
  ------------------
  |  Branch (2552:7): [True: 2.00M, False: 381k]
  ------------------
 2553|  2.00M|    return NOCAP;
  ------------------
  |  |   92|  2.00M|#define NOCAP 0
  ------------------
 2554|  2.00M|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (2554:14): [True: 228k, False: 152k]
  |  Branch (2554:29): [True: 110k, False: 118k]
  ------------------
 2555|   110k|    return INITCAP;
  ------------------
  |  |   93|   110k|#define INITCAP 1
  ------------------
 2556|   270k|  } else if ((ncap == word.size()) || ((ncap + nneutral) == word.size())) {
  ------------------
  |  Branch (2556:14): [True: 4.58k, False: 266k]
  |  Branch (2556:39): [True: 57.8k, False: 208k]
  ------------------
 2557|  62.3k|    return ALLCAP;
  ------------------
  |  |   94|  62.3k|#define ALLCAP 2
  ------------------
 2558|   208k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (2558:14): [True: 100k, False: 108k]
  |  Branch (2558:28): [True: 42.6k, False: 57.7k]
  ------------------
 2559|  42.6k|    return HUHINITCAP;
  ------------------
  |  |   96|  42.6k|#define HUHINITCAP 4
  ------------------
 2560|  42.6k|  }
 2561|   165k|  return HUHCAP;
  ------------------
  |  |   95|   165k|#define HUHCAP 3
  ------------------
 2562|  2.39M|}
_Z24remove_ignored_chars_utfRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEE:
 2566|   600k|                                const std::vector<w_char>& ignored_chars) {
 2567|   600k|  std::vector<w_char> w;
 2568|   600k|  std::vector<w_char> w2;
 2569|   600k|  u8_u16(w, word);
 2570|       |
 2571|   600k|  std::copy_if(w.begin(), w.end(), std::back_inserter(w2),
 2572|   600k|  [&ignored_chars](w_char wc) {
 2573|   600k|    return !std::binary_search(ignored_chars.begin(), ignored_chars.end(), wc);
 2574|   600k|  });
 2575|       |
 2576|   600k|  u16_u8(word, w2);
 2577|   600k|  return w2.size();
 2578|   600k|}
_Z20remove_ignored_charsRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_:
 2582|  1.96M|                            const std::string& ignored_chars) {
 2583|  1.96M|  word.erase(
 2584|  1.96M|      std::remove_if(word.begin(), word.end(), is_any_of(ignored_chars)),
 2585|  1.96M|      word.end());
 2586|  1.96M|  return word.size();
 2587|  1.96M|}
_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|   819k|static void warn_missing_cont(const std::string& src, std::string::const_iterator p) {
  154|       |  HUNSPELL_WARNING(stderr,
  155|   819k|                   "UTF-8 encoding error. Missing continuation byte in "
  156|   819k|                   "%ld. character position:\n%s\n",
  157|   819k|                   static_cast<long>(std::distance(src.begin(), p)),
  158|   819k|                   src.c_str());
  159|   819k|}
csutil.cxx:_ZN12_GLOBAL__N_19is_any_ofC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  244|  1.97M|  explicit is_any_of(const std::string& in) : chars(in) {}
csutil.cxx:_ZNK12_GLOBAL__N_19is_any_ofclEc:
  246|  28.2M|  bool operator()(char c) const { return chars.find(c) != std::string::npos; }
csutil.cxx:_ZN12_GLOBAL__N_16cupperEPK7cs_infoi:
  514|   126M|unsigned char cupper(const struct cs_info* csconv, int nIndex) {
  515|   126M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (515:3): [True: 126M, False: 0]
  |  Branch (515:3): [True: 126M, False: 0]
  |  Branch (515:3): [True: 126M, False: 0]
  ------------------
  516|   126M|  return csconv[nIndex].cupper;
  517|   126M|}
csutil.cxx:_ZN12_GLOBAL__N_16clowerEPK7cs_infoi:
  519|   138M|unsigned char clower(const struct cs_info* csconv, int nIndex) {
  520|   138M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (520:3): [True: 138M, False: 0]
  |  Branch (520:3): [True: 138M, False: 0]
  |  Branch (520:3): [True: 138M, False: 0]
  ------------------
  521|   138M|  return csconv[nIndex].clower;
  522|   138M|}
csutil.cxx:_ZL36toAsciiLowerAndRemoveNonAlphanumericPKcPc:
 2272|  1.82k|                                                 char* pBuf) {
 2273|  16.5k|  while (*pName) {
  ------------------
  |  Branch (2273:10): [True: 14.7k, False: 1.82k]
  ------------------
 2274|       |    /* A-Z */
 2275|  14.7k|    if ((*pName >= 0x41) && (*pName <= 0x5A)) {
  ------------------
  |  Branch (2275:9): [True: 5.47k, False: 9.22k]
  |  Branch (2275:29): [True: 294, False: 5.18k]
  ------------------
 2276|    294|      *pBuf = (*pName) + 0x20; /* toAsciiLower */
 2277|    294|      pBuf++;
 2278|    294|    }
 2279|       |    /* a-z, 0-9 */
 2280|  14.4k|    else if (((*pName >= 0x61) && (*pName <= 0x7A)) ||
  ------------------
  |  Branch (2280:15): [True: 5.18k, False: 9.22k]
  |  Branch (2280:35): [True: 5.18k, False: 0]
  ------------------
 2281|  14.3k|             ((*pName >= 0x30) && (*pName <= 0x39))) {
  ------------------
  |  Branch (2281:15): [True: 9.13k, False: 98]
  |  Branch (2281:35): [True: 9.13k, False: 0]
  ------------------
 2282|  14.3k|      *pBuf = *pName;
 2283|  14.3k|      pBuf++;
 2284|  14.3k|    }
 2285|       |
 2286|  14.7k|    pName++;
 2287|  14.7k|  }
 2288|       |
 2289|  1.82k|  *pBuf = '\0';
 2290|  1.82k|}
csutil.cxx:_ZN12_GLOBAL__N_15ccaseEPK7cs_infoi:
  524|   120M|unsigned char ccase(const struct cs_info* csconv, int nIndex) {
  525|   120M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (525:3): [True: 120M, False: 0]
  |  Branch (525:3): [True: 120M, False: 0]
  |  Branch (525:3): [True: 120M, False: 0]
  ------------------
  526|   120M|  return csconv[nIndex].ccase;
  527|   120M|}
csutil.cxx:_ZZ24remove_ignored_chars_utfRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEEENK3$_0clES8_:
 2572|  4.88M|  [&ignored_chars](w_char wc) {
 2573|  4.88M|    return !std::binary_search(ignored_chars.begin(), ignored_chars.end(), wc);
 2574|  4.88M|  });

_Z12is_utf8_contc:
  143|  62.8M|inline bool is_utf8_cont(char c) {
  144|  62.8M|  return (static_cast<unsigned char>(c) & 0xc0) == 0x80;
  145|  62.8M|}
_Z9utf8_nextRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm:
  148|  23.5k|inline size_t utf8_next(const std::string& s, size_t pos) {
  149|  23.5k|  if (pos < s.size()) {
  ------------------
  |  Branch (149:7): [True: 23.5k, False: 0]
  ------------------
  150|  23.5k|    ++pos;
  151|  28.0k|    while (pos < s.size() && is_utf8_cont(s[pos]))
  ------------------
  |  Branch (151:12): [True: 25.7k, False: 2.34k]
  |  Branch (151:30): [True: 4.55k, False: 21.1k]
  ------------------
  152|  4.55k|      ++pos;
  153|  23.5k|  }
  154|  23.5k|  return pos;
  155|  23.5k|}
_Z20has_no_ignored_charsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_:
  290|    757|                            const std::string& ignored_chars) {
  291|    757|  return std::all_of(ignored_chars.begin(), ignored_chars.end(),
  292|    757|    [&word](char ic) { return word.find(ic) == std::string::npos; });
  293|    757|}
_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.51k]
  ------------------
  299|  1.68M|    ret = nullptr;
  300|  1.51k|  else if (h->var & H_OPT_ALIASM)
  ------------------
  |  |   48|  1.51k|#define H_OPT_ALIASM (1 << 1)   // using alias compression?
  ------------------
  |  Branch (300:12): [True: 0, False: 1.51k]
  ------------------
  301|      0|    ret = get_stored_pointer(HENTRY_WORD(h) + h->blen + 1);
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  302|  1.51k|  else
  303|  1.51k|    ret = HENTRY_WORD(h) + h->blen + 1;
  ------------------
  |  |   54|  1.51k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  304|  1.68M|  return ret;
  305|  1.68M|}
_Z11HENTRY_FINDP6hentryPKc:
  332|  3.71k|inline char* HENTRY_FIND(struct hentry* h, const char* p) {
  333|  3.71k|  char* data = HENTRY_DATA(h);
  334|  3.71k|  return data ? strstr(data, p) : nullptr;
  ------------------
  |  Branch (334:10): [True: 4, False: 3.71k]
  ------------------
  335|  3.71k|}
_ZZ20has_no_ignored_charsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_ENKUlcE_clEc:
  292|  5.88k|    [&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|    289|void HashMgr::release_flags(unsigned short* astr, bool owned) {
  113|    289|  if (owned)
  ------------------
  |  Branch (113:7): [True: 203, False: 86]
  ------------------
  114|    203|    delete[] astr;
  115|    289|}
_ZNK7HashMgr6lookupEPKcm:
  154|   603M|struct hentry* HashMgr::lookup(const char* word, size_t len) const {
  155|   603M|  struct hentry* dp = tableptr[hash(word, len)];
  156|   603M|  if (!dp)
  ------------------
  |  Branch (156:7): [True: 542M, False: 61.0M]
  ------------------
  157|   542M|    return nullptr;
  158|   125M|  for (; dp != nullptr; dp = dp->next) {
  ------------------
  |  Branch (158:10): [True: 66.7M, False: 58.9M]
  ------------------
  159|  66.7M|    if (strcmp(word, dp->word) == 0)
  ------------------
  |  Branch (159:9): [True: 2.19M, False: 64.6M]
  ------------------
  160|  2.19M|      return dp;
  161|  66.7M|  }
  162|  58.9M|  return nullptr;
  163|  61.0M|}
_ZN7HashMgr8add_wordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPtiPS7_bib:
  173|  7.40k|                      bool own_aff) {
  174|       |
  175|  7.40k|  if (al > std::numeric_limits<short>::max()) {
  ------------------
  |  Branch (175:7): [True: 0, False: 7.40k]
  ------------------
  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.40k|  const std::string* word = &in_word;
  182|  7.40k|  const std::string* desc = in_desc;
  183|       |
  184|  7.40k|  std::string* word_copy = nullptr;
  185|  7.40k|  std::string* desc_copy = nullptr;
  186|  7.40k|  if ((!ignorechars.empty() && !has_no_ignored_chars(in_word, ignorechars)) || complexprefixes) {
  ------------------
  |  Branch (186:8): [True: 753, False: 6.65k]
  |  Branch (186:32): [True: 121, False: 632]
  |  Branch (186:80): [True: 463, False: 6.82k]
  ------------------
  187|    584|    word_copy = new std::string(in_word);
  188|       |
  189|    584|    if (!ignorechars.empty()) {
  ------------------
  |  Branch (189:9): [True: 121, False: 463]
  ------------------
  190|    121|      if (utf8) {
  ------------------
  |  Branch (190:11): [True: 33, False: 88]
  ------------------
  191|     33|        wcl = remove_ignored_chars_utf(*word_copy, ignorechars_utf16);
  192|     88|      } else {
  193|     88|        remove_ignored_chars(*word_copy, ignorechars);
  194|     88|      }
  195|    121|    }
  196|       |
  197|    584|    if (complexprefixes) {
  ------------------
  |  Branch (197:9): [True: 463, False: 121]
  ------------------
  198|    463|      if (utf8)
  ------------------
  |  Branch (198:11): [True: 0, False: 463]
  ------------------
  199|      0|        wcl = reverseword_utf(*word_copy);
  200|    463|      else
  201|    463|        reverseword(*word_copy);
  202|       |
  203|    463|      if (in_desc && aliasm.empty()) {
  ------------------
  |  Branch (203:11): [True: 0, False: 463]
  |  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|    463|    }
  215|       |
  216|    584|    word = word_copy;
  217|    584|  }
  218|       |
  219|       |  // limit of hp->blen
  220|  7.40k|  if (word->size() > std::numeric_limits<unsigned short>::max()) {
  ------------------
  |  Branch (220:7): [True: 0, False: 7.40k]
  ------------------
  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.40k|  bool upcasehomonym = false;
  229|  7.40k|  int descl = desc ? (!aliasm.empty() ? sizeof(char*) : desc->size() + 1) : 0;
  ------------------
  |  Branch (229:15): [True: 4, False: 7.40k]
  |  Branch (229:23): [True: 0, False: 4]
  ------------------
  230|       |  // variable-length hash record with word and optional fields
  231|  7.40k|  auto hp =
  232|  7.40k|      (struct hentry*)arena_alloc(sizeof(struct hentry) + word->size() + descl,
  233|  7.40k|                                  alignof(struct hentry));
  234|  7.40k|  if (!hp) {
  ------------------
  |  Branch (234:7): [True: 0, False: 7.40k]
  ------------------
  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.40k|  char* hpw = hp->word;
  242|  7.40k|  memcpy(hpw, word->data(), word->size());
  243|  7.40k|  hpw[word->size()] = 0;
  244|       |
  245|  7.40k|  int i = hash(hpw, word->size());
  246|       |
  247|  7.40k|  hp->blen = (unsigned short)word->size();
  248|  7.40k|  hp->clen = (unsigned short)wcl;
  249|  7.40k|  hp->alen = (short)al;
  250|  7.40k|  hp->astr = aff;
  251|  7.40k|  hp->next = nullptr;
  252|  7.40k|  hp->next_homonym = nullptr;
  253|  7.40k|  hp->var = (captype == INITCAP) ? H_OPT_INITCAP : 0;
  ------------------
  |  |   93|  7.40k|#define INITCAP 1
  ------------------
                hp->var = (captype == INITCAP) ? H_OPT_INITCAP : 0;
  ------------------
  |  |   50|  4.55k|#define H_OPT_INITCAP (1 << 3)  // is dictionary word capitalized?
  ------------------
  |  Branch (253:13): [True: 4.55k, False: 2.85k]
  ------------------
  254|  7.40k|  if (own_aff)
  ------------------
  |  Branch (254:7): [True: 5.20k, False: 2.19k]
  ------------------
  255|  5.20k|    hp->var |= H_OPT_OWNFLAGS;
  ------------------
  |  |   51|  5.20k|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  256|       |
  257|       |  // store the description string or its pointer
  258|  7.40k|  if (desc) {
  ------------------
  |  Branch (258:7): [True: 4, False: 7.40k]
  ------------------
  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.40k|  struct hentry* dp = tableptr[i];
  370|  7.40k|  if (!dp) {
  ------------------
  |  Branch (370:7): [True: 5.84k, False: 1.55k]
  ------------------
  371|  5.84k|    tableptr[i] = hp;
  372|  5.84k|    delete desc_copy;
  373|  5.84k|    delete word_copy;
  374|  5.84k|    return 0;
  375|  5.84k|  }
  376|  1.88k|  while (dp->next != nullptr) {
  ------------------
  |  Branch (376:10): [True: 332, False: 1.55k]
  ------------------
  377|    332|    if ((!dp->next_homonym) && (strcmp(hp->word, dp->word) == 0)) {
  ------------------
  |  Branch (377:9): [True: 313, False: 19]
  |  Branch (377:32): [True: 3, False: 310]
  ------------------
  378|       |      // remove hidden onlyupcase homonym
  379|      3|      if (!onlyupcase) {
  ------------------
  |  Branch (379:11): [True: 2, False: 1]
  ------------------
  380|      2|        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: 2]
  |  Branch (380:13): [True: 0, False: 2]
  ------------------
  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|      2|        } else if (!dp->astr && dp->alen == 0 &&
  ------------------
  |  Branch (390:20): [True: 2, False: 0]
  |  Branch (390:33): [True: 2, False: 0]
  ------------------
  391|      2|                   !hp->astr && hp->alen == 0) {
  ------------------
  |  Branch (391:20): [True: 2, False: 0]
  |  Branch (391:33): [True: 2, False: 0]
  ------------------
  392|       |          // word already exists with no flags, skip duplicate
  393|      2|          release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|      2|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  394|      2|          arena_free(hp);
  395|      2|          delete desc_copy;
  396|      2|          delete word_copy;
  397|      2|          return 0;
  398|      2|        } else {
  399|      0|          dp->next_homonym = hp;
  400|      0|        }
  401|      2|      } else {
  402|      1|        upcasehomonym = true;
  403|      1|      }
  404|      3|    }
  405|    330|    dp = dp->next;
  406|    330|  }
  407|  1.55k|  if (strcmp(hp->word, dp->word) == 0) {
  ------------------
  |  Branch (407:7): [True: 294, False: 1.26k]
  ------------------
  408|       |    // remove hidden onlyupcase homonym
  409|    294|    if (!onlyupcase) {
  ------------------
  |  Branch (409:9): [True: 209, False: 85]
  ------------------
  410|    209|      if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) {
  ------------------
  |  |   99|     16|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 16, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (410:11): [True: 16, False: 193]
  |  Branch (410:11): [True: 16, False: 193]
  ------------------
  411|     16|        release_flags(dp->astr, dp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     16|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  412|     16|        dp->astr = hp->astr;
  413|     16|        dp->alen = hp->alen;
  414|     16|        dp->var &= ~H_OPT_OWNFLAGS;
  ------------------
  |  |   51|     16|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  415|     16|        dp->var |= (hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     16|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  416|     16|        arena_free(hp);
  417|     16|        delete desc_copy;
  418|     16|        delete word_copy;
  419|     16|        return 0;
  420|    193|      } else if (!dp->astr && dp->alen == 0 &&
  ------------------
  |  Branch (420:18): [True: 193, False: 0]
  |  Branch (420:31): [True: 193, False: 0]
  ------------------
  421|    193|                 !hp->astr && hp->alen == 0) {
  ------------------
  |  Branch (421:18): [True: 185, False: 8]
  |  Branch (421:31): [True: 185, False: 0]
  ------------------
  422|       |        // word already exists with no flags, skip duplicate
  423|    185|        release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|    185|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  424|    185|        arena_free(hp);
  425|    185|        delete desc_copy;
  426|    185|        delete word_copy;
  427|    185|        return 0;
  428|    185|      } else {
  429|      8|        dp->next_homonym = hp;
  430|      8|      }
  431|    209|    } else {
  432|     85|      upcasehomonym = true;
  433|     85|    }
  434|    294|  }
  435|  1.35k|  if (!upcasehomonym) {
  ------------------
  |  Branch (435:7): [True: 1.26k, False: 86]
  ------------------
  436|  1.26k|    dp->next = hp;
  437|  1.26k|  } else {
  438|       |    // remove hidden onlyupcase homonym
  439|     86|    release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     86|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  440|     86|    arena_free(hp);
  441|     86|  }
  442|       |
  443|  1.35k|  delete desc_copy;
  444|  1.35k|  delete word_copy;
  445|  1.35k|  return 0;
  446|  1.55k|}
_ZN7HashMgr27add_hidden_capitalized_wordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPtiPS7_i:
  453|  5.36k|                                         int captype) {
  454|  5.36k|  if (flags == nullptr)
  ------------------
  |  Branch (454:7): [True: 5.26k, False: 106]
  ------------------
  455|  5.26k|    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.36k|  if (((captype == HUHCAP) || (captype == HUHINITCAP) ||
  ------------------
  |  |   95|  5.36k|#define HUHCAP 3
  ------------------
                if (((captype == HUHCAP) || (captype == HUHINITCAP) ||
  ------------------
  |  |   96|  5.11k|#define HUHINITCAP 4
  ------------------
  |  Branch (460:8): [True: 252, False: 5.11k]
  |  Branch (460:31): [True: 1.77k, False: 3.34k]
  ------------------
  461|  3.34k|       ((captype == ALLCAP) && (flagslen != 0))) &&
  ------------------
  |  |   94|  3.34k|#define ALLCAP 2
  ------------------
  |  Branch (461:9): [True: 378, False: 2.96k]
  |  Branch (461:32): [True: 16, False: 362]
  ------------------
  462|  2.03k|      !((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.02k]
  ------------------
  463|  2.03k|    auto flags2 = (unsigned short*)arena_alloc((flagslen + 1) * sizeof(unsigned short),
  464|  2.03k|                                                alignof(unsigned short));
  465|  2.03k|    flags2[flagslen] = ONLYUPCASEFLAG;
  ------------------
  |  |  128|  2.03k|#define ONLYUPCASEFLAG 65511
  ------------------
  466|  2.03k|    if (flagslen) {
  ------------------
  |  Branch (466:9): [True: 16, False: 2.02k]
  ------------------
  467|     16|      memcpy(flags2, flags, flagslen * sizeof(unsigned short));
  468|     16|      std::sort(flags2, flags2 + flagslen + 1);
  469|     16|    }
  470|  2.03k|    if (utf8) {
  ------------------
  |  Branch (470:9): [True: 162, False: 1.87k]
  ------------------
  471|    162|      std::string st;
  472|    162|      std::vector<w_char> w;
  473|    162|      u8_u16(w, word);
  474|    162|      mkallsmall_utf(w, langnum);
  475|    162|      mkinitcap_utf(w, langnum);
  476|    162|      u16_u8(st, w);
  477|    162|      return add_word(st, wcl, flags2, flagslen + 1, dp, true, INITCAP, false);
  ------------------
  |  |   93|    162|#define INITCAP 1
  ------------------
  478|  1.87k|    } else {
  479|  1.87k|      std::string new_word(word);
  480|  1.87k|      mkallsmall(new_word, csconv);
  481|  1.87k|      mkinitcap(new_word, csconv);
  482|  1.87k|      int ret = add_word(new_word, wcl, flags2, flagslen + 1, dp, true, INITCAP, false);
  ------------------
  |  |   93|  1.87k|#define INITCAP 1
  ------------------
  483|  1.87k|      return ret;
  484|  1.87k|    }
  485|  2.03k|  }
  486|  3.33k|  return 0;
  487|  5.36k|}
_ZN7HashMgr20get_clen_and_captypeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiRNS0_6vectorI6w_charNS4_ISB_EEEE:
  490|  5.36k|int HashMgr::get_clen_and_captype(const std::string& word, int* captype, std::vector<w_char> &workbuf) {
  491|  5.36k|  int len;
  492|  5.36k|  if (utf8) {
  ------------------
  |  Branch (492:7): [True: 2.55k, False: 2.81k]
  ------------------
  493|  2.55k|    len = u8_u16(workbuf, word);
  494|  2.55k|    *captype = get_captype_utf8(workbuf, langnum);
  495|  2.81k|  } else {
  496|  2.81k|    len = word.size();
  497|  2.81k|    *captype = get_captype(word, csconv);
  498|  2.81k|  }
  499|  5.36k|  return len;
  500|  5.36k|}
_ZN7HashMgr20get_clen_and_captypeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPi:
  502|  5.20k|int HashMgr::get_clen_and_captype(const std::string& word, int* captype) {
  503|  5.20k|  std::vector<w_char> workbuf;
  504|  5.20k|  return get_clen_and_captype(word, captype, workbuf);
  505|  5.20k|}
_ZN7HashMgr21remove_forbidden_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  528|  6.92k|void HashMgr::remove_forbidden_flag(const std::string& word) {
  529|  6.92k|  struct hentry* dp = lookup(word.c_str(), word.size());
  530|  6.92k|  if (!dp)
  ------------------
  |  Branch (530:7): [True: 6.60k, False: 319]
  ------------------
  531|  6.60k|    return;
  532|    670|  while (dp) {
  ------------------
  |  Branch (532:10): [True: 351, False: 319]
  ------------------
  533|    351|    if (dp->astr && TESTAFF(dp->astr, forbiddenword, dp->alen)) {
  ------------------
  |  |   99|     32|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 32]
  |  |  ------------------
  ------------------
  |  Branch (533:9): [True: 32, False: 319]
  ------------------
  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|    351|    dp = dp->next_homonym;
  553|    351|  }
  554|    319|}
_ZN7HashMgr3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  557|  5.18k|int HashMgr::add(const std::string& word) {
  558|  5.18k|  remove_forbidden_flag(word);
  559|  5.18k|  int captype, al = 0;
  560|  5.18k|  unsigned short* flags = nullptr;
  561|  5.18k|  int wcl = get_clen_and_captype(word, &captype);
  562|  5.18k|  if (add_word(word, wcl, flags, al, nullptr, false, captype, true))
  ------------------
  |  Branch (562:7): [True: 0, False: 5.18k]
  ------------------
  563|      0|    return 1;
  564|  5.18k|  return add_hidden_capitalized_word(word, wcl, flags, al, nullptr, captype);
  565|  5.18k|}
_ZN7HashMgr14add_with_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
  578|  1.74k|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|  1.74k|  struct hentry* dp = lookup(example.c_str(), example.size());
  581|  1.74k|  remove_forbidden_flag(word);
  582|  1.74k|  if (dp && dp->astr) {
  ------------------
  |  Branch (582:7): [True: 77, False: 1.66k]
  |  Branch (582:13): [True: 24, False: 53]
  ------------------
  583|     24|    int captype;
  584|     24|    int wcl = get_clen_and_captype(word, &captype);
  585|     24|    auto flags = new unsigned short[dp->alen];
  586|     24|    memcpy(flags, dp->astr, dp->alen * sizeof(unsigned short));
  587|     24|    if (add_word(word, wcl, flags, dp->alen, nullptr, false, captype, true))
  ------------------
  |  Branch (587:9): [True: 0, False: 24]
  ------------------
  588|      0|      return 1;
  589|     24|    return add_hidden_capitalized_word(word, wcl, flags, dp->alen, nullptr, captype);
  590|     24|  }
  591|  1.71k|  return 1;
  592|  1.74k|}
_ZNK7HashMgr14walk_hashtableERiP6hentry:
  596|  2.00M|struct hentry* HashMgr::walk_hashtable(int& col, struct hentry* hp) const {
  597|  2.00M|  if (hp && hp->next != nullptr)
  ------------------
  |  Branch (597:7): [True: 1.94M, False: 62.4k]
  |  Branch (597:13): [True: 135k, False: 1.80M]
  ------------------
  598|   135k|    return hp->next;
  599|  63.1M|  for (col++; col < (int)tableptr.size(); ++col) {
  ------------------
  |  Branch (599:15): [True: 63.0M, False: 62.4k]
  ------------------
  600|  63.0M|    if (tableptr[col])
  ------------------
  |  Branch (600:9): [True: 1.80M, False: 61.2M]
  ------------------
  601|  1.80M|      return tableptr[col];
  602|  63.0M|  }
  603|       |  // null at end and reset to start
  604|  62.4k|  col = -1;
  605|  62.4k|  return nullptr;
  606|  1.86M|}
_ZN7HashMgr11load_tablesEPKcS1_:
  609|     38|int HashMgr::load_tables(const char* tpath, const char* key) {
  610|       |  // open dictionary file
  611|     38|  FileMgr* dict = new FileMgr(tpath, key);
  612|       |
  613|       |  // first read the first line of file to get hash table size
  614|     38|  std::string ts;
  615|     38|  if (!dict->getline(ts)) {
  ------------------
  |  Branch (615:7): [True: 0, False: 38]
  ------------------
  616|      0|    fprintf(stderr, "error: empty dic file %s\n", tpath);
  617|      0|    delete dict;
  618|      0|    return 2;
  619|      0|  }
  620|     38|  mychomp(ts);
  621|       |
  622|       |  /* remove byte order mark */
  623|     38|  if (ts.compare(0, 3, "\xEF\xBB\xBF", 3) == 0) {
  ------------------
  |  Branch (623:7): [True: 0, False: 38]
  ------------------
  624|      0|    ts.erase(0, 3);
  625|      0|  }
  626|       |
  627|     38|  int tablesize = atoi(ts.c_str());
  628|       |
  629|     38|  const int nExtra = 5 + USERWORD;
  ------------------
  |  |   57|     38|#define USERWORD 1000
  ------------------
  630|       |#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  631|       |  // covers full-form uncompressed dictionaries (~7M for uk_UA expanded)
  632|       |  const int max_allowed = 10000000;
  633|       |#else
  634|     38|  const int max_allowed = (10000 - 1 - nExtra) / int(sizeof(struct hentry*));
  635|     38|#endif
  636|       |
  637|     38|  if (tablesize <= 0 || tablesize >= max_allowed) {
  ------------------
  |  Branch (637:7): [True: 0, False: 38]
  |  Branch (637:25): [True: 0, False: 38]
  ------------------
  638|      0|    fprintf(stderr,
  639|      0|            "error: %s: line 1: missing or bad word count in the dic file\n",
  640|      0|            tpath);
  641|      0|    delete dict;
  642|      0|    return 4;
  643|      0|  }
  644|     38|  tablesize += nExtra;
  645|     38|  if ((tablesize & 1) == 0)
  ------------------
  |  Branch (645:7): [True: 18, False: 20]
  ------------------
  646|     18|    tablesize++;
  647|       |
  648|       |  // allocate the hash table
  649|     38|  tableptr.resize(tablesize, nullptr);
  650|       |
  651|       |  // loop through all words on much list and add to hash
  652|       |  // table and create word and affix strings
  653|       |
  654|     38|  std::vector<w_char> workbuf;
  655|       |
  656|     38|  int nLineCount(0);
  657|    198|  while (dict->getline(ts)) {
  ------------------
  |  Branch (657:10): [True: 160, False: 38]
  ------------------
  658|    160|    ++nLineCount;
  659|    160|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  660|       |    // limit words loaded to avoid O(n^2) hash chain walk timeout
  661|    160|    if (nLineCount >= tablesize)
  ------------------
  |  Branch (661:9): [True: 0, False: 160]
  ------------------
  662|      0|      break;
  663|    160|#endif
  664|    160|    mychomp(ts);
  665|       |    // split each line into word and morphological description
  666|    160|    size_t dp_pos = 0;
  667|    160|    while ((dp_pos = ts.find(':', dp_pos)) != std::string::npos) {
  ------------------
  |  Branch (667:12): [True: 4, False: 156]
  ------------------
  668|      4|      if ((dp_pos > 3) && (ts[dp_pos - 3] == ' ' || ts[dp_pos - 3] == '\t')) {
  ------------------
  |  Branch (668:11): [True: 4, False: 0]
  |  Branch (668:28): [True: 0, False: 4]
  |  Branch (668:53): [True: 4, False: 0]
  ------------------
  669|      4|        for (dp_pos -= 3; dp_pos > 0 && (ts[dp_pos-1] == ' ' || ts[dp_pos-1] == '\t'); --dp_pos)
  ------------------
  |  Branch (669:27): [True: 4, False: 0]
  |  Branch (669:42): [True: 0, False: 4]
  |  Branch (669:65): [True: 0, False: 4]
  ------------------
  670|      0|          ;
  671|      4|        if (dp_pos == 0) {  // missing word
  ------------------
  |  Branch (671:13): [True: 0, False: 4]
  ------------------
  672|      0|          dp_pos = std::string::npos;
  673|      4|        } else {
  674|      4|          ++dp_pos;
  675|      4|        }
  676|      4|        break;
  677|      4|      }
  678|      0|      ++dp_pos;
  679|      0|    }
  680|       |
  681|       |    // tabulator is the old morphological field separator
  682|    160|    size_t dp2_pos = ts.find('\t');
  683|    160|    if (dp2_pos != std::string::npos && (dp_pos == std::string::npos || dp2_pos < dp_pos)) {
  ------------------
  |  Branch (683:9): [True: 4, False: 156]
  |  Branch (683:42): [True: 0, False: 4]
  |  Branch (683:73): [True: 4, False: 0]
  ------------------
  684|      4|      dp_pos = dp2_pos + 1;
  685|      4|    }
  686|       |
  687|    160|    std::string dp;
  688|    160|    if (dp_pos != std::string::npos) {
  ------------------
  |  Branch (688:9): [True: 4, False: 156]
  ------------------
  689|      4|      dp.assign(ts.substr(dp_pos));
  690|      4|      ts.resize(dp_pos - 1);
  691|      4|    }
  692|       |
  693|       |    // split each line into word and affix char strings
  694|       |    // "\/" signs slash in words (not affix separator)
  695|       |    // "/" at beginning of the line is word character (not affix separator)
  696|    160|    size_t ap_pos = ts.find('/');
  697|    160|    while (ap_pos != std::string::npos) {
  ------------------
  |  Branch (697:12): [True: 82, False: 78]
  ------------------
  698|     82|      if (ap_pos == 0) {
  ------------------
  |  Branch (698:11): [True: 0, False: 82]
  ------------------
  699|      0|        ++ap_pos;
  700|      0|        ap_pos = ts.find('/', ap_pos);
  701|      0|        continue;
  702|     82|      } else if (ts[ap_pos - 1] != '\\')
  ------------------
  |  Branch (702:18): [True: 82, False: 0]
  ------------------
  703|     82|        break;
  704|       |      // replace "\/" with "/"
  705|      0|      ts.erase(ap_pos - 1, 1);
  706|      0|      ap_pos = ts.find('/', ap_pos);
  707|      0|    }
  708|       |
  709|    160|    unsigned short* flags;
  710|    160|    int al;
  711|    160|    if (ap_pos != std::string::npos && ap_pos != ts.size()) {
  ------------------
  |  Branch (711:9): [True: 82, False: 78]
  |  Branch (711:40): [True: 82, False: 0]
  ------------------
  712|     82|      std::string ap(ts.substr(ap_pos + 1));
  713|     82|      ts.resize(ap_pos);
  714|     82|      if (!aliasf.empty()) {
  ------------------
  |  Branch (714:11): [True: 2, False: 80]
  ------------------
  715|      2|        int index = atoi(ap.c_str());
  716|      2|        al = get_aliasf(index, &flags, dict);
  717|      2|        if (!al) {
  ------------------
  |  Branch (717:13): [True: 0, False: 2]
  ------------------
  718|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad flag vector alias\n",
  719|      0|                           dict->getlinenum());
  720|      0|        }
  721|     80|      } else {
  722|     80|        al = decode_flags(&flags, ap, dict, /* arena = */ true);
  723|     80|        if (al == -1) {
  ------------------
  |  Branch (723:13): [True: 0, False: 80]
  ------------------
  724|      0|          HUNSPELL_WARNING(stderr, "Can't allocate memory.\n");
  725|      0|          delete dict;
  726|      0|          return 6;
  727|      0|        }
  728|     80|        std::sort(flags, flags + al);
  729|     80|      }
  730|     82|    } else {
  731|     78|      al = 0;
  732|     78|      flags = nullptr;
  733|     78|    }
  734|       |
  735|    160|    int captype;
  736|    160|    int wcl = get_clen_and_captype(ts, &captype, workbuf);
  737|    160|    const std::string* dp_str = dp.empty() ? nullptr : &dp;
  ------------------
  |  Branch (737:33): [True: 156, False: 4]
  ------------------
  738|       |    // add the word and its index plus its capitalized form optionally
  739|       |    // flags are arena-allocated, so own_aff must be false
  740|    160|    bool own = false;
  741|    160|    if (add_word(ts, wcl, flags, al, dp_str, false, captype, own) ||
  ------------------
  |  Branch (741:9): [True: 0, False: 160]
  ------------------
  742|    160|        add_hidden_capitalized_word(ts, wcl, flags, al, dp_str, captype)) {
  ------------------
  |  Branch (742:9): [True: 0, False: 160]
  ------------------
  743|      0|      delete dict;
  744|      0|      return 5;
  745|      0|    }
  746|    160|  }
  747|       |
  748|     38|  int ret(0);
  749|       |
  750|       |  // reject ludicrous tablesizes
  751|     38|  if (tablesize > 8192 + nExtra && tablesize > nLineCount * 10 + nExtra) {
  ------------------
  |  Branch (751:7): [True: 0, False: 38]
  |  Branch (751:36): [True: 0, False: 0]
  ------------------
  752|      0|    HUNSPELL_WARNING(stderr, ".dic initial approximate word count line value of %d is too large for %d lines\n", tablesize, nLineCount);
  753|      0|    ret = 3;
  754|      0|  }
  755|       |
  756|     38|  delete dict;
  757|     38|  return ret;
  758|     38|}
_ZNK7HashMgr4hashEPKcm:
  762|   603M|int HashMgr::hash(const char* word, size_t len) const {
  763|   603M|  unsigned long hv = 0;
  764|   603M|  size_t i = 0;
  765|  2.98G|  while (i < 4 && i < len)
  ------------------
  |  Branch (765:10): [True: 2.40G, False: 578M]
  |  Branch (765:19): [True: 2.38G, False: 24.9M]
  ------------------
  766|  2.38G|    hv = (hv << 8) | word[i++];
  767|  13.2G|  while (i < len) {
  ------------------
  |  Branch (767:10): [True: 12.6G, False: 603M]
  ------------------
  768|  12.6G|    ROTATE(hv, ROTATE_LEN);
  ------------------
  |  |   44|  12.6G|  (v) = ((v) << (q)) | (((v) >> (32 - q)) & ((1 << (q)) - 1));
  ------------------
  769|  12.6G|    hv ^= word[i++];
  770|  12.6G|  }
  771|   603M|  return (unsigned long)hv % tableptr.size();
  772|   603M|}
_ZNK7HashMgr12decode_flagsEPPtRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEP7FileMgr:
  774|     16|int HashMgr::decode_flags(unsigned short** result, const std::string& flags, FileMgr* af) const {
  775|     16|  return decode_flags(result, flags, af, /* arena = */ false);
  776|     16|}
_ZNK7HashMgr12decode_flagsEPPtRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEP7FileMgrb:
  778|    100|int HashMgr::decode_flags(unsigned short** result, const std::string& flags, FileMgr* af, bool use_arena) const {
  779|    100|  auto alloc = [&](int n) -> unsigned short* {
  780|    100|    return use_arena ? (unsigned short*)this->arena_alloc(n * sizeof(unsigned short),
  781|    100|                                                          alignof(unsigned short))
  782|    100|                     : new unsigned short[n];
  783|    100|  };
  784|    100|  int len;
  785|    100|  if (flags.empty()) {
  ------------------
  |  Branch (785:7): [True: 0, False: 100]
  ------------------
  786|      0|    *result = nullptr;
  787|      0|    return 0;
  788|      0|  }
  789|    100|  switch (flag_mode) {
  790|      0|    case FLAG_LONG: {  // two-character flags (1x2yZz -> 1x 2y Zz)
  ------------------
  |  Branch (790:5): [True: 0, False: 100]
  ------------------
  791|      0|      len = flags.size();
  792|      0|      if ((len & 1) == 1 && af != nullptr)
  ------------------
  |  Branch (792:11): [True: 0, False: 0]
  |  Branch (792:29): [True: 0, False: 0]
  ------------------
  793|      0|        HUNSPELL_WARNING(stderr, "error: line %d: bad flagvector\n",
  794|      0|                         af->getlinenum());
  795|      0|      len >>= 1;
  796|      0|      *result = alloc(len);
  797|      0|      for (int i = 0; i < len; i++) {
  ------------------
  |  Branch (797:23): [True: 0, False: 0]
  ------------------
  798|      0|        unsigned short flag = ((unsigned short)((unsigned char)flags[i << 1]) << 8) |
  799|      0|                              ((unsigned short)((unsigned char)flags[(i << 1) | 1]));
  800|       |
  801|      0|        (*result)[i] = flag;
  802|      0|      }
  803|      0|      break;
  804|      0|    }
  805|      0|    case FLAG_NUM: {  // decimal numbers separated by comma (4521,23,233 -> 4521
  ------------------
  |  Branch (805:5): [True: 0, False: 100]
  ------------------
  806|       |                      // 23 233)
  807|      0|      len = int(1 + std::count_if(flags.begin(), flags.end(), [](char c) { return c == ','; }));
  808|      0|      *result = alloc(len);
  809|      0|      unsigned short* dest = *result;
  810|      0|      const char* src = flags.c_str();
  811|      0|      for (size_t p = 0; p < flags.size(); ++p) {
  ------------------
  |  Branch (811:26): [True: 0, False: 0]
  ------------------
  812|      0|        if (flags[p] == ',') {
  ------------------
  |  Branch (812:13): [True: 0, False: 0]
  ------------------
  813|      0|          int i = atoi(src);
  814|      0|          if ((i > std::numeric_limits<unsigned short>::max() || i < 0) && af != nullptr) {
  ------------------
  |  Branch (814:16): [True: 0, False: 0]
  |  Branch (814:66): [True: 0, False: 0]
  |  Branch (814:76): [True: 0, False: 0]
  ------------------
  815|      0|            HUNSPELL_WARNING(
  816|      0|                stderr, "error: line %d: flag id %d is out of range\n",
  817|      0|                af->getlinenum(), i);
  818|      0|             i = 0;
  819|      0|          }
  820|      0|          *dest = (unsigned short)i;
  821|      0|          if (*dest == 0 && af != nullptr)
  ------------------
  |  Branch (821:15): [True: 0, False: 0]
  |  Branch (821:29): [True: 0, False: 0]
  ------------------
  822|      0|            HUNSPELL_WARNING(stderr, "error: line %d: 0 is wrong flag id\n",
  823|      0|                             af->getlinenum());
  824|      0|          src = flags.c_str() + p + 1;
  825|      0|          dest++;
  826|      0|        }
  827|      0|      }
  828|      0|      int i = atoi(src);
  829|      0|      if ((i > std::numeric_limits<unsigned short>::max() || i < 0) && af) {
  ------------------
  |  Branch (829:12): [True: 0, False: 0]
  |  Branch (829:62): [True: 0, False: 0]
  |  Branch (829:72): [True: 0, False: 0]
  ------------------
  830|      0|        HUNSPELL_WARNING(stderr,
  831|      0|                         "error: line %d: flag id %d is out of range\n",
  832|      0|                         af->getlinenum(), i);
  833|      0|        i = 0;
  834|      0|      }
  835|      0|      *dest = (unsigned short)i;
  836|      0|      if (*dest == 0 && af)
  ------------------
  |  Branch (836:11): [True: 0, False: 0]
  |  Branch (836:25): [True: 0, False: 0]
  ------------------
  837|      0|        HUNSPELL_WARNING(stderr, "error: line %d: 0 is wrong flag id\n",
  838|      0|                         af->getlinenum());
  839|      0|      break;
  840|      0|    }
  841|      0|    case FLAG_UNI: {  // UTF-8 characters
  ------------------
  |  Branch (841:5): [True: 0, False: 100]
  ------------------
  842|      0|      std::vector<w_char> w;
  843|      0|      u8_u16(w, flags);
  844|      0|      len = w.size();
  845|      0|      *result = alloc(len);
  846|      0|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  847|      0|      memcpy(*result, w.data(), len * sizeof(unsigned short));
  848|       |#else
  849|       |      unsigned short* dest = *result;
  850|       |      for (const w_char wc : w) {
  851|       |        *dest = (unsigned short)wc;
  852|       |        dest++;
  853|       |      }
  854|       |#endif
  855|      0|      break;
  856|      0|    }
  857|    100|    default: {  // Ispell's one-character flags (erfg -> e r f g)
  ------------------
  |  Branch (857:5): [True: 100, False: 0]
  ------------------
  858|    100|      len = flags.size();
  859|    100|      *result = alloc(len);
  860|    100|      unsigned short* dest = *result;
  861|    118|      for (const char flag : flags) {
  ------------------
  |  Branch (861:28): [True: 118, False: 100]
  ------------------
  862|    118|        *dest = (unsigned char)flag;
  863|    118|        dest++;
  864|    118|      }
  865|    100|    }
  866|    100|  }
  867|    100|  return len;
  868|    100|}
_ZNK7HashMgr11decode_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  944|     92|unsigned short HashMgr::decode_flag(const std::string& f) const {
  945|     92|  unsigned short s = 0;
  946|     92|  int i;
  947|     92|  switch (flag_mode) {
  948|      0|    case FLAG_LONG:
  ------------------
  |  Branch (948:5): [True: 0, False: 92]
  ------------------
  949|      0|      if (f.size() >= 2)
  ------------------
  |  Branch (949:11): [True: 0, False: 0]
  ------------------
  950|      0|        s = ((unsigned short)((unsigned char)f[0]) << 8) | ((unsigned short)((unsigned char)f[1]));
  951|      0|      break;
  952|      0|    case FLAG_NUM:
  ------------------
  |  Branch (952:5): [True: 0, False: 92]
  ------------------
  953|      0|      i = atoi(f.c_str());
  954|      0|      if (i > std::numeric_limits<unsigned short>::max() || i < 0) {
  ------------------
  |  Branch (954:11): [True: 0, False: 0]
  |  Branch (954:61): [True: 0, False: 0]
  ------------------
  955|      0|        HUNSPELL_WARNING(stderr, "error: flag id %d is out of range\n", i);
  956|      0|        i = 0;
  957|      0|      }
  958|      0|      s = (unsigned short)i;
  959|      0|      break;
  960|      0|    case FLAG_UNI: {
  ------------------
  |  Branch (960:5): [True: 0, False: 92]
  ------------------
  961|      0|      std::vector<w_char> w;
  962|      0|      u8_u16(w, f);
  963|      0|      if (!w.empty())
  ------------------
  |  Branch (963:11): [True: 0, False: 0]
  ------------------
  964|      0|        s = (unsigned short)w[0];
  965|      0|      break;
  966|      0|    }
  967|     92|    default:
  ------------------
  |  Branch (967:5): [True: 92, False: 0]
  ------------------
  968|     92|      if (!f.empty())
  ------------------
  |  Branch (968:11): [True: 92, False: 0]
  ------------------
  969|     92|        s = (unsigned char)f[0];
  970|     92|  }
  971|     92|  if (s == 0)
  ------------------
  |  Branch (971:7): [True: 0, False: 92]
  ------------------
  972|      0|    HUNSPELL_WARNING(stderr, "error: 0 is wrong flag id\n");
  973|     92|  return s;
  974|     92|}
_ZN7HashMgr11load_configEPKcS1_:
 1010|     38|int HashMgr::load_config(const char* affpath, const char* key) {
 1011|     38|  int firstline = 1;
 1012|       |
 1013|       |  // open the affix file
 1014|     38|  FileMgr* afflst = new FileMgr(affpath, key);
 1015|       |
 1016|       |  // read in each line ignoring any that do not
 1017|       |  // start with a known line type indicator
 1018|       |
 1019|     38|  std::string line;
 1020|    922|  while (afflst->getline(line)) {
  ------------------
  |  Branch (1020:10): [True: 886, False: 36]
  ------------------
 1021|    886|    mychomp(line);
 1022|       |
 1023|       |    /* remove byte order mark */
 1024|    886|    if (firstline) {
  ------------------
  |  Branch (1024:9): [True: 38, False: 848]
  ------------------
 1025|     38|      firstline = 0;
 1026|     38|      if (line.compare(0, 3, "\xEF\xBB\xBF", 3) == 0) {
  ------------------
  |  Branch (1026:11): [True: 0, False: 38]
  ------------------
 1027|      0|        line.erase(0, 3);
 1028|      0|      }
 1029|     38|    }
 1030|       |
 1031|       |    /* parse in the try string */
 1032|    886|    if ((line.compare(0, 4, "FLAG", 4) == 0) && line.size() > 4 && isspace(line[4])) {
  ------------------
  |  Branch (1032:9): [True: 0, False: 886]
  |  Branch (1032:49): [True: 0, False: 0]
  |  Branch (1032:68): [True: 0, False: 0]
  ------------------
 1033|      0|      if (flag_mode != FLAG_CHAR) {
  ------------------
  |  Branch (1033:11): [True: 0, False: 0]
  ------------------
 1034|      0|        HUNSPELL_WARNING(stderr,
 1035|      0|                         "error: line %d: multiple definitions of the FLAG "
 1036|      0|                         "affix file parameter\n",
 1037|      0|                         afflst->getlinenum());
 1038|      0|      }
 1039|      0|      if (line.find("long") != std::string::npos)
  ------------------
  |  Branch (1039:11): [True: 0, False: 0]
  ------------------
 1040|      0|        flag_mode = FLAG_LONG;
 1041|      0|      if (line.find("num") != std::string::npos)
  ------------------
  |  Branch (1041:11): [True: 0, False: 0]
  ------------------
 1042|      0|        flag_mode = FLAG_NUM;
 1043|      0|      if (line.find("UTF-8") != std::string::npos)
  ------------------
  |  Branch (1043:11): [True: 0, False: 0]
  ------------------
 1044|      0|        flag_mode = FLAG_UNI;
 1045|      0|      if (flag_mode == FLAG_CHAR) {
  ------------------
  |  Branch (1045:11): [True: 0, False: 0]
  ------------------
 1046|      0|        HUNSPELL_WARNING(
 1047|      0|            stderr,
 1048|      0|            "error: line %d: FLAG needs `num', `long' or `UTF-8' parameter\n",
 1049|      0|            afflst->getlinenum());
 1050|      0|      }
 1051|      0|    }
 1052|       |
 1053|    886|    if (line.compare(0, 13, "FORBIDDENWORD", 13) == 0) {
  ------------------
  |  Branch (1053:9): [True: 2, False: 884]
  ------------------
 1054|      2|      std::string st;
 1055|      2|      if (!parse_string(line, st, afflst->getlinenum())) {
  ------------------
  |  Branch (1055:11): [True: 0, False: 2]
  ------------------
 1056|      0|        delete afflst;
 1057|      0|        return 1;
 1058|      0|      }
 1059|      2|      forbiddenword = decode_flag(st);
 1060|      2|    }
 1061|       |
 1062|    886|    if (line.compare(0, 3, "SET", 3) == 0) {
  ------------------
  |  Branch (1062:9): [True: 18, False: 868]
  ------------------
 1063|     18|      if (!parse_string(line, enc, afflst->getlinenum())) {
  ------------------
  |  Branch (1063:11): [True: 0, False: 18]
  ------------------
 1064|      0|        delete afflst;
 1065|      0|        return 1;
 1066|      0|      }
 1067|     18|      if (enc == "UTF-8") {
  ------------------
  |  Branch (1067:11): [True: 18, False: 0]
  ------------------
 1068|     18|        utf8 = 1;
 1069|     18|      } else
 1070|      0|        csconv = get_current_cs(enc);
 1071|     18|    }
 1072|       |
 1073|    886|    if (line.compare(0, 4, "LANG", 4) == 0) {
  ------------------
  |  Branch (1073:9): [True: 2, False: 884]
  ------------------
 1074|      2|      if (!parse_string(line, lang, afflst->getlinenum())) {
  ------------------
  |  Branch (1074:11): [True: 0, False: 2]
  ------------------
 1075|      0|        delete afflst;
 1076|      0|        return 1;
 1077|      0|      }
 1078|      2|      langnum = get_lang_num(lang);
 1079|      2|    }
 1080|       |
 1081|       |    /* parse in the ignored characters (for example, Arabic optional diacritics
 1082|       |     * characters */
 1083|    886|    if (line.compare(0, 6, "IGNORE", 6) == 0) {
  ------------------
  |  Branch (1083:9): [True: 4, False: 882]
  ------------------
 1084|      4|      if (!parse_array(line, ignorechars, ignorechars_utf16,
  ------------------
  |  Branch (1084:11): [True: 0, False: 4]
  ------------------
 1085|      4|                       utf8, afflst->getlinenum())) {
 1086|      0|        delete afflst;
 1087|      0|        return 1;
 1088|      0|      }
 1089|      4|    }
 1090|       |
 1091|    886|    if ((line.compare(0, 2, "AF", 2) == 0) && line.size() > 2 && isspace(line[2])) {
  ------------------
  |  Branch (1091:9): [True: 2, False: 884]
  |  Branch (1091:47): [True: 2, False: 0]
  |  Branch (1091:66): [True: 2, False: 0]
  ------------------
 1092|      2|      if (!parse_aliasf(line, afflst)) {
  ------------------
  |  Branch (1092:11): [True: 0, False: 2]
  ------------------
 1093|      0|        delete afflst;
 1094|      0|        return 1;
 1095|      0|      }
 1096|      2|    }
 1097|       |
 1098|    886|    if ((line.compare(0, 2, "AM", 2) == 0) && line.size() > 2 && isspace(line[2])) {
  ------------------
  |  Branch (1098:9): [True: 0, False: 886]
  |  Branch (1098:47): [True: 0, False: 0]
  |  Branch (1098:66): [True: 0, False: 0]
  ------------------
 1099|      0|      if (!parse_aliasm(line, afflst)) {
  ------------------
  |  Branch (1099:11): [True: 0, False: 0]
  ------------------
 1100|      0|        delete afflst;
 1101|      0|        return 1;
 1102|      0|      }
 1103|      0|    }
 1104|       |
 1105|    886|    if (line.compare(0, 15, "COMPLEXPREFIXES", 15) == 0)
  ------------------
  |  Branch (1105:9): [True: 2, False: 884]
  ------------------
 1106|      2|      complexprefixes = 1;
 1107|       |
 1108|       |    /* parse in the typical fault correcting table */
 1109|    886|    if (line.compare(0, 3, "REP", 3) == 0) {
  ------------------
  |  Branch (1109:9): [True: 6, False: 880]
  ------------------
 1110|      6|      if (!parse_reptable(line, afflst)) {
  ------------------
  |  Branch (1110:11): [True: 0, False: 6]
  ------------------
 1111|      0|        delete afflst;
 1112|      0|        return 1;
 1113|      0|      }
 1114|      6|    }
 1115|       |
 1116|       |    // don't check the full affix file, yet
 1117|    886|    if (((line.compare(0, 3, "SFX", 3) == 0) ||
  ------------------
  |  Branch (1117:10): [True: 42, False: 844]
  ------------------
 1118|    844|         (line.compare(0, 3, "PFX", 3) == 0)) &&
  ------------------
  |  Branch (1118:10): [True: 24, False: 820]
  ------------------
 1119|     66|            line.size() > 3 && isspace(line[3]) &&
  ------------------
  |  Branch (1119:13): [True: 66, False: 0]
  |  Branch (1119:32): [True: 66, False: 0]
  ------------------
 1120|     66|            !reptable.empty()) // (REP table is in the end of Afrikaans aff file)
  ------------------
  |  Branch (1120:13): [True: 2, False: 64]
  ------------------
 1121|      2|      break;
 1122|    886|  }
 1123|       |
 1124|     38|  delete afflst;
 1125|     38|  return 0;
 1126|     38|}
_ZN7HashMgr12parse_aliasfERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 1129|      2|bool HashMgr::parse_aliasf(const std::string& line, FileMgr* af) {
 1130|      2|  if (!aliasf.empty()) {
  ------------------
  |  Branch (1130:7): [True: 0, False: 2]
  ------------------
 1131|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 1132|      0|                     af->getlinenum());
 1133|      0|    return false;
 1134|      0|  }
 1135|      2|  int i = 0, np = 0, numaliasf = 0;
 1136|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 1137|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (1137:10): [True: 4, False: 2]
  ------------------
 1138|      4|    switch (i) {
 1139|      2|      case 0: {
  ------------------
  |  Branch (1139:7): [True: 2, False: 2]
  ------------------
 1140|      2|        np++;
 1141|      2|        break;
 1142|      0|      }
 1143|      2|      case 1: {
  ------------------
  |  Branch (1143:7): [True: 2, False: 2]
  ------------------
 1144|      2|        numaliasf = atoi(std::string(start_piece, iter).c_str());
 1145|      2|        if (numaliasf < 1) {
  ------------------
  |  Branch (1145:13): [True: 0, False: 2]
  ------------------
 1146|      0|          aliasf.clear();
 1147|      0|          aliasflen.clear();
 1148|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 1149|      0|                           af->getlinenum());
 1150|      0|          return false;
 1151|      0|        }
 1152|      2|        aliasf.reserve(std::min(numaliasf, 16384));
 1153|      2|        aliasflen.reserve(std::min(numaliasf, 16384));
 1154|      2|        np++;
 1155|      2|        break;
 1156|      2|      }
 1157|      0|      default:
  ------------------
  |  Branch (1157:7): [True: 0, False: 4]
  ------------------
 1158|      0|        break;
 1159|      4|    }
 1160|      4|    ++i;
 1161|      4|    start_piece = mystrsep(line, iter);
 1162|      4|  }
 1163|      2|  if (np != 2) {
  ------------------
  |  Branch (1163:7): [True: 0, False: 2]
  ------------------
 1164|      0|    aliasf.clear();
 1165|      0|    aliasflen.clear();
 1166|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 1167|      0|                     af->getlinenum());
 1168|      0|    return false;
 1169|      0|  }
 1170|       |
 1171|       |  /* now parse the numaliasf lines to read in the remainder of the table */
 1172|      6|  for (int j = 0; j < numaliasf; ++j) {
  ------------------
  |  Branch (1172:19): [True: 4, False: 2]
  ------------------
 1173|      4|    std::string nl;
 1174|      4|    unsigned short* alias = nullptr;
 1175|      4|    unsigned aliaslen = 0;
 1176|      4|    i = 0;
 1177|      4|    if (af->getline(nl)) {
  ------------------
  |  Branch (1177:9): [True: 4, False: 0]
  ------------------
 1178|      4|      mychomp(nl);
 1179|      4|      iter = nl.begin();
 1180|      4|      start_piece = mystrsep(nl, iter);
 1181|      4|      bool errored = false;
 1182|     12|      while (!errored && start_piece != nl.end()) {
  ------------------
  |  Branch (1182:14): [True: 12, False: 0]
  |  Branch (1182:14): [True: 8, False: 4]
  |  Branch (1182:26): [True: 8, False: 4]
  ------------------
 1183|      8|        switch (i) {
 1184|      4|          case 0: {
  ------------------
  |  Branch (1184:11): [True: 4, False: 4]
  ------------------
 1185|      4|            if (nl.compare(start_piece - nl.begin(), 2, "AF", 2) != 0) {
  ------------------
  |  Branch (1185:17): [True: 0, False: 4]
  ------------------
 1186|      0|              errored = true;
 1187|      0|              break;
 1188|      0|            }
 1189|      4|            break;
 1190|      4|          }
 1191|      4|          case 1: {
  ------------------
  |  Branch (1191:11): [True: 4, False: 4]
  ------------------
 1192|      4|            std::string piece(start_piece, iter);
 1193|      4|            aliaslen =
 1194|      4|                (unsigned short)decode_flags(&alias, piece, af, /* arena = */ true);
 1195|      4|            std::sort(alias, alias + aliaslen);
 1196|      4|            break;
 1197|      4|          }
 1198|      0|          default:
  ------------------
  |  Branch (1198:11): [True: 0, False: 8]
  ------------------
 1199|      0|            break;
 1200|      8|        }
 1201|      8|        ++i;
 1202|      8|        start_piece = mystrsep(nl, iter);
 1203|      8|      }
 1204|      4|    }
 1205|      4|    if (!alias) {
  ------------------
  |  Branch (1205:9): [True: 0, False: 4]
  ------------------
 1206|      0|      for (int k = 0; k < j; ++k) {
  ------------------
  |  Branch (1206:23): [True: 0, False: 0]
  ------------------
 1207|      0|        arena_free(aliasf[k]);
 1208|      0|      }
 1209|      0|      aliasf.clear();
 1210|      0|      aliasflen.clear();
 1211|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 1212|      0|                       af->getlinenum());
 1213|      0|      return false;
 1214|      0|    }
 1215|       |
 1216|      4|    aliasf.push_back(alias);
 1217|      4|    aliasflen.push_back(aliaslen);
 1218|      4|  }
 1219|      2|  return true;
 1220|      2|}
_ZNK7HashMgr9is_aliasfEv:
 1222|     44|int HashMgr::is_aliasf() const {
 1223|     44|  return !aliasf.empty();
 1224|     44|}
_ZNK7HashMgr10get_aliasfEiPPtP7FileMgr:
 1226|      4|int HashMgr::get_aliasf(int index, unsigned short** fvec, FileMgr* af) const {
 1227|      4|  if (index > 0 && static_cast<size_t>(index) <= aliasflen.size()) {
  ------------------
  |  Branch (1227:7): [True: 4, False: 0]
  |  Branch (1227:20): [True: 4, False: 0]
  ------------------
 1228|      4|    *fvec = aliasf[index - 1];
 1229|      4|    return aliasflen[index - 1];
 1230|      4|  }
 1231|      0|  HUNSPELL_WARNING(stderr, "error: line %d: bad flag alias index: %d\n",
 1232|      0|                   af->getlinenum(), index);
 1233|      0|  *fvec = nullptr;
 1234|      0|  return 0;
 1235|      4|}
_ZNK7HashMgr9is_aliasmEv:
 1333|     32|int HashMgr::is_aliasm() const {
 1334|     32|  return !aliasm.empty();
 1335|     32|}
_ZN7HashMgr14parse_reptableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 1345|      6|bool HashMgr::parse_reptable(const std::string& line, FileMgr* af) {
 1346|      6|  if (!reptable.empty()) {
  ------------------
  |  Branch (1346:7): [True: 0, False: 6]
  ------------------
 1347|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 1348|      0|                     af->getlinenum());
 1349|      0|    return false;
 1350|      0|  }
 1351|      6|  int numrep = -1, i = 0, np = 0;
 1352|      6|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 1353|     18|  while (start_piece != line.end()) {
  ------------------
  |  Branch (1353:10): [True: 12, False: 6]
  ------------------
 1354|     12|    switch (i) {
 1355|      6|      case 0: {
  ------------------
  |  Branch (1355:7): [True: 6, False: 6]
  ------------------
 1356|      6|        np++;
 1357|      6|        break;
 1358|      0|      }
 1359|      6|      case 1: {
  ------------------
  |  Branch (1359:7): [True: 6, False: 6]
  ------------------
 1360|      6|        numrep = atoi(std::string(start_piece, iter).c_str());
 1361|      6|        if (numrep < 1) {
  ------------------
  |  Branch (1361:13): [True: 0, False: 6]
  ------------------
 1362|      0|          HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n",
 1363|      0|                           af->getlinenum());
 1364|      0|          return false;
 1365|      0|        }
 1366|      6|        reptable.reserve(std::min(numrep, 16384));
 1367|      6|        np++;
 1368|      6|        break;
 1369|      6|      }
 1370|      0|      default:
  ------------------
  |  Branch (1370:7): [True: 0, False: 12]
  ------------------
 1371|      0|        break;
 1372|     12|    }
 1373|     12|    ++i;
 1374|     12|    start_piece = mystrsep(line, iter);
 1375|     12|  }
 1376|      6|  if (np != 2) {
  ------------------
  |  Branch (1376:7): [True: 0, False: 6]
  ------------------
 1377|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 1378|      0|                     af->getlinenum());
 1379|      0|    return false;
 1380|      0|  }
 1381|       |
 1382|       |  /* now parse the numrep lines to read in the remainder of the table */
 1383|     12|  for (int j = 0; j < numrep; ++j) {
  ------------------
  |  Branch (1383:19): [True: 6, False: 6]
  ------------------
 1384|      6|    std::string nl;
 1385|      6|    reptable.emplace_back();
 1386|      6|    int type = 0;
 1387|      6|    if (af->getline(nl)) {
  ------------------
  |  Branch (1387:9): [True: 6, False: 0]
  ------------------
 1388|      6|      mychomp(nl);
 1389|      6|      iter = nl.begin();
 1390|      6|      i = 0;
 1391|      6|      start_piece = mystrsep(nl, iter);
 1392|      6|      bool errored = false;
 1393|     24|      while (!errored && start_piece != nl.end()) {
  ------------------
  |  Branch (1393:14): [True: 24, False: 0]
  |  Branch (1393:14): [True: 18, False: 6]
  |  Branch (1393:26): [True: 18, False: 6]
  ------------------
 1394|     18|        switch (i) {
 1395|      6|          case 0: {
  ------------------
  |  Branch (1395:11): [True: 6, False: 12]
  ------------------
 1396|      6|            if (nl.compare(start_piece - nl.begin(), 3, "REP", 3) != 0) {
  ------------------
  |  Branch (1396:17): [True: 0, False: 6]
  ------------------
 1397|      0|              errored = true;
 1398|      0|              break;
 1399|      0|            }
 1400|      6|            break;
 1401|      6|          }
 1402|      6|          case 1: {
  ------------------
  |  Branch (1402:11): [True: 6, False: 12]
  ------------------
 1403|      6|            if (*start_piece == '^')
  ------------------
  |  Branch (1403:17): [True: 0, False: 6]
  ------------------
 1404|      0|              type = 1;
 1405|      6|            reptable.back().pattern.assign(start_piece + type, iter);
 1406|      6|            mystrrep(reptable.back().pattern, "_", " ");
 1407|      6|            if (!reptable.back().pattern.empty() && reptable.back().pattern[reptable.back().pattern.size() - 1] == '$') {
  ------------------
  |  Branch (1407:17): [True: 6, False: 0]
  |  Branch (1407:53): [True: 0, False: 6]
  ------------------
 1408|      0|              type += 2;
 1409|      0|              reptable.back().pattern.resize(reptable.back().pattern.size() - 1);
 1410|      0|            }
 1411|      6|            break;
 1412|      6|          }
 1413|      6|          case 2: {
  ------------------
  |  Branch (1413:11): [True: 6, False: 12]
  ------------------
 1414|      6|            reptable.back().outstrings[type].assign(start_piece, iter);
 1415|      6|            mystrrep(reptable.back().outstrings[type], "_", " ");
 1416|      6|            break;
 1417|      6|          }
 1418|      0|          default:
  ------------------
  |  Branch (1418:11): [True: 0, False: 18]
  ------------------
 1419|      0|            break;
 1420|     18|        }
 1421|     18|        ++i;
 1422|     18|        start_piece = mystrsep(nl, iter);
 1423|     18|      }
 1424|      6|    }
 1425|      6|    if (reptable.back().pattern.empty() || reptable.back().outstrings[type].empty()) {
  ------------------
  |  Branch (1425:9): [True: 0, False: 6]
  |  Branch (1425:44): [True: 0, False: 6]
  ------------------
 1426|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 1427|      0|                       af->getlinenum());
 1428|      0|      reptable.clear();
 1429|      0|      return false;
 1430|      0|    }
 1431|      6|  }
 1432|      6|  return true;
 1433|      6|}
_ZNK7HashMgr12get_reptableEv:
 1436|   386k|const std::vector<replentry>& HashMgr::get_reptable() const {
 1437|   386k|  return reptable;
 1438|   386k|}
_ZNK7HashMgr11arena_allocEmm:
 1440|  9.52k|void* HashMgr::arena_alloc(size_t num_bytes, size_t alignment) const {
 1441|       |  // Fixed-size 64KB chunks: small enough to avoid significant waste on small
 1442|       |  // dictionaries, large enough to amortize per-chunk malloc overhead on large
 1443|       |  // ones. make_unique throws std::bad_alloc on OOM.
 1444|  9.52k|  static const size_t MIN_CHUNK_SIZE = 65536;
 1445|  9.52k|  static const size_t MAX_ALIGNMENT = alignof(max_align_t);
 1446|       |  // Chunk sizes are rounded up to MAX_ALIGNMENT below; with this invariant,
 1447|       |  // any alignment that divides MAX_ALIGNMENT keeps aligned_offset within bounds.
 1448|  9.52k|  assert(alignment > 0 && alignment <= MAX_ALIGNMENT);
  ------------------
  |  Branch (1448:3): [True: 9.52k, False: 0]
  |  Branch (1448:3): [True: 9.52k, False: 0]
  |  Branch (1448:3): [True: 9.52k, False: 0]
  ------------------
 1449|       |  // Pad the offset up to the requested alignment before placing this allocation.
 1450|       |  // make_unique returns memory aligned for any scalar, so chunk-start is fine.
 1451|  9.52k|  size_t aligned_offset = (current_chunk_offset + alignment - 1) & ~(alignment - 1);
 1452|  9.52k|  if (arena.empty() || current_chunk_size - aligned_offset < num_bytes) {
  ------------------
  |  Branch (1452:7): [True: 38, False: 9.49k]
  |  Branch (1452:24): [True: 86, False: 9.40k]
  ------------------
 1453|       |    // Round the new chunk's size up to a multiple of MAX_ALIGNMENT so that an
 1454|       |    // oversized num_bytes (>= MIN_CHUNK_SIZE) cannot leave a non-aligned
 1455|       |    // current_chunk_size that would later cause aligned_offset to overshoot.
 1456|       |    // Allocate before mutating current_chunk_size so a throwing make_unique
 1457|       |    // leaves the HashMgr in a consistent state.
 1458|    124|    size_t new_size = std::max(MIN_CHUNK_SIZE, num_bytes);
 1459|    124|    new_size = (new_size + MAX_ALIGNMENT - 1) & ~(MAX_ALIGNMENT - 1);
 1460|    124|    arena.push_back(std::make_unique<uint8_t[]>(new_size));
 1461|    124|    current_chunk_size = new_size;
 1462|    124|    aligned_offset = 0;
 1463|    124|  }
 1464|       |
 1465|  9.52k|  uint8_t* ptr = &arena.back()[aligned_offset];
 1466|  9.52k|  current_chunk_offset = aligned_offset + num_bytes;
 1467|  9.52k|  ++outstanding_arena_allocations;
 1468|  9.52k|  return ptr;
 1469|  9.52k|}
_ZNK7HashMgr10arena_freeEPv:
 1471|    289|void HashMgr::arena_free(void*) const {
 1472|       |  // The arena vector owns all allocations and frees them in bulk at HashMgr
 1473|       |  // destruction, so this is a no-op for the memory itself. The counter is a
 1474|       |  // memory-safety check: more arena_free calls than arena_alloc calls would
 1475|       |  // indicate a double-free or use-after-free in Hunspell. Abort hard rather
 1476|       |  // than silently desynchronize tracking, even in release builds.
 1477|    289|  if (outstanding_arena_allocations == 0) {
  ------------------
  |  Branch (1477:7): [True: 0, False: 289]
  ------------------
 1478|      0|    std::abort();
 1479|      0|  }
 1480|    289|  --outstanding_arena_allocations;
 1481|    289|}
hashmgr.cxx:_ZZNK7HashMgr12decode_flagsEPPtRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEP7FileMgrbENK3$_0clEi:
  779|    100|  auto alloc = [&](int n) -> unsigned short* {
  780|    100|    return use_arena ? (unsigned short*)this->arena_alloc(n * sizeof(unsigned short),
  ------------------
  |  Branch (780:12): [True: 84, False: 16]
  ------------------
  781|     84|                                                          alignof(unsigned short))
  782|    100|                     : new unsigned short[n];
  783|    100|  };

_ZN12HunspellImplC2EPKcS1_S1_:
  191|     38|  : affixpath(affpath) {
  192|     38|  csconv = nullptr;
  193|     38|  utf8 = 0;
  194|     38|  complexprefixes = 0;
  195|       |
  196|       |  /* first set up the hash manager */
  197|     38|  m_HMgrs.push_back(std::make_unique<HashMgr>(dpath, affpath, key));
  198|       |
  199|       |  /* next set up the affix manager */
  200|       |  /* it needs access to the hash manager lookup methods */
  201|     38|  pAMgr = std::make_unique<AffixMgr>(affpath, m_HMgrs, key);
  202|       |
  203|       |  /* get the preferred try string and the dictionary */
  204|       |  /* encoding from the Affix Manager for that dictionary */
  205|     38|  std::string try_string = pAMgr->get_try_string();
  206|     38|  encoding = pAMgr->get_encoding();
  207|     38|  langnum = pAMgr->get_langnum();
  208|     38|  utf8 = pAMgr->get_utf8();
  209|     38|  if (!utf8)
  ------------------
  |  Branch (209:7): [True: 20, False: 18]
  ------------------
  210|     20|    csconv = get_current_cs(encoding);
  211|     38|  complexprefixes = pAMgr->get_complexprefixes();
  212|     38|  wordbreak = pAMgr->get_breaktable();
  213|       |
  214|       |  /* and finally set up the suggestion manager */
  215|     38|  pSMgr = std::make_unique<SuggestMgr>(try_string, MAXSUGGESTION, pAMgr.get());
  ------------------
  |  |   83|     38|#define MAXSUGGESTION 15
  ------------------
  216|     38|}
_ZN12HunspellImpl12clean_ignoreERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
  235|  25.2M|                                const std::string& src) {
  236|  25.2M|  dest.clear();
  237|  25.2M|  dest.assign(src);
  238|  25.2M|  const char* ignoredchars = pAMgr ? pAMgr->get_ignore() : nullptr;
  ------------------
  |  Branch (238:30): [True: 25.2M, False: 0]
  ------------------
  239|  25.2M|  if (ignoredchars != nullptr) {
  ------------------
  |  Branch (239:7): [True: 2.56M, False: 22.6M]
  ------------------
  240|  2.56M|    if (utf8) {
  ------------------
  |  Branch (240:9): [True: 600k, False: 1.96M]
  ------------------
  241|   600k|      const std::vector<w_char>& ignoredchars_utf16 =
  242|   600k|          pAMgr->get_ignore_utf16();
  243|   600k|      remove_ignored_chars_utf(dest, ignoredchars_utf16);
  244|  1.96M|    } else {
  245|  1.96M|      remove_ignored_chars(dest, ignoredchars);
  246|  1.96M|    }
  247|  2.56M|  }
  248|  25.2M|}
_ZN12HunspellImpl10cleanword2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEERKS6_PiPm:
  262|  11.8M|                         size_t* pabbrev) {
  263|  11.8M|  dest.clear();
  264|  11.8M|  dest_utf.clear();
  265|       |
  266|       |  // remove IGNORE characters from the string
  267|  11.8M|  std::string w2;
  268|  11.8M|  clean_ignore(w2, src);
  269|       |
  270|  11.8M|  const char* q = w2.c_str();
  271|  11.8M|  int nl = (int)w2.size();
  272|       |
  273|       |  // first skip over any leading blanks
  274|  11.9M|  while (*q == ' ') {
  ------------------
  |  Branch (274:10): [True: 125k, False: 11.8M]
  ------------------
  275|   125k|    ++q;
  276|   125k|    nl--;
  277|   125k|  }
  278|       |
  279|       |  // now strip off any trailing periods (recording their presence)
  280|  11.8M|  *pabbrev = 0;
  281|       |
  282|  14.6M|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (282:10): [True: 13.9M, False: 674k]
  |  Branch (282:22): [True: 2.80M, False: 11.1M]
  ------------------
  283|  2.80M|    nl--;
  284|  2.80M|    (*pabbrev)++;
  285|  2.80M|  }
  286|       |
  287|       |  // if no characters are left it can't be capitalized
  288|  11.8M|  if (nl <= 0) {
  ------------------
  |  Branch (288:7): [True: 674k, False: 11.1M]
  ------------------
  289|   674k|    *pcaptype = NOCAP;
  ------------------
  |  |   92|   674k|#define NOCAP 0
  ------------------
  290|   674k|    return 0;
  291|   674k|  }
  292|       |
  293|  11.1M|  dest.append(q, nl);
  294|  11.1M|  nl = dest.size();
  295|  11.1M|  if (utf8) {
  ------------------
  |  Branch (295:7): [True: 2.38M, False: 8.80M]
  ------------------
  296|  2.38M|    u8_u16(dest_utf, dest);
  297|  2.38M|    *pcaptype = get_captype_utf8(dest_utf, langnum);
  298|  8.80M|  } else {
  299|  8.80M|    *pcaptype = get_captype(dest, csconv);
  300|  8.80M|  }
  301|  11.1M|  return nl;
  302|  11.8M|}
_ZN12HunspellImpl9cleanwordERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_PiSA_:
  307|  5.64k|                        int* pabbrev) {
  308|  5.64k|  dest.clear();
  309|  5.64k|  const unsigned char* q = (const unsigned char*)src.c_str();
  310|  5.64k|  int firstcap = 0, nl = (int)src.size();
  311|       |
  312|       |  // first skip over any leading blanks
  313|  7.10k|  while (*q == ' ') {
  ------------------
  |  Branch (313:10): [True: 1.45k, False: 5.64k]
  ------------------
  314|  1.45k|    ++q;
  315|  1.45k|    nl--;
  316|  1.45k|  }
  317|       |
  318|       |  // now strip off any trailing periods (recording their presence)
  319|  5.64k|  *pabbrev = 0;
  320|       |
  321|  19.1k|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (321:10): [True: 18.9k, False: 171]
  |  Branch (321:22): [True: 13.4k, False: 5.47k]
  ------------------
  322|  13.4k|    nl--;
  323|  13.4k|    (*pabbrev)++;
  324|  13.4k|  }
  325|       |
  326|       |  // if no characters are left it can't be capitalized
  327|  5.64k|  if (nl <= 0) {
  ------------------
  |  Branch (327:7): [True: 171, False: 5.47k]
  ------------------
  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.47k|  int ncap = 0;
  334|  5.47k|  int nneutral = 0;
  335|  5.47k|  int nc = 0;
  336|       |
  337|  5.47k|  if (!utf8) {
  ------------------
  |  Branch (337:7): [True: 2.88k, False: 2.58k]
  ------------------
  338|   518k|    while (nl > 0) {
  ------------------
  |  Branch (338:12): [True: 515k, False: 2.88k]
  ------------------
  339|   515k|      nc++;
  340|   515k|      if (csconv[(*q)].ccase)
  ------------------
  |  Branch (340:11): [True: 442k, False: 72.9k]
  ------------------
  341|   442k|        ncap++;
  342|   515k|      if (csconv[(*q)].cupper == csconv[(*q)].clower)
  ------------------
  |  Branch (342:11): [True: 62.4k, False: 453k]
  ------------------
  343|  62.4k|        nneutral++;
  344|   515k|      dest.push_back(*q++);
  345|   515k|      nl--;
  346|   515k|    }
  347|       |    // remember to terminate the destination string
  348|  2.88k|    firstcap = csconv[static_cast<unsigned char>(dest[0])].ccase;
  349|  2.88k|  } else {
  350|  2.58k|    std::vector<w_char> t;
  351|  2.58k|    u8_u16(t, src);
  352|   125k|    for (auto& wc : t) {
  ------------------
  |  Branch (352:19): [True: 125k, False: 2.58k]
  ------------------
  353|   125k|      const auto idx = (unsigned short)wc;
  354|   125k|      const auto low = unicodetolower(idx, langnum);
  355|   125k|      if (idx != low)
  ------------------
  |  Branch (355:11): [True: 83.5k, False: 41.9k]
  ------------------
  356|  83.5k|        ncap++;
  357|   125k|      if (unicodetoupper(idx, langnum) == low)
  ------------------
  |  Branch (357:11): [True: 38.2k, False: 87.3k]
  ------------------
  358|  38.2k|        nneutral++;
  359|   125k|    }
  360|  2.58k|    u16_u8(dest, t);
  361|  2.58k|    if (ncap) {
  ------------------
  |  Branch (361:9): [True: 1.79k, False: 794]
  ------------------
  362|  1.79k|      const auto idx = (unsigned short)t[0];
  363|  1.79k|      firstcap = (idx != unicodetolower(idx, langnum));
  364|  1.79k|    }
  365|  2.58k|  }
  366|       |
  367|       |  // now finally set the captype
  368|  5.47k|  if (ncap == 0) {
  ------------------
  |  Branch (368:7): [True: 1.52k, False: 3.95k]
  ------------------
  369|  1.52k|    *pcaptype = NOCAP;
  ------------------
  |  |   92|  1.52k|#define NOCAP 0
  ------------------
  370|  3.95k|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (370:14): [True: 1.90k, False: 2.05k]
  |  Branch (370:29): [True: 846, False: 1.05k]
  ------------------
  371|    846|    *pcaptype = INITCAP;
  ------------------
  |  |   93|    846|#define INITCAP 1
  ------------------
  372|  3.10k|  } else if ((ncap == nc) || ((ncap + nneutral) == nc)) {
  ------------------
  |  Branch (372:14): [True: 70, False: 3.03k]
  |  Branch (372:30): [True: 949, False: 2.08k]
  ------------------
  373|  1.01k|    *pcaptype = ALLCAP;
  ------------------
  |  |   94|  1.01k|#define ALLCAP 2
  ------------------
  374|  2.08k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (374:14): [True: 1.06k, False: 1.02k]
  |  Branch (374:28): [True: 654, False: 407]
  ------------------
  375|    654|    *pcaptype = HUHINITCAP;
  ------------------
  |  |   96|    654|#define HUHINITCAP 4
  ------------------
  376|  1.43k|  } else {
  377|  1.43k|    *pcaptype = HUHCAP;
  ------------------
  |  |   95|  1.43k|#define HUHCAP 3
  ------------------
  378|  1.43k|  }
  379|  5.47k|}
_ZN12HunspellImpl8mkallcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  381|  3.18k|void HunspellImpl::mkallcap(std::string& u8) {
  382|  3.18k|  if (utf8) {
  ------------------
  |  Branch (382:7): [True: 1.66k, False: 1.52k]
  ------------------
  383|  1.66k|    std::vector<w_char> u16;
  384|  1.66k|    u8_u16(u16, u8);
  385|  1.66k|    ::mkallcap_utf(u16, langnum);
  386|  1.66k|    u16_u8(u8, u16);
  387|  1.66k|  } else {
  388|  1.52k|    ::mkallcap(u8, csconv);
  389|  1.52k|  }
  390|  3.18k|}
_ZN12HunspellImpl11mkallsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
  392|  1.05M|int HunspellImpl::mkallsmall2(std::string& u8, std::vector<w_char>& u16) {
  393|  1.05M|  if (utf8) {
  ------------------
  |  Branch (393:7): [True: 259k, False: 797k]
  ------------------
  394|   259k|    ::mkallsmall_utf(u16, langnum);
  395|   259k|    u16_u8(u8, u16);
  396|   797k|  } else {
  397|   797k|    ::mkallsmall(u8, csconv);
  398|   797k|  }
  399|  1.05M|  return u8.size();
  400|  1.05M|}
_ZN12HunspellImpl11is_keepcaseEPK6hentry:
  438|  16.0k|int HunspellImpl::is_keepcase(const hentry* rv) {
  439|  16.0k|  return pAMgr && rv->astr && pAMgr->get_keepcase() &&
  ------------------
  |  Branch (439:10): [True: 16.0k, False: 0]
  |  Branch (439:19): [True: 412, False: 15.6k]
  |  Branch (439:31): [True: 37, False: 375]
  ------------------
  440|     37|         TESTAFF(rv->astr, pAMgr->get_keepcase(), rv->alen);
  ------------------
  |  |   99|  16.1k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 19, False: 18]
  |  |  ------------------
  ------------------
  441|  16.0k|}
_ZN12HunspellImpl10insert_sugERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_:
  444|  13.6k|void HunspellImpl::insert_sug(std::vector<std::string>& slst, const std::string& word) {
  445|  13.6k|  slst.insert(slst.begin(), word);
  446|  13.6k|}
_ZN12HunspellImpl5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  450|  11.9M|                         std::chrono::steady_clock::time_point suggest_start) {
  451|       |  // something very broken if spell ends up calling itself with the same word
  452|  11.9M|  if (std::find(candidate_stack.begin(), candidate_stack.end(), word) != candidate_stack.end())
  ------------------
  |  Branch (452:7): [True: 0, False: 11.9M]
  ------------------
  453|      0|    return false;
  454|       |
  455|  11.9M|  if (candidate_stack.size() >= MAXBREAKDEPTH)
  ------------------
  |  |   87|  11.9M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (455:7): [True: 0, False: 11.9M]
  ------------------
  456|      0|    return false;
  457|       |
  458|  11.9M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  11.9M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (458:7): [True: 0, False: 11.9M]
  ------------------
  459|      0|    return false;
  460|       |
  461|  11.9M|  candidate_stack.push_back(word);
  462|  11.9M|  bool r = spell_internal(word, candidate_stack, info, root, suggest_start);
  463|  11.9M|  candidate_stack.pop_back();
  464|       |
  465|  11.9M|  if (r && root) {
  ------------------
  |  Branch (465:7): [True: 2.83M, False: 9.07M]
  |  Branch (465:12): [True: 0, False: 2.83M]
  ------------------
  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|  11.9M|  return r;
  476|  11.9M|}
_ZN12HunspellImpl14spell_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  480|  11.9M|                                  std::chrono::steady_clock::time_point suggest_start) {
  481|  11.9M|  struct hentry* rv = nullptr;
  482|       |
  483|  11.9M|  int info2 = 0;
  484|  11.9M|  if (!info)
  ------------------
  |  Branch (484:7): [True: 11.9M, False: 25]
  ------------------
  485|  11.9M|    info = &info2;
  486|     25|  else
  487|     25|    *info = 0;
  488|       |
  489|       |  // Hunspell supports XML input of the simplified API (see manual)
  490|  11.9M|  if (word == SPELL_XML)
  ------------------
  |  |   80|  11.9M|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (490:7): [True: 110k, False: 11.7M]
  ------------------
  491|   110k|    return true;
  492|  11.7M|  if (utf8) {
  ------------------
  |  Branch (492:7): [True: 2.47M, False: 9.31M]
  ------------------
  493|  2.47M|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   86|  2.47M|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  2.47M|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (493:9): [True: 3.48k, False: 2.47M]
  ------------------
  494|  3.48k|      return false;
  495|  9.31M|  } else {
  496|  9.31M|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  9.31M|#define MAXWORDLEN 100
  ------------------
  |  Branch (496:9): [True: 6.10k, False: 9.31M]
  ------------------
  497|  6.10k|      return false;
  498|  9.31M|  }
  499|  11.7M|  int captype = NOCAP;
  ------------------
  |  |   92|  11.7M|#define NOCAP 0
  ------------------
  500|  11.7M|  size_t abbv = 0;
  501|  11.7M|  size_t wl = 0;
  502|       |
  503|  11.7M|  std::string scw;
  504|  11.7M|  std::vector<w_char> sunicw;
  505|       |
  506|       |  // input conversion
  507|  11.7M|  RepList* rl = pAMgr ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (507:17): [True: 11.7M, False: 0]
  ------------------
  508|  11.7M|  {
  509|  11.7M|    std::string wspace;
  510|       |
  511|  11.7M|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (511:23): [True: 361k, False: 11.4M]
  ------------------
  512|  11.7M|    if (convstatus) {
  ------------------
  |  Branch (512:9): [True: 0, False: 11.7M]
  ------------------
  513|       |      // the input conversion can grow the word without limit, so hold the
  514|       |      // converted word to the same maximum length as the raw word
  515|      0|      if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   86|      0|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                    if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   90|      0|#define MAXWORDLEN 100
  ------------------
  |  Branch (515:11): [True: 0, False: 0]
  |  Branch (515:11): [True: 0, False: 0]
  ------------------
  516|      0|        return false;
  517|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
  518|      0|    } else
  519|  11.7M|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
  520|  11.7M|  }
  521|       |
  522|  11.7M|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  523|  11.7M|    if (wl > 32768)
  ------------------
  |  Branch (523:9): [True: 0, False: 11.7M]
  ------------------
  524|      0|      return false;
  525|  11.7M|#endif
  526|       |
  527|       |#ifdef MOZILLA_CLIENT
  528|       |  // accept the abbreviated words without dots
  529|       |  // workaround for the incomplete tokenization of Mozilla
  530|       |  abbv = 1;
  531|       |#endif
  532|       |
  533|  11.7M|  if (wl == 0 || m_HMgrs.empty())
  ------------------
  |  Branch (533:7): [True: 673k, False: 11.1M]
  |  Branch (533:18): [True: 0, False: 11.1M]
  ------------------
  534|   673k|    return true;
  535|  11.1M|  if (root)
  ------------------
  |  Branch (535:7): [True: 0, False: 11.1M]
  ------------------
  536|      0|    root->clear();
  537|       |
  538|       |  // allow numbers with dots, dashes and commas (but forbid double separators:
  539|       |  // "..", "--" etc.). Besides the ASCII digits, accept the Arabic-Indic and
  540|       |  // Extended Arabic-Indic (Persian) digit ranges so those numbers are passed
  541|       |  // over the same way ASCII numbers are.
  542|  11.1M|  enum { NBEGIN, NNUM, NSEP };
  543|  11.1M|  int nstate = NBEGIN;
  544|  11.1M|  size_t i;
  545|  11.1M|  size_t n = utf8 ? sunicw.size() : wl;
  ------------------
  |  Branch (545:14): [True: 2.34M, False: 8.76M]
  ------------------
  546|       |
  547|  17.5M|  for (i = 0; (i < n); i++) {
  ------------------
  |  Branch (547:15): [True: 16.5M, False: 965k]
  ------------------
  548|  16.5M|    unsigned short c = utf8 ? static_cast<unsigned short>(sunicw[i]) : static_cast<unsigned char>(scw[i]);
  ------------------
  |  Branch (548:24): [True: 3.65M, False: 12.9M]
  ------------------
  549|  16.5M|    if ((c >= '0' && c <= '9') || (c >= 0x0660 && c <= 0x0669) ||  // Arabic-Indic digits
  ------------------
  |  Branch (549:10): [True: 11.6M, False: 4.87M]
  |  Branch (549:22): [True: 5.80M, False: 5.89M]
  |  Branch (549:36): [True: 320k, False: 10.4M]
  |  Branch (549:51): [True: 0, False: 320k]
  ------------------
  550|  10.7M|        (c >= 0x06F0 && c <= 0x06F9)) {                            // Extended Arabic-Indic (Persian) digits
  ------------------
  |  Branch (550:10): [True: 320k, False: 10.4M]
  |  Branch (550:25): [True: 0, False: 320k]
  ------------------
  551|  5.80M|      nstate = NNUM;
  552|  10.7M|    } else if ((c == ',') || (c == '.') || (c == '-')) {
  ------------------
  |  Branch (552:16): [True: 80.1k, False: 10.6M]
  |  Branch (552:30): [True: 1.18M, False: 9.49M]
  |  Branch (552:44): [True: 1.92M, False: 7.57M]
  ------------------
  553|  3.18M|      if ((nstate == NSEP) || (i == 0))
  ------------------
  |  Branch (553:11): [True: 112k, False: 3.07M]
  |  Branch (553:31): [True: 2.45M, False: 622k]
  ------------------
  554|  2.56M|        break;
  555|   622k|      nstate = NSEP;
  556|   622k|    } else
  557|  7.57M|      break;
  558|  16.5M|  }
  559|  11.1M|  if ((i == n) && (nstate == NNUM))
  ------------------
  |  Branch (559:7): [True: 965k, False: 10.1M]
  |  Branch (559:19): [True: 730k, False: 235k]
  ------------------
  560|   730k|    return true;
  561|       |
  562|  10.3M|  switch (captype) {
  ------------------
  |  Branch (562:11): [True: 10.3M, False: 0]
  ------------------
  563|   873k|    case HUHCAP:
  ------------------
  |  |   95|   873k|#define HUHCAP 3
  ------------------
  |  Branch (563:5): [True: 873k, False: 9.50M]
  ------------------
  564|       |    /* FALLTHROUGH */
  565|  1.19M|    case HUHINITCAP:
  ------------------
  |  |   96|  1.19M|#define HUHINITCAP 4
  ------------------
  |  Branch (565:5): [True: 320k, False: 10.0M]
  ------------------
  566|  1.19M|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   83|  1.19M|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  567|       |    /* FALLTHROUGH */
  568|  9.67M|    case NOCAP:
  ------------------
  |  |   92|  9.67M|#define NOCAP 0
  ------------------
  |  Branch (568:5): [True: 8.47M, False: 1.90M]
  ------------------
  569|  9.67M|      rv = checkword(scw, info, root, suggest_start);
  570|  9.67M|      if ((abbv) && !(rv)) {
  ------------------
  |  Branch (570:11): [True: 1.61M, False: 8.06M]
  |  Branch (570:21): [True: 1.60M, False: 3.52k]
  ------------------
  571|  1.60M|        std::string u8buffer(scw);
  572|  1.60M|        u8buffer.push_back('.');
  573|  1.60M|        rv = checkword(u8buffer, info, root, suggest_start);
  574|  1.60M|      }
  575|  9.67M|      break;
  576|   186k|    case ALLCAP: {
  ------------------
  |  |   94|   186k|#define ALLCAP 2
  ------------------
  |  Branch (576:5): [True: 186k, False: 10.1M]
  ------------------
  577|   186k|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   83|   186k|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  578|   186k|      rv = checkword(scw, info, root, suggest_start);
  579|   186k|      if (rv)
  ------------------
  |  Branch (579:11): [True: 83, False: 186k]
  ------------------
  580|     83|        break;
  581|   186k|      if (abbv) {
  ------------------
  |  Branch (581:11): [True: 27.7k, False: 158k]
  ------------------
  582|  27.7k|        std::string u8buffer(scw);
  583|  27.7k|        u8buffer.push_back('.');
  584|  27.7k|        rv = checkword(u8buffer, info, root, suggest_start);
  585|  27.7k|        if (rv)
  ------------------
  |  Branch (585:13): [True: 0, False: 27.7k]
  ------------------
  586|      0|          break;
  587|  27.7k|      }
  588|       |      // Spec. prefix handling for Catalan, French, Italian:
  589|       |      // prefixes separated by apostrophe (SANT'ELIA -> Sant'+Elia).
  590|   186k|      size_t apos = pAMgr ? scw.find('\'') : std::string::npos;
  ------------------
  |  Branch (590:21): [True: 186k, False: 0]
  ------------------
  591|   186k|      if (apos != std::string::npos) {
  ------------------
  |  Branch (591:11): [True: 69.6k, False: 117k]
  ------------------
  592|  69.6k|        mkallsmall2(scw, sunicw);
  593|       |        //conversion may result in string with different len to pre-mkallsmall2
  594|       |        //so re-scan
  595|  69.6k|        if (apos != std::string::npos && apos < scw.size() - 1) {
  ------------------
  |  Branch (595:13): [True: 69.6k, False: 0]
  |  Branch (595:42): [True: 62.9k, False: 6.69k]
  ------------------
  596|  62.9k|          std::string part1 = scw.substr(0, apos + 1), part2 = scw.substr(apos + 1);
  597|  62.9k|          if (utf8) {
  ------------------
  |  Branch (597:15): [True: 9.63k, False: 53.2k]
  ------------------
  598|  9.63k|            std::vector<w_char> part1u, part2u;
  599|  9.63k|            u8_u16(part1u, part1);
  600|  9.63k|            u8_u16(part2u, part2);
  601|  9.63k|            mkinitcap2(part2, part2u);
  602|  9.63k|            scw = part1 + part2;
  603|  9.63k|            sunicw = std::move(part1u);
  604|  9.63k|            sunicw.insert(sunicw.end(), part2u.begin(), part2u.end());
  605|  9.63k|            rv = checkword(scw, info, root, suggest_start);
  606|  9.63k|            if (rv)
  ------------------
  |  Branch (606:17): [True: 0, False: 9.63k]
  ------------------
  607|      0|              break;
  608|  53.2k|          } else {
  609|  53.2k|            mkinitcap2(part2, sunicw);
  610|  53.2k|            scw = part1 + part2;
  611|  53.2k|            rv = checkword(scw, info, root, suggest_start);
  612|  53.2k|            if (rv)
  ------------------
  |  Branch (612:17): [True: 1, False: 53.2k]
  ------------------
  613|      1|              break;
  614|  53.2k|          }
  615|  62.9k|          mkinitcap2(scw, sunicw);
  616|  62.9k|          rv = checkword(scw, info, root, suggest_start);
  617|  62.9k|          if (rv)
  ------------------
  |  Branch (617:15): [True: 0, False: 62.9k]
  ------------------
  618|      0|            break;
  619|  62.9k|        }
  620|  69.6k|      }
  621|   186k|      if (pAMgr && pAMgr->get_checksharps() && scw.find("SS") != std::string::npos) {
  ------------------
  |  Branch (621:11): [True: 186k, False: 0]
  |  Branch (621:20): [True: 0, False: 186k]
  |  Branch (621:48): [True: 0, False: 0]
  ------------------
  622|       |
  623|      0|        mkallsmall2(scw, sunicw);
  624|      0|        std::string u8buffer(scw);
  625|      0|        rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  626|      0|        if (!rv) {
  ------------------
  |  Branch (626:13): [True: 0, False: 0]
  ------------------
  627|      0|          mkinitcap2(scw, sunicw);
  628|      0|          rv = spellsharps(scw, 0, 0, 0, info, root, suggest_start);
  629|      0|        }
  630|      0|        if ((abbv) && !(rv)) {
  ------------------
  |  Branch (630:13): [True: 0, False: 0]
  |  Branch (630:23): [True: 0, False: 0]
  ------------------
  631|      0|          u8buffer.push_back('.');
  632|      0|          rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  633|      0|          if (!rv) {
  ------------------
  |  Branch (633:15): [True: 0, False: 0]
  ------------------
  634|      0|            u8buffer = std::string(scw);
  635|      0|            u8buffer.push_back('.');
  636|      0|            rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  637|      0|          }
  638|      0|        }
  639|      0|        if (rv)
  ------------------
  |  Branch (639:13): [True: 0, False: 0]
  ------------------
  640|      0|          break;
  641|      0|      }
  642|   186k|    }
  643|       |      /* FALLTHROUGH */
  644|   707k|    case INITCAP: {
  ------------------
  |  |   93|   707k|#define INITCAP 1
  ------------------
  |  Branch (644:5): [True: 520k, False: 9.85M]
  ------------------
  645|       |      // handle special capitalization of dotted I
  646|   707k|      bool Idot = (utf8 && (unsigned char) scw[0] == 0xc4 && (unsigned char) scw[1] == 0xb0);
  ------------------
  |  Branch (646:20): [True: 154k, False: 552k]
  |  Branch (646:28): [True: 0, False: 154k]
  |  Branch (646:62): [True: 0, False: 0]
  ------------------
  647|   707k|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   83|   707k|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  648|   707k|      if (captype == ALLCAP) {
  ------------------
  |  |   94|   707k|#define ALLCAP 2
  ------------------
  |  Branch (648:11): [True: 186k, False: 520k]
  ------------------
  649|   186k|          mkallsmall2(scw, sunicw);
  650|   186k|          mkinitcap2(scw, sunicw);
  651|   186k|          if (Idot)
  ------------------
  |  Branch (651:15): [True: 0, False: 186k]
  ------------------
  652|      0|             scw.replace(0, 1, "\xc4\xb0");
  653|   186k|      }
  654|   707k|      if (captype == INITCAP)
  ------------------
  |  |   93|   707k|#define INITCAP 1
  ------------------
  |  Branch (654:11): [True: 520k, False: 186k]
  ------------------
  655|   520k|        *info |= SPELL_INITCAP;
  ------------------
  |  |   82|   520k|#define SPELL_INITCAP (1 << 4)
  ------------------
  656|   707k|      rv = checkword(scw, info, root, suggest_start);
  657|   707k|      if (captype == INITCAP)
  ------------------
  |  |   93|   707k|#define INITCAP 1
  ------------------
  |  Branch (657:11): [True: 520k, False: 186k]
  ------------------
  658|   520k|        *info &= ~SPELL_INITCAP;
  ------------------
  |  |   82|   520k|#define SPELL_INITCAP (1 << 4)
  ------------------
  659|       |      // forbid bad capitalization
  660|       |      // (for example, ijs -> Ijs instead of IJs in Dutch)
  661|       |      // use explicit forms in dic: Ijs/F (F = FORBIDDENWORD flag)
  662|   707k|      if (*info & SPELL_FORBIDDEN) {
  ------------------
  |  |   79|   707k|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (662:11): [True: 0, False: 707k]
  ------------------
  663|      0|        rv = nullptr;
  664|      0|        break;
  665|      0|      }
  666|   707k|      if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   94|     11|#define ALLCAP 2
  ------------------
  |  Branch (666:11): [True: 9.26k, False: 697k]
  |  Branch (666:17): [True: 11, False: 9.25k]
  |  Branch (666:36): [True: 2, False: 9]
  ------------------
  667|      2|        rv = nullptr;
  668|   707k|      if (rv || (Idot && langnum != LANG_az && langnum != LANG_tr && langnum != LANG_crh))
  ------------------
  |  Branch (668:11): [True: 9.26k, False: 697k]
  |  Branch (668:18): [True: 0, False: 697k]
  |  Branch (668:26): [True: 0, False: 0]
  |  Branch (668:48): [True: 0, False: 0]
  |  Branch (668:70): [True: 0, False: 0]
  ------------------
  669|  9.26k|        break;
  670|       |
  671|   697k|      mkallsmall2(scw, sunicw);
  672|   697k|      std::string u8buffer(scw);
  673|   697k|      mkinitcap2(scw, sunicw);
  674|       |
  675|   697k|      rv = checkword(u8buffer, info, root, suggest_start);
  676|   697k|      if (abbv && !rv) {
  ------------------
  |  Branch (676:11): [True: 158k, False: 539k]
  |  Branch (676:19): [True: 156k, False: 2.19k]
  ------------------
  677|   156k|        u8buffer.push_back('.');
  678|   156k|        rv = checkword(u8buffer, info, root, suggest_start);
  679|   156k|        if (!rv) {
  ------------------
  |  Branch (679:13): [True: 156k, False: 0]
  ------------------
  680|   156k|          u8buffer = scw;
  681|   156k|          u8buffer.push_back('.');
  682|   156k|          if (captype == INITCAP)
  ------------------
  |  |   93|   156k|#define INITCAP 1
  ------------------
  |  Branch (682:15): [True: 128k, False: 27.7k]
  ------------------
  683|   128k|            *info |= SPELL_INITCAP;
  ------------------
  |  |   82|   128k|#define SPELL_INITCAP (1 << 4)
  ------------------
  684|   156k|          rv = checkword(u8buffer, info, root, suggest_start);
  685|   156k|          if (captype == INITCAP)
  ------------------
  |  |   93|   156k|#define INITCAP 1
  ------------------
  |  Branch (685:15): [True: 128k, False: 27.7k]
  ------------------
  686|   128k|            *info &= ~SPELL_INITCAP;
  ------------------
  |  |   82|   128k|#define SPELL_INITCAP (1 << 4)
  ------------------
  687|   156k|          if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   94|      7|#define ALLCAP 2
  ------------------
  |  Branch (687:15): [True: 7, False: 156k]
  |  Branch (687:21): [True: 7, False: 0]
  |  Branch (687:40): [True: 3, False: 4]
  ------------------
  688|      3|            rv = nullptr;
  689|   156k|          break;
  690|   156k|        }
  691|   156k|      }
  692|   541k|      if (rv && is_keepcase(rv) &&
  ------------------
  |  Branch (692:11): [True: 6.80k, False: 534k]
  |  Branch (692:17): [True: 1, False: 6.80k]
  ------------------
  693|      1|          ((captype == ALLCAP) ||
  ------------------
  |  |   94|      1|#define ALLCAP 2
  ------------------
  |  Branch (693:12): [True: 0, False: 1]
  ------------------
  694|       |           // if CHECKSHARPS: KEEPCASE words with \xDF  are allowed
  695|       |           // in INITCAP form, too.
  696|      1|           !(pAMgr->get_checksharps() &&
  ------------------
  |  Branch (696:14): [True: 0, False: 1]
  ------------------
  697|      0|             ((utf8 && u8buffer.find("\xC3\x9F") != std::string::npos) ||
  ------------------
  |  Branch (697:16): [True: 0, False: 0]
  |  Branch (697:24): [True: 0, False: 0]
  ------------------
  698|      0|              (!utf8 && u8buffer.find('\xDF') != std::string::npos)))))
  ------------------
  |  Branch (698:16): [True: 0, False: 0]
  |  Branch (698:25): [True: 0, False: 0]
  ------------------
  699|      1|        rv = nullptr;
  700|   541k|      break;
  701|   697k|    }
  702|  10.3M|  }
  703|       |
  704|  10.3M|  if (rv) {
  ------------------
  |  Branch (704:7): [True: 35.7k, False: 10.3M]
  ------------------
  705|  35.7k|    if (pAMgr && pAMgr->get_warn() && rv->astr &&
  ------------------
  |  Branch (705:9): [True: 35.7k, False: 0]
  |  Branch (705:9): [True: 1, False: 35.7k]
  |  Branch (705:18): [True: 3.03k, False: 32.6k]
  |  Branch (705:39): [True: 19, False: 3.02k]
  ------------------
  706|     19|        TESTAFF(rv->astr, pAMgr->get_warn(), rv->alen)) {
  ------------------
  |  |   99|     19|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 1, False: 18]
  |  |  ------------------
  ------------------
  707|      1|      *info |= SPELL_WARN;
  ------------------
  |  |   84|      1|#define SPELL_WARN (1 << 6)
  ------------------
  708|      1|      if (pAMgr->get_forbidwarn())
  ------------------
  |  Branch (708:11): [True: 0, False: 1]
  ------------------
  709|      0|        return false;
  710|      1|      return true;
  711|      1|    }
  712|  35.7k|    return true;
  713|  35.7k|  }
  714|       |
  715|       |  // recursive breaking at break points
  716|  10.3M|  if (!wordbreak.empty() && !(*info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   79|  10.3M|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (716:7): [True: 10.3M, False: 0]
  |  Branch (716:29): [True: 10.3M, False: 0]
  ------------------
  717|       |
  718|  10.3M|    int nbr = 0;
  719|  10.3M|    wl = scw.size();
  720|       |
  721|       |    // calculate break points for recursion limit
  722|  30.9M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (722:18): [True: 30.9M, False: 10.3M]
  ------------------
  723|  30.9M|      size_t pos = 0;
  724|  41.8M|      while ((pos = scw.find(j, pos)) != std::string::npos) {
  ------------------
  |  Branch (724:14): [True: 10.8M, False: 30.9M]
  ------------------
  725|  10.8M|        ++nbr;
  726|  10.8M|        pos += j.size();
  727|  10.8M|      }
  728|  30.9M|    }
  729|  10.3M|    if (nbr >= MAXBREAKDEPTH)
  ------------------
  |  |   87|  10.3M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (729:9): [True: 2.55k, False: 10.3M]
  ------------------
  730|  2.55k|      return false;
  731|       |
  732|       |    // check boundary patterns (^begin and end$)
  733|  30.8M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (733:18): [True: 30.8M, False: 9.10M]
  ------------------
  734|  30.8M|      size_t plen = j.size();
  735|  30.8M|      if (plen == 1 || plen > wl)
  ------------------
  |  Branch (735:11): [True: 10.3M, False: 20.5M]
  |  Branch (735:24): [True: 2.60M, False: 17.9M]
  ------------------
  736|  12.9M|        continue;
  737|       |
  738|  17.9M|      if (j[0] == '^' && scw.compare(0, plen - 1, j, 1, plen - 1) == 0 &&
  ------------------
  |  Branch (738:11): [True: 9.00M, False: 8.95M]
  |  Branch (738:11): [True: 67.2k, False: 17.8M]
  |  Branch (738:26): [True: 643k, False: 8.35M]
  ------------------
  739|   643k|          spell(scw.substr(plen - 1), candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (739:11): [True: 67.2k, False: 576k]
  ------------------
  740|  67.2k|        *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|  67.2k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  741|  67.2k|        return true;
  742|  67.2k|      }
  743|       |
  744|  17.8M|      if (j[plen - 1] == '$' &&
  ------------------
  |  Branch (744:11): [True: 8.93M, False: 8.95M]
  ------------------
  745|  8.93M|          scw.compare(wl - plen + 1, plen - 1, j, 0, plen - 1) == 0) {
  ------------------
  |  Branch (745:11): [True: 3.69M, False: 5.24M]
  ------------------
  746|  3.69M|        std::string suffix(scw.substr(wl - plen + 1));
  747|  3.69M|        scw.resize(wl - plen + 1);
  748|  3.69M|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (748:13): [True: 1.17M, False: 2.52M]
  ------------------
  749|  1.17M|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|  1.17M|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  750|  1.17M|          return true;
  751|  1.17M|        }
  752|  2.52M|        scw.append(suffix);
  753|  2.52M|      }
  754|  17.8M|    }
  755|       |
  756|       |    // other patterns
  757|  27.1M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (757:18): [True: 27.1M, False: 9.06M]
  ------------------
  758|  27.1M|      size_t plen = j.size();
  759|  27.1M|      size_t found = scw.find(j);
  760|  27.1M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (760:11): [True: 25.9M, False: 1.19M]
  |  Branch (760:26): [True: 2.96M, False: 23.0M]
  ------------------
  761|  2.96M|        size_t found2 = scw.find(j, found + 1);
  762|       |        // try to break at the second occurance
  763|       |        // to recognize dictionary words with wordbreak
  764|  2.96M|        if (found2 > 0 && (found2 < wl - plen))
  ------------------
  |  Branch (764:13): [True: 2.96M, False: 0]
  |  Branch (764:27): [True: 1.09M, False: 1.86M]
  ------------------
  765|  1.09M|            found = found2;
  766|  2.96M|        std::string substring(scw.substr(found + plen));
  767|  2.96M|        if (!spell(substring, candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (767:13): [True: 2.12M, False: 834k]
  ------------------
  768|  2.12M|          continue;
  769|   834k|        std::string suffix(scw.substr(found));
  770|   834k|        scw.resize(found);
  771|       |        // examine 2 sides of the break point
  772|   834k|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (772:13): [True: 38.2k, False: 796k]
  ------------------
  773|  38.2k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|  38.2k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  774|  38.2k|          return true;
  775|  38.2k|        }
  776|   796k|        scw.append(suffix);
  777|       |
  778|       |        // LANG_hu: spec. dash rule
  779|   796k|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (779:13): [True: 158, False: 796k]
  |  Branch (779:35): [True: 158, False: 0]
  ------------------
  780|    158|          suffix = scw.substr(found + 1);
  781|    158|          scw.resize(found + 1);
  782|    158|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (782:15): [True: 0, False: 158]
  ------------------
  783|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  784|      0|            return true;  // check the first part with dash
  785|      0|          }
  786|    158|          scw.append(suffix);
  787|    158|        }
  788|       |        // end of LANG specific region
  789|   796k|      }
  790|  27.1M|    }
  791|       |
  792|       |    // other patterns (break at first break point)
  793|  27.1M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (793:18): [True: 27.1M, False: 9.06M]
  ------------------
  794|  27.1M|      size_t plen = j.size(), found = scw.find(j);
  795|  27.1M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (795:11): [True: 25.9M, False: 1.19M]
  |  Branch (795:26): [True: 2.91M, False: 23.0M]
  ------------------
  796|  2.91M|        if (!spell(scw.substr(found + plen), candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (796:13): [True: 2.24M, False: 667k]
  ------------------
  797|  2.24M|          continue;
  798|   667k|        std::string suffix(scw.substr(found));
  799|   667k|        scw.resize(found);
  800|       |        // examine 2 sides of the break point
  801|   667k|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (801:13): [True: 3.63k, False: 663k]
  ------------------
  802|  3.63k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|  3.63k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  803|  3.63k|          return true;
  804|  3.63k|        }
  805|   663k|        scw.append(suffix);
  806|       |
  807|       |        // LANG_hu: spec. dash rule
  808|   663k|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (808:13): [True: 95, False: 663k]
  |  Branch (808:35): [True: 95, False: 0]
  ------------------
  809|     95|          suffix = scw.substr(found + 1);
  810|     95|          scw.resize(found + 1);
  811|     95|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (811:15): [True: 0, False: 95]
  ------------------
  812|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  813|      0|            return true;  // check the first part with dash
  814|      0|          }
  815|     95|          scw.append(suffix);
  816|     95|        }
  817|       |        // end of LANG specific region
  818|   663k|      }
  819|  27.1M|    }
  820|  9.06M|  }
  821|       |
  822|  9.06M|  return false;
  823|  10.3M|}
_ZN12HunspellImpl9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_NS0_6chrono10time_pointINSB_12steady_clockENSB_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  826|  13.3M|                                       std::chrono::steady_clock::time_point suggest_start) {
  827|       |  // check overall suggest time limit
  828|  13.3M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  13.3M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (828:7): [True: 0, False: 13.3M]
  ------------------
  829|      0|    return nullptr;
  830|       |
  831|  13.3M|  std::string word;
  832|       |
  833|       |  // remove IGNORE characters from the string
  834|  13.3M|  clean_ignore(word, w);
  835|       |
  836|  13.3M|  if (word.empty())
  ------------------
  |  Branch (836:7): [True: 1.36k, False: 13.3M]
  ------------------
  837|  1.36k|    return nullptr;
  838|       |
  839|       |  // word reversing wrapper for complex prefixes
  840|  13.3M|  if (complexprefixes) {
  ------------------
  |  Branch (840:7): [True: 1.05M, False: 12.2M]
  ------------------
  841|  1.05M|    if (utf8)
  ------------------
  |  Branch (841:9): [True: 0, False: 1.05M]
  ------------------
  842|      0|      reverseword_utf(word);
  843|  1.05M|    else
  844|  1.05M|      reverseword(word);
  845|  1.05M|  }
  846|       |
  847|  13.3M|  int len = word.size();
  848|       |
  849|       |  // look word in hash table
  850|  13.3M|  struct hentry* he = nullptr;
  851|  26.6M|  for (size_t i = 0; (i < m_HMgrs.size()) && !he; ++i) {
  ------------------
  |  Branch (851:22): [True: 13.3M, False: 13.3M]
  |  Branch (851:46): [True: 13.3M, False: 0]
  ------------------
  852|  13.3M|    he = m_HMgrs[i]->lookup(word.c_str(), word.size());
  853|       |
  854|       |    // check forbidden and onlyincompound words
  855|  13.3M|    if ((he) && (he->astr) && (pAMgr) &&
  ------------------
  |  Branch (855:9): [True: 35.7k, False: 13.3M]
  |  Branch (855:9): [True: 0, False: 13.3M]
  |  Branch (855:17): [True: 428, False: 35.3k]
  |  Branch (855:31): [True: 428, False: 0]
  ------------------
  856|    428|        TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) {
  ------------------
  |  |   99|    428|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 428]
  |  |  ------------------
  ------------------
  857|      0|      if (info)
  ------------------
  |  Branch (857:11): [True: 0, False: 0]
  ------------------
  858|      0|        *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   79|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  859|       |      // LANG_hu section: set dash information for suggestions
  860|      0|      if (langnum == LANG_hu) {
  ------------------
  |  Branch (860:11): [True: 0, False: 0]
  ------------------
  861|      0|        if (pAMgr->get_compoundflag() &&
  ------------------
  |  Branch (861:13): [True: 0, False: 0]
  |  Branch (861:13): [True: 0, False: 0]
  ------------------
  862|      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]
  |  |  ------------------
  ------------------
  863|      0|          if (info)
  ------------------
  |  Branch (863:15): [True: 0, False: 0]
  ------------------
  864|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  865|      0|        }
  866|      0|      }
  867|      0|      return nullptr;
  868|      0|    }
  869|       |
  870|       |    // he = next not needaffix, onlyincompound homonym or onlyupcase word
  871|  13.3M|    while (he && (he->astr) && pAMgr &&
  ------------------
  |  Branch (871:12): [True: 35.7k, False: 13.3M]
  |  Branch (871:12): [True: 13, False: 13.3M]
  |  Branch (871:18): [True: 428, False: 35.3k]
  |  Branch (871:32): [True: 428, False: 0]
  ------------------
  872|    428|           ((pAMgr->get_needaffix() &&
  ------------------
  |  Branch (872:14): [True: 27, False: 401]
  ------------------
  873|     27|             TESTAFF(he->astr, pAMgr->get_needaffix(), he->alen)) ||
  ------------------
  |  |   99|     27|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 27]
  |  |  ------------------
  ------------------
  874|    428|            (pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (874:14): [True: 0, False: 428]
  ------------------
  875|      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]
  |  |  ------------------
  ------------------
  876|    428|            (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   82|    428|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (876:14): [True: 428, False: 0]
  |  Branch (876:22): [True: 26, False: 402]
  ------------------
  877|     26|             TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen))))
  ------------------
  |  |   99|     26|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 13, False: 13]
  |  |  ------------------
  ------------------
  878|     13|      he = he->next_homonym;
  879|  13.3M|  }
  880|       |
  881|       |  // check with affixes
  882|  13.3M|  if (!he && pAMgr) {
  ------------------
  |  Branch (882:7): [True: 13.3M, False: 35.7k]
  |  Branch (882:14): [True: 13.3M, False: 0]
  ------------------
  883|       |    // try stripping off affixes
  884|  13.3M|    AffixScratch scratch;
  885|  13.3M|    he = pAMgr->affix_check(word, 0, len, scratch, 0);
  886|       |
  887|       |    // check compound restriction and onlyupcase
  888|  13.3M|    if (he && he->astr &&
  ------------------
  |  Branch (888:9): [True: 0, False: 13.3M]
  |  Branch (888:9): [True: 0, False: 13.3M]
  |  Branch (888:15): [True: 0, False: 0]
  ------------------
  889|      0|        ((pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (889:11): [True: 0, False: 0]
  ------------------
  890|      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]
  |  |  ------------------
  ------------------
  891|      0|         (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   82|      0|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (891:11): [True: 0, False: 0]
  |  Branch (891:19): [True: 0, False: 0]
  ------------------
  892|      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]
  |  |  ------------------
  ------------------
  893|      0|      he = nullptr;
  894|      0|    }
  895|       |
  896|  13.3M|    if (he) {
  ------------------
  |  Branch (896:9): [True: 0, False: 13.3M]
  ------------------
  897|      0|      if ((he->astr) && (pAMgr) &&
  ------------------
  |  Branch (897:11): [True: 0, False: 0]
  |  Branch (897:11): [True: 0, False: 0]
  |  Branch (897:25): [True: 0, False: 0]
  ------------------
  898|      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]
  |  |  ------------------
  ------------------
  899|      0|        if (info)
  ------------------
  |  Branch (899:13): [True: 0, False: 0]
  ------------------
  900|      0|          *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   79|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  901|      0|        return nullptr;
  902|      0|      }
  903|      0|      if (root) {
  ------------------
  |  Branch (903:11): [True: 0, False: 0]
  ------------------
  904|      0|        root->assign(he->word);
  905|      0|        if (complexprefixes) {
  ------------------
  |  Branch (905:13): [True: 0, False: 0]
  ------------------
  906|      0|          if (utf8)
  ------------------
  |  Branch (906:15): [True: 0, False: 0]
  ------------------
  907|      0|            reverseword_utf(*root);
  908|      0|          else
  909|      0|            reverseword(*root);
  910|      0|        }
  911|      0|      }
  912|       |      // try check compound word
  913|  13.3M|    } else if (pAMgr->get_compound()) {
  ------------------
  |  Branch (913:16): [True: 3.22M, False: 10.0M]
  ------------------
  914|  3.22M|      struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
  915|       |
  916|       |      // first allow only 2 words in the compound
  917|  3.22M|      int setinfo = SPELL_COMPOUND_2;
  ------------------
  |  |   85|  3.22M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  918|  3.22M|      if (info)
  ------------------
  |  Branch (918:11): [True: 3.22M, False: 0]
  ------------------
  919|  3.22M|        setinfo |= *info;
  920|  3.22M|      he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, &setinfo, scratch);
  921|  3.22M|      if (info)
  ------------------
  |  Branch (921:11): [True: 3.22M, False: 0]
  ------------------
  922|  3.22M|        *info = setinfo & ~SPELL_COMPOUND_2;
  ------------------
  |  |   85|  3.22M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  923|       |      // if not 2-word compoud word, try with 3 or more words
  924|       |      // (only if original info didn't forbid it)
  925|  3.22M|      if (!he && info && !(*info & SPELL_COMPOUND_2)) {
  ------------------
  |  |   85|  3.22M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (925:11): [True: 3.22M, False: 0]
  |  Branch (925:18): [True: 3.22M, False: 0]
  |  Branch (925:26): [True: 3.22M, False: 0]
  ------------------
  926|  3.22M|        *info &= ~SPELL_COMPOUND_2;
  ------------------
  |  |   85|  3.22M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  927|  3.22M|        he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, info, scratch);
  928|       |        // accept the compound with 3 or more words only if it is
  929|       |        // - not a dictionary word with a typo and
  930|       |        // - not two words written separately,
  931|       |        // - or if it's an arbitrary number accepted by compound rules (e.g. 999%)
  932|  3.22M|        if (he && !isdigit(word[0]))
  ------------------
  |  Branch (932:13): [True: 0, False: 3.22M]
  |  Branch (932:19): [True: 0, False: 0]
  ------------------
  933|      0|        {
  934|      0|          std::vector<std::string> slst;
  935|      0|          if (pSMgr->suggest(slst, word, nullptr, /*test_simplesug=*/true))
  ------------------
  |  Branch (935:15): [True: 0, False: 0]
  ------------------
  936|      0|            he = nullptr;
  937|      0|        }
  938|  3.22M|      }
  939|       |
  940|       |      // LANG_hu section: `moving rule' with last dash
  941|  3.22M|      if ((!he) && (langnum == LANG_hu) && (word[len - 1] == '-')) {
  ------------------
  |  Branch (941:11): [True: 3.22M, False: 0]
  |  Branch (941:20): [True: 27.1k, False: 3.19M]
  |  Branch (941:44): [True: 10.3k, False: 16.8k]
  ------------------
  942|  10.3k|        std::string dup(word, 0, len - 1);
  943|  10.3k|        he = pAMgr->compound_check(dup, -5, 0, 100, 0, nullptr, (hentry**)&rwords, 1, 0, info, scratch);
  944|  10.3k|      }
  945|       |      // end of LANG specific region
  946|  3.22M|      if (he) {
  ------------------
  |  Branch (946:11): [True: 0, False: 3.22M]
  ------------------
  947|      0|        if (root) {
  ------------------
  |  Branch (947:13): [True: 0, False: 0]
  ------------------
  948|      0|          root->assign(he->word);
  949|      0|          if (complexprefixes) {
  ------------------
  |  Branch (949:15): [True: 0, False: 0]
  ------------------
  950|      0|            if (utf8)
  ------------------
  |  Branch (950:17): [True: 0, False: 0]
  ------------------
  951|      0|              reverseword_utf(*root);
  952|      0|            else
  953|      0|              reverseword(*root);
  954|      0|          }
  955|      0|        }
  956|      0|        if (info)
  ------------------
  |  Branch (956:13): [True: 0, False: 0]
  ------------------
  957|      0|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  958|      0|      }
  959|  3.22M|    }
  960|  13.3M|  }
  961|       |
  962|  13.3M|  return he;
  963|  13.3M|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEENS0_6chrono10time_pointINSD_12steady_clockENSD_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  971|  90.7k|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) {
  972|       |
  973|  90.7k|  if (suggest_candidate_stack.size() > MAX_CANDIDATE_STACK_DEPTH || // apply a fairly arbitrary depth limit
  ------------------
  |  |  966|   181k|#define MAX_CANDIDATE_STACK_DEPTH 512
  ------------------
  |  Branch (973:7): [True: 0, False: 90.7k]
  |  Branch (973:7): [True: 0, False: 90.7k]
  ------------------
  974|       |      // something very broken if suggest ends up calling itself with the same word
  975|  90.7k|      std::find(suggest_candidate_stack.begin(), suggest_candidate_stack.end(), word) != suggest_candidate_stack.end()) {
  ------------------
  |  Branch (975:7): [True: 0, False: 90.7k]
  ------------------
  976|      0|    return { };
  977|      0|  }
  978|       |
  979|  90.7k|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  90.7k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (979:7): [True: 0, False: 90.7k]
  ------------------
  980|      0|    return { };
  981|       |
  982|  90.7k|  bool capwords;
  983|  90.7k|  size_t abbv;
  984|  90.7k|  int captype;
  985|  90.7k|  std::vector<std::string> spell_candidate_stack;
  986|  90.7k|  suggest_candidate_stack.push_back(word);
  987|  90.7k|  std::vector<std::string> slst = suggest_internal(word, spell_candidate_stack, suggest_candidate_stack,
  988|  90.7k|                                                   capwords, abbv, captype, suggest_start);
  989|  90.7k|  suggest_candidate_stack.pop_back();
  990|       |  // word reversing wrapper for complex prefixes
  991|  90.7k|  if (complexprefixes) {
  ------------------
  |  Branch (991:7): [True: 4.72k, False: 85.9k]
  ------------------
  992|  4.72k|    for (auto& j : slst) {
  ------------------
  |  Branch (992:18): [True: 2.24k, False: 4.72k]
  ------------------
  993|  2.24k|      if (utf8)
  ------------------
  |  Branch (993:11): [True: 0, False: 2.24k]
  ------------------
  994|      0|        reverseword_utf(j);
  995|  2.24k|      else
  996|  2.24k|        reverseword(j);
  997|  2.24k|    }
  998|  4.72k|  }
  999|       |
 1000|       |  // capitalize
 1001|  90.7k|  if (capwords) {
  ------------------
  |  Branch (1001:7): [True: 27.2k, False: 63.4k]
  ------------------
 1002|  27.2k|    for (auto& j : slst) {
  ------------------
  |  Branch (1002:18): [True: 14.9k, False: 27.2k]
  ------------------
 1003|  14.9k|      std::string capitalized(j);
 1004|  14.9k|      mkinitcap(capitalized);
 1005|  14.9k|      if (capitalized == word)
  ------------------
  |  Branch (1005:11): [True: 12, False: 14.9k]
  ------------------
 1006|     12|        continue;  // capitalizing would just reproduce the misspelled word
 1007|  14.9k|      j = std::move(capitalized);
 1008|  14.9k|    }
 1009|  27.2k|  }
 1010|       |
 1011|       |  // expand suggestions with dot(s)
 1012|  90.7k|  if (abbv && pAMgr && pAMgr->get_sugswithdots() && word.size() >= abbv) {
  ------------------
  |  Branch (1012:7): [True: 3.39k, False: 87.3k]
  |  Branch (1012:15): [True: 3.39k, False: 0]
  |  Branch (1012:24): [True: 0, False: 3.39k]
  |  Branch (1012:53): [True: 0, False: 0]
  ------------------
 1013|      0|    for (auto& j : slst) {
  ------------------
  |  Branch (1013:18): [True: 0, False: 0]
  ------------------
 1014|      0|      j.append(word.substr(word.size() - abbv));
 1015|      0|    }
 1016|      0|  }
 1017|       |
 1018|       |  // remove bad capitalized and forbidden forms
 1019|  90.7k|  if (pAMgr && (pAMgr->get_keepcase() || pAMgr->get_forbiddenword())) {
  ------------------
  |  Branch (1019:7): [True: 90.7k, False: 0]
  |  Branch (1019:17): [True: 4.75k, False: 85.9k]
  |  Branch (1019:42): [True: 85.9k, False: 0]
  ------------------
 1020|  90.7k|    switch (captype) {
  ------------------
  |  Branch (1020:13): [True: 23.6k, False: 67.0k]
  ------------------
 1021|  12.8k|      case INITCAP:
  ------------------
  |  |   93|  12.8k|#define INITCAP 1
  ------------------
  |  Branch (1021:7): [True: 12.8k, False: 77.8k]
  ------------------
 1022|  23.6k|      case ALLCAP: {
  ------------------
  |  |   94|  23.6k|#define ALLCAP 2
  ------------------
  |  Branch (1022:7): [True: 10.7k, False: 79.9k]
  ------------------
 1023|  23.6k|        size_t l = 0;
 1024|  33.2k|        for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1024:28): [True: 9.60k, False: 23.6k]
  ------------------
 1025|  9.60k|          if (slst[j].find(' ') == std::string::npos && !spell(slst[j], spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1025:15): [True: 9.08k, False: 522]
  |  Branch (1025:57): [True: 4.39k, False: 4.68k]
  ------------------
 1026|  4.39k|            std::string s;
 1027|  4.39k|            std::vector<w_char> w;
 1028|  4.39k|            if (utf8) {
  ------------------
  |  Branch (1028:17): [True: 3.75k, False: 643]
  ------------------
 1029|  3.75k|              u8_u16(w, slst[j]);
 1030|  3.75k|            } else {
 1031|    643|              s = slst[j];
 1032|    643|            }
 1033|  4.39k|            mkallsmall2(s, w);
 1034|  4.39k|            if (spell(s, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1034:17): [True: 1, False: 4.39k]
  ------------------
 1035|      1|              slst[l] = std::move(s);
 1036|      1|              ++l;
 1037|  4.39k|            } else {
 1038|  4.39k|              mkinitcap2(s, w);
 1039|  4.39k|              if (spell(s, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1039:19): [True: 5, False: 4.39k]
  ------------------
 1040|      5|                slst[l] = std::move(s);
 1041|      5|                ++l;
 1042|      5|              }
 1043|  4.39k|            }
 1044|  5.20k|          } else {
 1045|  5.20k|            slst[l] = slst[j];
 1046|  5.20k|            ++l;
 1047|  5.20k|          }
 1048|  9.60k|        }
 1049|  23.6k|        slst.resize(l);
 1050|  23.6k|      }
 1051|  90.7k|    }
 1052|  90.7k|  }
 1053|       |
 1054|       |  // remove duplications
 1055|  90.7k|  size_t l = 0;
 1056|   117k|  for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1056:22): [True: 26.4k, False: 90.7k]
  ------------------
 1057|  26.4k|    slst[l] = slst[j];
 1058|  41.1k|    for (size_t k = 0; k < l; ++k) {
  ------------------
  |  Branch (1058:24): [True: 15.6k, False: 25.4k]
  ------------------
 1059|  15.6k|      if (slst[k] == slst[j]) {
  ------------------
  |  Branch (1059:11): [True: 918, False: 14.7k]
  ------------------
 1060|    918|        --l;
 1061|    918|        break;
 1062|    918|      }
 1063|  15.6k|    }
 1064|  26.4k|    ++l;
 1065|  26.4k|  }
 1066|  90.7k|  slst.resize(l);
 1067|       |
 1068|       |  // output conversion
 1069|  90.7k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1069:17): [True: 90.7k, False: 0]
  ------------------
 1070|  90.7k|  if (rl) {
  ------------------
  |  Branch (1070:7): [True: 4.84k, False: 85.8k]
  ------------------
 1071|  4.84k|    size_t l = 0;
 1072|  5.78k|    for (size_t i = 0; i < slst.size(); ++i) {
  ------------------
  |  Branch (1072:24): [True: 944, False: 4.84k]
  ------------------
 1073|    944|      std::string wspace;
 1074|    944|      if (rl->conv(slst[i], wspace)) {
  ------------------
  |  Branch (1074:11): [True: 317, False: 627]
  ------------------
 1075|    317|        slst[i] = std::move(wspace);
 1076|    317|      }
 1077|       |      // gh#1002: OCONV can map a generated form back to the input word
 1078|       |      // (e.g. "románórum" -> "romanórum" when the user typed "romanórum"),
 1079|       |      // leaving the misspelled word as its own suggestion.
 1080|    944|      if (slst[i] == word)
  ------------------
  |  Branch (1080:11): [True: 0, False: 944]
  ------------------
 1081|      0|        continue;
 1082|    944|      if (l != i)
  ------------------
  |  Branch (1082:11): [True: 0, False: 944]
  ------------------
 1083|      0|        slst[l] = std::move(slst[i]);
 1084|    944|      ++l;
 1085|    944|    }
 1086|  4.84k|    slst.resize(l);
 1087|  4.84k|  }
 1088|  90.7k|  return slst;
 1089|  90.7k|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1091|  59.6k|std::vector<std::string> HunspellImpl::suggest(const std::string& word) {
 1092|  59.6k|  std::vector<std::string> suggest_candidate_stack;
 1093|  59.6k|  auto suggest_start = std::chrono::steady_clock::now();
 1094|  59.6k|  return suggest(word, suggest_candidate_stack, suggest_start);
 1095|  59.6k|}
_ZN12HunspellImpl16suggest_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEESC_RbRmRiNS0_6chrono10time_pointINSG_12steady_clockENSG_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1101|  90.7k|        std::chrono::steady_clock::time_point suggest_start) {
 1102|  90.7k|  captype = NOCAP;
  ------------------
  |  |   92|  90.7k|#define NOCAP 0
  ------------------
 1103|  90.7k|  abbv = 0;
 1104|  90.7k|  capwords = false;
 1105|       |
 1106|  90.7k|  std::vector<std::string> slst;
 1107|       |
 1108|  90.7k|  int onlycmpdsug = 0;
 1109|  90.7k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1109:7): [True: 0, False: 90.7k]
  |  Branch (1109:17): [True: 0, False: 90.7k]
  ------------------
 1110|      0|    return slst;
 1111|       |
 1112|       |  // process XML input of the simplified API (see manual)
 1113|  90.7k|  if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  90.7k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  90.7k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  90.7k|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (1113:7): [True: 20.3k, False: 70.3k]
  ------------------
 1114|  20.3k|    if (word.size() > MAXSPELLMLLEN)
  ------------------
  |  |   87|  20.3k|#define MAXSPELLMLLEN 8192
  ------------------
  |  Branch (1114:9): [True: 589, False: 19.7k]
  ------------------
 1115|    589|      return slst;
 1116|  19.7k|    return spellml(word);
 1117|  20.3k|  }
 1118|  70.3k|  if (utf8) {
  ------------------
  |  Branch (1118:7): [True: 33.6k, False: 36.6k]
  ------------------
 1119|  33.6k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   86|  33.6k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  33.6k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1119:9): [True: 90, False: 33.5k]
  ------------------
 1120|     90|      return slst;
 1121|  36.6k|  } else {
 1122|  36.6k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  36.6k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1122:9): [True: 120, False: 36.5k]
  ------------------
 1123|    120|      return slst;
 1124|  36.6k|  }
 1125|  70.1k|  size_t wl = 0;
 1126|       |
 1127|  70.1k|  std::string scw;
 1128|  70.1k|  std::vector<w_char> sunicw;
 1129|       |
 1130|       |  // input conversion
 1131|  70.1k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1131:17): [True: 70.1k, False: 0]
  ------------------
 1132|  70.1k|  {
 1133|  70.1k|    std::string wspace;
 1134|       |
 1135|  70.1k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1135:23): [True: 3.76k, False: 66.3k]
  ------------------
 1136|  70.1k|    if (convstatus) {
  ------------------
  |  Branch (1136:9): [True: 0, False: 70.1k]
  ------------------
 1137|       |      // the input conversion can grow the word without limit, so hold the
 1138|       |      // converted word to the same maximum length as the raw word
 1139|      0|      if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   86|      0|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                    if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   90|      0|#define MAXWORDLEN 100
  ------------------
  |  Branch (1139:11): [True: 0, False: 0]
  |  Branch (1139:11): [True: 0, False: 0]
  ------------------
 1140|      0|        return slst;
 1141|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1142|      0|    } else
 1143|  70.1k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1144|       |
 1145|  70.1k|    if (wl == 0)
  ------------------
  |  Branch (1145:9): [True: 0, False: 70.1k]
  ------------------
 1146|      0|      return slst;
 1147|       |
 1148|  70.1k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1149|  70.1k|    if (wl > 32768)
  ------------------
  |  Branch (1149:9): [True: 0, False: 70.1k]
  ------------------
 1150|      0|      return slst;
 1151|  70.1k|#endif
 1152|  70.1k|  }
 1153|       |
 1154|  70.1k|  bool good = false;
 1155|       |
 1156|       |  // check capitalized form for FORCEUCASE
 1157|  70.1k|  if (pAMgr && captype == NOCAP && pAMgr->get_forceucase()) {
  ------------------
  |  |   92|   140k|#define NOCAP 0
  ------------------
  |  Branch (1157:7): [True: 70.1k, False: 0]
  |  Branch (1157:16): [True: 20.1k, False: 49.9k]
  |  Branch (1157:36): [True: 0, False: 20.1k]
  ------------------
 1158|      0|    int info = SPELL_ORIGCAP;
  ------------------
  |  |   83|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
 1159|      0|    if (checkword(scw, &info, nullptr, suggest_start)) {
  ------------------
  |  Branch (1159:9): [True: 0, False: 0]
  ------------------
 1160|      0|      std::string form(std::move(scw));
 1161|      0|      mkinitcap(form);
 1162|      0|      slst.push_back(std::move(form));
 1163|      0|      return slst;
 1164|      0|    }
 1165|      0|  }
 1166|       |
 1167|  70.1k|  switch (captype) {
  ------------------
  |  Branch (1167:11): [True: 70.1k, False: 0]
  ------------------
 1168|  20.1k|    case NOCAP: {
  ------------------
  |  |   92|  20.1k|#define NOCAP 0
  ------------------
  |  Branch (1168:5): [True: 20.1k, False: 49.9k]
  ------------------
 1169|  20.1k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1170|  20.1k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  20.1k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1170:11): [True: 0, False: 20.1k]
  ------------------
 1171|      0|          return slst;
 1172|  20.1k|      if (abbv) {
  ------------------
  |  Branch (1172:11): [True: 1.76k, False: 18.3k]
  ------------------
 1173|  1.76k|        std::string wspace(scw);
 1174|  1.76k|        wspace.push_back('.');
 1175|  1.76k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1176|  1.76k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  1.76k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1176:13): [True: 0, False: 1.76k]
  ------------------
 1177|      0|            return slst;
 1178|  1.76k|      }
 1179|  20.1k|      break;
 1180|  20.1k|    }
 1181|       |
 1182|  20.1k|    case INITCAP: {
  ------------------
  |  |   93|  12.8k|#define INITCAP 1
  ------------------
  |  Branch (1182:5): [True: 12.8k, False: 57.2k]
  ------------------
 1183|  12.8k|      capwords = true;
 1184|  12.8k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1185|  12.8k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  12.8k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1185:11): [True: 0, False: 12.8k]
  ------------------
 1186|      0|          return slst;
 1187|  12.8k|      std::string wspace(scw);
 1188|  12.8k|      mkallsmall2(wspace, sunicw);
 1189|  12.8k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1190|  12.8k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  12.8k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1190:11): [True: 0, False: 12.8k]
  ------------------
 1191|      0|          return slst;
 1192|  12.8k|      break;
 1193|  12.8k|    }
 1194|  14.3k|    case HUHINITCAP:
  ------------------
  |  |   96|  14.3k|#define HUHINITCAP 4
  ------------------
  |  Branch (1194:5): [True: 14.3k, False: 55.7k]
  ------------------
 1195|  14.3k|      capwords = true;
 1196|       |      /* FALLTHROUGH */
 1197|  26.3k|    case HUHCAP: {
  ------------------
  |  |   95|  26.3k|#define HUHCAP 3
  ------------------
  |  Branch (1197:5): [True: 11.9k, False: 58.1k]
  ------------------
 1198|  26.3k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1199|  26.3k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  26.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1199:11): [True: 0, False: 26.3k]
  ------------------
 1200|      0|          return slst;
 1201|       |      // something.The -> something. The
 1202|  26.3k|      size_t dot_pos = scw.find('.');
 1203|  26.3k|      if (dot_pos != std::string::npos) {
  ------------------
  |  Branch (1203:11): [True: 8.86k, False: 17.4k]
  ------------------
 1204|  8.86k|        std::string postdot = scw.substr(dot_pos + 1);
 1205|  8.86k|        int captype_;
 1206|  8.86k|        if (utf8) {
  ------------------
  |  Branch (1206:13): [True: 2.18k, False: 6.67k]
  ------------------
 1207|  2.18k|          std::vector<w_char> postdotu;
 1208|  2.18k|          u8_u16(postdotu, postdot);
 1209|  2.18k|          captype_ = get_captype_utf8(postdotu, langnum);
 1210|  6.67k|        } else {
 1211|  6.67k|          captype_ = get_captype(postdot, csconv);
 1212|  6.67k|        }
 1213|  8.86k|        if (captype_ == INITCAP) {
  ------------------
  |  |   93|  8.86k|#define INITCAP 1
  ------------------
  |  Branch (1213:13): [True: 2.21k, False: 6.64k]
  ------------------
 1214|  2.21k|          std::string str(scw);
 1215|  2.21k|          str.insert(dot_pos + 1, 1, ' ');
 1216|  2.21k|          insert_sug(slst, str);
 1217|  2.21k|        }
 1218|  8.86k|      }
 1219|       |
 1220|  26.3k|      std::string wspace;
 1221|       |
 1222|  26.3k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   96|  26.3k|#define HUHINITCAP 4
  ------------------
  |  Branch (1222:11): [True: 14.3k, False: 11.9k]
  ------------------
 1223|       |        // TheOpenOffice.org -> The OpenOffice.org
 1224|  14.3k|        wspace = scw;
 1225|  14.3k|        mkinitsmall2(wspace, sunicw);
 1226|  14.3k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1227|  14.3k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  14.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1227:13): [True: 0, False: 14.3k]
  ------------------
 1228|      0|            return slst;
 1229|  14.3k|      }
 1230|  26.3k|      wspace = scw;
 1231|  26.3k|      mkallsmall2(wspace, sunicw);
 1232|  26.3k|      if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1232:11): [True: 734, False: 25.5k]
  ------------------
 1233|    734|        insert_sug(slst, wspace);
 1234|  26.3k|      size_t prevns = slst.size();
 1235|  26.3k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1236|  26.3k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  26.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1236:11): [True: 0, False: 26.3k]
  ------------------
 1237|      0|          return slst;
 1238|  26.3k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   96|  26.3k|#define HUHINITCAP 4
  ------------------
  |  Branch (1238:11): [True: 14.3k, False: 11.9k]
  ------------------
 1239|  14.3k|        mkinitcap2(wspace, sunicw);
 1240|  14.3k|        if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1240:13): [True: 375, False: 14.0k]
  ------------------
 1241|    375|          insert_sug(slst, wspace);
 1242|  14.3k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1243|  14.3k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  14.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1243:13): [True: 2, False: 14.3k]
  ------------------
 1244|      2|            return slst;
 1245|  14.3k|      }
 1246|       |      // aNew -> "a New" (instead of "a new")
 1247|  26.8k|      for (size_t j = prevns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1247:31): [True: 566, False: 26.3k]
  ------------------
 1248|    566|        const char* space = strchr(slst[j].c_str(), ' ');
 1249|    566|        if (space) {
  ------------------
  |  Branch (1249:13): [True: 406, False: 160]
  ------------------
 1250|    406|          size_t slen = strlen(space + 1);
 1251|       |          // different case after space (need capitalisation)
 1252|    406|          if ((slen < wl) && strcmp(scw.c_str() + wl - slen, space + 1) != 0) {
  ------------------
  |  Branch (1252:15): [True: 406, False: 0]
  |  Branch (1252:30): [True: 370, False: 36]
  ------------------
 1253|    370|            std::string first(slst[j].c_str(), space + 1);
 1254|    370|            std::string second(space + 1);
 1255|    370|            std::vector<w_char> w;
 1256|    370|            if (utf8)
  ------------------
  |  Branch (1256:17): [True: 105, False: 265]
  ------------------
 1257|    105|              u8_u16(w, second);
 1258|    370|            mkinitcap2(second, w);
 1259|       |            // set as first suggestion
 1260|    370|            slst.erase(slst.begin() + j);
 1261|    370|            slst.insert(slst.begin(), first + second);
 1262|    370|          }
 1263|    406|        }
 1264|    566|      }
 1265|  26.3k|      break;
 1266|  26.3k|    }
 1267|       |
 1268|  10.7k|    case ALLCAP: {
  ------------------
  |  |   94|  10.7k|#define ALLCAP 2
  ------------------
  |  Branch (1268:5): [True: 10.7k, False: 59.3k]
  ------------------
 1269|  10.7k|      std::string wspace(scw);
 1270|  10.7k|      mkallsmall2(wspace, sunicw);
 1271|  10.7k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1272|  10.7k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  10.7k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1272:11): [True: 0, False: 10.7k]
  ------------------
 1273|      0|          return slst;
 1274|  10.7k|      if (pAMgr && pAMgr->get_keepcase() && spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1274:11): [True: 10.7k, False: 0]
  |  Branch (1274:20): [True: 478, False: 10.3k]
  |  Branch (1274:45): [True: 0, False: 478]
  ------------------
 1275|      0|        insert_sug(slst, wspace);
 1276|  10.7k|      mkinitcap2(wspace, sunicw);
 1277|  10.7k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1278|  10.7k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  10.7k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1278:11): [True: 0, False: 10.7k]
  ------------------
 1279|      0|          return slst;
 1280|  10.7k|      for (auto& j : slst) {
  ------------------
  |  Branch (1280:20): [True: 605, False: 10.7k]
  ------------------
 1281|    605|        mkallcap(j);
 1282|    605|        if (pAMgr && pAMgr->get_checksharps()) {
  ------------------
  |  Branch (1282:13): [True: 605, False: 0]
  |  Branch (1282:22): [True: 0, False: 605]
  ------------------
 1283|      0|          if (utf8) {
  ------------------
  |  Branch (1283:15): [True: 0, False: 0]
  ------------------
 1284|      0|            mystrrep(j, "\xC3\x9F", "SS");
 1285|      0|          } else {
 1286|      0|            mystrrep(j, "\xDF", "SS");
 1287|      0|          }
 1288|      0|        }
 1289|    605|      }
 1290|  10.7k|      break;
 1291|  10.7k|    }
 1292|  70.1k|  }
 1293|       |
 1294|       |  // LANG_hu section: replace '-' with ' ' in Hungarian
 1295|  70.1k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1295:7): [True: 3.81k, False: 66.2k]
  ------------------
 1296|  3.81k|    for (auto& j : slst) {
  ------------------
  |  Branch (1296:18): [True: 179, False: 3.81k]
  ------------------
 1297|    179|      size_t pos = j.find('-');
 1298|    179|      if (pos != std::string::npos) {
  ------------------
  |  Branch (1298:11): [True: 25, False: 154]
  ------------------
 1299|     25|        int info = 0;
 1300|     25|        std::string w(j.substr(0, pos));
 1301|     25|        w.append(j.substr(pos + 1));
 1302|     25|        (void)spell(w, spell_candidate_stack, &info, nullptr, suggest_start);
 1303|     25|        if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   78|     25|#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 (1303:13): [True: 0, False: 25]
  |  Branch (1303:40): [True: 0, False: 0]
  ------------------
 1304|      0|          j[pos] = ' ';
 1305|      0|        } else
 1306|     25|          j[pos] = '-';
 1307|     25|      }
 1308|    179|    }
 1309|  3.81k|  }
 1310|       |  // END OF LANG_hu section
 1311|       |  // try ngram approach since found nothing good suggestion
 1312|  70.1k|  if (!good && pAMgr && (slst.empty() || onlycmpdsug) && (pAMgr->get_maxngramsugs() != 0)) {
  ------------------
  |  Branch (1312:7): [True: 70.0k, False: 52]
  |  Branch (1312:16): [True: 70.0k, False: 0]
  |  Branch (1312:26): [True: 64.9k, False: 5.14k]
  |  Branch (1312:42): [True: 5.10k, False: 39]
  |  Branch (1312:58): [True: 62.4k, False: 7.53k]
  ------------------
 1313|  62.4k|    switch (captype) {
  ------------------
  |  Branch (1313:13): [True: 62.4k, False: 0]
  ------------------
 1314|  17.3k|      case NOCAP: {
  ------------------
  |  |   92|  17.3k|#define NOCAP 0
  ------------------
  |  Branch (1314:7): [True: 17.3k, False: 45.0k]
  ------------------
 1315|  17.3k|        pSMgr->ngsuggest(slst, scw.c_str(), m_HMgrs, NOCAP);
  ------------------
  |  |   92|  17.3k|#define NOCAP 0
  ------------------
 1316|  17.3k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  17.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1316:13): [True: 0, False: 17.3k]
  ------------------
 1317|      0|            return slst;
 1318|  17.3k|        break;
 1319|  17.3k|      }
 1320|       |      /* FALLTHROUGH */
 1321|  17.3k|      case HUHINITCAP:
  ------------------
  |  |   96|  13.6k|#define HUHINITCAP 4
  ------------------
  |  Branch (1321:7): [True: 13.6k, False: 48.8k]
  ------------------
 1322|  13.6k|        capwords = true;
 1323|       |      /* FALLTHROUGH */
 1324|  24.6k|      case HUHCAP: {
  ------------------
  |  |   95|  24.6k|#define HUHCAP 3
  ------------------
  |  Branch (1324:7): [True: 11.0k, False: 51.4k]
  ------------------
 1325|  24.6k|        std::string wspace(scw);
 1326|  24.6k|        mkallsmall2(wspace, sunicw);
 1327|  24.6k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, HUHCAP);
  ------------------
  |  |   95|  24.6k|#define HUHCAP 3
  ------------------
 1328|  24.6k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  24.6k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1328:13): [True: 0, False: 24.6k]
  ------------------
 1329|      0|            return slst;
 1330|  24.6k|        break;
 1331|  24.6k|      }
 1332|  24.6k|      case INITCAP: {
  ------------------
  |  |   93|  10.9k|#define INITCAP 1
  ------------------
  |  Branch (1332:7): [True: 10.9k, False: 51.5k]
  ------------------
 1333|  10.9k|        capwords = true;
 1334|  10.9k|        std::string wspace(scw);
 1335|  10.9k|        mkallsmall2(wspace, sunicw);
 1336|  10.9k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, INITCAP);
  ------------------
  |  |   93|  10.9k|#define INITCAP 1
  ------------------
 1337|  10.9k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  10.9k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1337:13): [True: 0, False: 10.9k]
  ------------------
 1338|      0|            return slst;
 1339|  10.9k|        break;
 1340|  10.9k|      }
 1341|  10.9k|      case ALLCAP: {
  ------------------
  |  |   94|  9.43k|#define ALLCAP 2
  ------------------
  |  Branch (1341:7): [True: 9.43k, False: 53.0k]
  ------------------
 1342|  9.43k|        std::string wspace(scw);
 1343|  9.43k|        mkallsmall2(wspace, sunicw);
 1344|  9.43k|        size_t oldns = slst.size();
 1345|  9.43k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, ALLCAP);
  ------------------
  |  |   94|  9.43k|#define ALLCAP 2
  ------------------
 1346|  9.43k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  9.43k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1346:13): [True: 0, False: 9.43k]
  ------------------
 1347|      0|            return slst;
 1348|  12.0k|        for (size_t j = oldns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1348:32): [True: 2.58k, False: 9.43k]
  ------------------
 1349|  2.58k|          mkallcap(slst[j]);
 1350|  2.58k|        }
 1351|  9.43k|        break;
 1352|  9.43k|      }
 1353|  62.4k|    }
 1354|  62.4k|  }
 1355|       |
 1356|       |  // try dash suggestion (Afo-American -> Afro-American)
 1357|       |  // Note: LibreOffice was modified to treat dashes as word
 1358|       |  // characters to check "scot-free" etc. word forms, but
 1359|       |  // we need to handle suggestions for "Afo-American", etc.,
 1360|       |  // while "Afro-American" is missing from the dictionary.
 1361|       |  // TODO avoid possible overgeneration
 1362|  70.1k|  size_t dash_pos = scw.find('-');
 1363|  70.1k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1363:7): [True: 34.0k, False: 36.0k]
  ------------------
 1364|  34.0k|    int nodashsug = 1;
 1365|  40.5k|    for (size_t j = 0; j < slst.size() && nodashsug == 1; ++j) {
  ------------------
  |  Branch (1365:24): [True: 6.88k, False: 33.7k]
  |  Branch (1365:43): [True: 6.53k, False: 347]
  ------------------
 1366|  6.53k|      if (slst[j].find('-') != std::string::npos)
  ------------------
  |  Branch (1366:11): [True: 2.40k, False: 4.12k]
  ------------------
 1367|  2.40k|        nodashsug = 0;
 1368|  6.53k|    }
 1369|       |
 1370|  34.0k|    size_t prev_pos = 0;
 1371|  34.0k|    bool last = false;
 1372|       |
 1373|   106k|    while (!good && nodashsug && !last) {
  ------------------
  |  Branch (1373:12): [True: 106k, False: 25]
  |  Branch (1373:21): [True: 73.3k, False: 33.4k]
  |  Branch (1373:34): [True: 72.7k, False: 597]
  ------------------
 1374|  72.7k|      if (dash_pos == scw.size())
  ------------------
  |  Branch (1374:11): [True: 6.04k, False: 66.6k]
  ------------------
 1375|  6.04k|        last = true;
 1376|  72.7k|      std::string chunk = scw.substr(prev_pos, dash_pos - prev_pos);
 1377|  72.7k|      if (chunk != word && !spell(chunk, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1377:11): [True: 72.7k, False: 0]
  |  Branch (1377:28): [True: 31.0k, False: 41.6k]
  ------------------
 1378|  31.0k|        std::vector<std::string> nlst = suggest(chunk, suggest_candidate_stack, suggest_start);
 1379|  31.0k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|  31.0k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1379:13): [True: 2, False: 31.0k]
  ------------------
 1380|      2|            return slst;
 1381|  41.3k|        for (auto j = nlst.rbegin(); j != nlst.rend(); ++j) {
  ------------------
  |  Branch (1381:38): [True: 10.3k, False: 31.0k]
  ------------------
 1382|  10.3k|          std::string wspace = scw.substr(0, prev_pos);
 1383|  10.3k|          wspace.append(*j);
 1384|  10.3k|          if (!last) {
  ------------------
  |  Branch (1384:15): [True: 7.88k, False: 2.44k]
  ------------------
 1385|  7.88k|            wspace.append("-");
 1386|  7.88k|            wspace.append(scw.substr(dash_pos + 1));
 1387|  7.88k|          }
 1388|  10.3k|          int info = 0;
 1389|  10.3k|          if (pAMgr && pAMgr->get_forbiddenword())
  ------------------
  |  Branch (1389:15): [True: 10.3k, False: 0]
  |  Branch (1389:24): [True: 10.3k, False: 0]
  ------------------
 1390|  10.3k|            checkword(wspace, &info, nullptr, suggest_start);
 1391|  10.3k|          if (!(info & SPELL_FORBIDDEN))
  ------------------
  |  |   79|  10.3k|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (1391:15): [True: 10.3k, False: 0]
  ------------------
 1392|  10.3k|            insert_sug(slst, wspace);
 1393|  10.3k|        }
 1394|  31.0k|        nodashsug = 0;
 1395|  31.0k|      }
 1396|  72.7k|      if (!last) {
  ------------------
  |  Branch (1396:11): [True: 66.6k, False: 6.04k]
  ------------------
 1397|  66.6k|        prev_pos = dash_pos + 1;
 1398|  66.6k|        dash_pos = scw.find('-', prev_pos);
 1399|  66.6k|      }
 1400|  72.7k|      if (dash_pos == std::string::npos)
  ------------------
  |  Branch (1400:11): [True: 13.4k, False: 59.2k]
  ------------------
 1401|  13.4k|        dash_pos = scw.size();
 1402|  72.7k|    }
 1403|  34.0k|  }
 1404|  70.0k|  return slst;
 1405|  70.1k|}
_ZN12HunspellImpl4stemERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
 1411|    931|std::vector<std::string> HunspellImpl::stem(const std::vector<std::string>& desc) {
 1412|    931|  std::vector<std::string> slst;
 1413|       |
 1414|    931|  std::string result2;
 1415|    931|  if (desc.empty())
  ------------------
  |  Branch (1415:7): [True: 836, False: 95]
  ------------------
 1416|    836|    return slst;
 1417|    103|  for (const auto& i : desc) {
  ------------------
  |  Branch (1417:22): [True: 103, False: 95]
  ------------------
 1418|    103|    std::string result;
 1419|       |
 1420|       |    // add compound word parts (except the last one)
 1421|    103|    const char* s = i.c_str();
 1422|    103|    const char* part = strstr(s, MORPH_PART);
  ------------------
  |  |  116|    103|#define MORPH_PART "pa:"
  ------------------
 1423|    103|    if (part) {
  ------------------
  |  Branch (1423:9): [True: 0, False: 103]
  ------------------
 1424|      0|      const char* nextpart = strstr(part + 1, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1425|      0|      while (nextpart) {
  ------------------
  |  Branch (1425:14): [True: 0, False: 0]
  ------------------
 1426|      0|        std::string field;
 1427|      0|        copy_field(field, part, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1428|      0|        result.append(field);
 1429|      0|        part = nextpart;
 1430|      0|        nextpart = strstr(part + 1, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1431|      0|      }
 1432|      0|      s = part;
 1433|      0|    }
 1434|       |
 1435|    103|    std::string tok(s);
 1436|    103|    size_t alt = 0;
 1437|    103|    while ((alt = tok.find(" | ", alt)) != std::string::npos) {
  ------------------
  |  Branch (1437:12): [True: 0, False: 103]
  ------------------
 1438|      0|      tok[alt + 1] = MSEP_ALT;
  ------------------
  |  |  123|      0|#define MSEP_ALT '\v'
  ------------------
 1439|      0|    }
 1440|    103|    std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  123|    103|#define MSEP_ALT '\v'
  ------------------
 1441|    103|    for (auto& k : pl) {
  ------------------
  |  Branch (1441:18): [True: 103, False: 103]
  ------------------
 1442|       |      // add derivational suffixes
 1443|    103|      if (k.find(MORPH_DERI_SFX) != std::string::npos) {
  ------------------
  |  |  109|    103|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (1443:11): [True: 0, False: 103]
  ------------------
 1444|       |        // remove inflectional suffixes
 1445|      0|        const size_t is = k.find(MORPH_INFL_SFX);
  ------------------
  |  |  110|      0|#define MORPH_INFL_SFX "is:"
  ------------------
 1446|      0|        if (is != std::string::npos)
  ------------------
  |  Branch (1446:13): [True: 0, False: 0]
  ------------------
 1447|      0|          k.resize(is);
 1448|      0|        std::vector<std::string> singlepl;
 1449|      0|        singlepl.push_back(k);
 1450|      0|        std::string sg = pSMgr->suggest_gen(singlepl, k);
 1451|      0|        if (!sg.empty()) {
  ------------------
  |  Branch (1451:13): [True: 0, False: 0]
  ------------------
 1452|      0|          std::vector<std::string> gen = line_tok(sg, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1453|      0|          for (auto& j : gen) {
  ------------------
  |  Branch (1453:24): [True: 0, False: 0]
  ------------------
 1454|      0|            result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1455|      0|            result2.append(result);
 1456|      0|            result2.append(j);
 1457|      0|          }
 1458|      0|        }
 1459|    103|      } else {
 1460|    103|        result2.push_back(MSEP_REC);
  ------------------
  |  |  122|    103|#define MSEP_REC '\n'
  ------------------
 1461|    103|        result2.append(result);
 1462|    103|        if (k.find(MORPH_SURF_PFX) != std::string::npos) {
  ------------------
  |  |  112|    103|#define MORPH_SURF_PFX "sp:"
  ------------------
  |  Branch (1462:13): [True: 0, False: 103]
  ------------------
 1463|      0|          std::string field;
 1464|      0|          copy_field(field, k, MORPH_SURF_PFX);
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
 1465|      0|          result2.append(field);
 1466|      0|        }
 1467|    103|        std::string field;
 1468|    103|        copy_field(field, k, MORPH_STEM);
  ------------------
  |  |  103|    103|#define MORPH_STEM "st:"
  ------------------
 1469|    103|        result2.append(field);
 1470|    103|      }
 1471|    103|    }
 1472|    103|  }
 1473|     95|  slst = line_tok(result2, MSEP_REC);
  ------------------
  |  |  122|     95|#define MSEP_REC '\n'
  ------------------
 1474|     95|  uniqlist(slst);
 1475|     95|  return slst;
 1476|    931|}
_ZN12HunspellImpl4stemERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1478|    931|std::vector<std::string> HunspellImpl::stem(const std::string& word) {
 1479|    931|  return stem(analyze(word));
 1480|    931|}
_ZN12HunspellImpl9mkinitcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1490|  14.9k|void HunspellImpl::mkinitcap(std::string& u8) {
 1491|  14.9k|  if (utf8) {
  ------------------
  |  Branch (1491:7): [True: 4.65k, False: 10.2k]
  ------------------
 1492|  4.65k|    std::vector<w_char> u16;
 1493|  4.65k|    u8_u16(u16, u8);
 1494|  4.65k|    ::mkinitcap_utf(u16, langnum);
 1495|  4.65k|    u16_u8(u8, u16);
 1496|  10.2k|  } else {
 1497|  10.2k|    ::mkinitcap(u8, csconv);
 1498|  10.2k|  }
 1499|  14.9k|}
_ZN12HunspellImpl10mkinitcap2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1501|  1.04M|int HunspellImpl::mkinitcap2(std::string& u8, std::vector<w_char>& u16) {
 1502|  1.04M|  if (utf8) {
  ------------------
  |  Branch (1502:7): [True: 239k, False: 804k]
  ------------------
 1503|   239k|    ::mkinitcap_utf(u16, langnum);
 1504|   239k|    u16_u8(u8, u16);
 1505|   804k|  } else {
 1506|   804k|    ::mkinitcap(u8, csconv);
 1507|   804k|  }
 1508|  1.04M|  return u8.size();
 1509|  1.04M|}
_ZN12HunspellImpl12mkinitsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1511|  14.3k|int HunspellImpl::mkinitsmall2(std::string& u8, std::vector<w_char>& u16) {
 1512|  14.3k|  if (utf8) {
  ------------------
  |  Branch (1512:7): [True: 3.28k, False: 11.0k]
  ------------------
 1513|  3.28k|    ::mkinitsmall_utf(u16, langnum);
 1514|  3.28k|    u16_u8(u8, u16);
 1515|  11.0k|  } else {
 1516|  11.0k|    ::mkinitsmall(u8, csconv);
 1517|  11.0k|  }
 1518|  14.3k|  return u8.size();
 1519|  14.3k|}
_ZN12HunspellImpl3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1521|  5.18k|int HunspellImpl::add(const std::string& word) {
 1522|  5.18k|  if (!m_HMgrs.empty())
  ------------------
  |  Branch (1522:7): [True: 5.18k, False: 0]
  ------------------
 1523|  5.18k|    return m_HMgrs[0]->add(word);
 1524|      0|  return 0;
 1525|  5.18k|}
_ZN12HunspellImpl14add_with_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 1533|  1.74k|int HunspellImpl::add_with_affix(const std::string& word, const std::string& example) {
 1534|  1.74k|  if (!m_HMgrs.empty())
  ------------------
  |  Branch (1534:7): [True: 1.74k, False: 0]
  ------------------
 1535|  1.74k|    return m_HMgrs[0]->add_with_affix(word, example);
 1536|      0|  return 0;
 1537|  1.74k|}
_ZN12HunspellImpl10cat_resultERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
 1556|   310k|void HunspellImpl::cat_result(std::string& result, const std::string& st) {
 1557|   310k|  if (!st.empty()) {
  ------------------
  |  Branch (1557:7): [True: 3.06k, False: 307k]
  ------------------
 1558|  3.06k|    if (!result.empty())
  ------------------
  |  Branch (1558:9): [True: 648, False: 2.41k]
  ------------------
 1559|    648|      result.append("\n");
 1560|  3.06k|    result.append(st);
 1561|  3.06k|  }
 1562|   310k|}
_ZN12HunspellImpl7analyzeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1564|  7.43k|std::vector<std::string> HunspellImpl::analyze(const std::string& word) {
 1565|  7.43k|  std::vector<std::string> slst = analyze_internal(word);
 1566|       |  // output conversion
 1567|  7.43k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1567:17): [True: 7.43k, False: 0]
  ------------------
 1568|  7.43k|  if (rl) {
  ------------------
  |  Branch (1568:7): [True: 390, False: 7.04k]
  ------------------
 1569|    512|    for (size_t i = 0; rl && i < slst.size(); ++i) {
  ------------------
  |  Branch (1569:24): [True: 512, False: 0]
  |  Branch (1569:30): [True: 122, False: 390]
  ------------------
 1570|    122|      std::string wspace;
 1571|    122|      if (rl->conv(slst[i], wspace)) {
  ------------------
  |  Branch (1571:11): [True: 0, False: 122]
  ------------------
 1572|      0|        slst[i] = std::move(wspace);
 1573|      0|      }
 1574|    122|    }
 1575|    390|  }
 1576|  7.43k|  return slst;
 1577|  7.43k|}
_ZN12HunspellImpl16analyze_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1579|  7.43k|std::vector<std::string> HunspellImpl::analyze_internal(const std::string& word) {
 1580|  7.43k|  std::vector<std::string> candidate_stack, slst;
 1581|  7.43k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1581:7): [True: 0, False: 7.43k]
  |  Branch (1581:17): [True: 0, False: 7.43k]
  ------------------
 1582|      0|    return slst;
 1583|  7.43k|  if (utf8) {
  ------------------
  |  Branch (1583:7): [True: 3.51k, False: 3.91k]
  ------------------
 1584|  3.51k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   86|  3.51k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  3.51k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1584:9): [True: 262, False: 3.25k]
  ------------------
 1585|    262|      return slst;
 1586|  3.91k|  } else {
 1587|  3.91k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  3.91k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1587:9): [True: 520, False: 3.39k]
  ------------------
 1588|    520|      return slst;
 1589|  3.91k|  }
 1590|  6.65k|  int captype = NOCAP;
  ------------------
  |  |   92|  6.65k|#define NOCAP 0
  ------------------
 1591|  6.65k|  size_t abbv = 0;
 1592|  6.65k|  size_t wl = 0;
 1593|       |
 1594|  6.65k|  std::string scw;
 1595|  6.65k|  std::vector<w_char> sunicw;
 1596|       |
 1597|       |  // input conversion
 1598|  6.65k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1598:17): [True: 6.65k, False: 0]
  ------------------
 1599|  6.65k|  {
 1600|  6.65k|    std::string wspace;
 1601|       |
 1602|  6.65k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1602:23): [True: 361, False: 6.29k]
  ------------------
 1603|  6.65k|    if (convstatus) {
  ------------------
  |  Branch (1603:9): [True: 0, False: 6.65k]
  ------------------
 1604|       |      // the input conversion can grow the word without limit, so hold the
 1605|       |      // converted word to the same maximum length as the raw word
 1606|      0|      if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   86|      0|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                    if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   90|      0|#define MAXWORDLEN 100
  ------------------
  |  Branch (1606:11): [True: 0, False: 0]
  |  Branch (1606:11): [True: 0, False: 0]
  ------------------
 1607|      0|        return slst;
 1608|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1609|      0|    } else
 1610|  6.65k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1611|       |
 1612|  6.65k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1613|  6.65k|    if (wl > 32768)
  ------------------
  |  Branch (1613:9): [True: 0, False: 6.65k]
  ------------------
 1614|      0|      return slst;
 1615|  6.65k|#endif
 1616|  6.65k|  }
 1617|       |
 1618|  6.65k|  if (wl == 0) {
  ------------------
  |  Branch (1618:7): [True: 402, False: 6.25k]
  ------------------
 1619|    402|    if (abbv) {
  ------------------
  |  Branch (1619:9): [True: 266, False: 136]
  ------------------
 1620|    266|      scw.clear();
 1621|  5.26k|      for (wl = 0; wl < abbv; wl++)
  ------------------
  |  Branch (1621:20): [True: 4.99k, False: 266]
  ------------------
 1622|  4.99k|        scw.push_back('.');
 1623|    266|      abbv = 0;
 1624|    266|    } else
 1625|    136|      return slst;
 1626|    402|  }
 1627|       |
 1628|  6.51k|  std::string result;
 1629|       |
 1630|  6.51k|  auto suggest_start = std::chrono::steady_clock::now();
 1631|       |
 1632|  6.51k|  size_t n = 0;
 1633|       |  // test numbers
 1634|       |  // LANG_hu section: set dash information for suggestions
 1635|  6.51k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1635:7): [True: 355, False: 6.16k]
  ------------------
 1636|    355|    size_t n2 = 0;
 1637|    355|    size_t n3 = 0;
 1638|       |
 1639|    426|    while ((n < wl) && (((scw[n] <= '9') && (scw[n] >= '0')) ||
  ------------------
  |  Branch (1639:12): [True: 403, False: 23]
  |  Branch (1639:26): [True: 236, False: 167]
  |  Branch (1639:45): [True: 71, False: 165]
  ------------------
 1640|    332|                        (((scw[n] == '.') || (scw[n] == ',')) && (n > 0)))) {
  ------------------
  |  Branch (1640:27): [True: 19, False: 313]
  |  Branch (1640:46): [True: 0, False: 313]
  |  Branch (1640:66): [True: 0, False: 19]
  ------------------
 1641|     71|      n++;
 1642|     71|      if ((scw[n] == '.') || (scw[n] == ',')) {
  ------------------
  |  Branch (1642:11): [True: 0, False: 71]
  |  Branch (1642:30): [True: 0, False: 71]
  ------------------
 1643|      0|        if (((n2 == 0) && (n > 3)) ||
  ------------------
  |  Branch (1643:14): [True: 0, False: 0]
  |  Branch (1643:27): [True: 0, False: 0]
  ------------------
 1644|      0|            ((n2 > 0) && ((scw[n - 1] == '.') || (scw[n - 1] == ','))))
  ------------------
  |  Branch (1644:14): [True: 0, False: 0]
  |  Branch (1644:27): [True: 0, False: 0]
  |  Branch (1644:50): [True: 0, False: 0]
  ------------------
 1645|      0|          break;
 1646|      0|        n2++;
 1647|      0|        n3 = n;
 1648|      0|      }
 1649|     71|    }
 1650|       |
 1651|    355|    if ((n == wl) && (n3 > 0) && (n - n3 > 3))
  ------------------
  |  Branch (1651:9): [True: 23, False: 332]
  |  Branch (1651:22): [True: 0, False: 23]
  |  Branch (1651:34): [True: 0, False: 0]
  ------------------
 1652|      0|      return slst;
 1653|    355|    if ((n == wl) || ((n > 0) && ((scw[n] == '%') || (scw[n] == '\xB0')) && checkword(scw.substr(n), nullptr, nullptr, suggest_start))) {
  ------------------
  |  Branch (1653:9): [True: 23, False: 332]
  |  Branch (1653:9): [True: 23, False: 332]
  |  Branch (1653:23): [True: 0, False: 332]
  |  Branch (1653:35): [True: 0, False: 0]
  |  Branch (1653:54): [True: 0, False: 0]
  |  Branch (1653:77): [True: 0, False: 0]
  ------------------
 1654|     23|      result.append(scw);
 1655|     23|      result.resize(n - 1);
 1656|     23|      if (n == wl)
  ------------------
  |  Branch (1656:11): [True: 23, False: 0]
  ------------------
 1657|     23|        cat_result(result, pSMgr->suggest_morph(scw.substr(n - 1)));
 1658|      0|      else {
 1659|      0|        std::string chunk = scw.substr(n - 1, 1);
 1660|      0|        cat_result(result, pSMgr->suggest_morph(chunk));
 1661|      0|        result.push_back('+');  // XXX SPEC. MORPHCODE
 1662|      0|        cat_result(result, pSMgr->suggest_morph(scw.substr(n)));
 1663|      0|      }
 1664|     23|      return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|     23|#define MSEP_REC '\n'
  ------------------
 1665|     23|    }
 1666|    355|  }
 1667|       |  // END OF LANG_hu section
 1668|       |
 1669|  6.49k|  switch (captype) {
  ------------------
  |  Branch (1669:11): [True: 6.49k, False: 0]
  ------------------
 1670|    756|    case HUHCAP:
  ------------------
  |  |   95|    756|#define HUHCAP 3
  ------------------
  |  Branch (1670:5): [True: 756, False: 5.73k]
  ------------------
 1671|    976|    case HUHINITCAP:
  ------------------
  |  |   96|    976|#define HUHINITCAP 4
  ------------------
  |  Branch (1671:5): [True: 220, False: 6.27k]
  ------------------
 1672|  3.08k|    case NOCAP: {
  ------------------
  |  |   92|  3.08k|#define NOCAP 0
  ------------------
  |  Branch (1672:5): [True: 2.10k, False: 4.38k]
  ------------------
 1673|  3.08k|      cat_result(result, pSMgr->suggest_morph(scw));
 1674|  3.08k|      if (abbv) {
  ------------------
  |  Branch (1674:11): [True: 268, False: 2.81k]
  ------------------
 1675|    268|        std::string u8buffer(scw);
 1676|    268|        u8buffer.push_back('.');
 1677|    268|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1678|    268|      }
 1679|  3.08k|      break;
 1680|    976|    }
 1681|  1.24k|    case INITCAP: {
  ------------------
  |  |   93|  1.24k|#define INITCAP 1
  ------------------
  |  Branch (1681:5): [True: 1.24k, False: 5.24k]
  ------------------
 1682|  1.24k|      mkallsmall2(scw, sunicw);
 1683|  1.24k|      std::string u8buffer(scw);
 1684|  1.24k|      mkinitcap2(scw, sunicw);
 1685|  1.24k|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1686|  1.24k|      cat_result(result, pSMgr->suggest_morph(scw));
 1687|  1.24k|      if (abbv) {
  ------------------
  |  Branch (1687:11): [True: 279, False: 965]
  ------------------
 1688|    279|        u8buffer.push_back('.');
 1689|    279|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1690|       |
 1691|    279|        u8buffer = scw;
 1692|    279|        u8buffer.push_back('.');
 1693|       |
 1694|    279|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1695|    279|      }
 1696|  1.24k|      break;
 1697|    976|    }
 1698|  2.16k|    case ALLCAP: {
  ------------------
  |  |   94|  2.16k|#define ALLCAP 2
  ------------------
  |  Branch (1698:5): [True: 2.16k, False: 4.32k]
  ------------------
 1699|  2.16k|      cat_result(result, pSMgr->suggest_morph(scw));
 1700|  2.16k|      if (abbv) {
  ------------------
  |  Branch (1700:11): [True: 238, False: 1.92k]
  ------------------
 1701|    238|        std::string u8buffer(scw);
 1702|    238|        u8buffer.push_back('.');
 1703|    238|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1704|    238|      }
 1705|  2.16k|      mkallsmall2(scw, sunicw);
 1706|  2.16k|      std::string u8buffer(scw);
 1707|  2.16k|      mkinitcap2(scw, sunicw);
 1708|       |
 1709|  2.16k|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1710|  2.16k|      cat_result(result, pSMgr->suggest_morph(scw));
 1711|  2.16k|      if (abbv) {
  ------------------
  |  Branch (1711:11): [True: 238, False: 1.92k]
  ------------------
 1712|    238|        u8buffer.push_back('.');
 1713|    238|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1714|       |
 1715|    238|        u8buffer = scw;
 1716|    238|        u8buffer.push_back('.');
 1717|       |
 1718|    238|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1719|    238|      }
 1720|  2.16k|      break;
 1721|    976|    }
 1722|  6.49k|  }
 1723|       |
 1724|  6.49k|  if (!result.empty()) {
  ------------------
  |  Branch (1724:7): [True: 2.41k, False: 4.07k]
  ------------------
 1725|       |    // word reversing wrapper for complex prefixes
 1726|  2.41k|    if (complexprefixes) {
  ------------------
  |  Branch (1726:9): [True: 138, False: 2.27k]
  ------------------
 1727|    138|      if (utf8)
  ------------------
  |  Branch (1727:11): [True: 0, False: 138]
  ------------------
 1728|      0|        reverseword_utf(result);
 1729|    138|      else
 1730|    138|        reverseword(result);
 1731|    138|    }
 1732|  2.41k|    return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|  2.41k|#define MSEP_REC '\n'
  ------------------
 1733|  2.41k|  }
 1734|       |
 1735|       |  // compound word with dash (HU) I18n
 1736|       |  // LANG_hu section: set dash information for suggestions
 1737|       |
 1738|  4.07k|  size_t dash_pos = langnum == LANG_hu ? scw.find('-') : std::string::npos;
  ------------------
  |  Branch (1738:21): [True: 213, False: 3.86k]
  ------------------
 1739|  4.07k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1739:7): [True: 43, False: 4.03k]
  ------------------
 1740|     43|    int nresult = 0;
 1741|       |
 1742|     43|    std::string part1 = scw.substr(0, dash_pos), part2 = scw.substr(dash_pos + 1);
 1743|       |
 1744|       |    // examine 2 sides of the dash
 1745|     43|    if (part2.empty()) {  // base word ending with dash
  ------------------
  |  Branch (1745:9): [True: 4, False: 39]
  ------------------
 1746|      4|      if (spell(part1, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1746:11): [True: 0, False: 4]
  ------------------
 1747|      0|        std::string p = pSMgr->suggest_morph(part1);
 1748|      0|        if (!p.empty()) {
  ------------------
  |  Branch (1748:13): [True: 0, False: 0]
  ------------------
 1749|      0|          slst = line_tok(p, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1750|      0|          return slst;
 1751|      0|        }
 1752|      0|      }
 1753|     39|    } else if (part2.size() == 1 && part2[0] == 'e') {  // XXX (HU) -e hat.
  ------------------
  |  Branch (1753:16): [True: 5, False: 34]
  |  Branch (1753:37): [True: 0, False: 5]
  ------------------
 1754|      0|      if (spell(part1, candidate_stack, nullptr, nullptr, suggest_start) &&
  ------------------
  |  Branch (1754:11): [True: 0, False: 0]
  |  Branch (1754:11): [True: 0, False: 0]
  ------------------
 1755|      0|          (spell("-e", candidate_stack, nullptr, nullptr, suggest_start))) {
  ------------------
  |  Branch (1755:11): [True: 0, False: 0]
  ------------------
 1756|      0|        std::string st = pSMgr->suggest_morph(part1);
 1757|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1757:13): [True: 0, False: 0]
  ------------------
 1758|      0|          result.append(st);
 1759|      0|        }
 1760|      0|        result.push_back('+');  // XXX spec. separator in MORPHCODE
 1761|      0|        st = pSMgr->suggest_morph("-e");
 1762|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1762:13): [True: 0, False: 0]
  ------------------
 1763|      0|          result.append(st);
 1764|      0|        }
 1765|      0|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1766|      0|      }
 1767|     39|    } else {
 1768|       |      // first word ending with dash: word- XXX ???
 1769|     39|      part1.push_back(' ');
 1770|     39|      nresult = spell(part1, candidate_stack, nullptr, nullptr, suggest_start);
 1771|     39|      part1.erase(part1.size() - 1);
 1772|     39|      if (nresult && spell(part2, candidate_stack, nullptr, nullptr, suggest_start) &&
  ------------------
  |  Branch (1772:11): [True: 6, False: 33]
  |  Branch (1772:22): [True: 3, False: 3]
  ------------------
 1773|      3|          ((part2.size() > 1) || ((part2[0] > '0') && (part2[0] < '9')))) {
  ------------------
  |  Branch (1773:12): [True: 0, False: 3]
  |  Branch (1773:35): [True: 3, False: 0]
  |  Branch (1773:55): [True: 3, False: 0]
  ------------------
 1774|      3|        std::string st = pSMgr->suggest_morph(part1);
 1775|      3|        if (!st.empty()) {
  ------------------
  |  Branch (1775:13): [True: 0, False: 3]
  ------------------
 1776|      0|          result.append(st);
 1777|      0|          result.push_back('+');  // XXX spec. separator in MORPHCODE
 1778|      0|        }
 1779|      3|        st = pSMgr->suggest_morph(part2);
 1780|      3|        if (!st.empty()) {
  ------------------
  |  Branch (1780:13): [True: 0, False: 3]
  ------------------
 1781|      0|          result.append(st);
 1782|      0|        }
 1783|      3|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      3|#define MSEP_REC '\n'
  ------------------
 1784|      3|      }
 1785|     39|    }
 1786|       |    // affixed number in correct word
 1787|     40|    if (nresult && (dash_pos > 0) &&
  ------------------
  |  Branch (1787:9): [True: 3, False: 37]
  |  Branch (1787:20): [True: 0, False: 3]
  ------------------
 1788|      0|        (((scw[dash_pos - 1] <= '9') && (scw[dash_pos - 1] >= '0')) ||
  ------------------
  |  Branch (1788:11): [True: 0, False: 0]
  |  Branch (1788:41): [True: 0, False: 0]
  ------------------
 1789|      0|         (scw[dash_pos - 1] == '.'))) {
  ------------------
  |  Branch (1789:10): [True: 0, False: 0]
  ------------------
 1790|      0|      n = 1;
 1791|      0|      if (scw[dash_pos - n] == '.')
  ------------------
  |  Branch (1791:11): [True: 0, False: 0]
  ------------------
 1792|      0|        n++;
 1793|       |      // search first not a number character to left from dash
 1794|      0|      while ((dash_pos >= n) && ((scw[dash_pos - n] == '0') || (n < 3)) &&
  ------------------
  |  Branch (1794:14): [True: 0, False: 0]
  |  Branch (1794:34): [True: 0, False: 0]
  |  Branch (1794:64): [True: 0, False: 0]
  ------------------
 1795|      0|             (n < 6)) {
  ------------------
  |  Branch (1795:14): [True: 0, False: 0]
  ------------------
 1796|      0|        n++;
 1797|      0|      }
 1798|      0|      if (dash_pos < n)
  ------------------
  |  Branch (1798:11): [True: 0, False: 0]
  ------------------
 1799|      0|        n--;
 1800|       |      // numbers: valami1000000-hoz
 1801|       |      // examine 100000-hoz, 10000-hoz 1000-hoz, 10-hoz,
 1802|       |      // 56-hoz, 6-hoz
 1803|      0|      for (; n >= 1; n--) {
  ------------------
  |  Branch (1803:14): [True: 0, False: 0]
  ------------------
 1804|      0|        if (scw[dash_pos - n] < '0' || scw[dash_pos - n] > '9') {
  ------------------
  |  Branch (1804:13): [True: 0, False: 0]
  |  Branch (1804:40): [True: 0, False: 0]
  ------------------
 1805|      0|            continue;
 1806|      0|        }
 1807|      0|        std::string chunk = scw.substr(dash_pos - n);
 1808|      0|        if (checkword(chunk, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1808:13): [True: 0, False: 0]
  ------------------
 1809|      0|          result.append(chunk);
 1810|      0|          std::string st = pSMgr->suggest_morph(chunk);
 1811|      0|          if (!st.empty()) {
  ------------------
  |  Branch (1811:15): [True: 0, False: 0]
  ------------------
 1812|      0|            result.append(st);
 1813|      0|          }
 1814|      0|          return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1815|      0|        }
 1816|      0|      }
 1817|      0|    }
 1818|     40|  }
 1819|  4.07k|  return slst;
 1820|  4.07k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS0_6vectorIS6_NS4_IS6_EEEE:
 1822|  6.11k|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::vector<std::string>& pl) {
 1823|  6.11k|  std::vector<std::string> slst;
 1824|  6.11k|  if (!pSMgr || pl.empty())
  ------------------
  |  Branch (1824:7): [True: 0, False: 6.11k]
  |  Branch (1824:17): [True: 469, False: 5.64k]
  ------------------
 1825|    469|    return slst;
 1826|  5.64k|  std::vector<std::string> pl2 = analyze(word);
 1827|  5.64k|  int captype = NOCAP, abbv = 0;
  ------------------
  |  |   92|  5.64k|#define NOCAP 0
  ------------------
 1828|  5.64k|  std::string cw;
 1829|  5.64k|  cleanword(cw, word, &captype, &abbv);
 1830|  5.64k|  std::string result;
 1831|       |
 1832|  5.64k|  auto suggest_start = std::chrono::steady_clock::now();
 1833|   297k|  for (const auto& i : pl) {
  ------------------
  |  Branch (1833:22): [True: 297k, False: 5.64k]
  ------------------
 1834|   297k|    cat_result(result, pSMgr->suggest_gen(pl2, i, suggest_start));
 1835|   297k|  }
 1836|       |
 1837|  5.64k|  if (!result.empty()) {
  ------------------
  |  Branch (1837:7): [True: 0, False: 5.64k]
  ------------------
 1838|       |    // allcap
 1839|      0|    if (captype == ALLCAP)
  ------------------
  |  |   94|      0|#define ALLCAP 2
  ------------------
  |  Branch (1839:9): [True: 0, False: 0]
  ------------------
 1840|      0|      mkallcap(result);
 1841|       |
 1842|       |    // line split
 1843|      0|    slst = line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1844|       |
 1845|       |    // capitalize
 1846|      0|    if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   93|      0|#define INITCAP 1
  ------------------
                  if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   96|      0|#define HUHINITCAP 4
  ------------------
  |  Branch (1846:9): [True: 0, False: 0]
  |  Branch (1846:31): [True: 0, False: 0]
  ------------------
 1847|      0|      for (auto& str : slst) {
  ------------------
  |  Branch (1847:22): [True: 0, False: 0]
  ------------------
 1848|      0|        mkinitcap(str);
 1849|      0|      }
 1850|      0|    }
 1851|       |
 1852|       |    // temporary filtering of prefix related errors (eg.
 1853|       |    // generate("undrinkable", "eats") --> "undrinkables" and "*undrinks")
 1854|      0|    auto it = slst.begin();
 1855|      0|    while (it != slst.end()) {
  ------------------
  |  Branch (1855:12): [True: 0, False: 0]
  ------------------
 1856|      0|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|      0|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1856:11): [True: 0, False: 0]
  ------------------
 1857|      0|        break;
 1858|      0|      std::vector<std::string> candidate_stack;
 1859|      0|      if (!spell(*it, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1859:11): [True: 0, False: 0]
  ------------------
 1860|      0|        it = slst.erase(it);
 1861|      0|      } else  {
 1862|      0|        ++it;
 1863|      0|      }
 1864|      0|    }
 1865|      0|  }
 1866|  5.64k|  return slst;
 1867|  6.11k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 1869|    646|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::string& pattern) {
 1870|    646|  std::vector<std::string> pl = analyze(pattern);
 1871|    646|  std::vector<std::string> slst = generate(word, pl);
 1872|    646|  uniqlist(slst);
 1873|    646|  return slst;
 1874|    646|}
_ZN12HunspellImpl11get_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEm:
 1877|   381k|std::string HunspellImpl::get_xml_par(const std::string& in_par, std::string::size_type pos) {
 1878|   381k|  std::string dest;
 1879|   381k|  if (pos == std::string::npos)
  ------------------
  |  Branch (1879:7): [True: 5.66k, False: 375k]
  ------------------
 1880|  5.66k|    return dest;
 1881|   375k|  const char* par = in_par.c_str() + pos;
 1882|   375k|  char end = *par;
 1883|   375k|  if (end == '>')
  ------------------
  |  Branch (1883:7): [True: 372k, False: 2.86k]
  ------------------
 1884|   372k|    end = '<';
 1885|  2.86k|  else if (end != '\'' && end != '"')
  ------------------
  |  Branch (1885:12): [True: 2.33k, False: 532]
  |  Branch (1885:27): [True: 1.29k, False: 1.04k]
  ------------------
 1886|  1.29k|    return dest;  // bad XML
 1887|  10.8M|  for (par++; *par != '\0' && *par != end; ++par) {
  ------------------
  |  Branch (1887:15): [True: 10.7M, False: 30.3k]
  |  Branch (1887:31): [True: 10.4M, False: 343k]
  ------------------
 1888|  10.4M|    dest.push_back(*par);
 1889|  10.4M|  }
 1890|   374k|  mystrrep(dest, "&lt;", "<");
 1891|   374k|  mystrrep(dest, "&amp;", "&");
 1892|   374k|  return dest;
 1893|   375k|}
_ZN12HunspellImpl11get_xml_posERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 1909|  64.3k|std::string::size_type HunspellImpl::get_xml_pos(const std::string& s, std::string::size_type pos, const char* attr) {
 1910|  64.3k|  if (pos == std::string::npos)
  ------------------
  |  Branch (1910:7): [True: 0, False: 64.3k]
  ------------------
 1911|      0|    return std::string::npos;
 1912|       |
 1913|  64.3k|  std::string::size_type endpos = s.find('>', pos);
 1914|  64.3k|  if (attr == nullptr)
  ------------------
  |  Branch (1914:7): [True: 0, False: 64.3k]
  ------------------
 1915|      0|    return endpos;
 1916|   193k|  while (true) {
  ------------------
  |  Branch (1916:10): [True: 193k, Folded]
  ------------------
 1917|   193k|    pos = s.find(attr, pos);
 1918|   193k|    if (pos == std::string::npos || pos >= endpos)
  ------------------
  |  Branch (1918:9): [True: 3.19k, False: 190k]
  |  Branch (1918:37): [True: 1.52k, False: 188k]
  ------------------
 1919|  4.71k|      return std::string::npos;
 1920|   188k|    if (pos == 0 || s[pos - 1] == ' ' || s[pos - 1] == '\n')
  ------------------
  |  Branch (1920:9): [True: 0, False: 188k]
  |  Branch (1920:21): [True: 1.65k, False: 187k]
  |  Branch (1920:42): [True: 57.9k, False: 129k]
  ------------------
 1921|  59.6k|      break;
 1922|   129k|    pos += strlen(attr);
 1923|   129k|  }
 1924|  59.6k|  return pos + strlen(attr);
 1925|  64.3k|}
_ZN12HunspellImpl13check_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKcSA_:
 1929|  64.3k|                                const char* value) {
 1930|  64.3k|  const std::string cw = get_xml_par(q, get_xml_pos(q, pos, attr));
 1931|  64.3k|  return cw == value ? 1 : 0;
  ------------------
  |  Branch (1931:10): [True: 15.8k, False: 48.5k]
  ------------------
 1932|  64.3k|}
_ZN12HunspellImpl12get_xml_listERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 1934|  6.23k|std::vector<std::string> HunspellImpl::get_xml_list(const std::string& list, std::string::size_type pos, const char* tag) {
 1935|  6.23k|  std::vector<std::string> slst;
 1936|  6.23k|  if (pos == std::string::npos)
  ------------------
  |  Branch (1936:7): [True: 38, False: 6.19k]
  ------------------
 1937|     38|    return slst;
 1938|   303k|  while (true) {
  ------------------
  |  Branch (1938:10): [True: 303k, Folded]
  ------------------
 1939|   303k|    pos = list.find(tag, pos);
 1940|   303k|    if (pos == std::string::npos)
  ------------------
  |  Branch (1940:9): [True: 4.80k, False: 298k]
  ------------------
 1941|  4.80k|        break;
 1942|   298k|    std::string cw = get_xml_par(list, pos + strlen(tag) - 1);
 1943|   298k|    if (cw.empty()) {
  ------------------
  |  Branch (1943:9): [True: 1.38k, False: 296k]
  ------------------
 1944|  1.38k|      break;
 1945|  1.38k|    }
 1946|   296k|    slst.push_back(std::move(cw));
 1947|   296k|    ++pos;
 1948|   296k|  }
 1949|  6.19k|  return slst;
 1950|  6.23k|}
_ZN12HunspellImpl7spellmlERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1952|  19.7k|std::vector<std::string> HunspellImpl::spellml(const std::string& in_word) {
 1953|  19.7k|  std::vector<std::string> slst;
 1954|       |
 1955|  19.7k|  std::string::size_type qpos = in_word.find("<query");
 1956|  19.7k|  if (qpos == std::string::npos)
  ------------------
  |  Branch (1956:7): [True: 470, False: 19.3k]
  ------------------
 1957|    470|    return slst;  // bad XML input
 1958|       |
 1959|  19.3k|  std::string::size_type q2pos = in_word.find('>', qpos);
 1960|  19.3k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (1960:7): [True: 133, False: 19.1k]
  ------------------
 1961|    133|    return slst;  // bad XML input
 1962|       |
 1963|  19.1k|  q2pos = in_word.find("<word", q2pos);
 1964|  19.1k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (1964:7): [True: 342, False: 18.8k]
  ------------------
 1965|    342|    return slst;  // bad XML input
 1966|       |
 1967|  18.8k|  if (check_xml_par(in_word, qpos, "type=", "analyze")) {
  ------------------
  |  Branch (1967:7): [True: 456, False: 18.3k]
  ------------------
 1968|    456|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 1969|    456|    if (!cw.empty())
  ------------------
  |  Branch (1969:9): [True: 209, False: 247]
  ------------------
 1970|    209|      slst = analyze(cw);
 1971|    456|    if (slst.empty())
  ------------------
  |  Branch (1971:9): [True: 435, False: 21]
  ------------------
 1972|    435|      return slst;
 1973|       |    // convert the result to <code><a>ana1</a><a>ana2</a></code> format
 1974|     21|    std::string r;
 1975|     21|    r.append("<code>");
 1976|     21|    for (auto entry : slst) {
  ------------------
  |  Branch (1976:21): [True: 21, False: 21]
  ------------------
 1977|     21|      r.append("<a>");
 1978|       |
 1979|     21|      mystrrep(entry, "\t", " ");
 1980|     21|      mystrrep(entry, "&", "&amp;");
 1981|     21|      mystrrep(entry, "<", "&lt;");
 1982|     21|      r.append(entry);
 1983|       |
 1984|     21|      r.append("</a>");
 1985|     21|    }
 1986|     21|    r.append("</code>");
 1987|     21|    slst.clear();
 1988|     21|    slst.push_back(std::move(r));
 1989|     21|    return slst;
 1990|  18.3k|  } else if (check_xml_par(in_word, qpos, "type=", "stem")) {
  ------------------
  |  Branch (1990:14): [True: 1.29k, False: 17.1k]
  ------------------
 1991|  1.29k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 1992|  1.29k|    if (!cw.empty())
  ------------------
  |  Branch (1992:9): [True: 931, False: 361]
  ------------------
 1993|    931|      return stem(cw);
 1994|  17.1k|  } else if (check_xml_par(in_word, qpos, "type=", "generate")) {
  ------------------
  |  Branch (1994:14): [True: 7.10k, False: 10.0k]
  ------------------
 1995|  7.10k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 1996|  7.10k|    if (cw.empty())
  ------------------
  |  Branch (1996:9): [True: 95, False: 7.00k]
  ------------------
 1997|     95|      return slst;
 1998|  7.00k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 1999|  7.00k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (1999:9): [True: 741, False: 6.26k]
  ------------------
 2000|    741|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2001|    741|      if (!cw2.empty()) {
  ------------------
  |  Branch (2001:11): [True: 646, False: 95]
  ------------------
 2002|    646|        return generate(cw, cw2);
 2003|    646|      }
 2004|  6.26k|    } else {
 2005|  6.26k|      q2pos = in_word.find("<code", q2pos + 1);
 2006|  6.26k|      if (q2pos != std::string::npos) {
  ------------------
  |  Branch (2006:11): [True: 6.23k, False: 38]
  ------------------
 2007|  6.23k|        std::vector<std::string> slst2 = get_xml_list(in_word, in_word.find('>', q2pos), "<a>");
 2008|  6.23k|        if (!slst2.empty()) {
  ------------------
  |  Branch (2008:13): [True: 5.47k, False: 759]
  ------------------
 2009|  5.47k|          slst = generate(cw, slst2);
 2010|  5.47k|          uniqlist(slst);
 2011|  5.47k|          return slst;
 2012|  5.47k|        }
 2013|  6.23k|      }
 2014|  6.26k|    }
 2015|  10.0k|  } else if (check_xml_par(in_word, qpos, "type=", "add")) {
  ------------------
  |  Branch (2015:14): [True: 7.00k, False: 2.99k]
  ------------------
 2016|  7.00k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2017|  7.00k|    if (cw.empty())
  ------------------
  |  Branch (2017:9): [True: 76, False: 6.92k]
  ------------------
 2018|     76|      return slst;
 2019|  6.92k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 2020|  6.92k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (2020:9): [True: 1.95k, False: 4.97k]
  ------------------
 2021|  1.95k|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2022|  1.95k|      if (!cw2.empty()) {
  ------------------
  |  Branch (2022:11): [True: 1.74k, False: 208]
  ------------------
 2023|  1.74k|        add_with_affix(cw, cw2);
 2024|  1.74k|      } else {
 2025|    208|        add(cw);
 2026|    208|      }
 2027|  4.97k|    } else {
 2028|  4.97k|        add(cw);
 2029|  4.97k|    }
 2030|  6.92k|  }
 2031|  11.1k|  return slst;
 2032|  18.8k|}
_ZN8HunspellC2EPKcS1_S1_:
 2182|     38|  : m_Impl(new HunspellImpl(affpath, dpath, key)) {
 2183|     38|}
_ZN8Hunspell5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_:
 2194|  60.0k|bool Hunspell::spell(const std::string& word, int* info, std::string* root) {
 2195|  60.0k|  std::vector<std::string> candidate_stack;
 2196|  60.0k|  return m_Impl->spell(word, candidate_stack, info, root,
 2197|  60.0k|                       std::chrono::steady_clock::now());
 2198|  60.0k|}
_ZN8Hunspell7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 2200|  59.6k|std::vector<std::string> Hunspell::suggest(const std::string& word) {
 2201|  59.6k|  return m_Impl->suggest(word);
 2202|  59.6k|}

_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.3k|std::string phonet(const std::string& inword, phonetable& parms) {
   70|       |
   71|  10.3k|  int i, k = 0, p, z, k0, n0, p0 = -333;
   72|  10.3k|  char c;
   73|  10.3k|  using uchar = unsigned char;
   74|       |
   75|  10.3k|  size_t len = inword.size();
   76|  10.3k|  if (len > MAXPHONETUTF8LEN)
  ------------------
  |  |   35|  10.3k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.3k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
  |  Branch (76:7): [True: 0, False: 10.3k]
  ------------------
   77|      0|    return {};
   78|  10.3k|  char word[MAXPHONETUTF8LEN + 1];
   79|  10.3k|  strncpy(word, inword.c_str(), MAXPHONETUTF8LEN);
  ------------------
  |  |   35|  10.3k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.3k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   80|  10.3k|  word[MAXPHONETUTF8LEN] = '\0';
  ------------------
  |  |   35|  10.3k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.3k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   81|       |
   82|  10.3k|  std::string target;
   83|       |  /**  check word  **/
   84|  10.3k|  i = z = 0;
   85|  92.5k|  while ((c = word[i]) != '\0') {
  ------------------
  |  Branch (85:10): [True: 82.1k, False: 10.3k]
  ------------------
   86|  82.1k|    int n = parms.hash[(uchar)c];
   87|  82.1k|    int z0 = 0;
   88|       |
   89|  82.1k|    if (n >= 0 && !parms.rules[n].empty()) {
  ------------------
  |  Branch (89:9): [True: 25.4k, False: 56.7k]
  |  Branch (89:19): [True: 25.4k, False: 0]
  ------------------
   90|       |      /**  check all rules for the same letter  **/
   91|  61.8k|      while (parms.rules[n][0] == c) {
  ------------------
  |  Branch (91:14): [True: 59.9k, False: 1.86k]
  ------------------
   92|       |        /**  check whole string  **/
   93|  59.9k|        k = 1; /** number of found letters  **/
   94|  59.9k|        p = 5; /** default priority  **/
   95|  59.9k|        const char*s = parms.rules[n].c_str();
   96|  59.9k|        s++; /**  important for (see below)  "*(s-1)"  **/
   97|       |
   98|  62.0k|        while (*s != '\0' && word[i + k] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (98:16): [True: 40.5k, False: 21.4k]
  |  Branch (98:30): [True: 2.06k, False: 38.5k]
  |  Branch (98:51): [True: 2.06k, False: 0]
  |  Branch (98:82): [True: 2.03k, False: 31]
  ------------------
   99|  2.03k|          k++;
  100|  2.03k|          s++;
  101|  2.03k|        }
  102|  59.9k|        if (*s == '(') {
  ------------------
  |  Branch (102:13): [True: 3.79k, False: 56.1k]
  ------------------
  103|       |          /**  check letters in "(..)"  **/
  104|  3.79k|          if (myisalpha(word[i + k])  // ...could be implied?
  ------------------
  |  Branch (104:15): [True: 2.66k, False: 1.12k]
  ------------------
  105|  2.66k|              && strchr(s + 1, word[i + k]) != nullptr) {
  ------------------
  |  Branch (105:18): [True: 330, False: 2.33k]
  ------------------
  106|    330|            k++;
  107|  1.82k|            while (*s && *s != ')')
  ------------------
  |  Branch (107:20): [True: 1.82k, False: 0]
  |  Branch (107:26): [True: 1.49k, False: 330]
  ------------------
  108|  1.49k|              s++;
  109|    330|            if (*s == ')')
  ------------------
  |  Branch (109:17): [True: 330, False: 0]
  ------------------
  110|    330|              s++;
  111|    330|          }
  112|  3.79k|        }
  113|  59.9k|        p0 = (int)*s;
  114|  59.9k|        k0 = k;
  115|  61.5k|        while (*s == '-' && k > 1) {
  ------------------
  |  Branch (115:16): [True: 1.59k, False: 59.9k]
  |  Branch (115:29): [True: 1.59k, False: 0]
  ------------------
  116|  1.59k|          k--;
  117|  1.59k|          s++;
  118|  1.59k|        }
  119|  59.9k|        if (*s == '<')
  ------------------
  |  Branch (119:13): [True: 77, False: 59.9k]
  ------------------
  120|     77|          s++;
  121|  59.9k|        if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (121:13): [True: 0, False: 59.9k]
  ------------------
  122|       |          /**  determine priority  **/
  123|      0|          p = *s - '0';
  124|      0|          s++;
  125|      0|        }
  126|  59.9k|        if (*s == '^' && *(s + 1) == '^')
  ------------------
  |  Branch (126:13): [True: 2.42k, False: 57.5k]
  |  Branch (126:26): [True: 0, False: 2.42k]
  ------------------
  127|      0|          s++;
  128|       |
  129|  59.9k|        if (*s == '\0' || (*s == '^' && (i == 0 || !myisalpha(word[i - 1])) &&
  ------------------
  |  Branch (129:13): [True: 23.1k, False: 36.8k]
  |  Branch (129:28): [True: 2.42k, False: 34.4k]
  |  Branch (129:42): [True: 113, False: 2.31k]
  |  Branch (129:52): [True: 577, False: 1.73k]
  ------------------
  130|    690|                           (*(s + 1) != '$' || (!myisalpha(word[i + k0])))) ||
  ------------------
  |  Branch (130:29): [True: 690, False: 0]
  |  Branch (130:48): [True: 0, False: 0]
  ------------------
  131|  36.1k|            (*s == '$' && i > 0 && myisalpha(word[i - 1]) &&
  ------------------
  |  Branch (131:14): [True: 0, False: 36.1k]
  |  Branch (131:27): [True: 0, False: 0]
  |  Branch (131:36): [True: 0, False: 0]
  ------------------
  132|  23.8k|             (!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.8k|          char c0 = word[i + k - 1];
  136|  23.8k|          n0 = parms.hash[(uchar)c0];
  137|       |
  138|       |          //            if (parms.followup  &&  k > 1  &&  n0 >= 0
  139|  23.8k|          if (k > 1 && n0 >= 0 && p0 != (int)'-' && word[i + k] != '\0' && !parms.rules[n0].empty()) {
  ------------------
  |  Branch (139:15): [True: 441, False: 23.3k]
  |  Branch (139:24): [True: 441, False: 0]
  |  Branch (139:35): [True: 400, False: 41]
  |  Branch (139:53): [True: 372, False: 28]
  |  Branch (139:76): [True: 372, False: 0]
  ------------------
  140|       |            /**  test follow-up rule for "word[i+k]"  **/
  141|  1.00k|            while (parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (141:20): [True: 874, False: 130]
  ------------------
  142|       |              /**  check whole string  **/
  143|    874|              k0 = k;
  144|    874|              p0 = 5;
  145|    874|              s = parms.rules[n0].c_str();
  146|    874|              s++;
  147|  1.11k|              while (*s != '\0' && word[i + k0] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (147:22): [True: 744, False: 372]
  |  Branch (147:36): [True: 242, False: 502]
  |  Branch (147:58): [True: 242, False: 0]
  |  Branch (147:89): [True: 242, False: 0]
  ------------------
  148|    242|                k0++;
  149|    242|                s++;
  150|    242|              }
  151|    874|              if (*s == '(') {
  ------------------
  |  Branch (151:19): [True: 0, False: 874]
  ------------------
  152|       |                /**  check letters  **/
  153|      0|                if (myisalpha(word[i + k0]) && strchr(s + 1, word[i + k0]) != nullptr) {
  ------------------
  |  Branch (153:21): [True: 0, False: 0]
  |  Branch (153:48): [True: 0, False: 0]
  ------------------
  154|      0|                  k0++;
  155|      0|                  while (*s != ')' && *s != '\0')
  ------------------
  |  Branch (155:26): [True: 0, False: 0]
  |  Branch (155:39): [True: 0, False: 0]
  ------------------
  156|      0|                    s++;
  157|      0|                  if (*s == ')')
  ------------------
  |  Branch (157:23): [True: 0, False: 0]
  ------------------
  158|      0|                    s++;
  159|      0|                }
  160|      0|              }
  161|    874|              while (*s == '-') {
  ------------------
  |  Branch (161:22): [True: 0, False: 874]
  ------------------
  162|       |                /**  "k0" gets NOT reduced   **/
  163|       |                /**  because "if (k0 == k)"  **/
  164|      0|                s++;
  165|      0|              }
  166|    874|              if (*s == '<')
  ------------------
  |  Branch (166:19): [True: 0, False: 874]
  ------------------
  167|      0|                s++;
  168|    874|              if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (168:19): [True: 0, False: 874]
  ------------------
  169|      0|                p0 = *s - '0';
  170|      0|                s++;
  171|      0|              }
  172|       |
  173|    874|              if (*s == '\0'
  ------------------
  |  Branch (173:19): [True: 372, False: 502]
  ------------------
  174|       |                  /**  *s == '^' cuts  **/
  175|    502|                  || (*s == '$' && !myisalpha(word[i + k0]))) {
  ------------------
  |  Branch (175:23): [True: 0, False: 502]
  |  Branch (175:36): [True: 0, False: 0]
  ------------------
  176|    372|                if (k0 == k) {
  ------------------
  |  Branch (176:21): [True: 130, False: 242]
  ------------------
  177|       |                  /**  this is just a piece of the string  **/
  178|    130|                  n0 += 2;
  179|    130|                  continue;
  180|    130|                }
  181|       |
  182|    242|                if (p0 < p) {
  ------------------
  |  Branch (182:21): [True: 0, False: 242]
  ------------------
  183|       |                  /**  priority too low  **/
  184|      0|                  n0 += 2;
  185|      0|                  continue;
  186|      0|                }
  187|       |                /**  rule fits; stop search  **/
  188|    242|                break;
  189|    242|              }
  190|    502|              n0 += 2;
  191|    502|            } /**  End of "while (parms.rules[n0][0] == c0)"  **/
  192|       |
  193|    372|            if (p0 >= p && parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (193:17): [True: 372, False: 0]
  |  Branch (193:28): [True: 242, False: 130]
  ------------------
  194|    242|              n += 2;
  195|    242|              continue;
  196|    242|            }
  197|    372|          } /** end of follow-up stuff **/
  198|       |
  199|       |          /**  replace string  **/
  200|  23.5k|          s = parms.rules[n + 1].c_str();
  201|  23.5k|          p0 = (!parms.rules[n].empty() && strchr(parms.rules[n].c_str() + 1, '<') != nullptr) ? 1 : 0;
  ------------------
  |  Branch (201:17): [True: 23.5k, False: 0]
  |  Branch (201:44): [True: 77, False: 23.5k]
  ------------------
  202|  23.5k|          if (p0 == 1 && z == 0) {
  ------------------
  |  Branch (202:15): [True: 77, False: 23.5k]
  |  Branch (202:26): [True: 77, False: 0]
  ------------------
  203|       |            /**  rule with '<' is used  **/
  204|     77|            if (!target.empty() && *s != '\0' &&
  ------------------
  |  Branch (204:17): [True: 40, False: 37]
  |  Branch (204:36): [True: 40, False: 0]
  ------------------
  205|     40|                (target[target.size()-1] == c || target[target.size()-1] == *s)) {
  ------------------
  |  Branch (205:18): [True: 0, False: 40]
  |  Branch (205:50): [True: 0, False: 40]
  ------------------
  206|      0|              target.erase(target.size() - 1);
  207|      0|            }
  208|     77|            z0 = 1;
  209|     77|            z = 1;
  210|     77|            k0 = 0;
  211|    154|            while (*s != '\0' && word[i + k0] != '\0') {
  ------------------
  |  Branch (211:20): [True: 77, False: 77]
  |  Branch (211:34): [True: 77, False: 0]
  ------------------
  212|     77|              word[i + k0] = *s;
  213|     77|              k0++;
  214|     77|              s++;
  215|     77|            }
  216|     77|            if (k > k0)
  ------------------
  |  Branch (216:17): [True: 0, False: 77]
  ------------------
  217|      0|              strmove(&word[0] + i + k0, &word[0] + i + k);
  218|       |
  219|       |            /**  new "actual letter"  **/
  220|     77|            c = word[i];
  221|  23.5k|          } else { /** no '<' rule used **/
  222|  23.5k|            i += k - 1;
  223|  23.5k|            z = 0;
  224|  23.8k|            while (*s != '\0' && *(s + 1) != '\0' && target.size() < len) {
  ------------------
  |  Branch (224:20): [True: 22.3k, False: 1.49k]
  |  Branch (224:34): [True: 434, False: 21.9k]
  |  Branch (224:54): [True: 382, False: 52]
  ------------------
  225|    382|              if (target.empty() || target[target.size()-1] != *s) {
  ------------------
  |  Branch (225:19): [True: 2, False: 380]
  |  Branch (225:37): [True: 114, False: 266]
  ------------------
  226|    116|                target.push_back(*s);
  227|    116|              }
  228|    382|              s++;
  229|    382|            }
  230|       |            /**  new "actual letter"  **/
  231|  23.5k|            c = *s;
  232|  23.5k|            if (!parms.rules[n].empty() && strstr(parms.rules[n].c_str() + 1, "^^") != nullptr) {
  ------------------
  |  Branch (232:17): [True: 23.5k, False: 0]
  |  Branch (232:44): [True: 0, False: 23.5k]
  ------------------
  233|      0|              if (c != '\0') {
  ------------------
  |  Branch (233:19): [True: 0, False: 0]
  ------------------
  234|      0|                target.push_back(c);
  235|      0|              }
  236|      0|              strmove(&word[0], &word[0] + i + 1);
  237|      0|              i = 0;
  238|      0|              z0 = 1;
  239|      0|            }
  240|  23.5k|          }
  241|  23.5k|          break;
  242|  23.8k|        } /** end of follow-up stuff **/
  243|  36.1k|        n += 2;
  244|  36.1k|      } /**  end of while (parms.rules[n][0] == c)  **/
  245|  25.4k|    }   /**  end of if (n >= 0)  **/
  246|  82.1k|    if (z0 == 0) {
  ------------------
  |  Branch (246:9): [True: 82.0k, False: 77]
  ------------------
  247|  82.0k|      if (k && !p0 && target.size() < len && c != '\0') {
  ------------------
  |  Branch (247:11): [True: 25.3k, False: 56.7k]
  |  Branch (247:16): [True: 23.5k, False: 1.86k]
  |  Branch (247:23): [True: 23.4k, False: 65]
  |  Branch (247:46): [True: 21.9k, False: 1.49k]
  ------------------
  248|       |        /**  condense only double letters  **/
  249|  21.9k|        target.push_back(c);
  250|       |        /// printf("\n setting \n");
  251|  21.9k|      }
  252|       |
  253|  82.0k|      i++;
  254|  82.0k|      z = 0;
  255|  82.0k|      k = 0;
  256|  82.0k|    }
  257|  82.1k|  } /**  end of   while ((c = word[i]) != '\0')  **/
  258|       |
  259|  10.3k|  return target;
  260|  10.3k|} /**  end of function "phonet"  **/
phonet.cxx:_ZL9myisalphac:
   59|  6.10k|static int myisalpha(char ch) {
   60|  6.10k|  if ((unsigned char)ch < 128)
  ------------------
  |  Branch (60:7): [True: 5.62k, False: 483]
  ------------------
   61|  5.62k|    return isalpha(ch);
   62|    483|  return 1;
   63|  6.10k|}

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

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

_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|  87.1M|                        int& info) {
  167|  87.1M|  if (wlst.size() == maxSug)
  ------------------
  |  Branch (167:7): [True: 0, False: 87.1M]
  ------------------
  168|      0|    return;
  169|       |
  170|  87.1M|  const int cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (170:20): [True: 21.6k, False: 87.1M]
  ------------------
  171|       |
  172|  87.1M|  if (cwrd) {
  ------------------
  |  Branch (172:7): [True: 87.1M, False: 21.6k]
  ------------------
  173|  87.1M|    if (int result = checkword(candidate, cpdsuggest, timer, timelimit)) {
  ------------------
  |  Branch (173:13): [True: 1.51k, False: 87.1M]
  ------------------
  174|       |      // compound word in the dictionary
  175|  1.51k|      if (cpdsuggest == 0 && result >= 2)
  ------------------
  |  Branch (175:11): [True: 1.51k, False: 0]
  |  Branch (175:30): [True: 0, False: 1.51k]
  ------------------
  176|      0|          info |= SPELL_COMPOUND;
  ------------------
  |  |   78|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  177|  1.51k|      wlst.push_back(candidate);
  178|  1.51k|    }
  179|  87.1M|  }
  180|  87.1M|}
_ZN10SuggestMgr7suggestERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_Pib:
  190|   150k|                        int* onlycompoundsug, bool test_simplesug) {
  191|   150k|  int nocompoundtwowords = 0; // no second or third loops, see below
  192|   150k|  std::vector<w_char> word_utf;
  193|   150k|  size_t nsugorig = slst.size(), oldSug = 0;
  194|   150k|  std::string w2;
  195|   150k|  bool good_suggestion = false;
  196|       |
  197|       |  // word reversing wrapper for complex prefixes
  198|   150k|  if (complexprefixes) {
  ------------------
  |  Branch (198:7): [True: 8.78k, False: 141k]
  ------------------
  199|  8.78k|    w2.assign(w);
  200|  8.78k|    if (utf8)
  ------------------
  |  Branch (200:9): [True: 0, False: 8.78k]
  ------------------
  201|      0|      reverseword_utf(w2);
  202|  8.78k|    else
  203|  8.78k|      reverseword(w2);
  204|  8.78k|  }
  205|       |
  206|   150k|  const std::string& word = complexprefixes ? w2 : w;
  ------------------
  |  Branch (206:29): [True: 8.78k, False: 141k]
  ------------------
  207|       |
  208|   150k|  suggest_start = std::chrono::steady_clock::now();
  209|       |
  210|   150k|  if (utf8) {
  ------------------
  |  Branch (210:7): [True: 62.4k, False: 88.1k]
  ------------------
  211|  62.4k|    int wl = u8_u16(word_utf, word);
  212|  62.4k|    if (wl == -1) {
  ------------------
  |  Branch (212:9): [True: 9.89k, False: 52.5k]
  ------------------
  213|  9.89k|      return false;
  214|  9.89k|    }
  215|  62.4k|  }
  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|   140k|  int info = 0;
  225|   562k|  for (int cpdsuggest = 0; cpdsuggest < 3 && nocompoundtwowords == 0; cpdsuggest++) {
  ------------------
  |  Branch (225:28): [True: 421k, False: 140k]
  |  Branch (225:46): [True: 421k, False: 39]
  ------------------
  226|       |
  227|       |    // limit compound suggestion
  228|   421k|    if (cpdsuggest > 0)
  ------------------
  |  Branch (228:9): [True: 281k, False: 140k]
  ------------------
  229|   281k|      oldSug = slst.size();
  230|       |
  231|       |    // suggestions for an uppercase word (html -> HTML)
  232|   421k|    if (slst.size() < maxSug) {
  ------------------
  |  Branch (232:9): [True: 421k, False: 17]
  ------------------
  233|   421k|      size_t i = slst.size();
  234|   421k|      if (utf8)
  ------------------
  |  Branch (234:11): [True: 157k, False: 264k]
  ------------------
  235|   157k|        capchars_utf(slst, word_utf, cpdsuggest, info);
  236|   264k|      else
  237|   264k|        capchars(slst, word, cpdsuggest, info);
  238|   421k|      if (slst.size() > i)
  ------------------
  |  Branch (238:11): [True: 39, False: 421k]
  ------------------
  239|     39|        good_suggestion = true;
  240|   421k|    }
  241|       |
  242|       |    // perhaps we made a typical fault of spelling
  243|   421k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (243:9): [True: 421k, False: 17]
  |  Branch (243:36): [True: 140k, False: 281k]
  |  Branch (243:51): [True: 281k, False: 0]
  ------------------
  244|   421k|      size_t i = slst.size();
  245|   421k|      replchars(slst, word, cpdsuggest, info);
  246|   421k|      if (slst.size() > i) {
  ------------------
  |  Branch (246:11): [True: 0, False: 421k]
  ------------------
  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|   421k|    }
  252|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (252:9): [True: 0, False: 421k]
  ------------------
  253|      0|      return good_suggestion;
  254|   421k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (254:9): [True: 0, False: 421k]
  |  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|   421k|    if ((slst.size() < maxSug) &&
  ------------------
  |  Branch (258:9): [True: 421k, False: 17]
  ------------------
  259|   421k|        (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (259:10): [True: 140k, False: 281k]
  |  Branch (259:25): [True: 281k, False: 0]
  ------------------
  260|   421k|      mapchars(slst, word, cpdsuggest, info);
  261|   421k|    }
  262|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (262:9): [True: 6, False: 421k]
  ------------------
  263|      6|      return good_suggestion;
  264|   421k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (264:9): [True: 0, False: 421k]
  |  Branch (264:27): [True: 0, False: 0]
  ------------------
  265|      0|      return true;
  266|       |
  267|       |    // only suggest compound words when no other ~good suggestion
  268|   421k|    if ((cpdsuggest == 0) && (slst.size() > nsugorig))
  ------------------
  |  Branch (268:9): [True: 140k, False: 281k]
  |  Branch (268:30): [True: 39, False: 140k]
  ------------------
  269|     39|      nocompoundtwowords = 1;
  270|       |
  271|       |    // did we swap the order of chars by mistake
  272|   421k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (272:9): [True: 421k, False: 17]
  |  Branch (272:36): [True: 140k, False: 281k]
  |  Branch (272:51): [True: 281k, False: 0]
  ------------------
  273|   421k|      if (utf8)
  ------------------
  |  Branch (273:11): [True: 157k, False: 264k]
  ------------------
  274|   157k|        swapchar_utf(slst, word_utf, cpdsuggest, info);
  275|   264k|      else
  276|   264k|        swapchar(slst, word, cpdsuggest, info);
  277|   421k|    }
  278|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (278:9): [True: 0, False: 421k]
  ------------------
  279|      0|      return good_suggestion;
  280|   421k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (280:9): [True: 0, False: 421k]
  |  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|   421k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (284:9): [True: 421k, False: 17]
  |  Branch (284:36): [True: 140k, False: 281k]
  |  Branch (284:51): [True: 281k, False: 0]
  ------------------
  285|   421k|      if (utf8)
  ------------------
  |  Branch (285:11): [True: 157k, False: 264k]
  ------------------
  286|   157k|        longswapchar_utf(slst, word_utf, cpdsuggest, info);
  287|   264k|      else
  288|   264k|        longswapchar(slst, word, cpdsuggest, info);
  289|   421k|    }
  290|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (290:9): [True: 0, False: 421k]
  ------------------
  291|      0|      return good_suggestion;
  292|   421k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (292:9): [True: 0, False: 421k]
  |  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|   421k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (296:9): [True: 421k, False: 17]
  |  Branch (296:36): [True: 140k, False: 281k]
  |  Branch (296:51): [True: 281k, False: 0]
  ------------------
  297|   421k|      if (utf8)
  ------------------
  |  Branch (297:11): [True: 157k, False: 264k]
  ------------------
  298|   157k|        badcharkey_utf(slst, word_utf, cpdsuggest, info);
  299|   264k|      else
  300|   264k|        badcharkey(slst, word, cpdsuggest, info);
  301|   421k|    }
  302|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (302:9): [True: 0, False: 421k]
  ------------------
  303|      0|      return good_suggestion;
  304|   421k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (304:9): [True: 0, False: 421k]
  |  Branch (304:27): [True: 0, False: 0]
  ------------------
  305|      0|      return true;
  306|       |
  307|       |    // did we add a char that should not be there
  308|   421k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (308:9): [True: 421k, False: 17]
  |  Branch (308:36): [True: 140k, False: 281k]
  |  Branch (308:51): [True: 281k, False: 0]
  ------------------
  309|   421k|      if (utf8)
  ------------------
  |  Branch (309:11): [True: 157k, False: 264k]
  ------------------
  310|   157k|        extrachar_utf(slst, word_utf, cpdsuggest, info);
  311|   264k|      else
  312|   264k|        extrachar(slst, word, cpdsuggest, info);
  313|   421k|    }
  314|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (314:9): [True: 0, False: 421k]
  ------------------
  315|      0|      return good_suggestion;
  316|   421k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (316:9): [True: 0, False: 421k]
  |  Branch (316:27): [True: 0, False: 0]
  ------------------
  317|      0|      return true;
  318|       |
  319|       |    // did we forgot a char
  320|   421k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (320:9): [True: 421k, False: 17]
  |  Branch (320:36): [True: 140k, False: 281k]
  |  Branch (320:51): [True: 281k, False: 0]
  ------------------
  321|   421k|      if (utf8)
  ------------------
  |  Branch (321:11): [True: 157k, False: 264k]
  ------------------
  322|   157k|        forgotchar_utf(slst, word_utf, cpdsuggest, info);
  323|   264k|      else
  324|   264k|        forgotchar(slst, word, cpdsuggest, info);
  325|   421k|    }
  326|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (326:9): [True: 0, False: 421k]
  ------------------
  327|      0|      return good_suggestion;
  328|   421k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (328:9): [True: 0, False: 421k]
  |  Branch (328:27): [True: 0, False: 0]
  ------------------
  329|      0|      return true;
  330|       |
  331|       |    // did we move a char
  332|   421k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (332:9): [True: 421k, False: 17]
  |  Branch (332:36): [True: 140k, False: 281k]
  |  Branch (332:51): [True: 281k, False: 0]
  ------------------
  333|   421k|      if (utf8)
  ------------------
  |  Branch (333:11): [True: 157k, False: 264k]
  ------------------
  334|   157k|        movechar_utf(slst, word_utf, cpdsuggest, info);
  335|   264k|      else
  336|   264k|        movechar(slst, word, cpdsuggest, info);
  337|   421k|    }
  338|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (338:9): [True: 0, False: 421k]
  ------------------
  339|      0|      return good_suggestion;
  340|   421k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (340:9): [True: 0, False: 421k]
  |  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|   421k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (344:9): [True: 421k, False: 17]
  |  Branch (344:36): [True: 140k, False: 281k]
  |  Branch (344:51): [True: 281k, False: 0]
  ------------------
  345|   421k|      if (utf8)
  ------------------
  |  Branch (345:11): [True: 157k, False: 264k]
  ------------------
  346|   157k|        badchar_utf(slst, word_utf, cpdsuggest, info);
  347|   264k|      else
  348|   264k|        badchar(slst, word, cpdsuggest, info);
  349|   421k|    }
  350|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (350:9): [True: 0, False: 421k]
  ------------------
  351|      0|      return good_suggestion;
  352|   421k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (352:9): [True: 0, False: 421k]
  |  Branch (352:27): [True: 0, False: 0]
  ------------------
  353|      0|      return true;
  354|       |
  355|       |    // did we double two characters
  356|   421k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (356:9): [True: 421k, False: 17]
  |  Branch (356:36): [True: 140k, False: 281k]
  |  Branch (356:51): [True: 281k, False: 0]
  ------------------
  357|   421k|      if (utf8)
  ------------------
  |  Branch (357:11): [True: 157k, False: 264k]
  ------------------
  358|   157k|        doubletwochars_utf(slst, word_utf, cpdsuggest, info);
  359|   264k|      else
  360|   264k|        doubletwochars(slst, word, cpdsuggest, info);
  361|   421k|    }
  362|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (362:9): [True: 0, False: 421k]
  ------------------
  363|      0|      return good_suggestion;
  364|   421k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (364:9): [True: 0, False: 421k]
  |  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|   421k|    if (!cpdsuggest || (!nosplitsugs && slst.size() < oldSug + maxcpdsugs)) {
  ------------------
  |  Branch (371:9): [True: 140k, False: 281k]
  |  Branch (371:25): [True: 281k, False: 0]
  |  Branch (371:41): [True: 281k, False: 0]
  ------------------
  372|   421k|      good_suggestion = twowords(slst, word, cpdsuggest, good_suggestion, info);
  373|       |
  374|   421k|      if (info & SPELL_BEST_SUG)
  ------------------
  |  |   86|   421k|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  |  Branch (374:11): [True: 128, False: 421k]
  ------------------
  375|    128|        return true;
  376|   421k|    }
  377|   421k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   421k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (377:9): [True: 0, False: 421k]
  ------------------
  378|      0|      return good_suggestion;
  379|       |
  380|       |    // testing returns after the first loop
  381|   421k|    if (test_simplesug)
  ------------------
  |  Branch (381:9): [True: 0, False: 421k]
  ------------------
  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|   421k|    if (cpdsuggest == 1 && (slst.size() > oldSug || (info & SPELL_COMPOUND)))
  ------------------
  |  |   78|   140k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  |  Branch (387:9): [True: 140k, False: 281k]
  |  Branch (387:29): [True: 0, False: 140k]
  |  Branch (387:53): [True: 0, False: 140k]
  ------------------
  388|      0|       nocompoundtwowords = 1;
  389|       |
  390|   421k|  }  // repeating ``for'' statement compounding support
  391|       |
  392|   140k|  if (!nocompoundtwowords && (!slst.empty()) && onlycompoundsug)
  ------------------
  |  Branch (392:7): [True: 140k, False: 39]
  |  Branch (392:30): [True: 10.2k, False: 130k]
  |  Branch (392:49): [True: 10.2k, False: 0]
  ------------------
  393|  10.2k|    *onlycompoundsug = 1;
  394|       |
  395|   140k|  return good_suggestion;
  396|   140k|}
_ZN10SuggestMgr12capchars_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  401|   157k|                              int cpdsuggest, int& info) {
  402|   157k|  std::vector<w_char> candidate_utf(word);
  403|   157k|  mkallcap_utf(candidate_utf, langnum);
  404|   157k|  std::string candidate;
  405|   157k|  u16_u8(candidate, candidate_utf);
  406|   157k|  testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  407|   157k|}
_ZN10SuggestMgr8capcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  412|   264k|                          int cpdsuggest, int& info) {
  413|   264k|  std::string candidate(word);
  414|   264k|  mkallcap(candidate, csconv);
  415|   264k|  testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  416|   264k|}
_ZN10SuggestMgr8mapcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  421|   421k|                         int cpdsuggest, int& info) {
  422|   421k|  std::string candidate;
  423|   421k|  std::chrono::steady_clock::time_point timelimit;
  424|   421k|  int timer;
  425|       |
  426|   421k|  if (word.size() < 2 || !pAMgr)
  ------------------
  |  Branch (426:7): [True: 35.2k, False: 386k]
  |  Branch (426:26): [True: 0, False: 386k]
  ------------------
  427|  35.2k|    return wlst.size();
  428|       |
  429|   386k|  const std::vector<mapentry>& maptable = pAMgr->get_maptable();
  430|   386k|  if (maptable.empty())
  ------------------
  |  Branch (430:7): [True: 370k, False: 15.5k]
  ------------------
  431|   370k|    return wlst.size();
  432|       |
  433|  15.5k|  timelimit = std::chrono::steady_clock::now();
  434|  15.5k|  timer = MINTIMER;
  ------------------
  |  |  107|  15.5k|#define MINTIMER 100
  ------------------
  435|  15.5k|  return map_related(word, candidate, 0, wlst, cpdsuggest,
  436|  15.5k|                     maptable, &timer, &timelimit, 0, info);
  437|   386k|}
_ZN10SuggestMgr11map_relatedERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERS6_mRNS0_6vectorIS6_NS4_IS6_EEEEiRKNSA_ISC_NS4_ISC_EEEEPiPNS0_6chrono10time_pointINSJ_12steady_clockENSJ_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEEiRi:
  447|  5.52M|                            int depth, int& info) {
  448|  5.52M|  if (word.size() == wn) {
  ------------------
  |  Branch (448:7): [True: 696k, False: 4.82M]
  ------------------
  449|   696k|    if (candidate == word)
  ------------------
  |  Branch (449:9): [True: 15.5k, False: 680k]
  ------------------
  450|  15.5k|      return wlst.size();
  451|   680k|    const int cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (451:22): [True: 0, False: 680k]
  ------------------
  452|   680k|    if ((cwrd) && checkword(candidate, cpdsuggest, timer, timelimit)) {
  ------------------
  |  Branch (452:9): [True: 680k, False: 0]
  |  Branch (452:19): [True: 0, False: 680k]
  ------------------
  453|      0|      if (wlst.size() < maxSug) {
  ------------------
  |  Branch (453:11): [True: 0, False: 0]
  ------------------
  454|      0|        wlst.push_back(candidate);
  455|      0|      }
  456|      0|    }
  457|   680k|    return wlst.size();
  458|   696k|  }
  459|       |
  460|  4.82M|  if (depth > 0x3F00) {
  ------------------
  |  Branch (460:7): [True: 0, False: 4.82M]
  ------------------
  461|      0|    *timer = 0;
  462|      0|    return wlst.size();
  463|      0|  }
  464|       |
  465|  4.82M|  int in_map = 0;
  466|  19.2M|  for (size_t j = 0; j < maptable.size(); ++j) {
  ------------------
  |  Branch (466:22): [True: 14.4M, False: 4.82M]
  ------------------
  467|  53.0M|    for (size_t k = 0; k < maptable[j].size(); ++k) {
  ------------------
  |  Branch (467:24): [True: 38.5M, False: 14.4M]
  ------------------
  468|  38.5M|      size_t len = maptable[j][k].size();
  469|  38.5M|      if (len && word.compare(wn, len, maptable[j][k]) == 0) {
  ------------------
  |  Branch (469:11): [True: 38.5M, False: 0]
  |  Branch (469:18): [True: 340k, False: 38.2M]
  ------------------
  470|   340k|        in_map = 1;
  471|   340k|        size_t cn = candidate.size();
  472|  1.36M|        for (size_t l = 0; l < maptable[j].size(); ++l) {
  ------------------
  |  Branch (472:28): [True: 1.02M, False: 340k]
  ------------------
  473|  1.02M|          candidate.resize(cn);
  474|  1.02M|          candidate.append(maptable[j][l]);
  475|  1.02M|          map_related(word, candidate, wn + len, wlst,
  476|  1.02M|                           cpdsuggest, maptable, timer, timelimit, depth + 1, info);
  477|  1.02M|          if (!(*timer))
  ------------------
  |  Branch (477:15): [True: 110, False: 1.02M]
  ------------------
  478|    110|            return wlst.size();
  479|  1.02M|          if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS) {
  ------------------
  |  |  105|  1.02M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (479:15): [True: 6, False: 1.02M]
  ------------------
  480|      6|            *timer = 0;
  481|      6|            return wlst.size();
  482|      6|          }
  483|  1.02M|        }
  484|   340k|      }
  485|  38.5M|    }
  486|  14.4M|  }
  487|  4.82M|  if (!in_map) {
  ------------------
  |  Branch (487:7): [True: 4.48M, False: 340k]
  ------------------
  488|  4.48M|    candidate.push_back(word[wn]);
  489|  4.48M|    map_related(word, candidate, wn + 1, wlst, cpdsuggest,
  490|  4.48M|                maptable, timer, timelimit, depth + 1, info);
  491|  4.48M|  }
  492|  4.82M|  return wlst.size();
  493|  4.82M|}
_ZN10SuggestMgr9replcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  499|   421k|                          int cpdsuggest, int& info) {
  500|   421k|  std::string candidate;
  501|   421k|  int wl = word.size();
  502|   421k|  if (wl < 2 || !pAMgr)
  ------------------
  |  Branch (502:7): [True: 35.2k, False: 386k]
  |  Branch (502:17): [True: 0, False: 386k]
  ------------------
  503|  35.2k|    return wlst.size();
  504|   386k|  const std::vector<replentry>& reptable = pAMgr->get_reptable();
  505|   386k|  auto replchars_start = std::chrono::steady_clock::now();
  506|   386k|  for (const auto& entry : reptable) {
  ------------------
  |  Branch (506:26): [True: 79.9k, False: 386k]
  ------------------
  507|  79.9k|    size_t r = 0;
  508|       |    // search every occurence of the pattern in the word
  509|  79.9k|    while ((r = word.find(entry.pattern, r)) != std::string::npos) {
  ------------------
  |  Branch (509:12): [True: 21, False: 79.9k]
  ------------------
  510|     21|      if (std::chrono::steady_clock::now() - replchars_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|     21|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (510:11): [True: 0, False: 21]
  ------------------
  511|      0|        return wlst.size();
  512|     21|      int type = (r == 0) ? 1 : 0;
  ------------------
  |  Branch (512:18): [True: 0, False: 21]
  ------------------
  513|     21|      if (r + entry.pattern.size() == word.size())
  ------------------
  |  Branch (513:11): [True: 0, False: 21]
  ------------------
  514|      0|        type += 2;
  515|     21|      while (type && entry.outstrings[type].empty())
  ------------------
  |  Branch (515:14): [True: 0, False: 21]
  |  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|     21|      const std::string&out = entry.outstrings[type];
  518|     21|      if (out.empty()) {
  ------------------
  |  Branch (518:11): [True: 0, False: 21]
  ------------------
  519|      0|        ++r;
  520|      0|        continue;
  521|      0|      }
  522|     21|      candidate.assign(word, 0, r);
  523|     21|      candidate.append(entry.outstrings[type]);
  524|     21|      candidate.append(word, r + entry.pattern.size(), std::string::npos);
  525|     21|      size_t sp = candidate.find(' ');
  526|     21|      size_t oldns = wlst.size();
  527|     21|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  528|     21|      if (oldns < wlst.size()) {
  ------------------
  |  Branch (528:11): [True: 0, False: 21]
  ------------------
  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|     21|      if (sp != std::string::npos) {
  ------------------
  |  Branch (534:11): [True: 18, False: 3]
  ------------------
  535|     18|        size_t prev = 0;
  536|     36|        while (sp != std::string::npos) {
  ------------------
  |  Branch (536:16): [True: 18, False: 18]
  ------------------
  537|     18|          std::string prev_chunk = candidate.substr(prev, sp - prev);
  538|     18|          if (checkword(prev_chunk, 0, nullptr, nullptr)) {
  ------------------
  |  Branch (538:15): [True: 0, False: 18]
  ------------------
  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|     18|          prev = sp + 1;
  547|     18|          sp = candidate.find(' ', prev);
  548|     18|        }
  549|     18|      }
  550|     21|      r++;  // search for the next letter
  551|     21|    }
  552|  79.9k|  }
  553|   386k|  return wlst.size();
  554|   386k|}
_ZN10SuggestMgr14doubletwocharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  563|   264k|                               int cpdsuggest, int& info) {
  564|   264k|  size_t wl = word.size();
  565|   264k|  if (wl < 5 || !pAMgr)
  ------------------
  |  Branch (565:7): [True: 59.3k, False: 204k]
  |  Branch (565:17): [True: 0, False: 204k]
  ------------------
  566|  59.3k|    return wlst.size();
  567|       |
  568|   204k|  int state = 0;
  569|  5.21M|  for (size_t i = 2; i < wl; ++i) {
  ------------------
  |  Branch (569:22): [True: 5.01M, False: 204k]
  ------------------
  570|  5.01M|    if (word[i] == word[i - 2]) {
  ------------------
  |  Branch (570:9): [True: 1.24M, False: 3.76M]
  ------------------
  571|  1.24M|      state++;
  572|  1.24M|      if (state == 3 || (state == 2 && i >= 4)) {
  ------------------
  |  Branch (572:11): [True: 6.58k, False: 1.23M]
  |  Branch (572:26): [True: 439k, False: 800k]
  |  Branch (572:40): [True: 429k, False: 10.1k]
  ------------------
  573|   435k|        auto word_iter = word.begin();
  574|   435k|        std::string candidate(word_iter, word_iter + i - 1);
  575|   435k|        candidate.insert(candidate.end(), word_iter + i + 1, word.end());
  576|   435k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  577|   435k|        state = 0;
  578|   435k|      }
  579|  3.76M|    } else {
  580|  3.76M|      state = 0;
  581|  3.76M|    }
  582|  5.01M|  }
  583|   204k|  return wlst.size();
  584|   264k|}
_ZN10SuggestMgr18doubletwochars_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  593|   157k|                                   int cpdsuggest, int& info) {
  594|   157k|  size_t wl = word.size();
  595|   157k|  int state = 0;
  596|   157k|  if (wl < 5 || !pAMgr)
  ------------------
  |  Branch (596:7): [True: 57.9k, False: 99.6k]
  |  Branch (596:17): [True: 0, False: 99.6k]
  ------------------
  597|  57.9k|    return wlst.size();
  598|  1.70M|  for (size_t i = 2; i < wl; ++i) {
  ------------------
  |  Branch (598:22): [True: 1.60M, False: 99.6k]
  ------------------
  599|  1.60M|    if (word[i] == word[i - 2]) {
  ------------------
  |  Branch (599:9): [True: 469k, False: 1.13M]
  ------------------
  600|   469k|      state++;
  601|   469k|      if (state == 3 || (state == 2 && i >= 4)) {
  ------------------
  |  Branch (601:11): [True: 4.02k, False: 465k]
  |  Branch (601:26): [True: 160k, False: 305k]
  |  Branch (601:40): [True: 153k, False: 6.52k]
  ------------------
  602|   157k|        auto word_iter = word.begin();
  603|   157k|        std::vector<w_char> candidate_utf(word_iter, word_iter + i - 1);
  604|   157k|        candidate_utf.insert(candidate_utf.end(), word_iter + i + 1, word.end());
  605|   157k|        std::string candidate;
  606|   157k|        u16_u8(candidate, candidate_utf);
  607|   157k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  608|   157k|        state = 0;
  609|   157k|      }
  610|  1.13M|    } else {
  611|  1.13M|      state = 0;
  612|  1.13M|    }
  613|  1.60M|  }
  614|  99.6k|  return wlst.size();
  615|   157k|}
_ZN10SuggestMgr10badcharkeyERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  621|   264k|                           int cpdsuggest, int& info) {
  622|   264k|  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.82M|  for (size_t i = 0, wl = candidate.size(); i < wl; ++i) {
  ------------------
  |  Branch (626:45): [True: 5.56M, False: 264k]
  ------------------
  627|  5.56M|    char tmpc = candidate[i];
  628|       |    // check with uppercase letters
  629|  5.56M|    candidate[i] = csconv[((unsigned char)tmpc)].cupper;
  630|  5.56M|    if (tmpc != candidate[i]) {
  ------------------
  |  Branch (630:9): [True: 1.37M, False: 4.18M]
  ------------------
  631|  1.37M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  632|  1.37M|      candidate[i] = tmpc;
  633|  1.37M|    }
  634|       |    // check neighbor characters in keyboard string
  635|  5.56M|    if (ckey.empty())
  ------------------
  |  Branch (635:9): [True: 0, False: 5.56M]
  ------------------
  636|      0|      continue;
  637|  5.56M|    size_t loc = 0;
  638|   145M|    while ((loc < ckeyl) && ckey[loc] != tmpc)
  ------------------
  |  Branch (638:12): [True: 141M, False: 4.61M]
  |  Branch (638:29): [True: 140M, False: 946k]
  ------------------
  639|   140M|      ++loc;
  640|  6.55M|    while (loc < ckeyl) {
  ------------------
  |  Branch (640:12): [True: 999k, False: 5.56M]
  ------------------
  641|       |      // a long keyboard string can hold many neighbours for this
  642|       |      // character, so give up once the overall time budget is spent
  643|   999k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   999k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (643:11): [True: 0, False: 999k]
  ------------------
  644|      0|        return wlst.size();
  645|   999k|      if ((loc > 0) && ckey[loc - 1] != '|') {
  ------------------
  |  Branch (645:11): [True: 822k, False: 176k]
  |  Branch (645:24): [True: 781k, False: 41.3k]
  ------------------
  646|   781k|        candidate[i] = ckey[loc - 1];
  647|   781k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  648|   781k|      }
  649|   999k|      if (((loc + 1) < ckeyl) && (ckey[loc + 1] != '|')) {
  ------------------
  |  Branch (649:11): [True: 924k, False: 74.8k]
  |  Branch (649:34): [True: 839k, False: 84.3k]
  ------------------
  650|   839k|        candidate[i] = ckey[loc + 1];
  651|   839k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  652|   839k|      }
  653|  15.5M|      do {
  654|  15.5M|        loc++;
  655|  15.5M|      } while ((loc < ckeyl) && ckey[loc] != tmpc);
  ------------------
  |  Branch (655:16): [True: 14.6M, False: 946k]
  |  Branch (655:33): [True: 14.5M, False: 52.2k]
  ------------------
  656|   999k|    }
  657|  5.56M|    candidate[i] = tmpc;
  658|  5.56M|  }
  659|   264k|  return wlst.size();
  660|   264k|}
_ZN10SuggestMgr14badcharkey_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  666|   157k|                               int cpdsuggest, int& info) {
  667|   157k|  std::string candidate;
  668|   157k|  std::vector<w_char> candidate_utf(word);
  669|       |  // swap out each char one by one and try all the tryme
  670|       |  // chars in its place to see if that makes a good word
  671|  2.11M|  for (size_t i = 0, wl = word.size(); i < wl; ++i) {
  ------------------
  |  Branch (671:40): [True: 1.95M, False: 157k]
  ------------------
  672|  1.95M|    w_char tmpc = candidate_utf[i];
  673|       |    // check with uppercase letters
  674|  1.95M|    candidate_utf[i] = upper_utf(candidate_utf[i], 1);
  675|  1.95M|    if (tmpc != candidate_utf[i]) {
  ------------------
  |  Branch (675:9): [True: 449k, False: 1.50M]
  ------------------
  676|   449k|      u16_u8(candidate, candidate_utf);
  677|   449k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  678|   449k|      candidate_utf[i] = tmpc;
  679|   449k|    }
  680|       |    // check neighbor characters in keyboard string
  681|  1.95M|    if (ckey_utf.empty())
  ------------------
  |  Branch (681:9): [True: 0, False: 1.95M]
  ------------------
  682|      0|      continue;
  683|  1.95M|    size_t loc = 0;
  684|  48.9M|    while ((loc < ckeyl) && ckey_utf[loc] != tmpc)
  ------------------
  |  Branch (684:12): [True: 47.4M, False: 1.49M]
  |  Branch (684:29): [True: 47.0M, False: 459k]
  ------------------
  685|  47.0M|      ++loc;
  686|  2.42M|    while (loc < ckeyl) {
  ------------------
  |  Branch (686:12): [True: 472k, False: 1.95M]
  ------------------
  687|       |      // a long keyboard string can hold many neighbours for this
  688|       |      // character, so give up once the overall time budget is spent
  689|   472k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|   472k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (689:11): [True: 0, False: 472k]
  ------------------
  690|      0|        return wlst.size();
  691|   472k|      if ((loc > 0) && ckey_utf[loc - 1] != W_VLINE) {
  ------------------
  |  Branch (691:11): [True: 365k, False: 107k]
  |  Branch (691:24): [True: 365k, False: 0]
  ------------------
  692|   365k|        candidate_utf[i] = ckey_utf[loc - 1];
  693|   365k|        u16_u8(candidate, candidate_utf);
  694|   365k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  695|   365k|      }
  696|   472k|      if (((loc + 1) < ckeyl) && (ckey_utf[loc + 1] != W_VLINE)) {
  ------------------
  |  Branch (696:11): [True: 427k, False: 44.5k]
  |  Branch (696:34): [True: 427k, False: 0]
  ------------------
  697|   427k|        candidate_utf[i] = ckey_utf[loc + 1];
  698|   427k|        u16_u8(candidate, candidate_utf);
  699|   427k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  700|   427k|      }
  701|  7.67M|      do {
  702|  7.67M|        loc++;
  703|  7.67M|      } while ((loc < ckeyl) && ckey_utf[loc] != tmpc);
  ------------------
  |  Branch (703:16): [True: 7.21M, False: 459k]
  |  Branch (703:33): [True: 7.20M, False: 12.7k]
  ------------------
  704|   472k|    }
  705|  1.95M|    candidate_utf[i] = tmpc;
  706|  1.95M|  }
  707|   157k|  return wlst.size();
  708|   157k|}
_ZN10SuggestMgr7badcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  713|   264k|                               int cpdsuggest, int& info) {
  714|   264k|  std::string candidate(word);
  715|   264k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  716|   264k|  int timer = MINTIMER;
  ------------------
  |  |  107|   264k|#define MINTIMER 100
  ------------------
  717|       |  // swap out each char one by one and try all the tryme
  718|       |  // chars in its place to see if that makes a good word
  719|   264k|  for (size_t j = 0; j < ctryl; ++j) {
  ------------------
  |  Branch (719:22): [True: 0, False: 264k]
  ------------------
  720|      0|    for (auto aI = candidate.rbegin(), aEnd = candidate.rend(); aI != aEnd; ++aI) {
  ------------------
  |  Branch (720:65): [True: 0, False: 0]
  ------------------
  721|      0|      char tmpc = *aI;
  722|      0|      if (ctry[j] == tmpc)
  ------------------
  |  Branch (722:11): [True: 0, False: 0]
  ------------------
  723|      0|        continue;
  724|      0|      *aI = ctry[j];
  725|      0|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  726|      0|      if (!timer)
  ------------------
  |  Branch (726:11): [True: 0, False: 0]
  ------------------
  727|      0|        return wlst.size();
  728|      0|      *aI = tmpc;
  729|      0|    }
  730|      0|  }
  731|   264k|  return wlst.size();
  732|   264k|}
_ZN10SuggestMgr11badchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  737|   157k|                            int cpdsuggest, int& info) {
  738|   157k|  std::vector<w_char> candidate_utf(word);
  739|   157k|  std::string candidate;
  740|   157k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  741|   157k|  int timer = MINTIMER;
  ------------------
  |  |  107|   157k|#define MINTIMER 100
  ------------------
  742|       |  // swap out each char one by one and try all the tryme
  743|       |  // chars in its place to see if that makes a good word
  744|   176k|  for (size_t j = 0; j < ctryl; ++j) {
  ------------------
  |  Branch (744:22): [True: 18.6k, False: 157k]
  ------------------
  745|   250k|    for (auto aI = candidate_utf.rbegin(), aEnd = candidate_utf.rend(); aI != aEnd; ++aI) {
  ------------------
  |  Branch (745:73): [True: 231k, False: 18.6k]
  ------------------
  746|   231k|      w_char tmpc = *aI;
  747|   231k|      if (tmpc == ctry_utf[j])
  ------------------
  |  Branch (747:11): [True: 0, False: 231k]
  ------------------
  748|      0|        continue;
  749|   231k|      *aI = ctry_utf[j];
  750|   231k|      u16_u8(candidate, candidate_utf);
  751|   231k|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  752|   231k|      if (!timer)
  ------------------
  |  Branch (752:11): [True: 0, False: 231k]
  ------------------
  753|      0|        return wlst.size();
  754|   231k|      *aI = tmpc;
  755|   231k|    }
  756|  18.6k|  }
  757|   157k|  return wlst.size();
  758|   157k|}
_ZN10SuggestMgr13extrachar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  763|   157k|                              int cpdsuggest, int& info) {
  764|   157k|  std::vector<w_char> candidate_utf(word);
  765|   157k|  if (candidate_utf.size() < 2)
  ------------------
  |  Branch (765:7): [True: 16.2k, False: 141k]
  ------------------
  766|  16.2k|    return wlst.size();
  767|       |  // try omitting one char of word at a time
  768|  2.07M|  for (size_t i = 0; i < candidate_utf.size(); ++i) {
  ------------------
  |  Branch (768:22): [True: 1.93M, False: 141k]
  ------------------
  769|  1.93M|    size_t index = candidate_utf.size() - 1 - i;
  770|  1.93M|    w_char tmpc = candidate_utf[index];
  771|  1.93M|    candidate_utf.erase(candidate_utf.begin() + index);
  772|  1.93M|    std::string candidate;
  773|  1.93M|    u16_u8(candidate, candidate_utf);
  774|  1.93M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  775|  1.93M|    candidate_utf.insert(candidate_utf.begin() + index, tmpc);
  776|  1.93M|  }
  777|   141k|  return wlst.size();
  778|   157k|}
_ZN10SuggestMgr9extracharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  783|   264k|                          int cpdsuggest, int& info) {
  784|   264k|  std::string candidate(word);
  785|   264k|  if (candidate.size() < 2)
  ------------------
  |  Branch (785:7): [True: 19.5k, False: 244k]
  ------------------
  786|  19.5k|    return wlst.size();
  787|       |  // try omitting one char of word at a time
  788|  5.78M|  for (size_t i = 0; i < candidate.size(); ++i) {
  ------------------
  |  Branch (788:22): [True: 5.54M, False: 244k]
  ------------------
  789|  5.54M|    size_t index = candidate.size() - 1 - i;
  790|  5.54M|    char tmpc = candidate[index];
  791|  5.54M|    candidate.erase(candidate.begin() + index);
  792|  5.54M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  793|  5.54M|    candidate.insert(candidate.begin() + index, tmpc);
  794|  5.54M|  }
  795|   244k|  return wlst.size();
  796|   264k|}
_ZN10SuggestMgr10forgotcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  801|   264k|                           int cpdsuggest, int& info) {
  802|   264k|  std::string candidate(word);
  803|   264k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  804|   264k|  int timer = MINTIMER;
  ------------------
  |  |  107|   264k|#define MINTIMER 100
  ------------------
  805|       |
  806|       |  // try inserting a tryme character before every letter (and the null
  807|       |  // terminator)
  808|   264k|  for (size_t k = 0; k < ctryl; ++k) {
  ------------------
  |  Branch (808:22): [True: 0, False: 264k]
  ------------------
  809|      0|    for (size_t i = 0; i <= candidate.size(); ++i) {
  ------------------
  |  Branch (809:24): [True: 0, False: 0]
  ------------------
  810|      0|      size_t index = candidate.size() - i;
  811|      0|      candidate.insert(candidate.begin() + index, ctry[k]);
  812|      0|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  813|      0|      if (!timer)
  ------------------
  |  Branch (813:11): [True: 0, False: 0]
  ------------------
  814|      0|        return wlst.size();
  815|      0|      candidate.erase(candidate.begin() + index);
  816|      0|    }
  817|      0|  }
  818|   264k|  return wlst.size();
  819|   264k|}
_ZN10SuggestMgr14forgotchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  824|   157k|                               int cpdsuggest, int& info) {
  825|   157k|  std::vector<w_char> candidate_utf(word);
  826|   157k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  827|   157k|  int timer = MINTIMER;
  ------------------
  |  |  107|   157k|#define MINTIMER 100
  ------------------
  828|       |
  829|       |  // try inserting a tryme character at the end of the word and before every
  830|       |  // letter
  831|   176k|  for (size_t k = 0; k < ctryl; ++k) {
  ------------------
  |  Branch (831:22): [True: 18.6k, False: 157k]
  ------------------
  832|   268k|    for (size_t i = 0; i <= candidate_utf.size(); ++i) {
  ------------------
  |  Branch (832:24): [True: 250k, False: 18.6k]
  ------------------
  833|   250k|      size_t index = candidate_utf.size() - i;
  834|   250k|      candidate_utf.insert(candidate_utf.begin() + index, ctry_utf[k]);
  835|   250k|      std::string candidate;
  836|   250k|      u16_u8(candidate, candidate_utf);
  837|   250k|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  838|   250k|      if (!timer)
  ------------------
  |  Branch (838:11): [True: 0, False: 250k]
  ------------------
  839|      0|        return wlst.size();
  840|   250k|      candidate_utf.erase(candidate_utf.begin() + index);
  841|   250k|    }
  842|  18.6k|  }
  843|   157k|  return wlst.size();
  844|   157k|}
_ZN10SuggestMgr8twowordsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_ibRi:
  854|   421k|                         bool good, int& info) {
  855|   421k|  int c2, forbidden = 0, cwrd, wl = word.size();
  856|   421k|  if (wl < 3)
  ------------------
  |  Branch (856:7): [True: 58.6k, False: 363k]
  ------------------
  857|  58.6k|    return false;
  858|       |
  859|   363k|  if (langnum == LANG_hu)
  ------------------
  |  Branch (859:7): [True: 14.7k, False: 348k]
  ------------------
  860|  14.7k|    forbidden = check_forbidden(word);
  861|       |
  862|   363k|  char* candidate = new char[wl + 2];
  863|   363k|  memcpy(candidate + 1, word.data(), wl);
  864|   363k|  candidate[wl + 1] = 0;
  865|       |
  866|       |  // split the string into two pieces after every char
  867|       |  // if both pieces are good words make them a suggestion
  868|  4.80M|  for (char* p = candidate + 1; p[1] != '\0'; p++) {
  ------------------
  |  Branch (868:33): [True: 4.47M, False: 323k]
  ------------------
  869|  4.47M|    p[-1] = *p;
  870|       |    // go to end of the UTF-8 character
  871|  4.76M|    while (utf8 && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (871:12): [True: 1.53M, False: 3.22M]
  |  Branch (871:20): [True: 283k, False: 1.24M]
  ------------------
  872|   283k|      *p = p[1];
  873|   283k|      p++;
  874|   283k|    }
  875|  4.47M|    if (utf8 && p[1] == '\0')
  ------------------
  |  Branch (875:9): [True: 1.24M, False: 3.22M]
  |  Branch (875:17): [True: 39.8k, False: 1.20M]
  ------------------
  876|  39.8k|      break;  // last UTF-8 character
  877|       |
  878|       |    // Suggest only word pairs, if they are listed in the dictionary.
  879|       |    // For example, adding "a lot" to the English dic file will
  880|       |    // result only "alot" -> "a lot" suggestion instead of
  881|       |    // "alto, slot, alt, lot, allot, aloft, aloe, clot, plot, blot, a lot".
  882|       |    // Note: using "ph:alot" keeps the other suggestions:
  883|       |    // a lot ph:alot
  884|       |    // alot -> a lot, alto, slot...
  885|  4.43M|    *p = ' ';
  886|  4.43M|    if (!cpdsuggest && checkword(candidate, cpdsuggest, nullptr, nullptr)) {
  ------------------
  |  Branch (886:9): [True: 1.48M, False: 2.95M]
  |  Branch (886:9): [True: 1.48k, False: 4.43M]
  |  Branch (886:24): [True: 1.48k, False: 1.47M]
  ------------------
  887|       |      // best solution
  888|  1.48k|      info |= SPELL_BEST_SUG;
  ------------------
  |  |   86|  1.48k|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  889|       |
  890|       |      // remove not word pair suggestions
  891|  1.48k|      if (!good) {
  ------------------
  |  Branch (891:11): [True: 128, False: 1.36k]
  ------------------
  892|    128|        good = true;
  893|    128|        wlst.clear();
  894|    128|      }
  895|       |
  896|  1.48k|      wlst.insert(wlst.begin(), candidate);
  897|  1.48k|    }
  898|       |
  899|       |    // word pairs with dash?
  900|  4.43M|    if (lang_with_dash_usage) {
  ------------------
  |  Branch (900:9): [True: 0, False: 4.43M]
  ------------------
  901|      0|      *p = '-';
  902|       |
  903|      0|      if (!cpdsuggest && checkword(candidate, cpdsuggest, nullptr, nullptr)) {
  ------------------
  |  Branch (903:11): [True: 0, False: 0]
  |  Branch (903:11): [True: 0, False: 0]
  |  Branch (903:26): [True: 0, False: 0]
  ------------------
  904|       |        // best solution
  905|      0|        info |= SPELL_BEST_SUG;
  ------------------
  |  |   86|      0|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  906|       |
  907|       |        // remove not word pair suggestions
  908|      0|        if (!good) {
  ------------------
  |  Branch (908:13): [True: 0, False: 0]
  ------------------
  909|      0|          good = true;
  910|      0|          wlst.clear();
  911|      0|        }
  912|      0|        wlst.insert(wlst.begin(), candidate);
  913|      0|      }
  914|      0|    }
  915|       |
  916|  4.43M|    if (wlst.size() < maxSug && !nosplitsugs && !good) {
  ------------------
  |  Branch (916:9): [True: 4.43M, False: 682]
  |  Branch (916:33): [True: 4.43M, False: 0]
  |  Branch (916:49): [True: 4.43M, False: 807]
  ------------------
  917|  4.43M|      *p = '\0';
  918|  4.43M|      int c1 = checkword(candidate, cpdsuggest, nullptr, nullptr);
  919|  4.43M|      if (c1) {
  ------------------
  |  Branch (919:11): [True: 25.6k, False: 4.41M]
  ------------------
  920|  25.6k|        c2 = checkword((p + 1), cpdsuggest, nullptr, nullptr);
  921|  25.6k|        if (c2) {
  ------------------
  |  Branch (921:13): [True: 643, False: 24.9k]
  ------------------
  922|       |          // spec. Hungarian code (TODO need a better compound word support)
  923|    643|          if ((langnum == LANG_hu) && !forbidden &&
  ------------------
  |  Branch (923:15): [True: 16, False: 627]
  |  Branch (923:39): [True: 16, False: 0]
  ------------------
  924|       |              // if 3 repeating letter, use - instead of space
  925|     16|              (((p[-1] == p[1]) &&
  ------------------
  |  Branch (925:17): [True: 5, False: 11]
  ------------------
  926|      5|              (((p > candidate + 1) && (p[-1] == p[-2])) || (p[-1] == p[2]))) ||
  ------------------
  |  Branch (926:17): [True: 0, False: 5]
  |  Branch (926:40): [True: 0, False: 0]
  |  Branch (926:61): [True: 0, False: 5]
  ------------------
  927|       |              // or multiple compounding, with more, than 6 syllables
  928|     16|              ((c1 == 3) && (c2 >= 2))))
  ------------------
  |  Branch (928:16): [True: 0, False: 16]
  |  Branch (928:29): [True: 0, False: 0]
  ------------------
  929|      0|            *p = '-';
  930|    643|          else
  931|    643|            *p = ' ';
  932|       |
  933|    643|          cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (933:18): [True: 0, False: 643]
  ------------------
  934|       |
  935|    643|          if (cwrd && (wlst.size() < maxSug))
  ------------------
  |  Branch (935:15): [True: 643, False: 0]
  |  Branch (935:23): [True: 643, False: 0]
  ------------------
  936|    643|              wlst.emplace_back(candidate);
  937|       |
  938|       |          // add two word suggestion with dash, depending on the language
  939|       |          // Note that cwrd doesn't modified for REP twoword sugg.
  940|    643|          if ( !nosplitsugs && lang_with_dash_usage &&
  ------------------
  |  Branch (940:16): [True: 643, False: 0]
  |  Branch (940:32): [True: 0, False: 643]
  ------------------
  941|      0|              mystrlen(p + 1) > 1 && mystrlen(candidate) - mystrlen(p) > 1) {
  ------------------
  |  Branch (941:15): [True: 0, False: 0]
  |  Branch (941:38): [True: 0, False: 0]
  ------------------
  942|      0|            *p = '-';
  943|      0|            for (auto& k : wlst) {
  ------------------
  |  Branch (943:26): [True: 0, False: 0]
  ------------------
  944|      0|              if (k == candidate) {
  ------------------
  |  Branch (944:19): [True: 0, False: 0]
  ------------------
  945|      0|                cwrd = 0;
  946|      0|                break;
  947|      0|              }
  948|      0|            }
  949|       |
  950|      0|            if ((wlst.size() < maxSug) && cwrd)
  ------------------
  |  Branch (950:17): [True: 0, False: 0]
  |  Branch (950:43): [True: 0, False: 0]
  ------------------
  951|      0|              wlst.emplace_back(candidate);
  952|      0|          }
  953|    643|        }
  954|  25.6k|      }
  955|  4.43M|    }
  956|  4.43M|  }
  957|   363k|  delete[] candidate;
  958|   363k|  return good;
  959|   421k|}
_ZN10SuggestMgr8swapcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  964|   264k|                         int cpdsuggest, int& info) {
  965|   264k|  if (word.size() < 2)
  ------------------
  |  Branch (965:7): [True: 19.5k, False: 244k]
  ------------------
  966|  19.5k|    return wlst.size();
  967|       |
  968|   244k|  std::string candidate(word);
  969|       |
  970|       |  // try swapping adjacent chars one by one
  971|  5.54M|  for (size_t i = 0; i < candidate.size() - 1; ++i) {
  ------------------
  |  Branch (971:22): [True: 5.29M, False: 244k]
  ------------------
  972|  5.29M|    std::swap(candidate[i], candidate[i+1]);
  973|  5.29M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  974|  5.29M|    std::swap(candidate[i], candidate[i+1]);
  975|  5.29M|  }
  976|       |
  977|       |  // try double swaps for short words
  978|       |  // ahev -> have, owudl -> would
  979|   244k|  if (candidate.size() == 4 || candidate.size() == 5) {
  ------------------
  |  Branch (979:7): [True: 14.7k, False: 229k]
  |  Branch (979:32): [True: 9.94k, False: 219k]
  ------------------
  980|  24.7k|    candidate[0] = word[1];
  981|  24.7k|    candidate[1] = word[0];
  982|  24.7k|    candidate[2] = word[2];
  983|  24.7k|    candidate[candidate.size() - 2] = word[candidate.size() - 1];
  984|  24.7k|    candidate[candidate.size() - 1] = word[candidate.size() - 2];
  985|  24.7k|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  986|  24.7k|    if (candidate.size() == 5) {
  ------------------
  |  Branch (986:9): [True: 9.94k, False: 14.7k]
  ------------------
  987|  9.94k|      candidate[0] = word[0];
  988|  9.94k|      candidate[1] = word[2];
  989|  9.94k|      candidate[2] = word[1];
  990|  9.94k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  991|  9.94k|    }
  992|  24.7k|  }
  993|       |
  994|   244k|  return wlst.size();
  995|   264k|}
_ZN10SuggestMgr12swapchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1000|   157k|                             int cpdsuggest, int& info) {
 1001|   157k|  if (word.size() < 2)
  ------------------
  |  Branch (1001:7): [True: 16.2k, False: 141k]
  ------------------
 1002|  16.2k|    return wlst.size();
 1003|       |
 1004|   141k|  std::vector<w_char> candidate_utf(word);
 1005|       |
 1006|   141k|  std::string candidate;
 1007|       |  // try swapping adjacent chars one by one
 1008|  1.93M|  for (size_t i = 0; i < candidate_utf.size() - 1; ++i) {
  ------------------
  |  Branch (1008:22): [True: 1.79M, False: 141k]
  ------------------
 1009|  1.79M|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|  1.79M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (1009:9): [True: 0, False: 1.79M]
  ------------------
 1010|      0|      return wlst.size();
 1011|  1.79M|    std::swap(candidate_utf[i], candidate_utf[i+1]);
 1012|  1.79M|    u16_u8(candidate, candidate_utf);
 1013|  1.79M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1014|  1.79M|    std::swap(candidate_utf[i], candidate_utf[i+1]);
 1015|  1.79M|  }
 1016|       |
 1017|       |  // try double swaps for short words
 1018|       |  // ahev -> have, owudl -> would, suodn -> sound
 1019|   141k|  if (candidate_utf.size() == 4 || candidate_utf.size() == 5) {
  ------------------
  |  Branch (1019:7): [True: 19.0k, False: 122k]
  |  Branch (1019:36): [True: 8.75k, False: 113k]
  ------------------
 1020|  27.8k|    candidate_utf[0] = word[1];
 1021|  27.8k|    candidate_utf[1] = word[0];
 1022|  27.8k|    candidate_utf[2] = word[2];
 1023|  27.8k|    candidate_utf[candidate_utf.size() - 2] = word[candidate_utf.size() - 1];
 1024|  27.8k|    candidate_utf[candidate_utf.size() - 1] = word[candidate_utf.size() - 2];
 1025|  27.8k|    u16_u8(candidate, candidate_utf);
 1026|  27.8k|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1027|  27.8k|    if (candidate_utf.size() == 5) {
  ------------------
  |  Branch (1027:9): [True: 8.75k, False: 19.0k]
  ------------------
 1028|  8.75k|      candidate_utf[0] = word[0];
 1029|  8.75k|      candidate_utf[1] = word[2];
 1030|  8.75k|      candidate_utf[2] = word[1];
 1031|  8.75k|      u16_u8(candidate, candidate_utf);
 1032|  8.75k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1033|  8.75k|    }
 1034|  27.8k|  }
 1035|   141k|  return wlst.size();
 1036|   141k|}
_ZN10SuggestMgr12longswapcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
 1041|   264k|                             int cpdsuggest, int& info) {
 1042|   264k|  std::string candidate(word);
 1043|       |  // try swapping not adjacent chars one by one
 1044|  5.82M|  for (auto p = candidate.begin(); p < candidate.end(); ++p) {
  ------------------
  |  Branch (1044:36): [True: 5.56M, False: 264k]
  ------------------
 1045|   211M|    for (auto q = candidate.begin(); q < candidate.end(); ++q) {
  ------------------
  |  Branch (1045:38): [True: 205M, False: 5.56M]
  ------------------
 1046|   205M|      const auto distance = std::abs(std::distance(q, p));
 1047|   205M|      if (distance > 1 && distance <= MAX_CHAR_DISTANCE && *p != *q) {
  ------------------
  |  |   84|   395M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1047:11): [True: 189M, False: 16.1M]
  |  Branch (1047:27): [True: 28.9M, False: 160M]
  |  Branch (1047:60): [True: 22.1M, False: 6.84M]
  ------------------
 1048|  22.1M|        std::swap(*p, *q);
 1049|  22.1M|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1050|  22.1M|        std::swap(*p, *q);
 1051|  22.1M|      }
 1052|   205M|    }
 1053|  5.56M|  }
 1054|   264k|  return wlst.size();
 1055|   264k|}
_ZN10SuggestMgr16longswapchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1060|   157k|                                 int cpdsuggest, int& info) {
 1061|   157k|  std::vector<w_char> candidate_utf(word);
 1062|       |  // try swapping not adjacent chars
 1063|  2.11M|  for (auto p = candidate_utf.begin(); p < candidate_utf.end(); ++p) {
  ------------------
  |  Branch (1063:40): [True: 1.95M, False: 157k]
  ------------------
 1064|  52.3M|    for (auto q = candidate_utf.begin(); q < candidate_utf.end(); ++q) {
  ------------------
  |  Branch (1064:42): [True: 50.4M, False: 1.95M]
  ------------------
 1065|  50.4M|      const auto distance = std::abs(std::distance(q, p));
 1066|  50.4M|      if (distance > 1 && distance <= MAX_CHAR_DISTANCE && *p != *q) {
  ------------------
  |  |   84|  95.3M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1066:11): [True: 44.8M, False: 5.54M]
  |  Branch (1066:27): [True: 9.17M, False: 35.7M]
  |  Branch (1066:60): [True: 6.55M, False: 2.62M]
  ------------------
 1067|  6.55M|        std::swap(*p, *q);
 1068|  6.55M|        std::string candidate;
 1069|  6.55M|        u16_u8(candidate, candidate_utf);
 1070|  6.55M|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1071|  6.55M|        std::swap(*p, *q);
 1072|  6.55M|      }
 1073|  50.4M|    }
 1074|  1.95M|  }
 1075|   157k|  return wlst.size();
 1076|   157k|}
_ZN10SuggestMgr8movecharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
 1081|   264k|                         int cpdsuggest, int& info) {
 1082|   264k|  if (word.size() < 2)
  ------------------
  |  Branch (1082:7): [True: 19.5k, False: 244k]
  ------------------
 1083|  19.5k|    return wlst.size();
 1084|       |
 1085|   244k|  std::string candidate(word);
 1086|       |
 1087|       |  // try moving a char
 1088|  5.78M|  for (auto p = candidate.begin(); p < candidate.end(); ++p) {
  ------------------
  |  Branch (1088:36): [True: 5.54M, False: 244k]
  ------------------
 1089|  25.3M|    for (auto q = p + 1; q < candidate.end() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  24.1M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1089:26): [True: 24.1M, False: 1.14M]
  |  Branch (1089:26): [True: 19.7M, False: 5.54M]
  |  Branch (1089:49): [True: 19.7M, False: 4.39M]
  ------------------
 1090|  19.7M|      std::swap(*q, *(q - 1));
 1091|  19.7M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1091:11): [True: 5.29M, False: 14.4M]
  ------------------
 1092|  5.29M|        continue;  // omit swap char
 1093|  14.4M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1094|  14.4M|    }
 1095|  5.54M|    const auto word_iter = word.begin();
 1096|  5.54M|    std::copy_n(word_iter, candidate.size(), candidate.begin());
 1097|  5.54M|  }
 1098|       |
 1099|  5.54M|  for (auto p = candidate.rbegin(), pEnd = candidate.rend() - 1; p != pEnd; ++p) {
  ------------------
  |  Branch (1099:66): [True: 5.29M, False: 244k]
  ------------------
 1100|  25.0M|    for (auto q = p + 1, qEnd = candidate.rend(); q != qEnd && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  24.1M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1100:51): [True: 24.1M, False: 899k]
  |  Branch (1100:64): [True: 19.7M, False: 4.39M]
  ------------------
 1101|  19.7M|      std::swap(*q, *(q - 1));
 1102|  19.7M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1102:11): [True: 5.29M, False: 14.4M]
  ------------------
 1103|  5.29M|        continue;  // omit swap char
 1104|  14.4M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1105|  14.4M|    }
 1106|  5.29M|    const auto word_iter = word.begin();
 1107|  5.29M|    std::copy_n(word_iter, candidate.size(), candidate.begin());
 1108|  5.29M|  }
 1109|       |
 1110|   244k|  return wlst.size();
 1111|   264k|}
_ZN10SuggestMgr12movechar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1116|   157k|                             int cpdsuggest, int& info) {
 1117|   157k|  if (word.size() < 2)
  ------------------
  |  Branch (1117:7): [True: 16.2k, False: 141k]
  ------------------
 1118|  16.2k|    return wlst.size();
 1119|       |
 1120|   141k|  std::vector<w_char> candidate_utf(word);
 1121|       |
 1122|       |  // try moving a char
 1123|  2.07M|  for (auto p = candidate_utf.begin(); p < candidate_utf.end(); ++p) {
  ------------------
  |  Branch (1123:40): [True: 1.93M, False: 141k]
  ------------------
 1124|  8.31M|    for (auto q = p + 1; q < candidate_utf.end() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  7.68M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1124:26): [True: 7.68M, False: 629k]
  |  Branch (1124:26): [True: 6.38M, False: 1.93M]
  |  Branch (1124:53): [True: 6.38M, False: 1.30M]
  ------------------
 1125|  6.38M|      std::swap(*q, *(q - 1));
 1126|  6.38M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1126:11): [True: 1.79M, False: 4.58M]
  ------------------
 1127|  1.79M|        continue;  // omit swap char
 1128|  4.58M|      std::string candidate;
 1129|  4.58M|      u16_u8(candidate, candidate_utf);
 1130|  4.58M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1131|  4.58M|    }
 1132|  1.93M|    const auto word_iter = word.begin();
 1133|  1.93M|    std::copy_n(word_iter, candidate_utf.size(), candidate_utf.begin());
 1134|  1.93M|  }
 1135|       |
 1136|  2.07M|  for (auto p = candidate_utf.rbegin(); p < candidate_utf.rend(); ++p) {
  ------------------
  |  Branch (1136:41): [True: 1.93M, False: 141k]
  ------------------
 1137|  8.31M|    for (auto q = p + 1; q < candidate_utf.rend() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  7.68M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1137:26): [True: 7.68M, False: 629k]
  |  Branch (1137:26): [True: 6.38M, False: 1.93M]
  |  Branch (1137:54): [True: 6.38M, False: 1.30M]
  ------------------
 1138|  6.38M|      std::swap(*q, *(q - 1));
 1139|  6.38M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1139:11): [True: 1.79M, False: 4.58M]
  ------------------
 1140|  1.79M|        continue;  // omit swap char
 1141|  4.58M|      std::string candidate;
 1142|  4.58M|      u16_u8(candidate, candidate_utf);
 1143|  4.58M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1144|  4.58M|    }
 1145|  1.93M|    const auto word_iter = word.begin();
 1146|  1.93M|    std::copy_n(word_iter, candidate_utf.size(), candidate_utf.begin());
 1147|  1.93M|  }
 1148|       |
 1149|   141k|  return wlst.size();
 1150|   157k|}
_ZN10SuggestMgr9ngsuggestERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEEPKcRKNS1_INS0_10unique_ptrI7HashMgrNS0_14default_deleteISE_EEEENS5_ISH_EEEEi:
 1185|  62.4k|                          int captype) {
 1186|  62.4k|  int lval, sc, lp, lpphon, nonbmp = 0;
 1187|       |
 1188|       |  // exhaustively search through all root words
 1189|       |  // keeping track of the MAX_ROOTS most similar root words
 1190|  62.4k|  struct hentry* roots[MAX_ROOTS];
 1191|  62.4k|  char* rootsphon[MAX_ROOTS];
 1192|  62.4k|  int scores[MAX_ROOTS];
 1193|  62.4k|  int scoresphon[MAX_ROOTS];
 1194|  6.30M|  for (int i = 0; i < MAX_ROOTS; i++) {
  ------------------
  |  |   74|  6.30M|#define MAX_ROOTS 100
  ------------------
  |  Branch (1194:19): [True: 6.24M, False: 62.4k]
  ------------------
 1195|  6.24M|    roots[i] = nullptr;
 1196|  6.24M|    scores[i] = -100 * i;
 1197|  6.24M|    rootsphon[i] = nullptr;
 1198|  6.24M|    scoresphon[i] = -100 * i;
 1199|  6.24M|  }
 1200|  62.4k|  bool has_roots = false;
 1201|  62.4k|  bool has_rootsphon = false;
 1202|  62.4k|  lp = MAX_ROOTS - 1;
  ------------------
  |  |   74|  62.4k|#define MAX_ROOTS 100
  ------------------
 1203|  62.4k|  lpphon = MAX_ROOTS - 1;
  ------------------
  |  |   74|  62.4k|#define MAX_ROOTS 100
  ------------------
 1204|  62.4k|  int low = NGRAM_LOWERING;
  ------------------
  |  |   83|  62.4k|#define NGRAM_LOWERING (1 << 2)
  ------------------
 1205|       |
 1206|  62.4k|  std::string w2;
 1207|  62.4k|  const char* word = w;
 1208|       |
 1209|  62.4k|  int nc;
 1210|       |  // word reversing wrapper for complex prefixes
 1211|  62.4k|  if (complexprefixes) {
  ------------------
  |  Branch (1211:7): [True: 3.58k, False: 58.8k]
  ------------------
 1212|  3.58k|    w2.assign(w);
 1213|  3.58k|    if (utf8)
  ------------------
  |  Branch (1213:9): [True: 0, False: 3.58k]
  ------------------
 1214|      0|      reverseword_utf(w2);
 1215|  3.58k|    else
 1216|  3.58k|      reverseword(w2);
 1217|  3.58k|    word = w2.c_str();
 1218|  3.58k|    nc = (int)w2.size();
 1219|  58.8k|  } else {
 1220|  58.8k|    nc = (int)strlen(word);
 1221|  58.8k|  }
 1222|       |
 1223|  62.4k|  std::vector<w_char> u8;
 1224|  62.4k|  int n = (utf8) ? u8_u16(u8, word) : nc;
  ------------------
  |  Branch (1224:11): [True: 26.0k, False: 36.4k]
  ------------------
 1225|       |
 1226|       |  // set character based ngram suggestion for words with non-BMP Unicode
 1227|       |  // characters
 1228|  62.4k|  const struct cs_info* origconv = csconv;
 1229|  62.4k|  if (n == -1) {
  ------------------
  |  Branch (1229:7): [True: 1.72k, False: 60.7k]
  ------------------
 1230|  1.72k|    utf8 = 0;  // XXX not state-free
 1231|  1.72k|    if (!csconv)
  ------------------
  |  Branch (1231:9): [True: 1.72k, False: 0]
  ------------------
 1232|  1.72k|      csconv = get_current_cs("iso88591"); // XXX not state-free
 1233|  1.72k|    n = nc;
 1234|  1.72k|    nonbmp = 1;
 1235|  1.72k|    low = 0;
 1236|  1.72k|  }
 1237|  62.4k|  ngsuggest_guard restore_state(nonbmp, origconv, &utf8, &csconv);
 1238|  62.4k|  int max_word_len = (utf8) ? MAXWORDUTF8LEN : MAXWORDLEN;
  ------------------
  |  |   85|  24.2k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  24.2k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                int max_word_len = (utf8) ? MAXWORDUTF8LEN : MAXWORDLEN;
  ------------------
  |  |   90|  38.1k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1238:22): [True: 24.2k, False: 38.1k]
  ------------------
 1239|       |  // ofz#59067 a replist entry can generate a very long word, abandon
 1240|       |  // ngram if that odd-edge case arises
 1241|  62.4k|  if (n > max_word_len * 4)
  ------------------
  |  Branch (1241:7): [True: 0, False: 62.4k]
  ------------------
 1242|      0|      return;
 1243|       |
 1244|  62.4k|  struct hentry* hp = nullptr;
 1245|  62.4k|  int col = -1;
 1246|  62.4k|  phonetable* ph = (pAMgr) ? pAMgr->get_phonetable() : nullptr;
  ------------------
  |  Branch (1246:20): [True: 62.4k, False: 0]
  ------------------
 1247|  62.4k|  std::string target;
 1248|  62.4k|  std::string candidate;
 1249|  62.4k|  std::vector<w_char> w_candidate;
 1250|  62.4k|  if (ph) {
  ------------------
  |  Branch (1250:7): [True: 3.59k, False: 58.8k]
  ------------------
 1251|  3.59k|    if (utf8) {
  ------------------
  |  Branch (1251:9): [True: 0, False: 3.59k]
  ------------------
 1252|      0|      u8_u16(w_candidate, word);
 1253|      0|      mkallcap_utf(w_candidate, langnum);
 1254|      0|      u16_u8(candidate, w_candidate);
 1255|  3.59k|    } else {
 1256|  3.59k|      candidate.assign(word);
 1257|  3.59k|      if (!nonbmp)
  ------------------
  |  Branch (1257:11): [True: 3.59k, False: 0]
  ------------------
 1258|  3.59k|        mkallcap(candidate, csconv);
 1259|  3.59k|    }
 1260|  3.59k|    target = phonet(candidate, *ph);  // XXX phonet() is 8-bit (nc, not n)
 1261|  3.59k|  }
 1262|       |
 1263|  62.4k|  FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL;
  ------------------
  |  |   95|  62.4k|#define FLAG unsigned short
  ------------------
                FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL;
  ------------------
  |  |   96|  62.4k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1263:24): [True: 62.4k, False: 0]
  ------------------
 1264|  62.4k|  FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL;
  ------------------
  |  |   95|  62.4k|#define FLAG unsigned short
  ------------------
                FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL;
  ------------------
  |  |   96|  62.4k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1264:20): [True: 62.4k, False: 0]
  ------------------
 1265|  62.4k|  FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL;
  ------------------
  |  |   95|  62.4k|#define FLAG unsigned short
  ------------------
                FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL;
  ------------------
  |  |   96|  62.4k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1265:25): [True: 62.4k, False: 0]
  ------------------
 1266|  62.4k|  FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL;
  ------------------
  |  |   95|  62.4k|#define FLAG unsigned short
  ------------------
                FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL;
  ------------------
  |  |   96|  62.4k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1266:25): [True: 62.4k, False: 0]
  ------------------
 1267|       |
 1268|  62.4k|  std::vector<w_char> w_word, w_target;
 1269|  62.4k|  if (utf8) {
  ------------------
  |  Branch (1269:7): [True: 24.2k, False: 38.1k]
  ------------------
 1270|  24.2k|    u8_u16(w_word, word);
 1271|  24.2k|    u8_u16(w_target, target);
 1272|  24.2k|  }
 1273|       |
 1274|  62.4k|  std::string f;
 1275|  62.4k|  std::vector<w_char> w_f;
 1276|       |
 1277|  62.4k|  for (const auto& i : rHMgr) {
  ------------------
  |  Branch (1277:22): [True: 62.4k, False: 62.4k]
  ------------------
 1278|  2.00M|    while (nullptr != (hp = i->walk_hashtable(col, hp))) {
  ------------------
  |  Branch (1278:12): [True: 1.94M, False: 62.4k]
  ------------------
 1279|       |      // skip exceptions
 1280|  1.94M|      if (
 1281|       |           // skip it, if the word length different by 5 or
 1282|       |           // more characters (to avoid strange suggestions)
 1283|       |           // (except Unicode characters over BMP)
 1284|  1.94M|           (((abs(n - hp->clen) > 4) && !nonbmp)) ||
  ------------------
  |  Branch (1284:12): [True: 1.33M, False: 602k]
  |  Branch (1284:14): [True: 1.22M, False: 716k]
  |  Branch (1284:41): [True: 1.18M, False: 44.3k]
  ------------------
 1285|       |           // don't suggest capitalized dictionary words for
 1286|       |           // lower case misspellings in ngram suggestions, except
 1287|       |           // - PHONE usage, or
 1288|       |           // - in the case of German, where not only proper
 1289|       |           //   nouns are capitalized, or
 1290|       |           // - the capitalized word has special pronunciation
 1291|   760k|           ((captype == NOCAP) && (hp->var & H_OPT_INITCAP) &&
  ------------------
  |  |   92|   760k|#define NOCAP 0
  ------------------
                         ((captype == NOCAP) && (hp->var & H_OPT_INITCAP) &&
  ------------------
  |  |   50|   161k|#define H_OPT_INITCAP (1 << 3)  // is dictionary word capitalized?
  ------------------
  |  Branch (1291:13): [True: 161k, False: 599k]
  |  Branch (1291:35): [True: 69.8k, False: 91.5k]
  ------------------
 1292|  69.8k|              !ph && (langnum != LANG_de) && !(hp->var & H_OPT_PHON)) ||
  ------------------
  |  |   49|  68.0k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  |  Branch (1292:15): [True: 68.0k, False: 1.76k]
  |  Branch (1292:22): [True: 68.0k, False: 0]
  |  Branch (1292:46): [True: 68.0k, False: 0]
  ------------------
 1293|       |           // or it has one of the following special flags
 1294|   692k|           ((hp->astr) && (pAMgr) &&
  ------------------
  |  Branch (1294:13): [True: 187k, False: 504k]
  |  Branch (1294:27): [True: 187k, False: 0]
  ------------------
 1295|   187k|             (TESTAFF(hp->astr, forbiddenword, hp->alen) ||
  ------------------
  |  |   99|   375k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 2.07k, False: 185k]
  |  |  ------------------
  ------------------
 1296|   185k|             TESTAFF(hp->astr, ONLYUPCASEFLAG, hp->alen) ||
  ------------------
  |  |   99|   373k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 87.7k, False: 98.1k]
  |  |  ------------------
  ------------------
 1297|  98.1k|             TESTAFF(hp->astr, nosuggest, hp->alen) ||
  ------------------
  |  |   99|   286k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 98.1k]
  |  |  ------------------
  ------------------
 1298|  98.1k|             TESTAFF(hp->astr, nongramsuggest, hp->alen) ||
  ------------------
  |  |   99|   286k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 98.1k]
  |  |  ------------------
  ------------------
 1299|  98.1k|             TESTAFF(hp->astr, onlyincompound, hp->alen)))
  ------------------
  |  |   99|  98.1k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 98.1k]
  |  |  ------------------
  ------------------
 1300|  1.94M|         )
 1301|  1.33M|        continue;
 1302|       |
 1303|   602k|      if (utf8) {
  ------------------
  |  Branch (1303:11): [True: 277k, False: 324k]
  ------------------
 1304|   277k|        u8_u16(w_f, HENTRY_WORD(hp));
  ------------------
  |  |   54|   277k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1305|       |
 1306|   277k|        int leftcommon = leftcommonsubstring(w_word, w_f);
 1307|   277k|        if (low) {
  ------------------
  |  Branch (1307:13): [True: 277k, False: 0]
  ------------------
 1308|       |          // lowering dictionary word
 1309|   277k|          mkallsmall_utf(w_f, langnum);
 1310|   277k|        }
 1311|   277k|        sc = ngram(3, w_word, w_f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|   277k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1312|   324k|      } else {
 1313|   324k|        f.assign(HENTRY_WORD(hp));
  ------------------
  |  |   54|   324k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1314|       |
 1315|   324k|        int leftcommon = leftcommonsubstring(word, f.c_str());
 1316|   324k|        if (low) {
  ------------------
  |  Branch (1316:13): [True: 303k, False: 21.0k]
  ------------------
 1317|       |          // lowering dictionary word
 1318|   303k|          mkallsmall(f, csconv);
 1319|   303k|        }
 1320|   324k|        sc = ngram(3, word, f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|   324k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1321|   324k|      }
 1322|       |
 1323|       |      // check special pronunciation
 1324|   602k|      f.clear();
 1325|   602k|      if ((hp->var & H_OPT_PHON) &&
  ------------------
  |  |   49|   602k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  |  Branch (1325:11): [True: 753, False: 601k]
  |  Branch (1325:11): [True: 753, False: 601k]
  ------------------
 1326|    753|          copy_field(f, HENTRY_DATA(hp), MORPH_PHON)) {
  ------------------
  |  |  114|    753|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (1326:11): [True: 753, False: 0]
  ------------------
 1327|    753|        int sc2;
 1328|    753|        if (utf8) {
  ------------------
  |  Branch (1328:13): [True: 0, False: 753]
  ------------------
 1329|      0|          u8_u16(w_f, f);
 1330|       |
 1331|      0|          int leftcommon = leftcommonsubstring(w_word, w_f);
 1332|      0|          if (low) {
  ------------------
  |  Branch (1332:15): [True: 0, False: 0]
  ------------------
 1333|       |            // lowering dictionary word
 1334|      0|            mkallsmall_utf(w_f, langnum);
 1335|      0|          }
 1336|      0|          sc2 = ngram(3, w_word, w_f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|      0|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1337|    753|        } else {
 1338|    753|          int leftcommon = leftcommonsubstring(word, f.c_str());
 1339|    753|          if (low) {
  ------------------
  |  Branch (1339:15): [True: 753, False: 0]
  ------------------
 1340|       |            // lowering dictionary word
 1341|    753|            mkallsmall(f, csconv);
 1342|    753|          }
 1343|    753|          sc2 = ngram(3, word, f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|    753|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1344|    753|        }
 1345|    753|        if (sc2 > sc)
  ------------------
  |  Branch (1345:13): [True: 376, False: 377]
  ------------------
 1346|    376|          sc = sc2;
 1347|    753|      }
 1348|       |
 1349|   602k|      int scphon = -20000;
 1350|   602k|      if (ph && (sc > 2) && (abs(n - (int)hp->clen) <= 3)) {
  ------------------
  |  Branch (1350:11): [True: 34.9k, False: 567k]
  |  Branch (1350:17): [True: 7.81k, False: 27.1k]
  |  Branch (1350:29): [True: 6.78k, False: 1.03k]
  ------------------
 1351|  6.78k|        if (utf8) {
  ------------------
  |  Branch (1351:13): [True: 0, False: 6.78k]
  ------------------
 1352|      0|          u8_u16(w_candidate, HENTRY_WORD(hp));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1353|      0|          mkallcap_utf(w_candidate, langnum);
 1354|      0|          u16_u8(candidate, w_candidate);
 1355|  6.78k|        } else {
 1356|  6.78k|          candidate = HENTRY_WORD(hp);
  ------------------
  |  |   54|  6.78k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1357|  6.78k|          mkallcap(candidate, csconv);
 1358|  6.78k|        }
 1359|  6.78k|        f = phonet(candidate, *ph);
 1360|  6.78k|        if (utf8) {
  ------------------
  |  Branch (1360:13): [True: 0, False: 6.78k]
  ------------------
 1361|      0|          u8_u16(w_f, f);
 1362|      0|          scphon = 2 * ngram(3, w_target, w_f,
 1363|      0|                             NGRAM_LONGER_WORSE);
  ------------------
  |  |   81|      0|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1364|  6.78k|        } else {
 1365|  6.78k|          scphon = 2 * ngram(3, target, f,
 1366|  6.78k|                             NGRAM_LONGER_WORSE);
  ------------------
  |  |   81|  6.78k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1367|  6.78k|        }
 1368|  6.78k|      }
 1369|       |
 1370|   602k|      if (sc > scores[lp]) {
  ------------------
  |  Branch (1370:11): [True: 602k, False: 0]
  ------------------
 1371|   602k|        scores[lp] = sc;
 1372|   602k|        roots[lp] = hp;
 1373|   602k|        has_roots = true;
 1374|   602k|        lval = sc;
 1375|  60.8M|        for (int j = 0; j < MAX_ROOTS; j++)
  ------------------
  |  |   74|  60.8M|#define MAX_ROOTS 100
  ------------------
  |  Branch (1375:25): [True: 60.2M, False: 602k]
  ------------------
 1376|  60.2M|          if (scores[j] < lval) {
  ------------------
  |  Branch (1376:15): [True: 49.8M, False: 10.4M]
  ------------------
 1377|  49.8M|            lp = j;
 1378|  49.8M|            lval = scores[j];
 1379|  49.8M|          }
 1380|   602k|      }
 1381|       |
 1382|   602k|      if (scphon > scoresphon[lpphon]) {
  ------------------
  |  Branch (1382:11): [True: 6.78k, False: 595k]
  ------------------
 1383|  6.78k|        scoresphon[lpphon] = scphon;
 1384|  6.78k|        rootsphon[lpphon] = HENTRY_WORD(hp);
  ------------------
  |  |   54|  6.78k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1385|  6.78k|        has_rootsphon = true;
 1386|  6.78k|        lval = scphon;
 1387|   685k|        for (int j = 0; j < MAX_ROOTS; j++)
  ------------------
  |  |   74|   685k|#define MAX_ROOTS 100
  ------------------
  |  Branch (1387:25): [True: 678k, False: 6.78k]
  ------------------
 1388|   678k|          if (scoresphon[j] < lval) {
  ------------------
  |  Branch (1388:15): [True: 598k, False: 79.7k]
  ------------------
 1389|   598k|            lpphon = j;
 1390|   598k|            lval = scoresphon[j];
 1391|   598k|          }
 1392|  6.78k|      }
 1393|   602k|    }
 1394|  62.4k|  }
 1395|       |
 1396|  62.4k|  if (!has_roots && !has_rootsphon) {
  ------------------
  |  Branch (1396:7): [True: 14.0k, False: 48.4k]
  |  Branch (1396:21): [True: 14.0k, False: 0]
  ------------------
 1397|       |    // with no roots there will be no guesses and no point running
 1398|       |    // ngram
 1399|  14.0k|    return;
 1400|  14.0k|  }
 1401|       |
 1402|       |  // find minimum threshold for a passable suggestion
 1403|       |  // mangle original word three differnt ways
 1404|       |  // and score them to generate a minimum acceptable score
 1405|  48.4k|  std::vector<w_char> w_mw;
 1406|  48.4k|  int thresh = 0;
 1407|   193k|  for (int sp = 1; sp < 4; sp++) {
  ------------------
  |  Branch (1407:20): [True: 145k, False: 48.4k]
  ------------------
 1408|   145k|    if (utf8) {
  ------------------
  |  Branch (1408:9): [True: 59.6k, False: 85.6k]
  ------------------
 1409|  59.6k|      w_mw = w_word;
 1410|   111k|      for (int k = sp; k < n; k += 4) {
  ------------------
  |  Branch (1410:24): [True: 51.6k, False: 59.6k]
  ------------------
 1411|  51.6k|        w_mw[k].l = '*';
 1412|  51.6k|        w_mw[k].h = 0;
 1413|  51.6k|      }
 1414|       |
 1415|  59.6k|      if (low) {
  ------------------
  |  Branch (1415:11): [True: 59.6k, False: 0]
  ------------------
 1416|       |        // lowering dictionary word
 1417|  59.6k|        mkallsmall_utf(w_mw, langnum);
 1418|  59.6k|      }
 1419|       |
 1420|  59.6k|      thresh += ngram(n, w_word, w_mw, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  59.6k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1421|  85.6k|    } else {
 1422|  85.6k|      std::string mw = word;
 1423|   201k|      for (int k = sp; k < n; k += 4)
  ------------------
  |  Branch (1423:24): [True: 115k, False: 85.6k]
  ------------------
 1424|   115k|        mw[k] = '*';
 1425|       |
 1426|  85.6k|      if (low) {
  ------------------
  |  Branch (1426:11): [True: 80.4k, False: 5.18k]
  ------------------
 1427|       |        // lowering dictionary word
 1428|  80.4k|        mkallsmall(mw, csconv);
 1429|  80.4k|      }
 1430|       |
 1431|  85.6k|      thresh += ngram(n, word, mw, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  85.6k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1432|  85.6k|    }
 1433|   145k|  }
 1434|  48.4k|  thresh = thresh / 3;
 1435|  48.4k|  thresh--;
 1436|       |
 1437|       |  // now expand affixes on each of these root words and
 1438|       |  // and use length adjusted ngram scores to select
 1439|       |  // possible suggestions
 1440|  48.4k|  char* guess[MAX_GUESS];
 1441|  48.4k|  char* guessorig[MAX_GUESS];
 1442|  48.4k|  int gscore[MAX_GUESS];
 1443|  9.73M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.73M|#define MAX_GUESS 200
  ------------------
  |  Branch (1443:19): [True: 9.68M, False: 48.4k]
  ------------------
 1444|  9.68M|    guess[i] = nullptr;
 1445|  9.68M|    guessorig[i] = nullptr;
 1446|  9.68M|    gscore[i] = -100 * i;
 1447|  9.68M|  }
 1448|       |
 1449|  48.4k|  lp = MAX_GUESS - 1;
  ------------------
  |  |   76|  48.4k|#define MAX_GUESS 200
  ------------------
 1450|       |
 1451|  48.4k|  std::vector<guessword> glst(MAX_WORDS);
  ------------------
  |  |   75|  48.4k|#define MAX_WORDS 100
  ------------------
 1452|       |
 1453|  4.84M|  for (auto& root : roots) {
  ------------------
  |  Branch (1453:19): [True: 4.84M, False: 48.4k]
  ------------------
 1454|  4.84M|    if (root) {
  ------------------
  |  Branch (1454:9): [True: 602k, False: 4.24M]
  ------------------
 1455|   602k|      struct hentry* rp = root;
 1456|       |
 1457|   602k|      f.clear();
 1458|   602k|      const char* field = nullptr;
 1459|   602k|      if ((rp->var & H_OPT_PHON) && copy_field(f, HENTRY_DATA(rp), MORPH_PHON))
  ------------------
  |  |   49|   602k|#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|    753|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (1459:11): [True: 753, False: 601k]
  |  Branch (1459:11): [True: 753, False: 601k]
  |  Branch (1459:37): [True: 753, False: 0]
  ------------------
 1460|    753|          field = f.c_str();
 1461|   602k|      int nw = pAMgr->expand_rootword(
 1462|   602k|          glst.data(), MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word,
  ------------------
  |  |   75|   602k|#define MAX_WORDS 100
  ------------------
                        glst.data(), MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word,
  ------------------
  |  |   54|   602k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1463|   602k|          nc, field);
 1464|       |
 1465|  1.20M|      for (int k = 0; k < nw; k++) {
  ------------------
  |  Branch (1465:23): [True: 601k, False: 602k]
  ------------------
 1466|   601k|        if (utf8) {
  ------------------
  |  Branch (1466:13): [True: 277k, False: 323k]
  ------------------
 1467|   277k|          u8_u16(w_f, glst[k].word);
 1468|       |
 1469|   277k|          int leftcommon = leftcommonsubstring(w_word, w_f);
 1470|   277k|          if (low) {
  ------------------
  |  Branch (1470:15): [True: 277k, False: 0]
  ------------------
 1471|       |            // lowering dictionary word
 1472|   277k|            mkallsmall_utf(w_f, langnum);
 1473|   277k|          }
 1474|       |
 1475|   277k|          sc = ngram(n, w_word, w_f, NGRAM_ANY_MISMATCH) + leftcommon;
  ------------------
  |  |   82|   277k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1476|   323k|        } else {
 1477|   323k|          f = glst[k].word;
 1478|       |
 1479|   323k|          int leftcommon = leftcommonsubstring(word, f.c_str());
 1480|   323k|          if (low) {
  ------------------
  |  Branch (1480:15): [True: 302k, False: 21.0k]
  ------------------
 1481|       |            // lowering dictionary word
 1482|   302k|            mkallsmall(f, csconv);
 1483|   302k|          }
 1484|       |
 1485|   323k|          sc = ngram(n, word, f, NGRAM_ANY_MISMATCH) + leftcommon;
  ------------------
  |  |   82|   323k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1486|   323k|        }
 1487|       |
 1488|   601k|        if (sc > thresh) {
  ------------------
  |  Branch (1488:13): [True: 106k, False: 494k]
  ------------------
 1489|   106k|          if (sc > gscore[lp]) {
  ------------------
  |  Branch (1489:15): [True: 106k, False: 0]
  ------------------
 1490|   106k|            if (guess[lp]) {
  ------------------
  |  Branch (1490:17): [True: 0, False: 106k]
  ------------------
 1491|      0|              delete[] guess[lp];
 1492|      0|              if (guessorig[lp]) {
  ------------------
  |  Branch (1492:19): [True: 0, False: 0]
  ------------------
 1493|      0|                delete[] guessorig[lp];
 1494|      0|                guessorig[lp] = nullptr;
 1495|      0|              }
 1496|      0|            }
 1497|   106k|            gscore[lp] = sc;
 1498|   106k|            guess[lp] = glst[k].word;
 1499|   106k|            guessorig[lp] = glst[k].orig;
 1500|   106k|            lval = sc;
 1501|  21.4M|            for (int j = 0; j < MAX_GUESS; j++)
  ------------------
  |  |   76|  21.4M|#define MAX_GUESS 200
  ------------------
  |  Branch (1501:29): [True: 21.3M, False: 106k]
  ------------------
 1502|  21.3M|              if (gscore[j] < lval) {
  ------------------
  |  Branch (1502:19): [True: 20.4M, False: 912k]
  ------------------
 1503|  20.4M|                lp = j;
 1504|  20.4M|                lval = gscore[j];
 1505|  20.4M|              }
 1506|   106k|          } else {
 1507|      0|            delete[] glst[k].word;
 1508|      0|            delete[] glst[k].orig;
 1509|      0|          }
 1510|   494k|        } else {
 1511|   494k|          delete[] glst[k].word;
 1512|   494k|          delete[] glst[k].orig;
 1513|   494k|        }
 1514|   601k|      }
 1515|   602k|    }
 1516|  4.84M|  }
 1517|  48.4k|  glst.clear();
 1518|       |
 1519|       |  // now we are done generating guesses
 1520|       |  // sort in order of decreasing score
 1521|       |
 1522|  48.4k|  bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS);
  ------------------
  |  |   76|  48.4k|#define MAX_GUESS 200
  ------------------
 1523|  48.4k|  if (ph)
  ------------------
  |  Branch (1523:7): [True: 2.85k, False: 45.5k]
  ------------------
 1524|  2.85k|    bubblesort(&rootsphon[0], nullptr, &scoresphon[0], MAX_ROOTS);
  ------------------
  |  |   74|  2.85k|#define MAX_ROOTS 100
  ------------------
 1525|       |
 1526|       |  // weight suggestions with a similarity index, based on
 1527|       |  // the longest common subsequent algorithm and resort
 1528|       |
 1529|  48.4k|  int is_swap = 0;
 1530|  48.4k|  int re = 0;
 1531|  48.4k|  double fact = 1.0;
 1532|  48.4k|  if (pAMgr) {
  ------------------
  |  Branch (1532:7): [True: 48.4k, False: 0]
  ------------------
 1533|  48.4k|    int maxd = pAMgr->get_maxdiff();
 1534|  48.4k|    if (maxd >= 0)
  ------------------
  |  Branch (1534:9): [True: 0, False: 48.4k]
  ------------------
 1535|      0|      fact = (10.0 - maxd) / 5.0;
 1536|  48.4k|  }
 1537|       |
 1538|  48.4k|  std::vector<w_char> w_gl;
 1539|  9.20M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.20M|#define MAX_GUESS 200
  ------------------
  |  Branch (1539:19): [True: 9.16M, False: 45.8k]
  ------------------
 1540|  9.16M|    if (guess[i]) {
  ------------------
  |  Branch (1540:9): [True: 79.5k, False: 9.08M]
  ------------------
 1541|       |      // lowering guess[i]
 1542|  79.5k|      std::string gl;
 1543|  79.5k|      int len;
 1544|  79.5k|      if (utf8) {
  ------------------
  |  Branch (1544:11): [True: 25.2k, False: 54.3k]
  ------------------
 1545|  25.2k|        len = u8_u16(w_gl, guess[i]);
 1546|  25.2k|        mkallsmall_utf(w_gl, langnum);
 1547|  25.2k|        u16_u8(gl, w_gl);
 1548|  54.3k|      } else {
 1549|  54.3k|        gl.assign(guess[i]);
 1550|  54.3k|        if (!nonbmp)
  ------------------
  |  Branch (1550:13): [True: 54.3k, False: 18]
  ------------------
 1551|  54.3k|          mkallsmall(gl, csconv);
 1552|  54.3k|        len = strlen(guess[i]);
 1553|  54.3k|      }
 1554|       |
 1555|  79.5k|      int _lcs = lcslen(word, gl.c_str());
 1556|       |
 1557|       |      // same characters with different casing
 1558|  79.5k|      if ((n == len) && (n == _lcs)) {
  ------------------
  |  Branch (1558:11): [True: 19.5k, False: 60.0k]
  |  Branch (1558:25): [True: 2.63k, False: 16.8k]
  ------------------
 1559|  2.63k|        gscore[i] += 2000;
 1560|  2.63k|        break;
 1561|  2.63k|      }
 1562|       |      // using 2-gram instead of 3, and other weightening
 1563|       |
 1564|  76.9k|      if (utf8) {
  ------------------
  |  Branch (1564:11): [True: 23.1k, False: 53.8k]
  ------------------
 1565|  23.1k|        u8_u16(w_gl, gl);
 1566|       |        //w_gl is lowercase already at this point
 1567|  23.1k|        re = ngram(2, w_word, w_gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  23.1k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                      re = ngram(2, w_word, w_gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  23.1k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1568|  23.1k|        if (low) {
  ------------------
  |  Branch (1568:13): [True: 23.1k, False: 0]
  ------------------
 1569|  23.1k|          w_f = w_word;
 1570|       |          // lowering dictionary word
 1571|  23.1k|          mkallsmall_utf(w_f, langnum);
 1572|  23.1k|          re += ngram(2, w_gl, w_f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  23.1k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, w_gl, w_f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  23.1k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1573|  23.1k|        } else {
 1574|      0|          re += ngram(2, w_gl, w_word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|      0|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, w_gl, w_word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|      0|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1575|      0|        }
 1576|  53.8k|      } else {
 1577|       |        //gl is lowercase already at this point
 1578|  53.8k|        re = ngram(2, word, gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  53.8k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                      re = ngram(2, word, gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  53.8k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1579|  53.8k|        if (low) {
  ------------------
  |  Branch (1579:13): [True: 53.8k, False: 18]
  ------------------
 1580|  53.8k|          f = word;
 1581|       |          // lowering dictionary word
 1582|  53.8k|          mkallsmall(f, csconv);
 1583|  53.8k|          re += ngram(2, gl, f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  53.8k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, gl, f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  53.8k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1584|  53.8k|        } else {
 1585|     18|          re += ngram(2, gl, word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|     18|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, gl, word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|     18|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1586|     18|        }
 1587|  53.8k|      }
 1588|       |
 1589|  76.9k|      int ngram_score, leftcommon_score;
 1590|  76.9k|      if (utf8) {
  ------------------
  |  Branch (1590:11): [True: 23.1k, False: 53.8k]
  ------------------
 1591|       |        //w_gl is lowercase already at this point
 1592|  23.1k|        ngram_score = ngram(4, w_word, w_gl, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  23.1k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1593|  23.1k|        leftcommon_score = leftcommonsubstring(w_word, w_gl);
 1594|  53.8k|      } else {
 1595|       |        //gl is lowercase already at this point
 1596|  53.8k|        ngram_score = ngram(4, word, gl, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  53.8k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1597|  53.8k|        leftcommon_score = leftcommonsubstring(word, gl.c_str());
 1598|  53.8k|      }
 1599|  76.9k|      gscore[i] =
 1600|       |          // length of longest common subsequent minus length difference
 1601|  76.9k|          2 * _lcs - abs((int)(n - len)) +
 1602|       |          // weight length of the left common substring
 1603|  76.9k|          leftcommon_score +
 1604|       |          // weight equal character positions
 1605|  76.9k|          (!nonbmp && commoncharacterpositions(word, gl.c_str(), &is_swap)
  ------------------
  |  Branch (1605:12): [True: 76.9k, False: 18]
  |  Branch (1605:23): [True: 64.4k, False: 12.4k]
  ------------------
 1606|  76.9k|               ? 1
 1607|  76.9k|               : 0) +
 1608|       |          // swap character (not neighboring)
 1609|  76.9k|          ((is_swap) ? 10 : 0) +
  ------------------
  |  Branch (1609:12): [True: 86, False: 76.8k]
  ------------------
 1610|       |          // ngram
 1611|  76.9k|          ngram_score +
 1612|       |          // weighted ngrams
 1613|  76.9k|          re +
 1614|       |          // different limit for dictionaries with PHONE rules
 1615|  76.9k|          (ph ? (re < len * fact ? -1000 : 0)
  ------------------
  |  Branch (1615:12): [True: 5.23k, False: 71.7k]
  |  Branch (1615:18): [True: 4.10k, False: 1.12k]
  ------------------
 1616|  76.9k|              : (re < (n + len) * fact ? -1000 : 0));
  ------------------
  |  Branch (1616:18): [True: 65.8k, False: 5.87k]
  ------------------
 1617|  76.9k|    }
 1618|  9.16M|  }
 1619|       |
 1620|  48.4k|  bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS);
  ------------------
  |  |   76|  48.4k|#define MAX_GUESS 200
  ------------------
 1621|       |
 1622|       |  // phonetic version
 1623|  48.4k|  if (ph)
  ------------------
  |  Branch (1623:7): [True: 2.85k, False: 45.5k]
  ------------------
 1624|   288k|    for (int i = 0; i < MAX_ROOTS; i++) {
  ------------------
  |  |   74|   288k|#define MAX_ROOTS 100
  ------------------
  |  Branch (1624:21): [True: 285k, False: 2.85k]
  ------------------
 1625|   285k|      if (rootsphon[i]) {
  ------------------
  |  Branch (1625:11): [True: 6.78k, False: 278k]
  ------------------
 1626|       |        // lowering rootphon[i]
 1627|  6.78k|        std::string gl;
 1628|  6.78k|        int len;
 1629|  6.78k|        if (utf8) {
  ------------------
  |  Branch (1629:13): [True: 0, False: 6.78k]
  ------------------
 1630|      0|          len = u8_u16(w_gl, rootsphon[i]);
 1631|      0|          mkallsmall_utf(w_gl, langnum);
 1632|      0|          u16_u8(gl, w_gl);
 1633|  6.78k|        } else {
 1634|  6.78k|          gl.assign(rootsphon[i]);
 1635|  6.78k|          if (!nonbmp)
  ------------------
  |  Branch (1635:15): [True: 6.78k, False: 0]
  ------------------
 1636|  6.78k|            mkallsmall(gl, csconv);
 1637|  6.78k|          len = strlen(rootsphon[i]);
 1638|  6.78k|        }
 1639|       |
 1640|       |        // weight length of the left common substring
 1641|  6.78k|        int leftcommon_score;
 1642|  6.78k|        if (utf8)
  ------------------
  |  Branch (1642:13): [True: 0, False: 6.78k]
  ------------------
 1643|      0|          leftcommon_score = leftcommonsubstring(w_word, w_gl);
 1644|  6.78k|        else
 1645|  6.78k|          leftcommon_score = leftcommonsubstring(word, gl.c_str());
 1646|       |        // heuristic weigthing of ngram scores
 1647|  6.78k|        scoresphon[i] += 2 * lcslen(word, gl) - abs((int)(n - len)) +
 1648|  6.78k|                         leftcommon_score;
 1649|  6.78k|      }
 1650|   285k|    }
 1651|       |
 1652|  48.4k|  if (ph)
  ------------------
  |  Branch (1652:7): [True: 2.85k, False: 45.5k]
  ------------------
 1653|  2.85k|    bubblesort(&rootsphon[0], nullptr, &scoresphon[0], MAX_ROOTS);
  ------------------
  |  |   74|  2.85k|#define MAX_ROOTS 100
  ------------------
 1654|       |
 1655|       |  // copy over
 1656|  48.4k|  size_t oldns = wlst.size();
 1657|       |
 1658|  48.4k|  int same = 0;
 1659|  9.73M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.73M|#define MAX_GUESS 200
  ------------------
  |  Branch (1659:19): [True: 9.68M, False: 48.4k]
  ------------------
 1660|  9.68M|    if (guess[i]) {
  ------------------
  |  Branch (1660:9): [True: 106k, False: 9.58M]
  ------------------
 1661|   106k|      if ((wlst.size() < oldns + maxngramsugs) && (wlst.size() < maxSug) &&
  ------------------
  |  Branch (1661:11): [True: 102k, False: 4.69k]
  |  Branch (1661:51): [True: 102k, False: 0]
  ------------------
 1662|   102k|          (!same || (gscore[i] > 1000))) {
  ------------------
  |  Branch (1662:12): [True: 17.2k, False: 85.0k]
  |  Branch (1662:21): [True: 0, False: 85.0k]
  ------------------
 1663|  17.2k|        int unique = 1;
 1664|       |        // leave only excellent suggestions, if exists
 1665|  17.2k|        if (gscore[i] > 1000)
  ------------------
  |  Branch (1665:13): [True: 2.63k, False: 14.5k]
  ------------------
 1666|  2.63k|          same = 1;
 1667|  14.5k|        else if (gscore[i] < -100) {
  ------------------
  |  Branch (1667:18): [True: 8.54k, False: 6.02k]
  ------------------
 1668|  8.54k|          same = 1;
 1669|       |          // keep the best ngram suggestions, unless in ONLYMAXDIFF mode
 1670|  8.54k|          if (wlst.size() > oldns || (pAMgr && pAMgr->get_onlymaxdiff())) {
  ------------------
  |  Branch (1670:15): [True: 1.11k, False: 7.43k]
  |  Branch (1670:39): [True: 7.43k, False: 0]
  |  Branch (1670:48): [True: 0, False: 7.43k]
  ------------------
 1671|  1.11k|            delete[] guess[i];
 1672|  1.11k|            delete[] guessorig[i];
 1673|  1.11k|            continue;
 1674|  1.11k|          }
 1675|  8.54k|        }
 1676|  16.1k|        for (auto& j : wlst) {
  ------------------
  |  Branch (1676:22): [True: 8.51k, False: 13.2k]
  ------------------
 1677|       |          // don't suggest previous suggestions or a previous suggestion with
 1678|       |          // prefixes or affixes
 1679|  8.51k|          if ((!guessorig[i] && strstr(guess[i], j.c_str())) || (guessorig[i] && strstr(guessorig[i], j.c_str())) ||
  ------------------
  |  Branch (1679:15): [True: 2.86k, False: 5.65k]
  |  Branch (1679:16): [True: 8.51k, False: 0]
  |  Branch (1679:33): [True: 2.86k, False: 5.65k]
  |  Branch (1679:66): [True: 0, False: 5.65k]
  |  Branch (1679:82): [True: 0, False: 0]
  ------------------
 1680|       |              // check forbidden words
 1681|  5.65k|              !checkword(guess[i], 0, nullptr, nullptr)) {
  ------------------
  |  Branch (1681:15): [True: 0, False: 5.65k]
  ------------------
 1682|  2.86k|            unique = 0;
 1683|  2.86k|            break;
 1684|  2.86k|          }
 1685|  8.51k|        }
 1686|  16.1k|        if (unique) {
  ------------------
  |  Branch (1686:13): [True: 13.2k, False: 2.86k]
  ------------------
 1687|  13.2k|          if (guessorig[i]) {
  ------------------
  |  Branch (1687:15): [True: 0, False: 13.2k]
  ------------------
 1688|      0|            wlst.emplace_back(guessorig[i]);
 1689|  13.2k|          } else {
 1690|  13.2k|            wlst.emplace_back(guess[i]);
 1691|  13.2k|          }
 1692|  13.2k|        }
 1693|  16.1k|        delete[] guess[i];
 1694|  16.1k|        delete[] guessorig[i];
 1695|  89.7k|      } else {
 1696|  89.7k|        delete[] guess[i];
 1697|  89.7k|        delete[] guessorig[i];
 1698|  89.7k|      }
 1699|   106k|    }
 1700|  9.68M|  }
 1701|       |
 1702|  48.4k|  oldns = wlst.size();
 1703|  48.4k|  if (ph)
  ------------------
  |  Branch (1703:7): [True: 2.85k, False: 45.5k]
  ------------------
 1704|   285k|    for (auto& i : rootsphon) {
  ------------------
  |  Branch (1704:18): [True: 285k, False: 2.85k]
  ------------------
 1705|   285k|      if (i) {
  ------------------
  |  Branch (1705:11): [True: 6.78k, False: 278k]
  ------------------
 1706|  6.78k|        if ((wlst.size() < oldns + MAXPHONSUGS) && (wlst.size() < maxSug)) {
  ------------------
  |  |   78|  6.78k|#define MAXPHONSUGS 2
  ------------------
  |  Branch (1706:13): [True: 2.41k, False: 4.36k]
  |  Branch (1706:52): [True: 2.41k, False: 0]
  ------------------
 1707|  2.41k|          int unique = 1;
 1708|  4.09k|          for (auto& j : wlst) {
  ------------------
  |  Branch (1708:24): [True: 4.09k, False: 984]
  ------------------
 1709|       |            // don't suggest previous suggestions or a previous suggestion with
 1710|       |            // prefixes or affixes
 1711|  4.09k|            if (strstr(i, j.c_str()) ||
  ------------------
  |  Branch (1711:17): [True: 1.43k, False: 2.66k]
  |  Branch (1711:17): [True: 1.43k, False: 2.66k]
  ------------------
 1712|       |                // check forbidden words
 1713|  2.66k|                !checkword(i, 0, nullptr, nullptr)) {
  ------------------
  |  Branch (1713:17): [True: 0, False: 2.66k]
  ------------------
 1714|  1.43k|              unique = 0;
 1715|  1.43k|              break;
 1716|  1.43k|            }
 1717|  4.09k|          }
 1718|  2.41k|          if (unique) {
  ------------------
  |  Branch (1718:15): [True: 984, False: 1.43k]
  ------------------
 1719|    984|            wlst.emplace_back(i);
 1720|    984|          }
 1721|  2.41k|        }
 1722|  6.78k|      }
 1723|   285k|    }
 1724|  48.4k|}
_ZN10SuggestMgr9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPiPNS0_6chrono10time_pointINSA_12steady_clockENSA_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1735|  93.7M|                          std::chrono::steady_clock::time_point* timelimit) {
 1736|       |  // check overall suggestion time limit
 1737|  93.7M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  105|  93.7M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (1737:7): [True: 6, False: 93.7M]
  ------------------
 1738|      6|    return 0;
 1739|       |
 1740|       |  // check time limit
 1741|  93.7M|  if (timer) {
  ------------------
  |  Branch (1741:7): [True: 1.16M, False: 92.6M]
  ------------------
 1742|  1.16M|    (*timer)--;
 1743|  1.16M|    if (!(*timer) && timelimit) {
  ------------------
  |  Branch (1743:9): [True: 6.69k, False: 1.15M]
  |  Branch (1743:22): [True: 6.69k, False: 0]
  ------------------
 1744|  6.69k|      if (std::chrono::steady_clock::now() - *timelimit > TIMELIMIT_MS)
  ------------------
  |  |  106|  6.69k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1744:11): [True: 6, False: 6.68k]
  ------------------
 1745|      6|        return 0;
 1746|  6.68k|      *timer = MAXPLUSTIMER;
  ------------------
  |  |  108|  6.68k|#define MAXPLUSTIMER 100
  ------------------
 1747|  6.68k|    }
 1748|  1.16M|  }
 1749|       |
 1750|  93.7M|  if (pAMgr) {
  ------------------
  |  Branch (1750:7): [True: 93.7M, False: 0]
  ------------------
 1751|  93.7M|    struct hentry* rv = nullptr;
 1752|  93.7M|    int nosuffix = 0;
 1753|       |
 1754|  93.7M|    if (cpdsuggest >= 1) {
  ------------------
  |  Branch (1754:9): [True: 61.4M, False: 32.3M]
  ------------------
 1755|  61.4M|      if (pAMgr->get_compound()) {
  ------------------
  |  Branch (1755:11): [True: 15.5M, False: 45.9M]
  ------------------
 1756|  15.5M|        struct hentry* rv2 = nullptr;
 1757|  15.5M|        struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
 1758|  15.5M|        int info = (cpdsuggest == 1) ? SPELL_COMPOUND_2 : 0;
  ------------------
  |  |   85|  7.75M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (1758:20): [True: 7.75M, False: 7.75M]
  ------------------
 1759|  15.5M|        AffixScratch scratch;
 1760|  15.5M|        rv = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 1, &info, scratch);  // EXT
 1761|       |        // TODO filter 3-word or more compound words, as in spell()
 1762|       |        // (it's too slow to call suggest() here for all possible compound words)
 1763|  15.5M|        if (rv &&
  ------------------
  |  Branch (1763:13): [True: 0, False: 15.5M]
  |  Branch (1763:13): [True: 0, False: 15.5M]
  ------------------
 1764|      0|            (!(rv2 = pAMgr->lookup(word.c_str(), word.size())) || !rv2->astr ||
  ------------------
  |  Branch (1764:14): [True: 0, False: 0]
  |  Branch (1764:67): [True: 0, False: 0]
  ------------------
 1765|      0|             !(TESTAFF(rv2->astr, pAMgr->get_forbiddenword(), rv2->alen) ||
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1766|      0|               TESTAFF(rv2->astr, pAMgr->get_nosuggest(), rv2->alen))))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1767|      0|          return 3;  // XXX obsolote categorisation + only ICONV needs affix
 1768|       |                     // flag check?
 1769|  15.5M|      }
 1770|  61.4M|      return 0;
 1771|  61.4M|    }
 1772|       |
 1773|  32.3M|    rv = pAMgr->lookup(word.c_str(), word.size());
 1774|       |
 1775|  32.3M|    if (rv) {
  ------------------
  |  Branch (1775:9): [True: 37.7k, False: 32.2M]
  ------------------
 1776|  37.7k|      if ((rv->astr) &&
  ------------------
  |  Branch (1776:11): [True: 224, False: 37.5k]
  |  Branch (1776:11): [True: 0, False: 37.7k]
  ------------------
 1777|    224|          (TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |   99|    448|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 224]
  |  |  ------------------
  ------------------
 1778|    224|           TESTAFF(rv->astr, pAMgr->get_nosuggest(), rv->alen) ||
  ------------------
  |  |   99|    448|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 224]
  |  |  ------------------
  ------------------
 1779|    224|           TESTAFF(rv->astr, pAMgr->get_substandard(), rv->alen)))
  ------------------
  |  |   99|    224|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 224]
  |  |  ------------------
  ------------------
 1780|      0|        return 0;
 1781|  38.0k|      while (rv) {
  ------------------
  |  Branch (1781:14): [True: 37.7k, False: 214]
  ------------------
 1782|  37.7k|        if (rv->astr &&
  ------------------
  |  Branch (1782:13): [True: 224, False: 37.5k]
  |  Branch (1782:13): [True: 214, False: 37.5k]
  ------------------
 1783|    224|            (TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |   99|    448|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 224]
  |  |  ------------------
  ------------------
 1784|    224|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |   99|    448|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 214, False: 10]
  |  |  ------------------
  ------------------
 1785|    214|             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]
  |  |  ------------------
  ------------------
 1786|    214|          rv = rv->next_homonym;
 1787|    214|        } else
 1788|  37.5k|          break;
 1789|  37.7k|      }
 1790|  32.2M|    } else {
 1791|  32.2M|      AffixScratch scratch;
 1792|  32.2M|      rv = pAMgr->prefix_check(word, 0, word.size(),
 1793|  32.2M|                               0, scratch);  // only prefix, and prefix + suffix XXX
 1794|  32.2M|    }
 1795|       |
 1796|  32.3M|    if (rv) {
  ------------------
  |  Branch (1796:9): [True: 37.5k, False: 32.2M]
  ------------------
 1797|  37.5k|      nosuffix = 1;
 1798|  32.2M|    } else {
 1799|  32.2M|      AffixScratch scratch;
 1800|  32.2M|      rv = pAMgr->suffix_check(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // only suffix
  ------------------
  |  |   96|  32.2M|#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|  32.2M|#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|  32.2M|#define IN_CPD_NOT 0
  ------------------
 1801|  32.2M|    }
 1802|       |
 1803|  32.3M|    if (!rv && pAMgr->have_contclass()) {
  ------------------
  |  Branch (1803:9): [True: 32.2M, False: 37.5k]
  |  Branch (1803:16): [True: 11.6M, False: 20.6M]
  ------------------
 1804|  11.6M|      AffixScratch scratch;
 1805|  11.6M|      rv = pAMgr->suffix_check_twosfx(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL);
  ------------------
  |  |   96|  11.6M|#define FLAG_NULL 0x00
  ------------------
 1806|  11.6M|      if (!rv)
  ------------------
  |  Branch (1806:11): [True: 11.6M, False: 0]
  ------------------
 1807|  11.6M|        rv = pAMgr->prefix_check_twosfx(word, 0, word.size(), 0, scratch, FLAG_NULL);
  ------------------
  |  |   96|  11.6M|#define FLAG_NULL 0x00
  ------------------
 1808|  11.6M|    }
 1809|       |
 1810|       |    // check forbidden words
 1811|  32.3M|    if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1811:9): [True: 37.5k, False: 32.2M]
  |  Branch (1811:9): [True: 0, False: 32.3M]
  |  Branch (1811:17): [True: 12, False: 37.5k]
  ------------------
 1812|     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]
  |  |  ------------------
  ------------------
 1813|     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]
  |  |  ------------------
  ------------------
 1814|     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]
  |  |  ------------------
  ------------------
 1815|     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]
  |  |  ------------------
  ------------------
 1816|      0|      return 0;
 1817|       |
 1818|  32.3M|    if (rv) {  // XXX obsolote
  ------------------
  |  Branch (1818:9): [True: 37.5k, False: 32.2M]
  ------------------
 1819|  37.5k|      if ((pAMgr->get_compoundflag()) &&
  ------------------
  |  Branch (1819:11): [True: 8.87k, False: 28.7k]
  |  Branch (1819:11): [True: 4, False: 37.5k]
  ------------------
 1820|  8.87k|          TESTAFF(rv->astr, pAMgr->get_compoundflag(), rv->alen))
  ------------------
  |  |   99|  8.87k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 4, False: 8.87k]
  |  |  ------------------
  ------------------
 1821|      4|        return 2 + nosuffix;
 1822|  37.5k|      return 1;
 1823|  37.5k|    }
 1824|  32.3M|  }
 1825|  32.2M|  return 0;
 1826|  93.7M|}
_ZN10SuggestMgr15check_forbiddenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1828|  14.7k|int SuggestMgr::check_forbidden(const std::string& word) {
 1829|  14.7k|  if (pAMgr) {
  ------------------
  |  Branch (1829:7): [True: 14.7k, False: 0]
  ------------------
 1830|  14.7k|    struct hentry* rv = pAMgr->lookup(word.c_str(), word.size());
 1831|  14.7k|    if (rv && rv->astr &&
  ------------------
  |  Branch (1831:9): [True: 3, False: 14.7k]
  |  Branch (1831:9): [True: 0, False: 14.7k]
  |  Branch (1831:15): [True: 3, False: 0]
  ------------------
 1832|      3|        (TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |   99|      6|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 1833|      3|         TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen)))
  ------------------
  |  |   99|      3|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 3]
  |  |  ------------------
  ------------------
 1834|      0|      rv = nullptr;
 1835|  14.7k|    size_t len = word.size();
 1836|  14.7k|    AffixScratch scratch;
 1837|  14.7k|    if (!(pAMgr->prefix_check(word, 0, len, 1, scratch)))
  ------------------
  |  Branch (1837:9): [True: 14.7k, False: 0]
  ------------------
 1838|  14.7k|      rv = pAMgr->suffix_check(word, 0, len, 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // prefix+suffix, suffix
  ------------------
  |  |   96|  14.7k|#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.7k|#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.7k|#define IN_CPD_NOT 0
  ------------------
 1839|       |    // check forbidden words
 1840|  14.7k|    if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1840:9): [True: 0, False: 14.7k]
  |  Branch (1840:9): [True: 0, False: 14.7k]
  |  Branch (1840:17): [True: 0, False: 0]
  ------------------
 1841|      0|        TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen))
  ------------------
  |  |   99|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1842|      0|      return 1;
 1843|  14.7k|  }
 1844|  14.7k|  return 0;
 1845|  14.7k|}
_ZN10SuggestMgr13suggest_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1847|  13.6k|std::string SuggestMgr::suggest_morph(const std::string& in_w) {
 1848|  13.6k|  std::string result;
 1849|       |
 1850|  13.6k|  struct hentry* rv = nullptr;
 1851|       |
 1852|  13.6k|  if (!pAMgr)
  ------------------
  |  Branch (1852:7): [True: 0, False: 13.6k]
  ------------------
 1853|      0|    return {};
 1854|       |
 1855|  13.6k|  std::string w(in_w);
 1856|       |
 1857|       |  // word reversing wrapper for complex prefixes
 1858|  13.6k|  if (complexprefixes) {
  ------------------
  |  Branch (1858:7): [True: 694, False: 12.9k]
  ------------------
 1859|    694|    if (utf8)
  ------------------
  |  Branch (1859:9): [True: 0, False: 694]
  ------------------
 1860|      0|      reverseword_utf(w);
 1861|    694|    else
 1862|    694|      reverseword(w);
 1863|    694|  }
 1864|       |
 1865|  13.6k|  rv = pAMgr->lookup(w.c_str(), w.size());
 1866|       |
 1867|  17.3k|  while (rv) {
  ------------------
  |  Branch (1867:10): [True: 3.71k, False: 13.6k]
  ------------------
 1868|  3.71k|    if ((!rv->astr) ||
  ------------------
  |  Branch (1868:9): [True: 3.06k, False: 648]
  |  Branch (1868:9): [True: 3.71k, False: 0]
  ------------------
 1869|    648|        !(TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |   99|  1.29k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 648]
  |  |  ------------------
  ------------------
 1870|    648|          TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |   99|  1.29k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 648]
  |  |  ------------------
  ------------------
 1871|  3.71k|          TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen))) {
  ------------------
  |  |   99|    648|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (99:26): [True: 0, False: 648]
  |  |  ------------------
  ------------------
 1872|  3.71k|      if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|  3.71k|#define MORPH_STEM "st:"
  ------------------
  |  Branch (1872:11): [True: 3.71k, False: 0]
  ------------------
 1873|  3.71k|        result.push_back(MSEP_FLD);
  ------------------
  |  |  121|  3.71k|#define MSEP_FLD ' '
  ------------------
 1874|  3.71k|        result.append(MORPH_STEM);
  ------------------
  |  |  103|  3.71k|#define MORPH_STEM "st:"
  ------------------
 1875|  3.71k|        result.append(w);
 1876|  3.71k|      }
 1877|  3.71k|      if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (1877:11): [True: 0, False: 3.71k]
  ------------------
 1878|      0|        result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 1879|      0|        result.append(HENTRY_DATA2(rv));
 1880|      0|      }
 1881|  3.71k|      result.push_back(MSEP_REC);
  ------------------
  |  |  122|  3.71k|#define MSEP_REC '\n'
  ------------------
 1882|  3.71k|    }
 1883|  3.71k|    rv = rv->next_homonym;
 1884|  3.71k|  }
 1885|       |
 1886|  13.6k|  AffixScratch scratch;
 1887|  13.6k|  std::string st = pAMgr->affix_check_morph(w, 0, w.size(), scratch);
 1888|  13.6k|  if (!st.empty()) {
  ------------------
  |  Branch (1888:7): [True: 0, False: 13.6k]
  ------------------
 1889|      0|    result.append(st);
 1890|      0|  }
 1891|       |
 1892|  13.6k|  if (pAMgr->get_compound() && result.empty()) {
  ------------------
  |  Branch (1892:7): [True: 2.83k, False: 10.8k]
  |  Branch (1892:32): [True: 2.05k, False: 779]
  ------------------
 1893|  2.05k|    struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
 1894|  2.05k|    pAMgr->compound_check_morph(w, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, result, nullptr, scratch);
 1895|  2.05k|  }
 1896|       |
 1897|  13.6k|  line_uniq(result, MSEP_REC);
  ------------------
  |  |  122|  13.6k|#define MSEP_REC '\n'
  ------------------
 1898|       |
 1899|  13.6k|  return result;
 1900|  13.6k|}
_ZN10SuggestMgr18suggest_hentry_genEP6hentryPKc:
 1925|   558k|std::string SuggestMgr::suggest_hentry_gen(hentry* rv, const char* pattern) {
 1926|   558k|  std::string result;
 1927|   558k|  int sfxcount = get_sfxcount(pattern);
 1928|       |
 1929|   558k|  if (get_sfxcount(HENTRY_DATA(rv)) > sfxcount)
  ------------------
  |  Branch (1929:7): [True: 0, False: 558k]
  ------------------
 1930|      0|    return result;
 1931|       |
 1932|   558k|  if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (1932:7): [True: 0, False: 558k]
  ------------------
 1933|      0|    std::string aff = pAMgr->morphgen(HENTRY_WORD(rv), rv->blen, rv->astr, rv->alen,
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1934|      0|                                      HENTRY_DATA(rv), pattern, 0);
 1935|      0|    if (!aff.empty()) {
  ------------------
  |  Branch (1935:9): [True: 0, False: 0]
  ------------------
 1936|      0|      result.append(aff);
 1937|      0|      result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1938|      0|    }
 1939|      0|  }
 1940|       |
 1941|       |  // check all allomorphs
 1942|   558k|  char* p = nullptr;
 1943|   558k|  if (HENTRY_DATA(rv))
  ------------------
  |  Branch (1943:7): [True: 0, False: 558k]
  ------------------
 1944|      0|    p = (char*)strstr(HENTRY_DATA2(rv), MORPH_ALLOMORPH);
  ------------------
  |  |  104|      0|#define MORPH_ALLOMORPH "al:"
  ------------------
 1945|   558k|  while (p) {
  ------------------
  |  Branch (1945:10): [True: 0, False: 558k]
  ------------------
 1946|      0|    p += MORPH_TAG_LEN;
  ------------------
  |  |  119|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
 1947|      0|    int plen = fieldlen(p);
 1948|      0|    std::string allomorph(p, plen);
 1949|      0|    struct hentry* rv2 = pAMgr->lookup(allomorph.c_str(), allomorph.size());
 1950|      0|    while (rv2) {
  ------------------
  |  Branch (1950:12): [True: 0, False: 0]
  ------------------
 1951|       |      //            if (HENTRY_DATA(rv2) && get_sfxcount(HENTRY_DATA(rv2)) <=
 1952|       |      //            sfxcount) {
 1953|      0|      if (HENTRY_DATA(rv2)) {
  ------------------
  |  Branch (1953:11): [True: 0, False: 0]
  ------------------
 1954|      0|        char* st = (char*)strstr(HENTRY_DATA2(rv2), MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 1955|      0|        if (st && (strncmp(st + MORPH_TAG_LEN, HENTRY_WORD(rv),
  ------------------
  |  |  119|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
                      if (st && (strncmp(st + MORPH_TAG_LEN, HENTRY_WORD(rv),
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (1955:13): [True: 0, False: 0]
  |  Branch (1955:19): [True: 0, False: 0]
  ------------------
 1956|      0|                           fieldlen(st + MORPH_TAG_LEN)) == 0)) {
  ------------------
  |  |  119|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
 1957|      0|          std::string aff = pAMgr->morphgen(HENTRY_WORD(rv2), rv2->blen, rv2->astr,
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1958|      0|                                            rv2->alen, HENTRY_DATA(rv2), pattern, 0);
 1959|      0|          if (!aff.empty()) {
  ------------------
  |  Branch (1959:15): [True: 0, False: 0]
  ------------------
 1960|      0|            result.append(aff);
 1961|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1962|      0|          }
 1963|      0|        }
 1964|      0|      }
 1965|      0|      rv2 = rv2->next_homonym;
 1966|      0|    }
 1967|      0|    p = strstr(p + plen, MORPH_ALLOMORPH);
  ------------------
  |  |  104|      0|#define MORPH_ALLOMORPH "al:"
  ------------------
 1968|      0|  }
 1969|       |
 1970|   558k|  return result;
 1971|   558k|}
_ZN10SuggestMgr11suggest_genERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_NS0_6chrono10time_pointINSE_12steady_clockENSE_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1974|   297k|                                    std::chrono::steady_clock::time_point start_time) {
 1975|   297k|  if (desc.empty() || !pAMgr)
  ------------------
  |  Branch (1975:7): [True: 150k, False: 146k]
  |  Branch (1975:23): [True: 0, False: 146k]
  ------------------
 1976|   150k|    return {};
 1977|       |
 1978|   146k|  const char* pattern = in_pattern.c_str();
 1979|   146k|  std::string result2;
 1980|   146k|  std::string newpattern;
 1981|   146k|  struct hentry* rv = nullptr;
 1982|       |
 1983|       |  // search affixed forms with and without derivational suffixes
 1984|   196k|  while (true) {
  ------------------
  |  Branch (1984:10): [True: 196k, Folded]
  ------------------
 1985|   243k|    for (const auto& k : desc) {
  ------------------
  |  Branch (1985:24): [True: 243k, False: 196k]
  ------------------
 1986|   243k|      if (std::chrono::steady_clock::now() - start_time > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|   243k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1986:11): [True: 0, False: 243k]
  ------------------
 1987|      0|        return result2;
 1988|   243k|      std::string result;
 1989|       |
 1990|       |      // add compound word parts (except the last one)
 1991|   243k|      const char* s = k.c_str();
 1992|   243k|      const char* part = strstr(s, MORPH_PART);
  ------------------
  |  |  116|   243k|#define MORPH_PART "pa:"
  ------------------
 1993|   243k|      if (part) {
  ------------------
  |  Branch (1993:11): [True: 0, False: 243k]
  ------------------
 1994|      0|        const char* nextpart = strstr(part + 1, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1995|      0|        while (nextpart) {
  ------------------
  |  Branch (1995:16): [True: 0, False: 0]
  ------------------
 1996|      0|          std::string field;
 1997|      0|          copy_field(field, part, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 1998|      0|          result.append(field);
 1999|      0|          part = nextpart;
 2000|      0|          nextpart = strstr(part + 1, MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2001|      0|        }
 2002|      0|        s = part;
 2003|      0|      }
 2004|       |
 2005|   243k|      std::string tok(s);
 2006|   243k|      size_t pos = tok.find(" | ");
 2007|   243k|      while (pos != std::string::npos) {
  ------------------
  |  Branch (2007:14): [True: 0, False: 243k]
  ------------------
 2008|      0|        tok[pos + 1] = MSEP_ALT;
  ------------------
  |  |  123|      0|#define MSEP_ALT '\v'
  ------------------
 2009|      0|        pos = tok.find(" | ", pos);
 2010|      0|      }
 2011|   243k|      std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  123|   243k|#define MSEP_ALT '\v'
  ------------------
 2012|   243k|      for (auto& i : pl) {
  ------------------
  |  Branch (2012:20): [True: 243k, False: 243k]
  ------------------
 2013|       |        // remove inflectional and terminal suffixes
 2014|   243k|        size_t is = i.find(MORPH_INFL_SFX);
  ------------------
  |  |  110|   243k|#define MORPH_INFL_SFX "is:"
  ------------------
 2015|   243k|        if (is != std::string::npos)
  ------------------
  |  Branch (2015:13): [True: 0, False: 243k]
  ------------------
 2016|      0|          i.resize(is);
 2017|   243k|        size_t ts = i.find(MORPH_TERM_SFX);
  ------------------
  |  |  111|   243k|#define MORPH_TERM_SFX "ts:"
  ------------------
 2018|   243k|        while (ts != std::string::npos) {
  ------------------
  |  Branch (2018:16): [True: 0, False: 243k]
  ------------------
 2019|      0|          i[ts] = '_';
 2020|      0|          ts = i.find(MORPH_TERM_SFX);
  ------------------
  |  |  111|      0|#define MORPH_TERM_SFX "ts:"
  ------------------
 2021|      0|        }
 2022|   243k|        const char* st = strstr(s, MORPH_STEM);
  ------------------
  |  |  103|   243k|#define MORPH_STEM "st:"
  ------------------
 2023|   243k|        if (st) {
  ------------------
  |  Branch (2023:13): [True: 232k, False: 11.9k]
  ------------------
 2024|   232k|          copy_field(tok, st, MORPH_STEM);
  ------------------
  |  |  103|   232k|#define MORPH_STEM "st:"
  ------------------
 2025|   232k|          rv = pAMgr->lookup(tok.c_str(), tok.size());
 2026|   511k|          while (rv) {
  ------------------
  |  Branch (2026:18): [True: 279k, False: 232k]
  ------------------
 2027|   279k|            if (std::chrono::steady_clock::now() - start_time > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  104|   279k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (2027:17): [True: 0, False: 279k]
  ------------------
 2028|      0|              return result2;
 2029|   279k|            std::string newpat(i);
 2030|   279k|            newpat.append(pattern);
 2031|   279k|            std::string sg = suggest_hentry_gen(rv, newpat.c_str());
 2032|   279k|            if (sg.empty())
  ------------------
  |  Branch (2032:17): [True: 279k, False: 0]
  ------------------
 2033|   279k|              sg = suggest_hentry_gen(rv, pattern);
 2034|   279k|            if (!sg.empty()) {
  ------------------
  |  Branch (2034:17): [True: 0, False: 279k]
  ------------------
 2035|      0|              std::vector<std::string> gen = line_tok(sg, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2036|      0|              for (auto& j : gen) {
  ------------------
  |  Branch (2036:28): [True: 0, False: 0]
  ------------------
 2037|      0|                result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2038|      0|                result2.append(result);
 2039|      0|                if (i.find(MORPH_SURF_PFX) != std::string::npos) {
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
  |  Branch (2039:21): [True: 0, False: 0]
  ------------------
 2040|      0|                  std::string field;
 2041|      0|                  copy_field(field, i, MORPH_SURF_PFX);
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
 2042|      0|                  result2.append(field);
 2043|      0|                }
 2044|      0|                result2.append(j);
 2045|      0|              }
 2046|      0|            }
 2047|   279k|            rv = rv->next_homonym;
 2048|   279k|          }
 2049|   232k|        }
 2050|   243k|      }
 2051|   243k|    }
 2052|       |
 2053|   196k|    if (!result2.empty() || !strstr(pattern, MORPH_DERI_SFX))
  ------------------
  |  |  109|   196k|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (2053:9): [True: 0, False: 196k]
  |  Branch (2053:29): [True: 146k, False: 50.3k]
  ------------------
 2054|   146k|      break;
 2055|       |
 2056|  50.3k|    newpattern.assign(pattern);
 2057|  50.3k|    mystrrep(newpattern, MORPH_DERI_SFX, MORPH_TERM_SFX);
  ------------------
  |  |  109|  50.3k|#define MORPH_DERI_SFX "ds:"
  ------------------
                  mystrrep(newpattern, MORPH_DERI_SFX, MORPH_TERM_SFX);
  ------------------
  |  |  111|  50.3k|#define MORPH_TERM_SFX "ts:"
  ------------------
 2058|  50.3k|    pattern = newpattern.c_str();
 2059|  50.3k|  }
 2060|   146k|  return result2;
 2061|   146k|}
_ZN10SuggestMgr5ngramEiRKNSt3__16vectorI6w_charNS0_9allocatorIS2_EEEES7_i:
 2067|   684k|                      int opt) {
 2068|   684k|  int nscore = 0, ns, l1 = su1.size(), l2 = su2.size();
 2069|       |
 2070|   684k|  if (l2 == 0)
  ------------------
  |  Branch (2070:7): [True: 4.92k, False: 679k]
  ------------------
 2071|  4.92k|    return 0;
 2072|  1.08M|  for (int j = 1; j <= n; j++) {
  ------------------
  |  Branch (2072:19): [True: 1.02M, False: 53.8k]
  ------------------
 2073|  1.02M|    ns = 0;
 2074|  4.83M|    for (int i = 0; i <= (l1 - j); i++) {
  ------------------
  |  Branch (2074:21): [True: 3.80M, False: 1.02M]
  ------------------
 2075|  3.80M|      int k = 0;
 2076|  17.0M|      for (int l = 0; l <= (l2 - j); l++) {
  ------------------
  |  Branch (2076:23): [True: 14.5M, False: 2.42M]
  ------------------
 2077|  19.8M|        for (k = 0; k < j; k++) {
  ------------------
  |  Branch (2077:21): [True: 18.5M, False: 1.37M]
  ------------------
 2078|  18.5M|          if (su1[i + k] != su2[l + k])
  ------------------
  |  Branch (2078:15): [True: 13.2M, False: 5.29M]
  ------------------
 2079|  13.2M|            break;
 2080|  18.5M|        }
 2081|  14.5M|        if (k == j) {
  ------------------
  |  Branch (2081:13): [True: 1.37M, False: 13.2M]
  ------------------
 2082|  1.37M|          ns++;
 2083|  1.37M|          break;
 2084|  1.37M|        }
 2085|  14.5M|      }
 2086|  3.80M|      if (k != j && opt & NGRAM_WEIGHTED) {
  ------------------
  |  |   84|  2.42M|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2086:11): [True: 2.42M, False: 1.37M]
  |  Branch (2086:21): [True: 114k, False: 2.31M]
  ------------------
 2087|   114k|        ns--;
 2088|   114k|        if (i == 0 || i == l1 - j)
  ------------------
  |  Branch (2088:13): [True: 26.2k, False: 87.8k]
  |  Branch (2088:23): [True: 41.6k, False: 46.1k]
  ------------------
 2089|  67.9k|          ns--;  // side weight
 2090|   114k|      }
 2091|  3.80M|    }
 2092|  1.02M|    nscore = nscore + ns;
 2093|  1.02M|    if (ns < 2 && !(opt & NGRAM_WEIGHTED))
  ------------------
  |  |   84|   694k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2093:9): [True: 694k, False: 332k]
  |  Branch (2093:19): [True: 625k, False: 68.9k]
  ------------------
 2094|   625k|      break;
 2095|  1.02M|  }
 2096|       |
 2097|   679k|  ns = 0;
 2098|   679k|  if (opt & NGRAM_LONGER_WORSE)
  ------------------
  |  |   81|   679k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
  |  Branch (2098:7): [True: 277k, False: 401k]
  ------------------
 2099|   277k|    ns = (l2 - l1) - 2;
 2100|   679k|  if (opt & NGRAM_ANY_MISMATCH)
  ------------------
  |  |   82|   679k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
  |  Branch (2100:7): [True: 401k, False: 277k]
  ------------------
 2101|   401k|    ns = abs(l2 - l1) - 2;
 2102|   679k|  ns = (nscore - ((ns > 0) ? ns : 0));
  ------------------
  |  Branch (2102:19): [True: 113k, False: 566k]
  ------------------
 2103|   679k|  return ns;
 2104|   684k|}
_ZN10SuggestMgr5ngramEiRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 2110|   902k|                      int opt) {
 2111|   902k|  int nscore = 0, ns, l1, l2 = s2.size();
 2112|       |
 2113|   902k|  if (l2 == 0)
  ------------------
  |  Branch (2113:7): [True: 10.8k, False: 891k]
  ------------------
 2114|  10.8k|    return 0;
 2115|   891k|  l1 = s1.size();
 2116|  1.64M|  for (int j = 1; j <= n; j++) {
  ------------------
  |  Branch (2116:19): [True: 1.51M, False: 135k]
  ------------------
 2117|  1.51M|    ns = 0;
 2118|  10.8M|    for (int i = 0; i <= (l1 - j); i++) {
  ------------------
  |  Branch (2118:21): [True: 9.38M, False: 1.51M]
  ------------------
 2119|       |      //s2 is haystack, s1[i..i+j) is needle
 2120|  9.38M|      if (s2.find(s1.c_str()+i, 0, j) != std::string::npos) {
  ------------------
  |  Branch (2120:11): [True: 3.65M, False: 5.72M]
  ------------------
 2121|  3.65M|        ns++;
 2122|  5.72M|      } else if (opt & NGRAM_WEIGHTED) {
  ------------------
  |  |   84|  5.72M|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2122:18): [True: 413k, False: 5.31M]
  ------------------
 2123|   413k|        ns--;
 2124|   413k|        if (i == 0 || i == l1 - j)
  ------------------
  |  Branch (2124:13): [True: 42.0k, False: 371k]
  |  Branch (2124:23): [True: 117k, False: 253k]
  ------------------
 2125|   159k|          ns--;  // side weight
 2126|   413k|      }
 2127|  9.38M|    }
 2128|  1.51M|    nscore = nscore + ns;
 2129|  1.51M|    if (ns < 2 && !(opt & NGRAM_WEIGHTED))
  ------------------
  |  |   84|   903k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2129:9): [True: 903k, False: 608k]
  |  Branch (2129:19): [True: 756k, False: 147k]
  ------------------
 2130|   756k|      break;
 2131|  1.51M|  }
 2132|       |
 2133|   891k|  ns = 0;
 2134|   891k|  if (opt & NGRAM_LONGER_WORSE)
  ------------------
  |  |   81|   891k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
  |  Branch (2134:7): [True: 330k, False: 561k]
  ------------------
 2135|   330k|    ns = (l2 - l1) - 2;
 2136|   891k|  if (opt & NGRAM_ANY_MISMATCH)
  ------------------
  |  |   82|   891k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
  |  Branch (2136:7): [True: 561k, False: 330k]
  ------------------
 2137|   561k|    ns = abs(l2 - l1) - 2;
 2138|   891k|  ns = (nscore - ((ns > 0) ? ns : 0));
  ------------------
  |  Branch (2138:19): [True: 193k, False: 698k]
  ------------------
 2139|   891k|  return ns;
 2140|   902k|}
_ZN10SuggestMgr19leftcommonsubstringERKNSt3__16vectorI6w_charNS0_9allocatorIS2_EEEES7_:
 2145|   578k|    const std::vector<w_char>& su2) {
 2146|   578k|  int l1 = su1.size(), l2 = su2.size();
 2147|       |  // decapitalize dictionary word
 2148|   578k|  if (complexprefixes) {
  ------------------
  |  Branch (2148:7): [True: 0, False: 578k]
  ------------------
 2149|      0|    if (l1 && l2 && su1[l1 - 1] == su2[l2 - 1])
  ------------------
  |  Branch (2149:9): [True: 0, False: 0]
  |  Branch (2149:15): [True: 0, False: 0]
  |  Branch (2149:21): [True: 0, False: 0]
  ------------------
 2150|      0|      return 1;
 2151|   578k|  } else {
 2152|   578k|    unsigned short idx = su2.empty() ? 0 : (unsigned short)(su2[0]),
  ------------------
  |  Branch (2152:26): [True: 0, False: 578k]
  ------------------
 2153|   578k|                   otheridx = su1.empty() ? 0 : (unsigned short)(su1[0]);
  ------------------
  |  Branch (2153:31): [True: 12.9k, False: 565k]
  ------------------
 2154|   578k|    if (otheridx != idx && (otheridx != unicodetolower(idx, langnum)))
  ------------------
  |  Branch (2154:9): [True: 541k, False: 37.1k]
  |  Branch (2154:28): [True: 388k, False: 152k]
  ------------------
 2155|   388k|      return 0;
 2156|   189k|    int i;
 2157|   294k|    for (i = 1; (i < l1) && (i < l2) && (su1[i] == su2[i]);
  ------------------
  |  Branch (2157:17): [True: 282k, False: 12.2k]
  |  Branch (2157:29): [True: 266k, False: 15.0k]
  |  Branch (2157:41): [True: 104k, False: 162k]
  ------------------
 2158|   189k|         i++)
 2159|   104k|      ;
 2160|   189k|    return i;
 2161|   578k|  }
 2162|      0|  return 0;
 2163|   578k|}
_ZN10SuggestMgr19leftcommonsubstringEPKcS1_:
 2168|   709k|    const char* s2) {
 2169|   709k|  if (complexprefixes) {
  ------------------
  |  Branch (2169:7): [True: 59.9k, False: 649k]
  ------------------
 2170|  59.9k|    int l1 = strlen(s1), l2 = strlen(s2);
 2171|  59.9k|    if (l1 && l1 <= l2 && s1[l1 - 1] == s2[l2 - 1])
  ------------------
  |  Branch (2171:9): [True: 58.5k, False: 1.35k]
  |  Branch (2171:15): [True: 29.9k, False: 28.6k]
  |  Branch (2171:27): [True: 2.49k, False: 27.4k]
  ------------------
 2172|  2.49k|      return 1;
 2173|   649k|  } else if (csconv) {
  ------------------
  |  Branch (2173:14): [True: 649k, False: 0]
  ------------------
 2174|   649k|    const char* olds = s1;
 2175|       |    // decapitalise dictionary word
 2176|   649k|    if ((*s1 != *s2) && (((unsigned char)*s1) != csconv[((unsigned char)*s2)].clower))
  ------------------
  |  Branch (2176:9): [True: 585k, False: 63.8k]
  |  Branch (2176:25): [True: 424k, False: 161k]
  ------------------
 2177|   424k|      return 0;
 2178|   453k|    do {
 2179|   453k|      s1++;
 2180|   453k|      s2++;
 2181|   453k|    } while ((*s1 == *s2) && (*s1 != '\0'));
  ------------------
  |  Branch (2181:14): [True: 228k, False: 225k]
  |  Branch (2181:30): [True: 228k, False: 407]
  ------------------
 2182|   225k|    return (int)(s1 - olds);
 2183|   649k|  }
 2184|  57.4k|  return 0;
 2185|   709k|}
_ZN10SuggestMgr24commoncharacterpositionsEPKcS1_Pi:
 2189|  76.9k|                                         int* is_swap) {
 2190|  76.9k|  int num = 0, diff = 0, diffpos[2];
 2191|  76.9k|  *is_swap = 0;
 2192|  76.9k|  if (utf8) {
  ------------------
  |  Branch (2192:7): [True: 23.1k, False: 53.8k]
  ------------------
 2193|  23.1k|    std::vector<w_char> su1;
 2194|  23.1k|    std::vector<w_char> su2;
 2195|  23.1k|    int l1 = u8_u16(su1, s1), l2 = u8_u16(su2, s2);
 2196|       |
 2197|  23.1k|    if (l1 <= 0 || l2 <= 0)
  ------------------
  |  Branch (2197:9): [True: 2.57k, False: 20.5k]
  |  Branch (2197:20): [True: 0, False: 20.5k]
  ------------------
 2198|  2.57k|      return 0;
 2199|       |
 2200|       |    // decapitalize dictionary word
 2201|  20.5k|    if (complexprefixes) {
  ------------------
  |  Branch (2201:9): [True: 0, False: 20.5k]
  ------------------
 2202|      0|      su2[l2 - 1] = lower_utf(su2[l2 - 1], langnum);
 2203|  20.5k|    } else {
 2204|  20.5k|      su2[0] = lower_utf(su2[0], langnum);
 2205|  20.5k|    }
 2206|  78.9k|    for (int i = 0; (i < l1) && (i < l2); i++) {
  ------------------
  |  Branch (2206:21): [True: 63.3k, False: 15.5k]
  |  Branch (2206:33): [True: 58.3k, False: 4.95k]
  ------------------
 2207|  58.3k|      if (su1[i] == su2[i]) {
  ------------------
  |  Branch (2207:11): [True: 30.5k, False: 27.7k]
  ------------------
 2208|  30.5k|        num++;
 2209|  30.5k|      } else {
 2210|  27.7k|        if (diff < 2)
  ------------------
  |  Branch (2210:13): [True: 23.2k, False: 4.53k]
  ------------------
 2211|  23.2k|          diffpos[diff] = i;
 2212|  27.7k|        diff++;
 2213|  27.7k|      }
 2214|  58.3k|    }
 2215|  20.5k|    if ((diff == 2) && (l1 == l2) &&
  ------------------
  |  Branch (2215:9): [True: 4.11k, False: 16.4k]
  |  Branch (2215:24): [True: 1.05k, False: 3.05k]
  ------------------
 2216|  1.05k|        (su1[diffpos[0]] == su2[diffpos[1]]) &&
  ------------------
  |  Branch (2216:9): [True: 175, False: 880]
  ------------------
 2217|    175|        (su1[diffpos[1]] == su2[diffpos[0]]))
  ------------------
  |  Branch (2217:9): [True: 36, False: 139]
  ------------------
 2218|     36|      *is_swap = 1;
 2219|  53.8k|  } else {
 2220|  53.8k|    size_t i;
 2221|  53.8k|    std::string t(s2);
 2222|       |    // decapitalize dictionary word
 2223|  53.8k|    if (complexprefixes) {
  ------------------
  |  Branch (2223:9): [True: 3.18k, False: 50.6k]
  ------------------
 2224|  3.18k|      size_t l2 = t.size();
 2225|  3.18k|      t[l2 - 1] = csconv[(unsigned char)t[l2 - 1]].clower;
 2226|  50.6k|    } else {
 2227|  50.6k|      mkallsmall(t, csconv);
 2228|  50.6k|    }
 2229|   292k|    for (i = 0; i < t.size() && (*(s1 + i) != 0); ++i) {
  ------------------
  |  Branch (2229:17): [True: 267k, False: 25.4k]
  |  Branch (2229:33): [True: 239k, False: 28.3k]
  ------------------
 2230|   239k|      if (*(s1 + i) == t[i]) {
  ------------------
  |  Branch (2230:11): [True: 116k, False: 122k]
  ------------------
 2231|   116k|        num++;
 2232|   122k|      } else {
 2233|   122k|        if (diff < 2)
  ------------------
  |  Branch (2233:13): [True: 68.0k, False: 54.1k]
  ------------------
 2234|  68.0k|          diffpos[diff] = i;
 2235|   122k|        diff++;
 2236|   122k|      }
 2237|   239k|    }
 2238|  53.8k|    if ((diff == 2) && (*(s1 + i) == 0) && i == t.size() &&
  ------------------
  |  Branch (2238:9): [True: 13.8k, False: 39.9k]
  |  Branch (2238:24): [True: 11.1k, False: 2.69k]
  |  Branch (2238:44): [True: 3.90k, False: 7.24k]
  ------------------
 2239|  3.90k|        (*(s1 + diffpos[0]) == t[diffpos[1]]) &&
  ------------------
  |  Branch (2239:9): [True: 687, False: 3.21k]
  ------------------
 2240|    687|        (*(s1 + diffpos[1]) == t[diffpos[0]]))
  ------------------
  |  Branch (2240:9): [True: 50, False: 637]
  ------------------
 2241|     50|      *is_swap = 1;
 2242|  53.8k|  }
 2243|  74.3k|  return num;
 2244|  76.9k|}
_ZN10SuggestMgr10bubblesortEPPcS1_Pii:
 2255|   102k|void SuggestMgr::bubblesort(char** rword, char** rword2, int* rsc, int n) {
 2256|   102k|  int m = 1;
 2257|  19.9M|  while (m < n) {
  ------------------
  |  Branch (2257:10): [True: 19.8M, False: 102k]
  ------------------
 2258|  19.8M|    int j = m;
 2259|  41.1M|    while (j > 0) {
  ------------------
  |  Branch (2259:12): [True: 41.0M, False: 28.7k]
  ------------------
 2260|  41.0M|      if (rsc[j - 1] < rsc[j]) {
  ------------------
  |  Branch (2260:11): [True: 21.2M, False: 19.8M]
  ------------------
 2261|  21.2M|        int sctmp = rsc[j - 1];
 2262|  21.2M|        char* wdtmp = rword[j - 1];
 2263|  21.2M|        rsc[j - 1] = rsc[j];
 2264|  21.2M|        rword[j - 1] = rword[j];
 2265|  21.2M|        rsc[j] = sctmp;
 2266|  21.2M|        rword[j] = wdtmp;
 2267|  21.2M|        if (rword2) {
  ------------------
  |  Branch (2267:13): [True: 20.7M, False: 563k]
  ------------------
 2268|  20.7M|          wdtmp = rword2[j - 1];
 2269|  20.7M|          rword2[j - 1] = rword2[j];
 2270|  20.7M|          rword2[j] = wdtmp;
 2271|  20.7M|        }
 2272|  21.2M|        j--;
 2273|  21.2M|      } else
 2274|  19.8M|        break;
 2275|  41.0M|    }
 2276|  19.8M|    m++;
 2277|  19.8M|  }
 2278|   102k|}
_ZN10SuggestMgr3lcsEPKcS1_PiS2_:
 2284|  86.3k|                      int* l2) {
 2285|  86.3k|  int n, m, i, j;
 2286|  86.3k|  std::vector<w_char> su;
 2287|  86.3k|  std::vector<w_char> su2;
 2288|  86.3k|  if (utf8) {
  ------------------
  |  Branch (2288:7): [True: 25.2k, False: 61.1k]
  ------------------
 2289|  25.2k|    m = u8_u16(su, s);
 2290|  25.2k|    n = u8_u16(su2, s2);
 2291|  61.1k|  } else {
 2292|  61.1k|    m = strlen(s);
 2293|  61.1k|    n = strlen(s2);
 2294|  61.1k|  }
 2295|  86.3k|  if (m <= 0 || n <= 0) {
  ------------------
  |  Branch (2295:7): [True: 6.48k, False: 79.8k]
  |  Branch (2295:17): [True: 0, False: 79.8k]
  ------------------
 2296|  6.48k|    *l1 = 0;
 2297|  6.48k|    *l2 = 0;
 2298|  6.48k|    return nullptr;
 2299|  6.48k|  }
 2300|  79.8k|  char* c = new char[(m + 1) * (n + 1)]();
 2301|  79.8k|  char* b = new char[(m + 1) * (n + 1)]();
 2302|   462k|  for (i = 1; i <= m; i++) {
  ------------------
  |  Branch (2302:15): [True: 382k, False: 79.8k]
  ------------------
 2303|  4.24M|    for (j = 1; j <= n; j++) {
  ------------------
  |  Branch (2303:17): [True: 3.86M, False: 382k]
  ------------------
 2304|  3.86M|      if (((utf8) && (su[i - 1] == su2[j - 1])) ||
  ------------------
  |  Branch (2304:12): [True: 332k, False: 3.53M]
  |  Branch (2304:22): [True: 72.9k, False: 259k]
  ------------------
 2305|  3.79M|          ((!utf8) && (s[i - 1] == s2[j - 1]))) {
  ------------------
  |  Branch (2305:12): [True: 3.53M, False: 259k]
  |  Branch (2305:23): [True: 422k, False: 3.10M]
  ------------------
 2306|   494k|        c[i * (n + 1) + j] = c[(i - 1) * (n + 1) + j - 1] + 1;
 2307|   494k|        b[i * (n + 1) + j] = LCS_UPLEFT;
 2308|  3.36M|      } else if (c[(i - 1) * (n + 1) + j] >= c[i * (n + 1) + j - 1]) {
  ------------------
  |  Branch (2308:18): [True: 2.51M, False: 851k]
  ------------------
 2309|  2.51M|        c[i * (n + 1) + j] = c[(i - 1) * (n + 1) + j];
 2310|  2.51M|        b[i * (n + 1) + j] = LCS_UP;
 2311|  2.51M|      } else {
 2312|   851k|        c[i * (n + 1) + j] = c[i * (n + 1) + j - 1];
 2313|   851k|        b[i * (n + 1) + j] = LCS_LEFT;
 2314|   851k|      }
 2315|  3.86M|    }
 2316|   382k|  }
 2317|  79.8k|  delete[] c;
 2318|  79.8k|  *l1 = m;
 2319|  79.8k|  *l2 = n;
 2320|  79.8k|  return b;
 2321|  86.3k|}
_ZN10SuggestMgr6lcslenEPKcS1_:
 2323|  86.3k|int SuggestMgr::lcslen(const char* s, const char* s2) {
 2324|  86.3k|  int m, n, len = 0;
 2325|  86.3k|  char* result = lcs(s, s2, &m, &n);
 2326|  86.3k|  if (!result)
  ------------------
  |  Branch (2326:7): [True: 6.48k, False: 79.8k]
  ------------------
 2327|  6.48k|    return 0;
 2328|  79.8k|  int i = m, j = n;
 2329|   637k|  while ((i != 0) && (j != 0)) {
  ------------------
  |  Branch (2329:10): [True: 563k, False: 73.1k]
  |  Branch (2329:22): [True: 557k, False: 6.74k]
  ------------------
 2330|   557k|    if (result[i * (n + 1) + j] == LCS_UPLEFT) {
  ------------------
  |  Branch (2330:9): [True: 210k, False: 346k]
  ------------------
 2331|   210k|      len++;
 2332|   210k|      i--;
 2333|   210k|      j--;
 2334|   346k|    } else if (result[i * (n + 1) + j] == LCS_UP) {
  ------------------
  |  Branch (2334:16): [True: 160k, False: 185k]
  ------------------
 2335|   160k|      i--;
 2336|   160k|    } else
 2337|   185k|      j--;
 2338|   557k|  }
 2339|  79.8k|  delete[] result;
 2340|  79.8k|  return len;
 2341|  86.3k|}
_ZN10SuggestMgr6lcslenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 2343|  6.78k|int SuggestMgr::lcslen(const std::string& s, const std::string& s2) {
 2344|  6.78k|  return lcslen(s.c_str(), s2.c_str());
 2345|  6.78k|}
suggestmgr.cxx:_ZN12_GLOBAL__N_115ngsuggest_guardC2EbPK7cs_infoPiPS3_:
 1164|  62.4k|      : m_nonbmp(nonbmp)
 1165|  62.4k|      , m_origconv(origconv)
 1166|  62.4k|      , m_utf8(utf8)
 1167|  62.4k|      , m_csconv(csconv)
 1168|  62.4k|    {
 1169|  62.4k|    }
suggestmgr.cxx:_ZN12_GLOBAL__N_115ngsuggest_guardD2Ev:
 1172|  62.4k|    {
 1173|  62.4k|      if (m_nonbmp) {
  ------------------
  |  Branch (1173:11): [True: 1.72k, False: 60.7k]
  ------------------
 1174|  1.72k|        *m_csconv = m_origconv;
 1175|  1.72k|        *m_utf8 = 1;
 1176|  1.72k|      }
 1177|  62.4k|    }
suggestmgr.cxx:_ZL12get_sfxcountPKc:
 1902|  1.11M|static int get_sfxcount(const char* morph) {
 1903|  1.11M|  if (!morph || !*morph)
  ------------------
  |  Branch (1903:7): [True: 558k, False: 558k]
  |  Branch (1903:17): [True: 0, False: 558k]
  ------------------
 1904|   558k|    return 0;
 1905|   558k|  int n = 0;
 1906|   558k|  const char* old = morph;
 1907|   558k|  morph = strstr(morph, MORPH_DERI_SFX);
  ------------------
  |  |  109|   558k|#define MORPH_DERI_SFX "ds:"
  ------------------
 1908|   558k|  if (!morph)
  ------------------
  |  Branch (1908:7): [True: 415k, False: 143k]
  ------------------
 1909|   415k|    morph = strstr(old, MORPH_INFL_SFX);
  ------------------
  |  |  110|   415k|#define MORPH_INFL_SFX "is:"
  ------------------
 1910|   558k|  if (!morph)
  ------------------
  |  Branch (1910:7): [True: 413k, False: 145k]
  ------------------
 1911|   413k|    morph = strstr(old, MORPH_TERM_SFX);
  ------------------
  |  |  111|   413k|#define MORPH_TERM_SFX "ts:"
  ------------------
 1912|   931k|  while (morph) {
  ------------------
  |  Branch (1912:10): [True: 372k, False: 558k]
  ------------------
 1913|   372k|    n++;
 1914|   372k|    old = morph;
 1915|   372k|    morph = strstr(morph + 1, MORPH_DERI_SFX);
  ------------------
  |  |  109|   372k|#define MORPH_DERI_SFX "ds:"
  ------------------
 1916|   372k|    if (!morph)
  ------------------
  |  Branch (1916:9): [True: 330k, False: 41.5k]
  ------------------
 1917|   330k|      morph = strstr(old + 1, MORPH_INFL_SFX);
  ------------------
  |  |  110|   330k|#define MORPH_INFL_SFX "is:"
  ------------------
 1918|   372k|    if (!morph)
  ------------------
  |  Branch (1918:9): [True: 330k, False: 41.6k]
  ------------------
 1919|   330k|      morph = strstr(old + 1, MORPH_TERM_SFX);
  ------------------
  |  |  111|   330k|#define MORPH_TERM_SFX "ts:"
  ------------------
 1920|   372k|  }
 1921|   558k|  return n;
 1922|  1.11M|}

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

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

