_ZN8PfxEntryC2EP8AffixMgr:
   99|      8|    : pmyMgr(pmgr)
  100|      8|    , next(nullptr)
  101|      8|    , nexteq(nullptr)
  102|      8|    , nextne(nullptr)
  103|      8|    , flgnxt(nullptr) {}
_ZN8PfxEntry3addEPKcm:
  106|     11|std::string PfxEntry::add(const char* word, size_t len) {
  107|     11|  std::string result;
  108|     11|  if ((len > strip.size() || (len == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (108:7): [True: 11, False: 0]
  |  Branch (108:8): [True: 11, False: 0]
  |  Branch (108:31): [True: 0, False: 0]
  |  Branch (108:43): [True: 0, False: 0]
  ------------------
  109|     11|      (len >= numconds) && test_condition(word) &&
  ------------------
  |  Branch (109:7): [True: 11, False: 0]
  |  Branch (109:28): [True: 11, False: 0]
  ------------------
  110|     11|      (strip.empty() ||
  ------------------
  |  Branch (110:8): [True: 11, False: 0]
  ------------------
  111|     11|      (len >= strip.size() && strncmp(word, strip.c_str(), strip.size()) == 0))) {
  ------------------
  |  Branch (111:8): [True: 0, False: 0]
  |  Branch (111:31): [True: 0, False: 0]
  ------------------
  112|       |    /* we have a match so add prefix */
  113|     11|    result.assign(appnd);
  114|     11|    result.append(word + strip.size());
  115|     11|  }
  116|     11|  return result;
  117|     11|}
_ZN8PfxEntry9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  275|  1.58M|                                   AffixScratch& scratch) {
  276|  1.58M|  struct hentry* he;  // hash entry of root word or NULL
  277|       |
  278|  1.58M|  TraceCtx* t = trace_on(scratch.trace);
  279|  1.58M|  if (t)
  ------------------
  |  Branch (279:7): [True: 0, False: 1.58M]
  ------------------
  280|      0|    trace_affix(*t, "pfx", pmyMgr, *this);
  281|  1.58M|  TraceScope trace_depth(t);
  282|       |
  283|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  284|       |  // So if the remaining root word has positive length
  285|       |  // and if there are enough chars in root word and added back strip chars
  286|       |  // to meet the number of characters conditions, then test it
  287|       |
  288|  1.58M|  int tmpl = len - appnd.size(); // length of tmpword
  289|       |
  290|  1.58M|  if (tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) {
  ------------------
  |  Branch (290:7): [True: 1.57M, False: 3.09k]
  |  Branch (290:20): [True: 3.09k, False: 0]
  |  Branch (290:33): [True: 0, False: 3.09k]
  ------------------
  291|       |    // generate new root word by removing prefix and adding
  292|       |    // back any characters that would have been stripped
  293|       |
  294|  1.57M|    std::string& tmpword = scratch.pfx_check_word;
  295|  1.57M|    tmpword.assign(strip);
  296|  1.57M|    tmpword.append(word, start + appnd.size(), tmpl);
  297|       |
  298|       |    // now make sure all of the conditions on characters
  299|       |    // are met.  Please see the appendix at the end of
  300|       |    // this file for more info on exactly what is being
  301|       |    // tested
  302|       |
  303|       |    // if all conditions are met then check if resulting
  304|       |    // root word in the dictionary
  305|       |
  306|  1.57M|    if (t)
  ------------------
  |  Branch (306:9): [True: 0, False: 1.57M]
  ------------------
  307|      0|      trace(*t, "stem \"%s\"", tmpword.c_str());
  308|       |
  309|  1.57M|    bool passes = test_condition(tmpword);
  310|  1.57M|    if (t)
  ------------------
  |  Branch (310:9): [True: 0, False: 1.57M]
  ------------------
  311|      0|      trace(*t, "test condition cond=\"%s\" on \"%s\" -> %s",
  312|      0|            get_condition().c_str(),
  313|      0|            tmpword.c_str(), passes ? "pass" : "fail");
  ------------------
  |  Branch (313:30): [True: 0, False: 0]
  ------------------
  314|       |
  315|  1.57M|    if (passes) {
  ------------------
  |  Branch (315:9): [True: 20.0k, False: 1.55M]
  ------------------
  316|  20.0k|      tmpl += strip.size();
  317|  20.0k|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (317:11): [True: 0, False: 20.0k]
  ------------------
  318|      0|        if (t)
  ------------------
  |  Branch (318:13): [True: 0, False: 0]
  ------------------
  319|      0|          trace(*t, "lookup \"%s\" -> entry \"%s\" flags=%s", tmpword.c_str(),
  320|      0|                he->word, trace_flags(pmyMgr, he->astr, he->alen).c_str());
  321|      0|        do {
  322|      0|          if (applies_to(he, needflag, t)) {
  ------------------
  |  Branch (322:15): [True: 0, False: 0]
  ------------------
  323|      0|            if (t)
  ------------------
  |  Branch (323:17): [True: 0, False: 0]
  ------------------
  324|      0|              trace(*t, "accept");
  325|      0|            return he;
  326|      0|          }
  327|      0|          he = he->next_homonym;  // check homonyms
  328|      0|          if (t) {
  ------------------
  |  Branch (328:15): [True: 0, False: 0]
  ------------------
  329|      0|            if (he)
  ------------------
  |  Branch (329:17): [True: 0, False: 0]
  ------------------
  330|      0|              trace(*t, "lookup \"%s\" -> entry \"%s\" flags=%s",
  331|      0|                    tmpword.c_str(), he->word,
  332|      0|                    trace_flags(pmyMgr, he->astr, he->alen).c_str());
  333|      0|            else
  334|      0|              trace(*t, "lookup \"%s\" -> no more homonyms", tmpword.c_str());
  335|      0|          }
  336|      0|        } while (he);
  ------------------
  |  Branch (336:18): [True: 0, False: 0]
  ------------------
  337|  20.0k|      } else if (t) {
  ------------------
  |  Branch (337:18): [True: 0, False: 20.0k]
  ------------------
  338|      0|        trace(*t, "lookup \"%s\" -> miss", tmpword.c_str());
  339|      0|      }
  340|       |
  341|       |      // prefix matched but no root word was found
  342|       |      // if aeXPRODUCT is allowed, try again but now
  343|       |      // ross checked combined with a suffix
  344|       |
  345|       |      // if ((opts & aeXPRODUCT) && in_compound) {
  346|  20.0k|      if ((opts & aeXPRODUCT)) {
  ------------------
  |  |   65|  20.0k|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (346:11): [True: 20.0k, False: 0]
  ------------------
  347|  20.0k|        he = pmyMgr->suffix_check(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|  20.0k|#define aeXPRODUCT (1 << 0)
  ------------------
  348|  20.0k|                                  scratch, FLAG_NULL, needflag, in_compound);
  ------------------
  |  |   99|  20.0k|#define FLAG_NULL 0x00
  ------------------
  349|  20.0k|        if (he)
  ------------------
  |  Branch (349:13): [True: 0, False: 20.0k]
  ------------------
  350|      0|          return he;
  351|  20.0k|      }
  352|  20.0k|    }
  353|  1.57M|  } else if (t) {
  ------------------
  |  Branch (353:14): [True: 0, False: 3.09k]
  ------------------
  354|      0|    trace(*t, "test length have=%d -> fail, nothing would be left of the word",
  355|      0|          tmpl);
  356|      0|  }
  357|  1.58M|  return nullptr;
  358|  1.58M|}
_ZN8PfxEntry12check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  366|  1.57M|                                      AffixScratch& scratch) {
  367|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  368|       |  // So if the remaining root word has positive length
  369|       |  // and if there are enough chars in root word and added back strip chars
  370|       |  // to meet the number of characters conditions, then test it
  371|       |
  372|  1.57M|  int tmpl = len - appnd.size(); // length of tmpword
  373|       |
  374|  1.57M|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (374:8): [True: 1.56M, False: 3.02k]
  |  Branch (374:21): [True: 3.02k, False: 0]
  |  Branch (374:34): [True: 0, False: 3.02k]
  ------------------
  375|  1.56M|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (375:7): [True: 1.50M, False: 61.9k]
  ------------------
  376|       |    // generate new root word by removing prefix and adding
  377|       |    // back any characters that would have been stripped
  378|       |
  379|  1.50M|    std::string& tmpword = scratch.pfx_check_twosfx;
  380|  1.50M|    tmpword.assign(strip);
  381|  1.50M|    tmpword.append(word, start + appnd.size(), tmpl);
  382|       |
  383|       |    // now make sure all of the conditions on characters
  384|       |    // are met.  Please see the appendix at the end of
  385|       |    // this file for more info on exactly what is being
  386|       |    // tested
  387|       |
  388|       |    // if all conditions are met then check if resulting
  389|       |    // root word in the dictionary
  390|       |
  391|  1.50M|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (391:9): [True: 11.8k, False: 1.49M]
  ------------------
  392|  11.8k|      tmpl += strip.size();
  393|       |
  394|       |      // prefix matched but no root word was found
  395|       |      // if aeXPRODUCT is allowed, try again but now
  396|       |      // cross checked combined with a suffix
  397|       |
  398|  11.8k|      if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   65|  11.8k|#define aeXPRODUCT (1 << 0)
  ------------------
                    if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   76|  11.8k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (398:11): [True: 11.8k, False: 0]
  |  Branch (398:34): [True: 11.8k, False: 0]
  ------------------
  399|       |        // hash entry of root word or NULL
  400|  11.8k|        struct hentry* he = pmyMgr->suffix_check_twosfx(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|  11.8k|#define aeXPRODUCT (1 << 0)
  ------------------
  401|  11.8k|                                                        scratch, needflag);
  402|  11.8k|        if (he)
  ------------------
  |  Branch (402:13): [True: 0, False: 11.8k]
  ------------------
  403|      0|          return he;
  404|  11.8k|      }
  405|  11.8k|    }
  406|  1.50M|  }
  407|  1.57M|  return nullptr;
  408|  1.57M|}
_ZN8PfxEntry18check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  416|    690|                                         AffixScratch& scratch) {
  417|    690|  std::string result;
  418|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  419|       |  // So if the remaining root word has positive length
  420|       |  // and if there are enough chars in root word and added back strip chars
  421|       |  // to meet the number of characters conditions, then test it
  422|    690|  int tmpl = len - appnd.size(); // length of tmpword
  423|       |
  424|    690|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (424:8): [True: 690, False: 0]
  |  Branch (424:21): [True: 0, False: 0]
  |  Branch (424:34): [True: 0, False: 0]
  ------------------
  425|    690|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (425:7): [True: 592, False: 98]
  ------------------
  426|       |    // generate new root word by removing prefix and adding
  427|       |    // back any characters that would have been stripped
  428|       |
  429|    592|    std::string& tmpword = scratch.pfx_check_twosfx;
  430|    592|    tmpword.assign(strip);
  431|    592|    tmpword.append(word, start + appnd.size(), tmpl);
  432|       |
  433|       |    // now make sure all of the conditions on characters
  434|       |    // are met.  Please see the appendix at the end of
  435|       |    // this file for more info on exactly what is being
  436|       |    // tested
  437|       |
  438|       |    // if all conditions are met then check if resulting
  439|       |    // root word in the dictionary
  440|       |
  441|    592|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (441:9): [True: 0, False: 592]
  ------------------
  442|      0|      tmpl += strip.size();
  443|       |
  444|       |      // prefix matched but no root word was found
  445|       |      // if aeXPRODUCT is allowed, try again but now
  446|       |      // ross checked combined with a suffix
  447|       |
  448|      0|      if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
                    if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   76|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (448:11): [True: 0, False: 0]
  |  Branch (448:34): [True: 0, False: 0]
  ------------------
  449|      0|        result = pmyMgr->suffix_check_twosfx_morph(tmpword, 0, tmpl,
  450|      0|                                                   aeXPRODUCT,
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  451|      0|                                                   this, scratch, needflag);
  452|      0|      }
  453|      0|    }
  454|    592|  }
  455|    690|  return result;
  456|    690|}
_ZN8PfxEntry11check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  464|    690|                                  AffixScratch& scratch) {
  465|    690|  std::string result;
  466|       |
  467|       |  // on entry prefix is 0 length or already matches the beginning of the word.
  468|       |  // So if the remaining root word has positive length
  469|       |  // and if there are enough chars in root word and added back strip chars
  470|       |  // to meet the number of characters conditions, then test it
  471|       |
  472|    690|  int tmpl = len - appnd.size(); // length of tmpword
  473|       |
  474|    690|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (474:8): [True: 690, False: 0]
  |  Branch (474:21): [True: 0, False: 0]
  |  Branch (474:34): [True: 0, False: 0]
  ------------------
  475|    690|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (475:7): [True: 592, False: 98]
  ------------------
  476|       |    // generate new root word by removing prefix and adding
  477|       |    // back any characters that would have been stripped
  478|       |
  479|    592|    std::string& tmpword = scratch.pfx_check_word;
  480|    592|    tmpword.assign(strip);
  481|    592|    tmpword.append(word, start + appnd.size(), tmpl);
  482|       |
  483|       |    // now make sure all of the conditions on characters
  484|       |    // are met.  Please see the appendix at the end of
  485|       |    // this file for more info on exactly what is being
  486|       |    // tested
  487|       |
  488|       |    // if all conditions are met then check if resulting
  489|       |    // root word in the dictionary
  490|       |
  491|    592|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (491:9): [True: 0, False: 592]
  ------------------
  492|      0|      tmpl += strip.size();
  493|      0|      struct hentry* he;  // hash entry of root word or NULL
  494|      0|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (494:11): [True: 0, False: 0]
  ------------------
  495|      0|        do {
  496|      0|          if (applies_to(he, needflag, nullptr)) {
  ------------------
  |  Branch (496:15): [True: 0, False: 0]
  ------------------
  497|      0|            if (morphcode) {
  ------------------
  |  Branch (497:17): [True: 0, False: 0]
  ------------------
  498|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  499|      0|              result.append(morphcode);
  500|      0|            } else
  501|      0|              result.append(getKey());
  502|      0|            if (!HENTRY_FIND(he, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (502:17): [True: 0, False: 0]
  ------------------
  503|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  504|      0|              result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  505|      0|              result.append(HENTRY_WORD(he));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  506|      0|            }
  507|       |            // store the pointer of the hash entry
  508|      0|            if (HENTRY_DATA(he)) {
  ------------------
  |  Branch (508:17): [True: 0, False: 0]
  ------------------
  509|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  510|      0|              result.append(HENTRY_DATA2(he));
  511|      0|            } else {
  512|       |              // return with debug information
  513|      0|              std::string flag = pmyMgr->encode_flag(getFlag());
  514|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  515|      0|              result.append(MORPH_FLAG);
  ------------------
  |  |  117|      0|#define MORPH_FLAG "fl:"
  ------------------
  516|      0|              result.append(flag);
  517|      0|            }
  518|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
  519|      0|          }
  520|      0|          he = he->next_homonym;
  521|      0|        } while (he);
  ------------------
  |  Branch (521:18): [True: 0, False: 0]
  ------------------
  522|      0|      }
  523|       |
  524|       |      // prefix matched but no root word was found
  525|       |      // if aeXPRODUCT is allowed, try again but now
  526|       |      // ross checked combined with a suffix
  527|       |
  528|      0|      if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
                    if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   76|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (528:11): [True: 0, False: 0]
  |  Branch (528:34): [True: 0, False: 0]
  ------------------
  529|      0|        std::string st = pmyMgr->suffix_check_morph(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  530|      0|                                                    scratch, FLAG_NULL, needflag);
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  531|      0|        if (!st.empty()) {
  ------------------
  |  Branch (531:13): [True: 0, False: 0]
  ------------------
  532|      0|          result.append(st);
  533|      0|        }
  534|      0|      }
  535|      0|    }
  536|    592|  }
  537|       |
  538|    690|  return result;
  539|    690|}
_ZN8SfxEntryC2EP8AffixMgr:
  542|     34|    : pmyMgr(pmgr)  // register affix manager
  543|     34|    , next(nullptr)
  544|     34|    , nexteq(nullptr)
  545|     34|    , nextne(nullptr)
  546|     34|    , flgnxt(nullptr)
  547|     34|    , l_morph(nullptr)
  548|     34|    , r_morph(nullptr)
  549|     34|    , eq_morph(nullptr) {}
_ZN8SfxEntry3addEPKcm:
  579|     11|std::string SfxEntry::add(const char* word, size_t len) {
  580|     11|  std::string result;
  581|       |  /* make sure all conditions match */
  582|     11|  if ((len > strip.size() || (len == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (582:8): [True: 11, False: 0]
  |  Branch (582:31): [True: 0, False: 0]
  |  Branch (582:43): [True: 0, False: 0]
  ------------------
  583|     11|      (len >= numconds) && test_condition(word + len, word) &&
  ------------------
  |  Branch (583:7): [True: 11, False: 0]
  |  Branch (583:28): [True: 11, False: 0]
  ------------------
  584|     11|      (strip.empty() ||
  ------------------
  |  Branch (584:8): [True: 11, False: 0]
  ------------------
  585|     11|       (len >= strip.size() && strcmp(word + len - strip.size(), strip.c_str()) == 0))) {
  ------------------
  |  Branch (585:9): [True: 0, False: 0]
  |  Branch (585:32): [True: 0, False: 0]
  ------------------
  586|     11|    result.assign(word, len);
  587|       |    /* we have a match so add suffix */
  588|     11|    result.replace(len - strip.size(), std::string::npos, appnd);
  589|     11|  }
  590|     11|  return result;
  591|     11|}
_ZNK8SfxEntry10applies_toEPK6hentryiP8PfxEntrytttPK8TraceCtx:
  731|     13|                          const TraceCtx* t) const {
  732|       |  // the suffix flag is either on the entry itself, or on a prefix that enables
  733|       |  // this suffix
  734|     13|  bool in_dic = TESTAFF(he->astr, aflag, he->alen);
  ------------------
  |  |  102|     13|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  735|     13|  bool in_prefix = ep && ep->getCont() &&
  ------------------
  |  Branch (735:20): [True: 0, False: 13]
  |  Branch (735:26): [True: 0, False: 0]
  ------------------
  736|      0|                   TESTAFF(ep->getCont(), aflag, ep->getContLen());
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  737|     13|  if (t) {
  ------------------
  |  Branch (737:7): [True: 0, False: 13]
  ------------------
  738|      0|    if (in_prefix && !in_dic)
  ------------------
  |  Branch (738:9): [True: 0, False: 0]
  |  Branch (738:22): [True: 0, False: 0]
  ------------------
  739|      0|      trace_test(*t, "sfx-aflag", pmyMgr, aflag, "pfx-cont", ep->getCont(),
  740|      0|                 ep->getContLen(), "pass, the prefix enables this suffix");
  741|      0|    else
  742|      0|      trace_test(*t, "sfx-aflag", pmyMgr, aflag, "dic", he->astr, he->alen,
  743|      0|                 in_dic ? "pass" : "fail");
  ------------------
  |  Branch (743:18): [True: 0, False: 0]
  ------------------
  744|      0|  }
  745|     13|  if (!in_dic && !in_prefix)
  ------------------
  |  Branch (745:7): [True: 13, False: 0]
  |  Branch (745:18): [True: 13, False: 0]
  ------------------
  746|     13|    return false;
  747|       |
  748|       |  // the prefix and the suffix have to be allowed to meet
  749|      0|  if ((optflags & aeXPRODUCT) != 0) {
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (749:7): [True: 0, False: 0]
  ------------------
  750|      0|    FLAG pflag = ep ? ep->getFlag() : FLAG_NULL;
  ------------------
  |  |   98|      0|#define FLAG unsigned short
  ------------------
                  FLAG pflag = ep ? ep->getFlag() : FLAG_NULL;
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (750:18): [True: 0, False: 0]
  ------------------
  751|      0|    in_dic = ep && TESTAFF(he->astr, pflag, he->alen);
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (751:14): [True: 0, False: 0]
  ------------------
  752|      0|    bool in_cont = contclass && ep && TESTAFF(contclass, pflag, contclasslen);
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (752:20): [True: 0, False: 0]
  |  Branch (752:33): [True: 0, False: 0]
  ------------------
  753|      0|    if (t) {
  ------------------
  |  Branch (753:9): [True: 0, False: 0]
  ------------------
  754|      0|      if (in_cont && !in_dic)
  ------------------
  |  Branch (754:11): [True: 0, False: 0]
  |  Branch (754:22): [True: 0, False: 0]
  ------------------
  755|      0|        trace_test(*t, "xprod", pmyMgr, pflag, "sfx-cont", contclass,
  756|      0|                   contclasslen, "pass, this suffix enables the prefix");
  757|      0|      else
  758|      0|        trace_test(*t, "xprod", pmyMgr, pflag, "dic", he->astr, he->alen,
  759|      0|                   in_dic ? "pass"
  ------------------
  |  Branch (759:20): [True: 0, False: 0]
  ------------------
  760|      0|                          : "fail, the stem does not take the prefix as well");
  761|      0|    }
  762|      0|    if (!in_dic && !in_cont)
  ------------------
  |  Branch (762:9): [True: 0, False: 0]
  |  Branch (762:20): [True: 0, False: 0]
  ------------------
  763|      0|      return false;
  764|      0|  }
  765|       |
  766|       |  // handle cont. class
  767|      0|  if (cclass) {
  ------------------
  |  Branch (767:7): [True: 0, False: 0]
  ------------------
  768|      0|    bool ok = contclass && TESTAFF(contclass, cclass, contclasslen);
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (768:15): [True: 0, False: 0]
  ------------------
  769|      0|    if (t)
  ------------------
  |  Branch (769:9): [True: 0, False: 0]
  ------------------
  770|      0|      trace_test(*t, "cclass", pmyMgr, cclass, "sfx-cont", contclass,
  771|      0|                 contclasslen,
  772|      0|                 ok ? "pass" : "fail, this suffix does not continue the last one");
  ------------------
  |  Branch (772:18): [True: 0, False: 0]
  ------------------
  773|      0|    if (!ok)
  ------------------
  |  Branch (773:9): [True: 0, False: 0]
  ------------------
  774|      0|      return false;
  775|      0|  }
  776|       |
  777|       |  // check only in compound homonyms (bad flags)
  778|      0|  if (badflag) {
  ------------------
  |  Branch (778:7): [True: 0, False: 0]
  ------------------
  779|      0|    bool ok = !TESTAFF(he->astr, badflag, he->alen);
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  780|      0|    if (t)
  ------------------
  |  Branch (780:9): [True: 0, False: 0]
  ------------------
  781|      0|      trace_test(*t, "badflag", pmyMgr, badflag, "dic", he->astr, he->alen,
  782|      0|                 ok ? "pass" : "fail, the stem has a flag this context forbids");
  ------------------
  |  Branch (782:18): [True: 0, False: 0]
  ------------------
  783|      0|    if (!ok)
  ------------------
  |  Branch (783:9): [True: 0, False: 0]
  ------------------
  784|      0|      return false;
  785|      0|  }
  786|       |
  787|       |  // handle required flag
  788|      0|  if (needflag) {
  ------------------
  |  Branch (788:7): [True: 0, False: 0]
  ------------------
  789|      0|    in_dic = TESTAFF(he->astr, needflag, he->alen);
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  790|      0|    bool in_cont = contclass && TESTAFF(contclass, needflag, contclasslen);
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (790:20): [True: 0, False: 0]
  ------------------
  791|      0|    if (t) {
  ------------------
  |  Branch (791:9): [True: 0, False: 0]
  ------------------
  792|      0|      if (in_cont && !in_dic)
  ------------------
  |  Branch (792:11): [True: 0, False: 0]
  |  Branch (792:22): [True: 0, False: 0]
  ------------------
  793|      0|        trace_test(*t, "needflag", pmyMgr, needflag, "sfx-cont", contclass,
  794|      0|                   contclasslen, "pass");
  795|      0|      else
  796|      0|        trace_test(*t, "needflag", pmyMgr, needflag, "dic", he->astr, he->alen,
  797|      0|                   in_dic ? "pass"
  ------------------
  |  Branch (797:20): [True: 0, False: 0]
  ------------------
  798|      0|                          : "fail, the stem lacks the flag the caller asked for");
  799|      0|    }
  800|      0|    if (!in_dic && !in_cont)
  ------------------
  |  Branch (800:9): [True: 0, False: 0]
  |  Branch (800:20): [True: 0, False: 0]
  ------------------
  801|      0|      return false;
  802|      0|  }
  803|       |
  804|      0|  return true;
  805|      0|}
_ZN8SfxEntry9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntrytttR12AffixScratch:
  816|  47.2k|                                   AffixScratch& scratch) {
  817|  47.2k|  struct hentry* he;  // hash entry pointer
  818|  47.2k|  PfxEntry* ep = ppfx;
  819|       |
  820|  47.2k|  TraceCtx* t = trace_on(scratch.trace);
  821|  47.2k|  if (t)
  ------------------
  |  Branch (821:7): [True: 0, False: 47.2k]
  ------------------
  822|      0|    trace_affix(*t, "sfx", pmyMgr, *this);
  823|  47.2k|  TraceScope trace_depth(t);
  824|       |
  825|       |  // if this suffix is being cross checked with a prefix
  826|       |  // but it does not support cross products skip it
  827|       |
  828|  47.2k|  if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0)) {
  ------------------
  |  |   65|  47.2k|#define aeXPRODUCT (1 << 0)
  ------------------
                if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0)) {
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (828:7): [True: 0, False: 47.2k]
  |  Branch (828:41): [True: 0, False: 0]
  ------------------
  829|      0|    if (t)
  ------------------
  |  Branch (829:9): [True: 0, False: 0]
  ------------------
  830|      0|      trace(*t, "test xprod -> fail, this suffix class does not cross with a"
  831|      0|                " prefix");
  832|      0|    return nullptr;
  833|      0|  }
  834|       |
  835|       |  // upon entry suffix is 0 length or already matches the end of the word.
  836|       |  // So if the remaining root word has positive length
  837|       |  // and if there are enough chars in root word and added back strip chars
  838|       |  // to meet the number of characters conditions, then test it
  839|       |
  840|  47.2k|  int tmpl = len - appnd.size(); // length of tmpword
  841|       |  // the second condition is not enough for UTF-8 strings
  842|       |  // it checked in test_condition()
  843|       |
  844|  47.2k|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (844:8): [True: 45.8k, False: 1.42k]
  |  Branch (844:21): [True: 1.42k, False: 0]
  |  Branch (844:34): [True: 0, False: 1.42k]
  ------------------
  845|  45.8k|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (845:7): [True: 45.8k, False: 0]
  ------------------
  846|       |    // generate new root word by removing suffix and adding
  847|       |    // back any characters that would have been stripped or
  848|       |    // or null terminating the shorter string
  849|       |
  850|  45.8k|    std::string& tmpword = scratch.sfx_check_word;
  851|  45.8k|    tmpword.assign(word, start, tmpl);
  852|  45.8k|    if (!strip.empty()) {
  ------------------
  |  Branch (852:9): [True: 0, False: 45.8k]
  ------------------
  853|      0|      tmpword.append(strip);
  854|      0|    }
  855|       |
  856|  45.8k|    const char* beg = tmpword.c_str();
  857|  45.8k|    const char* end = beg + tmpword.size();
  858|       |
  859|       |    // now make sure all of the conditions on characters
  860|       |    // are met.  Please see the appendix at the end of
  861|       |    // this file for more info on exactly what is being
  862|       |    // tested
  863|       |
  864|       |    // if all conditions are met then check if resulting
  865|       |    // root word in the dictionary
  866|       |
  867|  45.8k|    if (t)
  ------------------
  |  Branch (867:9): [True: 0, False: 45.8k]
  ------------------
  868|      0|      trace(*t, "stem \"%s\"", tmpword.c_str());
  869|       |
  870|  45.8k|    bool passes = test_condition(end, beg);
  871|  45.8k|    if (t)
  ------------------
  |  Branch (871:9): [True: 0, False: 45.8k]
  ------------------
  872|      0|      trace(*t, "test condition cond=\"%s\" on \"%s\" -> %s",
  873|      0|            get_condition().c_str(),
  874|      0|            tmpword.c_str(), passes ? "pass" : "fail");
  ------------------
  |  Branch (874:30): [True: 0, False: 0]
  ------------------
  875|       |
  876|  45.8k|    if (passes) {
  ------------------
  |  Branch (876:9): [True: 45.8k, False: 1]
  ------------------
  877|       |#ifdef SZOSZABLYA_POSSIBLE_ROOTS
  878|       |      fprintf(stdout, "%s %s %c\n", word.c_str() + start, beg, aflag);
  879|       |#endif
  880|  45.8k|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (880:11): [True: 13, False: 45.8k]
  ------------------
  881|     13|        if (t)
  ------------------
  |  Branch (881:13): [True: 0, False: 13]
  ------------------
  882|      0|          trace(*t, "lookup \"%s\" -> entry \"%s\" flags=%s", tmpword.c_str(),
  883|      0|                he->word, trace_flags(pmyMgr, he->astr, he->alen).c_str());
  884|     13|        do {
  885|     13|          if (applies_to(he, optflags, ep, cclass, needflag, badflag, t)) {
  ------------------
  |  Branch (885:15): [True: 0, False: 13]
  ------------------
  886|      0|            if (t)
  ------------------
  |  Branch (886:17): [True: 0, False: 0]
  ------------------
  887|      0|              trace(*t, "accept");
  888|      0|            return he;
  889|      0|          }
  890|     13|          he = he->next_homonym;  // check homonyms
  891|     13|          if (t) {
  ------------------
  |  Branch (891:15): [True: 0, False: 13]
  ------------------
  892|      0|            if (he)
  ------------------
  |  Branch (892:17): [True: 0, False: 0]
  ------------------
  893|      0|              trace(*t, "lookup \"%s\" -> entry \"%s\" flags=%s",
  894|      0|                    tmpword.c_str(), he->word,
  895|      0|                    trace_flags(pmyMgr, he->astr, he->alen).c_str());
  896|      0|            else
  897|      0|              trace(*t, "lookup \"%s\" -> no more homonyms", tmpword.c_str());
  898|      0|          }
  899|     13|        } while (he);
  ------------------
  |  Branch (899:18): [True: 0, False: 13]
  ------------------
  900|  45.8k|      } else if (t) {
  ------------------
  |  Branch (900:18): [True: 0, False: 45.8k]
  ------------------
  901|      0|        trace(*t, "lookup \"%s\" -> miss", tmpword.c_str());
  902|      0|      }
  903|  45.8k|    }
  904|  45.8k|  } else if (t) {
  ------------------
  |  Branch (904:14): [True: 0, False: 1.42k]
  ------------------
  905|      0|    trace(*t, "test length have=%d need=%d -> fail, too little is left of the"
  906|      0|              " word to test", tmpl, (int)numconds);
  907|      0|  }
  908|  47.2k|  return nullptr;
  909|  47.2k|}
_ZN8SfxEntry12check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntrytR12AffixScratch:
  918|  28.0k|                                      AffixScratch& scratch) {
  919|  28.0k|  PfxEntry* ep = ppfx;
  920|       |
  921|       |  // if this suffix is being cross checked with a prefix
  922|       |  // but it does not support cross products skip it
  923|       |
  924|  28.0k|  if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0)
  ------------------
  |  |   65|  28.0k|#define aeXPRODUCT (1 << 0)
  ------------------
                if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0)
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (924:7): [True: 0, False: 28.0k]
  |  Branch (924:39): [True: 0, False: 0]
  ------------------
  925|      0|    return nullptr;
  926|       |
  927|       |  // upon entry suffix is 0 length or already matches the end of the word.
  928|       |  // So if the remaining root word has positive length
  929|       |  // and if there are enough chars in root word and added back strip chars
  930|       |  // to meet the number of characters conditions, then test it
  931|       |
  932|  28.0k|  int tmpl = len - appnd.size(); // length of tmpword
  933|       |
  934|  28.0k|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (934:8): [True: 27.7k, False: 238]
  |  Branch (934:21): [True: 238, False: 0]
  |  Branch (934:34): [True: 0, False: 238]
  ------------------
  935|  27.7k|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (935:7): [True: 27.7k, False: 0]
  ------------------
  936|       |    // generate new root word by removing suffix and adding
  937|       |    // back any characters that would have been stripped or
  938|       |    // or null terminating the shorter string
  939|       |
  940|  27.7k|    std::string& tmpword = scratch.sfx_check_twosfx;
  941|  27.7k|    tmpword.assign(word, start);
  942|  27.7k|    tmpword.resize(tmpl);
  943|  27.7k|    tmpword.append(strip);
  944|  27.7k|    tmpl += strip.size();
  945|       |
  946|  27.7k|    const char* beg = tmpword.c_str();
  947|  27.7k|    const char* end = beg + tmpl;
  948|       |
  949|       |    // now make sure all of the conditions on characters
  950|       |    // are met.  Please see the appendix at the end of
  951|       |    // this file for more info on exactly what is being
  952|       |    // tested
  953|       |
  954|       |    // if all conditions are met then recall suffix_check
  955|       |
  956|  27.7k|    if (test_condition(end, beg)) {
  ------------------
  |  Branch (956:9): [True: 27.7k, False: 0]
  ------------------
  957|  27.7k|      struct hentry* he;  // hash entry pointer
  958|  27.7k|      if (ppfx) {
  ------------------
  |  Branch (958:11): [True: 0, False: 27.7k]
  ------------------
  959|       |        // handle conditional suffix
  960|      0|        if ((contclass) && TESTAFF(contclass, ep->getFlag(), contclasslen))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (960:13): [True: 0, False: 0]
  |  Branch (960:13): [True: 0, False: 0]
  ------------------
  961|      0|          he = pmyMgr->suffix_check(tmpword, 0, tmpl, 0, nullptr, scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   75|      0|#define IN_CPD_NOT 0
  ------------------
  962|      0|        else
  963|      0|          he = pmyMgr->suffix_check(tmpword, 0, tmpl, optflags, ppfx,
  964|      0|                                    scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   75|      0|#define IN_CPD_NOT 0
  ------------------
  965|  27.7k|      } else {
  966|  27.7k|        he = pmyMgr->suffix_check(tmpword, 0, tmpl, 0, nullptr, scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   75|  27.7k|#define IN_CPD_NOT 0
  ------------------
  967|  27.7k|      }
  968|  27.7k|      if (he)
  ------------------
  |  Branch (968:11): [True: 0, False: 27.7k]
  ------------------
  969|      0|        return he;
  970|  27.7k|    }
  971|  27.7k|  }
  972|  28.0k|  return nullptr;
  973|  28.0k|}
_ZN8SfxEntry15initReverseWordEv:
 1084|     34|void SfxEntry::initReverseWord() {
 1085|     34|  rappnd = appnd;
 1086|     34|  reverseword(rappnd);
 1087|     34|}
_ZN8PfxEntry14test_conditionERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  134|  3.08M|inline int PfxEntry::test_condition(const std::string& s) {
  135|  3.08M|  size_t st = 0;
  136|  3.08M|  size_t pos = std::string::npos;  // group with pos input position
  137|  3.08M|  bool neg = false;        // complementer
  138|  3.08M|  bool ingroup = false;    // character in the group
  139|  3.08M|  if (numconds == 0)
  ------------------
  |  Branch (139:7): [True: 8.26k, False: 3.07M]
  ------------------
  140|  8.26k|    return 1;
  141|  3.07M|  char* p = c.conds;
  142|  3.19M|  while (true) {
  ------------------
  |  Branch (142:10): [True: 3.19M, Folded]
  ------------------
  143|  3.19M|    switch (*p) {
  144|      0|      case '\0':
  ------------------
  |  Branch (144:7): [True: 0, False: 3.19M]
  ------------------
  145|      0|        return 1;
  146|  23.6k|      case '[': {
  ------------------
  |  Branch (146:7): [True: 23.6k, False: 3.17M]
  ------------------
  147|  23.6k|        neg = false;
  148|  23.6k|        ingroup = false;
  149|  23.6k|        p = nextchar(p);
  150|  23.6k|        pos = st;
  151|  23.6k|        break;
  152|      0|      }
  153|  23.6k|      case '^': {
  ------------------
  |  Branch (153:7): [True: 23.6k, False: 3.17M]
  ------------------
  154|  23.6k|        p = nextchar(p);
  155|  23.6k|        neg = true;
  156|  23.6k|        break;
  157|      0|      }
  158|  23.6k|      case ']': {
  ------------------
  |  Branch (158:7): [True: 23.6k, False: 3.17M]
  ------------------
  159|  23.6k|        if (bool(neg) == bool(ingroup))
  ------------------
  |  Branch (159:13): [True: 0, False: 23.6k]
  ------------------
  160|      0|          return 0;
  161|  23.6k|        pos = std::string::npos;
  162|  23.6k|        p = nextchar(p);
  163|       |        // skip the next character
  164|  23.6k|        if (!ingroup && st < s.size())
  ------------------
  |  Branch (164:13): [True: 23.6k, False: 0]
  |  Branch (164:25): [True: 22.2k, False: 1.37k]
  ------------------
  165|  22.2k|          st = (opts & aeUTF8) ? utf8_next(s, st) : st + 1;
  ------------------
  |  |   66|  22.2k|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (165:16): [True: 22.2k, False: 0]
  ------------------
  166|  23.6k|        if (st == s.size() && p)
  ------------------
  |  Branch (166:13): [True: 3.64k, False: 19.9k]
  |  Branch (166:31): [True: 0, False: 3.64k]
  ------------------
  167|      0|          return 0;  // word <= condition
  168|  23.6k|        break;
  169|  23.6k|      }
  170|  23.6k|      case '.':
  ------------------
  |  Branch (170:7): [True: 0, False: 3.19M]
  ------------------
  171|      0|        if (pos == std::string::npos) {  // dots are not metacharacters in groups: [.]
  ------------------
  |  Branch (171:13): [True: 0, False: 0]
  ------------------
  172|      0|          if (st == s.size())
  ------------------
  |  Branch (172:15): [True: 0, False: 0]
  ------------------
  173|      0|            return 0;  // dot has no character to match
  174|      0|          p = nextchar(p);
  175|       |          // skip the next character
  176|      0|          st = (opts & aeUTF8) ? utf8_next(s, st) : st + 1;
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (176:16): [True: 0, False: 0]
  ------------------
  177|      0|          break;
  178|      0|        }
  179|       |      /* FALLTHROUGH */
  180|  3.12M|      default: {
  ------------------
  |  Branch (180:7): [True: 3.12M, False: 70.9k]
  ------------------
  181|  3.12M|        if (st < s.size() && s[st] == *p) {
  ------------------
  |  Branch (181:13): [True: 3.12M, False: 2.74k]
  |  Branch (181:30): [True: 23.8k, False: 3.09M]
  ------------------
  182|  23.8k|          ++st;
  183|  23.8k|          p = nextchar(p);
  184|  23.8k|          if ((opts & aeUTF8) && (s[st - 1] & 0x80)) {  // multibyte
  ------------------
  |  |   66|  23.8k|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (184:15): [True: 23.8k, False: 0]
  |  Branch (184:34): [True: 23.8k, False: 0]
  ------------------
  185|  47.5k|            while (p && is_utf8_cont(*p)) {             // character
  ------------------
  |  Branch (185:20): [True: 47.5k, False: 0]
  |  Branch (185:25): [True: 23.8k, False: 23.6k]
  ------------------
  186|  23.8k|              if (st >= s.size() || *p != s[st]) {
  ------------------
  |  Branch (186:19): [True: 0, False: 23.8k]
  |  Branch (186:37): [True: 248, False: 23.6k]
  ------------------
  187|    248|                if (pos == std::string::npos)
  ------------------
  |  Branch (187:21): [True: 248, False: 0]
  ------------------
  188|    248|                  return 0;
  189|      0|                st = pos;
  190|      0|                break;
  191|    248|              }
  192|  23.6k|              p = nextchar(p);
  193|  23.6k|              ++st;
  194|  23.6k|            }
  195|  23.6k|            if (pos != std::string::npos && st != pos) {
  ------------------
  |  Branch (195:17): [True: 0, False: 23.6k]
  |  Branch (195:45): [True: 0, False: 0]
  ------------------
  196|      0|              ingroup = true;
  197|      0|              while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (197:22): [True: 0, False: 0]
  |  Branch (197:27): [True: 0, False: 0]
  |  Branch (197:40): [True: 0, False: 0]
  ------------------
  198|      0|              }
  199|      0|            }
  200|  23.6k|          } else if (pos != std::string::npos) {
  ------------------
  |  Branch (200:22): [True: 0, False: 0]
  ------------------
  201|      0|            ingroup = true;
  202|      0|            while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (202:20): [True: 0, False: 0]
  |  Branch (202:25): [True: 0, False: 0]
  |  Branch (202:38): [True: 0, False: 0]
  ------------------
  203|      0|            }
  204|      0|          }
  205|  3.10M|        } else if (pos != std::string::npos) {  // group
  ------------------
  |  Branch (205:20): [True: 47.2k, False: 3.05M]
  ------------------
  206|  47.2k|          p = nextchar(p);
  207|  47.2k|        } else
  208|  3.05M|          return 0;
  209|  3.12M|      }
  210|  3.19M|    }
  211|   141k|    if (!p)
  ------------------
  |  Branch (211:9): [True: 23.6k, False: 118k]
  ------------------
  212|  23.6k|      return 1;
  213|   141k|  }
  214|  3.07M|}
_ZN8PfxEntry8nextcharEPc:
  119|   165k|inline char* PfxEntry::nextchar(char* p) {
  120|   165k|  if (p) {
  ------------------
  |  Branch (120:7): [True: 165k, False: 0]
  ------------------
  121|   165k|    p++;
  122|   165k|    if (opts & aeLONGCOND) {
  ------------------
  |  |   69|   165k|#define aeLONGCOND (1 << 4)
  ------------------
  |  Branch (122:9): [True: 0, False: 165k]
  ------------------
  123|       |      // jump to the 2nd part of the condition
  124|      0|      if (p == c.conds + MAXCONDLEN_1)
  ------------------
  |  |   94|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   93|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
  |  Branch (124:11): [True: 0, False: 0]
  ------------------
  125|      0|        return c.l.conds2;
  126|       |      // end of the MAXCONDLEN length condition
  127|   165k|    } else if (p == c.conds + MAXCONDLEN)
  ------------------
  |  |   93|   165k|#define MAXCONDLEN 20
  ------------------
  |  Branch (127:16): [True: 0, False: 165k]
  ------------------
  128|      0|      return nullptr;
  129|   165k|    return *p ? p : nullptr;
  ------------------
  |  Branch (129:12): [True: 142k, False: 23.6k]
  ------------------
  130|   165k|  }
  131|      0|  return nullptr;
  132|   165k|}
_ZN8SfxEntry14test_conditionEPKcS1_:
  608|  73.5k|inline int SfxEntry::test_condition(const char* st, const char* beg) {
  609|  73.5k|  const char* pos = nullptr;  // group with pos input position
  610|  73.5k|  bool neg = false;        // complementer
  611|  73.5k|  bool ingroup = false;    // character in the group
  612|  73.5k|  if (numconds == 0)
  ------------------
  |  Branch (612:7): [True: 73.5k, False: 1]
  ------------------
  613|  73.5k|    return 1;
  614|      1|  char* p = c.conds;
  615|      1|  st--;
  616|      1|  int i = 1;
  617|      8|  while (true) {
  ------------------
  |  Branch (617:10): [True: 8, Folded]
  ------------------
  618|      8|    switch (*p) {
  619|      0|      case '\0':
  ------------------
  |  Branch (619:7): [True: 0, False: 8]
  ------------------
  620|      0|        return 1;
  621|      1|      case '[':
  ------------------
  |  Branch (621:7): [True: 1, False: 7]
  ------------------
  622|      1|        p = nextchar(p);
  623|      1|        pos = st;
  624|      1|        break;
  625|      0|      case '^':
  ------------------
  |  Branch (625:7): [True: 0, False: 8]
  ------------------
  626|      0|        p = nextchar(p);
  627|      0|        neg = true;
  628|      0|        break;
  629|      1|      case ']':
  ------------------
  |  Branch (629:7): [True: 1, False: 7]
  ------------------
  630|      1|        if (!neg && !ingroup)
  ------------------
  |  Branch (630:13): [True: 1, False: 0]
  |  Branch (630:21): [True: 1, False: 0]
  ------------------
  631|      1|          return 0;
  632|      0|        i++;
  633|       |        // skip the next character
  634|      0|        if (!ingroup) {
  ------------------
  |  Branch (634:13): [True: 0, False: 0]
  ------------------
  635|      0|          for (; (opts & aeUTF8) && (st >= beg) && is_utf8_cont(*st); st--)
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (635:18): [True: 0, False: 0]
  |  Branch (635:37): [True: 0, False: 0]
  |  Branch (635:52): [True: 0, False: 0]
  ------------------
  636|      0|            ;
  637|      0|          st--;
  638|      0|        }
  639|      0|        pos = nullptr;
  640|      0|        neg = false;
  641|      0|        ingroup = false;
  642|      0|        p = nextchar(p);
  643|      0|        if (st < beg && p)
  ------------------
  |  Branch (643:13): [True: 0, False: 0]
  |  Branch (643:25): [True: 0, False: 0]
  ------------------
  644|      0|          return 0;  // word <= condition
  645|      0|        break;
  646|      0|      case '.':
  ------------------
  |  Branch (646:7): [True: 0, False: 8]
  ------------------
  647|      0|        if (!pos) {
  ------------------
  |  Branch (647:13): [True: 0, False: 0]
  ------------------
  648|       |          // dots are not metacharacters in groups: [.]
  649|      0|          p = nextchar(p);
  650|       |          // skip one character to the left. Walk back over any UTF-8
  651|       |          // continuation bytes of that character to its leading byte first,
  652|       |          // then step past it, so a single-byte match preceded by a
  653|       |          // multibyte character does not consume the multibyte character.
  654|      0|          for (; (opts & aeUTF8) && (st >= beg) && is_utf8_cont(*st); st--)
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (654:18): [True: 0, False: 0]
  |  Branch (654:37): [True: 0, False: 0]
  |  Branch (654:52): [True: 0, False: 0]
  ------------------
  655|      0|            ;
  656|      0|          st--;
  657|      0|          if (st < beg) {  // word <= condition
  ------------------
  |  Branch (657:15): [True: 0, False: 0]
  ------------------
  658|      0|            if (p)
  ------------------
  |  Branch (658:17): [True: 0, False: 0]
  ------------------
  659|      0|              return 0;
  660|      0|            else
  661|      0|              return 1;
  662|      0|          }
  663|      0|          break;
  664|      0|        }
  665|       |      /* FALLTHROUGH */
  666|      6|      default: {
  ------------------
  |  Branch (666:7): [True: 6, False: 2]
  ------------------
  667|      6|        if (*st == *p) {
  ------------------
  |  Branch (667:13): [True: 0, False: 6]
  ------------------
  668|      0|          p = nextchar(p);
  669|      0|          if ((opts & aeUTF8) && (*st & 0x80)) {
  ------------------
  |  |   66|      0|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (669:15): [True: 0, False: 0]
  |  Branch (669:34): [True: 0, False: 0]
  ------------------
  670|      0|            st--;
  671|      0|            while (p && (st >= beg)) {
  ------------------
  |  Branch (671:20): [True: 0, False: 0]
  |  Branch (671:25): [True: 0, False: 0]
  ------------------
  672|      0|              if (*p != *st) {
  ------------------
  |  Branch (672:19): [True: 0, False: 0]
  ------------------
  673|      0|                if (!pos)
  ------------------
  |  Branch (673:21): [True: 0, False: 0]
  ------------------
  674|      0|                  return 0;
  675|      0|                st = pos;
  676|      0|                break;
  677|      0|              }
  678|       |              // first byte of the UTF-8 multibyte character
  679|      0|              if (!is_utf8_cont(*p))
  ------------------
  |  Branch (679:19): [True: 0, False: 0]
  ------------------
  680|      0|                break;
  681|      0|              p = nextchar(p);
  682|      0|              st--;
  683|      0|            }
  684|      0|            if (pos && st != pos) {
  ------------------
  |  Branch (684:17): [True: 0, False: 0]
  |  Branch (684:24): [True: 0, False: 0]
  ------------------
  685|      0|              if (neg)
  ------------------
  |  Branch (685:19): [True: 0, False: 0]
  ------------------
  686|      0|                return 0;
  687|      0|              else if (i == numconds)
  ------------------
  |  Branch (687:24): [True: 0, False: 0]
  ------------------
  688|      0|                return 1;
  689|      0|              ingroup = true;
  690|      0|              while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (690:22): [True: 0, False: 0]
  |  Branch (690:27): [True: 0, False: 0]
  |  Branch (690:40): [True: 0, False: 0]
  ------------------
  691|      0|              }
  692|      0|              st--;
  693|      0|            }
  694|      0|            if (p && *p != ']')
  ------------------
  |  Branch (694:17): [True: 0, False: 0]
  |  Branch (694:22): [True: 0, False: 0]
  ------------------
  695|      0|              p = nextchar(p);
  696|      0|          } else if (pos) {
  ------------------
  |  Branch (696:22): [True: 0, False: 0]
  ------------------
  697|      0|            if (neg)
  ------------------
  |  Branch (697:17): [True: 0, False: 0]
  ------------------
  698|      0|              return 0;
  699|      0|            else if (i == numconds)
  ------------------
  |  Branch (699:22): [True: 0, False: 0]
  ------------------
  700|      0|              return 1;
  701|      0|            ingroup = true;
  702|      0|            while (p && *p != ']' && ((p = nextchar(p)) != nullptr)) {
  ------------------
  |  Branch (702:20): [True: 0, False: 0]
  |  Branch (702:25): [True: 0, False: 0]
  |  Branch (702:38): [True: 0, False: 0]
  ------------------
  703|      0|            }
  704|       |            // if (p && *p != ']') p = nextchar(p);
  705|      0|            st--;
  706|      0|          }
  707|      0|          if (!pos) {
  ------------------
  |  Branch (707:15): [True: 0, False: 0]
  ------------------
  708|      0|            i++;
  709|      0|            st--;
  710|      0|          }
  711|      0|          if (st < beg && p && *p != ']')
  ------------------
  |  Branch (711:15): [True: 0, False: 0]
  |  Branch (711:27): [True: 0, False: 0]
  |  Branch (711:32): [True: 0, False: 0]
  ------------------
  712|      0|            return 0;      // word <= condition
  713|      6|        } else if (pos) {  // group
  ------------------
  |  Branch (713:20): [True: 6, False: 0]
  ------------------
  714|      6|          p = nextchar(p);
  715|      6|        } else
  716|      0|          return 0;
  717|      6|      }
  718|      8|    }
  719|      7|    if (!p)
  ------------------
  |  Branch (719:9): [True: 0, False: 7]
  ------------------
  720|      0|      return 1;
  721|      7|  }
  722|      1|}
_ZN8SfxEntry8nextcharEPc:
  593|      7|inline char* SfxEntry::nextchar(char* p) {
  594|      7|  if (p) {
  ------------------
  |  Branch (594:7): [True: 7, False: 0]
  ------------------
  595|      7|    p++;
  596|      7|    if (opts & aeLONGCOND) {
  ------------------
  |  |   69|      7|#define aeLONGCOND (1 << 4)
  ------------------
  |  Branch (596:9): [True: 0, False: 7]
  ------------------
  597|       |      // jump to the 2nd part of the condition
  598|      0|      if (p == c.l.conds1 + MAXCONDLEN_1)
  ------------------
  |  |   94|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   93|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
  |  Branch (598:11): [True: 0, False: 0]
  ------------------
  599|      0|        return c.l.conds2;
  600|       |      // end of the MAXCONDLEN length condition
  601|      7|    } else if (p == c.conds + MAXCONDLEN)
  ------------------
  |  |   93|      7|#define MAXCONDLEN 20
  ------------------
  |  Branch (601:16): [True: 0, False: 7]
  ------------------
  602|      0|      return nullptr;
  603|      7|    return *p ? p : nullptr;
  ------------------
  |  Branch (603:12): [True: 7, False: 0]
  ------------------
  604|      7|  }
  605|      0|  return nullptr;
  606|      7|}

_ZN8PfxEntry7getContEv:
  136|  4.72M|  inline const unsigned short* getCont() { return contclass; }
_ZN8PfxEntry10getContLenEv:
  137|  1.57M|  inline unsigned short getContLen() { return contclasslen; }
_ZN8SfxEntry7getContEv:
  226|   565k|  inline const unsigned short* getCont() { return contclass; }
_ZN8SfxEntry10getContLenEv:
  227|  29.5k|  inline unsigned short getContLen() { return contclasslen; }
_ZN8PfxEntry7getFlagEv:
  128|    848|  FLAG getFlag() { return aflag; }
_ZN8PfxEntry6getKeyEv:
  129|   159k|  const char* getKey() { return appnd.c_str(); }
_ZN8SfxEntry7getFlagEv:
  220|   104k|  FLAG getFlag() { return aflag; }
_ZN8SfxEntry8getAffixEv:
  228|  35.0k|  inline const char* getAffix() { return appnd.c_str(); }
_ZNK8PfxEntry10allowCrossEv:
   94|     11|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|     11|#define aeXPRODUCT (1 << 0)
  ------------------
_ZN8PfxEntry9getKeyLenEv:
  132|  2.52k|  inline int getKeyLen() { return appnd.size(); }
_ZN8PfxEntry7getNextEv:
  139|  3.03M|  inline PfxEntry* getNext() { return next; }
_ZN8PfxEntry9getNextNEEv:
  140|  35.0k|  inline PfxEntry* getNextNE() { return nextne; }
_ZN8PfxEntry9getNextEQEv:
  141|   123k|  inline PfxEntry* getNextEQ() { return nexteq; }
_ZN8PfxEntry9getFlgNxtEv:
  142|    840|  inline PfxEntry* getFlgNxt() { return flgnxt; }
_ZN8PfxEntry7setNextEPS_:
  144|      8|  inline void setNext(PfxEntry* ptr) { next = ptr; }
_ZN8PfxEntry9setNextNEEPS_:
  145|     16|  inline void setNextNE(PfxEntry* ptr) { nextne = ptr; }
_ZN8PfxEntry9setNextEQEPS_:
  146|     14|  inline void setNextEQ(PfxEntry* ptr) { nexteq = ptr; }
_ZN8PfxEntry9setFlgNxtEPS_:
  147|      8|  inline void setFlgNxt(PfxEntry* ptr) { flgnxt = ptr; }
_ZNK8SfxEntry10allowCrossEv:
  176|     11|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|     11|#define aeXPRODUCT (1 << 0)
  ------------------
_ZN8SfxEntry6getKeyEv:
  221|   587k|  const char* getKey() { return rappnd.c_str(); }
_ZN8SfxEntry9getKeyLenEv:
  230|   158k|  inline int getKeyLen() { return appnd.size(); }
_ZN8SfxEntry7getNextEv:
  232|    228|  inline SfxEntry* getNext() { return next; }
_ZN8SfxEntry9getNextNEEv:
  233|  85.2k|  inline SfxEntry* getNextNE() { return nextne; }
_ZN8SfxEntry9getNextEQEv:
  234|   501k|  inline SfxEntry* getNextEQ() { return nexteq; }
_ZN8SfxEntry9getFlgNxtEv:
  239|  61.6k|  inline SfxEntry* getFlgNxt() { return flgnxt; }
_ZN8SfxEntry7setNextEPS_:
  241|     34|  inline void setNext(SfxEntry* ptr) { next = ptr; }
_ZN8SfxEntry9setNextNEEPS_:
  242|     80|  inline void setNextNE(SfxEntry* ptr) { nextne = ptr; }
_ZN8SfxEntry9setNextEQEPS_:
  243|     88|  inline void setNextEQ(SfxEntry* ptr) { nexteq = ptr; }
_ZN8SfxEntry9setFlgNxtEPS_:
  244|     34|  inline void setFlgNxt(SfxEntry* ptr) { flgnxt = ptr; }

_ZN8AffixMgrC2EPKcRKNSt3__16vectorINS2_10unique_ptrI7HashMgrNS2_14default_deleteIS5_EEEENS2_9allocatorIS8_EEEES1_:
  137|     38|  : alldic(ptr)
  138|     38|  , pHMgr(ptr[0].get()) {
  139|       |
  140|       |  // register hash manager and load affix data from aff file
  141|     38|  csconv = nullptr;
  142|     38|  utf8 = 0;
  143|     38|  complexprefixes = 0;
  144|     38|  parsedmaptable = false;
  145|     38|  parsedbreaktable = false;
  146|     38|  iconvtable = nullptr;
  147|     38|  oconvtable = nullptr;
  148|       |  // allow simplified compound forms (see 3rd field of CHECKCOMPOUNDPATTERN)
  149|     38|  simplifiedcpd = 0;
  150|     38|  parsedcheckcpd = false;
  151|     38|  parseddefcpd = false;
  152|     38|  phone = nullptr;
  153|     38|  compoundflag = FLAG_NULL;        // permits word in compound forms
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  154|     38|  compoundbegin = FLAG_NULL;       // may be first word in compound forms
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  155|     38|  compoundmiddle = FLAG_NULL;      // may be middle word in compound forms
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  156|     38|  compoundend = FLAG_NULL;         // may be last word in compound forms
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  157|     38|  compoundroot = FLAG_NULL;        // compound word signing flag
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  158|     38|  compoundpermitflag = FLAG_NULL;  // compound permitting flag for suffixed word
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  159|     38|  compoundforbidflag = FLAG_NULL;  // compound fordidden flag for suffixed word
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  160|     38|  compoundmoresuffixes = 0;        // allow more suffixes within compound words
  161|     38|  checkcompounddup = 0;            // forbid double words in compounds
  162|     38|  checkcompoundrep = 0;  // forbid bad compounds (may be non-compound word with
  163|       |                         // a REP substitution)
  164|     38|  checkcompoundcase =
  165|     38|      0;  // forbid upper and lowercase combinations at word bounds
  166|     38|  checkcompoundtriple = 0;  // forbid compounds with triple letters
  167|     38|  simplifiedtriple = 0;     // allow simplified triple letters in compounds
  168|       |                            // (Schiff+fahrt -> Schiffahrt)
  169|     38|  forbiddenword = FORBIDDENWORD;  // forbidden word signing flag
  ------------------
  |  |  127|     38|#define FORBIDDENWORD 65510
  ------------------
  170|     38|  nosuggest = FLAG_NULL;  // don't suggest words signed with NOSUGGEST flag
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  171|     38|  nongramsuggest = FLAG_NULL;
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  172|     38|  langnum = 0;  // language code (see http://l10n.openoffice.org/languages.html)
  173|     38|  needaffix = FLAG_NULL;  // forbidden root, allowed only with suffixes
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  174|     38|  cpdwordmax = -1;        // default: unlimited wordcount in compound words
  175|     38|  cpdmin = -1;            // undefined
  176|     38|  cpdmaxsyllable = 0;     // default: unlimited syllablecount in compound words
  177|     38|  pfxappnd = nullptr;     // previous prefix for counting syllables of the prefix BUG
  178|     38|  sfxappnd = nullptr;     // previous suffix for counting syllables of the suffix BUG
  179|     38|  sfxextra = 0;     // modifier for syllable count of sfxappnd BUG
  180|     38|  checknum = 0;               // checking numbers, and word with numbers
  181|     38|  havecontclass = 0;  // flags of possible continuing classes (double affix)
  182|       |  // LEMMA_PRESENT: not put root into the morphological output. Lemma presents
  183|       |  // in morhological description in dictionary file. It's often combined with
  184|       |  // PSEUDOROOT.
  185|     38|  lemma_present = FLAG_NULL;
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  186|     38|  circumfix = FLAG_NULL;
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  187|     38|  onlyincompound = FLAG_NULL;
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  188|     38|  maxngramsugs = -1;  // undefined
  189|     38|  maxdiff = -1;       // undefined
  190|     38|  onlymaxdiff = 0;
  191|     38|  maxcpdsugs = -1;  // undefined
  192|     38|  nosplitsugs = 0;
  193|     38|  sugswithdots = 0;
  194|     38|  keepcase = 0;
  195|     38|  forceucase = 0;
  196|     38|  warn = 0;
  197|     38|  forbidwarn = 0;
  198|     38|  checksharps = 0;
  199|     38|  substandard = FLAG_NULL;
  ------------------
  |  |   99|     38|#define FLAG_NULL 0x00
  ------------------
  200|     38|  fullstrip = 0;
  201|       |
  202|     38|  sfx = nullptr;
  203|     38|  pfx = nullptr;
  204|       |
  205|  9.76k|  for (int i = 0; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.76k|#define SETSIZE 256
  ------------------
  |  Branch (205:19): [True: 9.72k, False: 38]
  ------------------
  206|  9.72k|    pStart[i] = nullptr;
  207|  9.72k|    sStart[i] = nullptr;
  208|  9.72k|    pFlag[i] = nullptr;
  209|  9.72k|    sFlag[i] = nullptr;
  210|  9.72k|  }
  211|       |
  212|     38|  memset(contclasses, 0, CONTSIZE * sizeof(char));
  ------------------
  |  |   62|     38|#define CONTSIZE 65536
  ------------------
  213|       |
  214|     38|  if (parse_file(affpath, key)) {
  ------------------
  |  Branch (214:7): [True: 0, False: 38]
  ------------------
  215|      0|    fprintf(stderr, "Failure loading aff file %s\n", affpath);
  216|      0|  }
  217|       |
  218|       |  /* get encoding for CHECKCOMPOUNDCASE */
  219|     38|  if (!utf8) {
  ------------------
  |  Branch (219:7): [True: 20, False: 18]
  ------------------
  220|     20|    csconv = get_current_cs(get_encoding());
  221|  5.14k|    for (int i = 0; i <= 255; i++) {
  ------------------
  |  Branch (221:21): [True: 5.12k, False: 20]
  ------------------
  222|  5.12k|      if ((csconv[i].cupper != csconv[i].clower) &&
  ------------------
  |  Branch (222:11): [True: 2.24k, False: 2.88k]
  ------------------
  223|  2.24k|          (wordchars.find((char)i) == std::string::npos)) {
  ------------------
  |  Branch (223:11): [True: 2.24k, False: 0]
  ------------------
  224|  2.24k|        wordchars.push_back((char)i);
  225|  2.24k|      }
  226|  5.12k|    }
  227|     20|  }
  228|       |
  229|       |  // default BREAK definition
  230|     38|  if (!parsedbreaktable) {
  ------------------
  |  Branch (230:7): [True: 34, False: 4]
  ------------------
  231|     34|    breaktable.emplace_back("-");
  232|     34|    breaktable.emplace_back("^-");
  233|     34|    breaktable.emplace_back("-$");
  234|     34|    parsedbreaktable = true;
  235|     34|  }
  236|       |
  237|     38|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  238|       |  // not entirely sure this is invalid, so only for fuzzing for now
  239|     38|  if (iconvtable && !iconvtable->check_against_breaktable(breaktable)) {
  ------------------
  |  Branch (239:7): [True: 2, False: 36]
  |  Branch (239:21): [True: 0, False: 2]
  ------------------
  240|      0|      delete iconvtable;
  241|      0|      iconvtable = nullptr;
  242|      0|  }
  243|     38|#endif
  244|       |
  245|     38|  if (cpdmin == -1)
  ------------------
  |  Branch (245:7): [True: 34, False: 4]
  ------------------
  246|     34|    cpdmin = MINCPDLEN;
  ------------------
  |  |   91|     34|#define MINCPDLEN 3
  ------------------
  247|     38|}
_ZN8AffixMgr13finishFileMgrEP7FileMgr:
  304|     38|void AffixMgr::finishFileMgr(FileMgr* afflst) {
  305|     38|  delete afflst;
  306|       |
  307|       |  // convert affix trees to sorted list
  308|     38|  process_pfx_tree_to_list();
  309|     38|  process_sfx_tree_to_list();
  310|     38|}
_ZN8AffixMgr10parse_fileEPKcS1_:
  313|     38|int AffixMgr::parse_file(const char* affpath, const char* key) {
  314|       |
  315|       |  // checking flag duplication
  316|     38|  char dupflags[CONTSIZE];
  317|     38|  char dupflags_ini = 1;
  318|       |
  319|       |  // first line indicator for removing byte order mark
  320|     38|  int firstline = 1;
  321|       |
  322|       |  // open the affix file
  323|     38|  FileMgr* afflst = new FileMgr(affpath, key);
  324|       |
  325|       |  // step one is to parse the affix file building up the internal
  326|       |  // affix data structures
  327|       |
  328|       |  // read in each line ignoring any that do not
  329|       |  // start with a known line type indicator
  330|     38|  std::string line;
  331|    646|  while (afflst->getline(line)) {
  ------------------
  |  Branch (331:10): [True: 608, False: 38]
  ------------------
  332|    608|    mychomp(line);
  333|       |
  334|       |    /* remove byte order mark */
  335|    608|    if (firstline) {
  ------------------
  |  Branch (335:9): [True: 38, False: 570]
  ------------------
  336|     38|      firstline = 0;
  337|       |      // Affix file begins with byte order mark: possible incompatibility with
  338|       |      // old Hunspell versions
  339|     38|      if (line.compare(0, 3, "\xEF\xBB\xBF", 3) == 0) {
  ------------------
  |  Branch (339:11): [True: 0, False: 38]
  ------------------
  340|      0|        line.erase(0, 3);
  341|      0|      }
  342|     38|    }
  343|       |
  344|       |    /* parse in the keyboard string */
  345|    608|    if (line.compare(0, 3, "KEY", 3) == 0) {
  ------------------
  |  Branch (345:9): [True: 0, False: 608]
  ------------------
  346|      0|      if (!parse_string(line, keystring, afflst->getlinenum())) {
  ------------------
  |  Branch (346:11): [True: 0, False: 0]
  ------------------
  347|      0|        finishFileMgr(afflst);
  348|      0|        return 1;
  349|      0|      }
  350|      0|    }
  351|       |
  352|       |    /* parse in the try string */
  353|    608|    if (line.compare(0, 3, "TRY", 3) == 0) {
  ------------------
  |  Branch (353:9): [True: 2, False: 606]
  ------------------
  354|      2|      if (!parse_string(line, trystring, afflst->getlinenum())) {
  ------------------
  |  Branch (354:11): [True: 0, False: 2]
  ------------------
  355|      0|        finishFileMgr(afflst);
  356|      0|        return 1;
  357|      0|      }
  358|      2|    }
  359|       |
  360|       |    /* parse in the name of the character set used by the .dict and .aff */
  361|    608|    if (line.compare(0, 3, "SET", 3) == 0) {
  ------------------
  |  Branch (361:9): [True: 18, False: 590]
  ------------------
  362|     18|      if (!parse_string(line, encoding, afflst->getlinenum())) {
  ------------------
  |  Branch (362:11): [True: 0, False: 18]
  ------------------
  363|      0|        finishFileMgr(afflst);
  364|      0|        return 1;
  365|      0|      }
  366|     18|      if (encoding == "UTF-8") {
  ------------------
  |  Branch (366:11): [True: 18, False: 0]
  ------------------
  367|     18|        utf8 = 1;
  368|     18|      }
  369|     18|    }
  370|       |
  371|       |    /* parse COMPLEXPREFIXES for agglutinative languages with right-to-left
  372|       |     * writing system */
  373|    608|    if (line.compare(0, 15, "COMPLEXPREFIXES", 15) == 0)
  ------------------
  |  Branch (373:9): [True: 2, False: 606]
  ------------------
  374|      2|      complexprefixes = 1;
  375|       |
  376|       |    /* parse in the flag used by the controlled compound words */
  377|    608|    if (line.compare(0, 12, "COMPOUNDFLAG", 12) == 0) {
  ------------------
  |  Branch (377:9): [True: 8, False: 600]
  ------------------
  378|      8|      if (!parse_flag(line, &compoundflag, afflst)) {
  ------------------
  |  Branch (378:11): [True: 0, False: 8]
  ------------------
  379|      0|        finishFileMgr(afflst);
  380|      0|        return 1;
  381|      0|      }
  382|      8|    }
  383|       |
  384|       |    /* parse in the flag used by compound words */
  385|    608|    if (line.compare(0, 13, "COMPOUNDBEGIN", 13) == 0) {
  ------------------
  |  Branch (385:9): [True: 0, False: 608]
  ------------------
  386|      0|      if (complexprefixes) {
  ------------------
  |  Branch (386:11): [True: 0, False: 0]
  ------------------
  387|      0|        if (!parse_flag(line, &compoundend, afflst)) {
  ------------------
  |  Branch (387:13): [True: 0, False: 0]
  ------------------
  388|      0|          finishFileMgr(afflst);
  389|      0|          return 1;
  390|      0|        }
  391|      0|      } else {
  392|      0|        if (!parse_flag(line, &compoundbegin, afflst)) {
  ------------------
  |  Branch (392:13): [True: 0, False: 0]
  ------------------
  393|      0|          finishFileMgr(afflst);
  394|      0|          return 1;
  395|      0|        }
  396|      0|      }
  397|      0|    }
  398|       |
  399|       |    /* parse in the flag used by compound words */
  400|    608|    if (line.compare(0, 14, "COMPOUNDMIDDLE", 14) == 0) {
  ------------------
  |  Branch (400:9): [True: 0, False: 608]
  ------------------
  401|      0|      if (!parse_flag(line, &compoundmiddle, afflst)) {
  ------------------
  |  Branch (401:11): [True: 0, False: 0]
  ------------------
  402|      0|        finishFileMgr(afflst);
  403|      0|        return 1;
  404|      0|      }
  405|      0|    }
  406|       |
  407|       |    /* parse in the flag used by compound words */
  408|    608|    if (line.compare(0, 11, "COMPOUNDEND", 11) == 0) {
  ------------------
  |  Branch (408:9): [True: 0, False: 608]
  ------------------
  409|      0|      if (complexprefixes) {
  ------------------
  |  Branch (409:11): [True: 0, False: 0]
  ------------------
  410|      0|        if (!parse_flag(line, &compoundbegin, afflst)) {
  ------------------
  |  Branch (410:13): [True: 0, False: 0]
  ------------------
  411|      0|          finishFileMgr(afflst);
  412|      0|          return 1;
  413|      0|        }
  414|      0|      } else {
  415|      0|        if (!parse_flag(line, &compoundend, afflst)) {
  ------------------
  |  Branch (415:13): [True: 0, False: 0]
  ------------------
  416|      0|          finishFileMgr(afflst);
  417|      0|          return 1;
  418|      0|        }
  419|      0|      }
  420|      0|    }
  421|       |
  422|       |    /* parse in the data used by compound_check() method */
  423|    608|    if (line.compare(0, 15, "COMPOUNDWORDMAX", 15) == 0) {
  ------------------
  |  Branch (423:9): [True: 2, False: 606]
  ------------------
  424|      2|      if (!parse_num(line, &cpdwordmax, afflst)) {
  ------------------
  |  Branch (424:11): [True: 0, False: 2]
  ------------------
  425|      0|        finishFileMgr(afflst);
  426|      0|        return 1;
  427|      0|      }
  428|      2|    }
  429|       |
  430|       |    /* parse in the flag sign compounds in dictionary */
  431|    608|    if (line.compare(0, 12, "COMPOUNDROOT", 12) == 0) {
  ------------------
  |  Branch (431:9): [True: 0, False: 608]
  ------------------
  432|      0|      if (!parse_flag(line, &compoundroot, afflst)) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        finishFileMgr(afflst);
  434|      0|        return 1;
  435|      0|      }
  436|      0|    }
  437|       |
  438|       |    /* parse in the flag used by compound_check() method */
  439|    608|    if (line.compare(0, 18, "COMPOUNDPERMITFLAG", 18) == 0) {
  ------------------
  |  Branch (439:9): [True: 2, False: 606]
  ------------------
  440|      2|      if (!parse_flag(line, &compoundpermitflag, afflst)) {
  ------------------
  |  Branch (440:11): [True: 0, False: 2]
  ------------------
  441|      0|        finishFileMgr(afflst);
  442|      0|        return 1;
  443|      0|      }
  444|      2|    }
  445|       |
  446|       |    /* parse in the flag used by compound_check() method */
  447|    608|    if (line.compare(0, 18, "COMPOUNDFORBIDFLAG", 18) == 0) {
  ------------------
  |  Branch (447:9): [True: 2, False: 606]
  ------------------
  448|      2|      if (!parse_flag(line, &compoundforbidflag, afflst)) {
  ------------------
  |  Branch (448:11): [True: 0, False: 2]
  ------------------
  449|      0|        finishFileMgr(afflst);
  450|      0|        return 1;
  451|      0|      }
  452|      2|    }
  453|       |
  454|    608|    if (line.compare(0, 20, "COMPOUNDMORESUFFIXES", 20) == 0) {
  ------------------
  |  Branch (454:9): [True: 0, False: 608]
  ------------------
  455|      0|      compoundmoresuffixes = 1;
  456|      0|    }
  457|       |
  458|    608|    if (line.compare(0, 16, "CHECKCOMPOUNDDUP", 16) == 0) {
  ------------------
  |  Branch (458:9): [True: 0, False: 608]
  ------------------
  459|      0|      checkcompounddup = 1;
  460|      0|    }
  461|       |
  462|    608|    if (line.compare(0, 16, "CHECKCOMPOUNDREP", 16) == 0) {
  ------------------
  |  Branch (462:9): [True: 2, False: 606]
  ------------------
  463|      2|      checkcompoundrep = 1;
  464|      2|    }
  465|       |
  466|    608|    if (line.compare(0, 19, "CHECKCOMPOUNDTRIPLE", 19) == 0) {
  ------------------
  |  Branch (466:9): [True: 0, False: 608]
  ------------------
  467|      0|      checkcompoundtriple = 1;
  468|      0|    }
  469|       |
  470|    608|    if (line.compare(0, 16, "SIMPLIFIEDTRIPLE", 16) == 0) {
  ------------------
  |  Branch (470:9): [True: 0, False: 608]
  ------------------
  471|      0|      simplifiedtriple = 1;
  472|      0|    }
  473|       |
  474|    608|    if (line.compare(0, 17, "CHECKCOMPOUNDCASE", 17) == 0) {
  ------------------
  |  Branch (474:9): [True: 0, False: 608]
  ------------------
  475|      0|      checkcompoundcase = 1;
  476|      0|    }
  477|       |
  478|    608|    if (line.compare(0, 9, "NOSUGGEST", 9) == 0) {
  ------------------
  |  Branch (478:9): [True: 0, False: 608]
  ------------------
  479|      0|      if (!parse_flag(line, &nosuggest, afflst)) {
  ------------------
  |  Branch (479:11): [True: 0, False: 0]
  ------------------
  480|      0|        finishFileMgr(afflst);
  481|      0|        return 1;
  482|      0|      }
  483|      0|    }
  484|       |
  485|    608|    if (line.compare(0, 14, "NONGRAMSUGGEST", 14) == 0) {
  ------------------
  |  Branch (485:9): [True: 0, False: 608]
  ------------------
  486|      0|      if (!parse_flag(line, &nongramsuggest, afflst)) {
  ------------------
  |  Branch (486:11): [True: 0, False: 0]
  ------------------
  487|      0|        finishFileMgr(afflst);
  488|      0|        return 1;
  489|      0|      }
  490|      0|    }
  491|       |
  492|       |    /* parse in the flag used by forbidden words */
  493|    608|    if (line.compare(0, 13, "FORBIDDENWORD", 13) == 0) {
  ------------------
  |  Branch (493:9): [True: 2, False: 606]
  ------------------
  494|      2|      if (!parse_flag(line, &forbiddenword, afflst)) {
  ------------------
  |  Branch (494:11): [True: 0, False: 2]
  ------------------
  495|      0|        finishFileMgr(afflst);
  496|      0|        return 1;
  497|      0|      }
  498|      2|    }
  499|       |
  500|       |    /* parse in the flag used by forbidden words (is deprecated) */
  501|    608|    if (line.compare(0, 13, "LEMMA_PRESENT", 13) == 0) {
  ------------------
  |  Branch (501:9): [True: 0, False: 608]
  ------------------
  502|      0|      if (!parse_flag(line, &lemma_present, afflst)) {
  ------------------
  |  Branch (502:11): [True: 0, False: 0]
  ------------------
  503|      0|        finishFileMgr(afflst);
  504|      0|        return 1;
  505|      0|      }
  506|      0|    }
  507|       |
  508|       |    /* parse in the flag used by circumfixes */
  509|    608|    if (line.compare(0, 9, "CIRCUMFIX", 9) == 0) {
  ------------------
  |  Branch (509:9): [True: 2, False: 606]
  ------------------
  510|      2|      if (!parse_flag(line, &circumfix, afflst)) {
  ------------------
  |  Branch (510:11): [True: 0, False: 2]
  ------------------
  511|      0|        finishFileMgr(afflst);
  512|      0|        return 1;
  513|      0|      }
  514|      2|    }
  515|       |
  516|       |    /* parse in the flag used by fogemorphemes */
  517|    608|    if (line.compare(0, 14, "ONLYINCOMPOUND", 14) == 0) {
  ------------------
  |  Branch (517:9): [True: 0, False: 608]
  ------------------
  518|      0|      if (!parse_flag(line, &onlyincompound, afflst)) {
  ------------------
  |  Branch (518:11): [True: 0, False: 0]
  ------------------
  519|      0|        finishFileMgr(afflst);
  520|      0|        return 1;
  521|      0|      }
  522|      0|    }
  523|       |
  524|       |    /* parse in the flag used by `needaffixs' (is deprecated) */
  525|    608|    if (line.compare(0, 10, "PSEUDOROOT", 10) == 0) {
  ------------------
  |  Branch (525:9): [True: 0, False: 608]
  ------------------
  526|      0|      if (!parse_flag(line, &needaffix, afflst)) {
  ------------------
  |  Branch (526:11): [True: 0, False: 0]
  ------------------
  527|      0|        finishFileMgr(afflst);
  528|      0|        return 1;
  529|      0|      }
  530|      0|    }
  531|       |
  532|       |    /* parse in the flag used by `needaffixs' */
  533|    608|    if (line.compare(0, 9, "NEEDAFFIX", 9) == 0) {
  ------------------
  |  Branch (533:9): [True: 2, False: 606]
  ------------------
  534|      2|      if (!parse_flag(line, &needaffix, afflst)) {
  ------------------
  |  Branch (534:11): [True: 0, False: 2]
  ------------------
  535|      0|        finishFileMgr(afflst);
  536|      0|        return 1;
  537|      0|      }
  538|      2|    }
  539|       |
  540|       |    /* parse in the minimal length for words in compounds */
  541|    608|    if (line.compare(0, 11, "COMPOUNDMIN", 11) == 0) {
  ------------------
  |  Branch (541:9): [True: 4, False: 604]
  ------------------
  542|      4|      if (!parse_num(line, &cpdmin, afflst)) {
  ------------------
  |  Branch (542:11): [True: 0, False: 4]
  ------------------
  543|      0|        finishFileMgr(afflst);
  544|      0|        return 1;
  545|      0|      }
  546|      4|      if (cpdmin < 1)
  ------------------
  |  Branch (546:11): [True: 0, False: 4]
  ------------------
  547|      0|        cpdmin = 1;
  548|      4|    }
  549|       |
  550|       |    /* parse in the max. words and syllables in compounds */
  551|    608|    if (line.compare(0, 16, "COMPOUNDSYLLABLE", 16) == 0) {
  ------------------
  |  Branch (551:9): [True: 2, False: 606]
  ------------------
  552|      2|      if (!parse_cpdsyllable(line, afflst)) {
  ------------------
  |  Branch (552:11): [True: 0, False: 2]
  ------------------
  553|      0|        finishFileMgr(afflst);
  554|      0|        return 1;
  555|      0|      }
  556|      2|    }
  557|       |
  558|       |    /* parse in the flag used by compound_check() method */
  559|    608|    if (line.compare(0, 11, "SYLLABLENUM", 11) == 0) {
  ------------------
  |  Branch (559:9): [True: 0, False: 608]
  ------------------
  560|      0|      if (!parse_string(line, cpdsyllablenum, afflst->getlinenum())) {
  ------------------
  |  Branch (560:11): [True: 0, False: 0]
  ------------------
  561|      0|        finishFileMgr(afflst);
  562|      0|        return 1;
  563|      0|      }
  564|      0|    }
  565|       |
  566|       |    /* parse in the flag used by the controlled compound words */
  567|    608|    if (line.compare(0, 8, "CHECKNUM", 8) == 0) {
  ------------------
  |  Branch (567:9): [True: 0, False: 608]
  ------------------
  568|      0|      checknum = 1;
  569|      0|    }
  570|       |
  571|       |    /* parse in the extra word characters */
  572|    608|    if (line.compare(0, 9, "WORDCHARS", 9) == 0) {
  ------------------
  |  Branch (572:9): [True: 6, False: 602]
  ------------------
  573|      6|      if (!parse_array(line, wordchars, wordchars_utf16,
  ------------------
  |  Branch (573:11): [True: 0, False: 6]
  ------------------
  574|      6|                       utf8, afflst->getlinenum())) {
  575|      0|        finishFileMgr(afflst);
  576|      0|        return 1;
  577|      0|      }
  578|      6|    }
  579|       |
  580|       |    /* parse in the ignored characters (for example, Arabic optional diacretics
  581|       |     * charachters */
  582|    608|    if (line.compare(0, 6, "IGNORE", 6) == 0) {
  ------------------
  |  Branch (582:9): [True: 4, False: 604]
  ------------------
  583|      4|      if (!parse_array(line, ignorechars, ignorechars_utf16,
  ------------------
  |  Branch (583:11): [True: 0, False: 4]
  ------------------
  584|      4|                       utf8, afflst->getlinenum())) {
  585|      0|        finishFileMgr(afflst);
  586|      0|        return 1;
  587|      0|      }
  588|      4|    }
  589|       |
  590|       |    /* parse in the input conversion table */
  591|    608|    if (line.compare(0, 5, "ICONV", 5) == 0) {
  ------------------
  |  Branch (591:9): [True: 2, False: 606]
  ------------------
  592|      2|      if (!parse_convtable(line, afflst, &iconvtable, "ICONV")) {
  ------------------
  |  Branch (592:11): [True: 0, False: 2]
  ------------------
  593|      0|        finishFileMgr(afflst);
  594|      0|        return 1;
  595|      0|      }
  596|      2|    }
  597|       |
  598|       |    /* parse in the output conversion table */
  599|    608|    if (line.compare(0, 5, "OCONV", 5) == 0) {
  ------------------
  |  Branch (599:9): [True: 2, False: 606]
  ------------------
  600|      2|      if (!parse_convtable(line, afflst, &oconvtable, "OCONV")) {
  ------------------
  |  Branch (600:11): [True: 0, False: 2]
  ------------------
  601|      0|        finishFileMgr(afflst);
  602|      0|        return 1;
  603|      0|      }
  604|      2|    }
  605|       |
  606|       |    /* parse in the phonetic translation table */
  607|    608|    if (line.compare(0, 5, "PHONE", 5) == 0) {
  ------------------
  |  Branch (607:9): [True: 2, False: 606]
  ------------------
  608|      2|      if (!parse_phonetable(line, afflst)) {
  ------------------
  |  Branch (608:11): [True: 0, False: 2]
  ------------------
  609|      0|        finishFileMgr(afflst);
  610|      0|        return 1;
  611|      0|      }
  612|      2|    }
  613|       |
  614|       |    /* parse in the checkcompoundpattern table */
  615|    608|    if (line.compare(0, 20, "CHECKCOMPOUNDPATTERN", 20) == 0) {
  ------------------
  |  Branch (615:9): [True: 2, False: 606]
  ------------------
  616|      2|      if (!parse_checkcpdtable(line, afflst)) {
  ------------------
  |  Branch (616:11): [True: 0, False: 2]
  ------------------
  617|      0|        finishFileMgr(afflst);
  618|      0|        return 1;
  619|      0|      }
  620|      2|    }
  621|       |
  622|       |    /* parse in the defcompound table */
  623|    608|    if (line.compare(0, 12, "COMPOUNDRULE", 12) == 0) {
  ------------------
  |  Branch (623:9): [True: 0, False: 608]
  ------------------
  624|      0|      if (!parse_defcpdtable(line, afflst)) {
  ------------------
  |  Branch (624:11): [True: 0, False: 0]
  ------------------
  625|      0|        finishFileMgr(afflst);
  626|      0|        return 1;
  627|      0|      }
  628|      0|    }
  629|       |
  630|       |    /* parse in the related character map table */
  631|    608|    if (line.compare(0, 3, "MAP", 3) == 0) {
  ------------------
  |  Branch (631:9): [True: 2, False: 606]
  ------------------
  632|      2|      if (!parse_maptable(line, afflst)) {
  ------------------
  |  Branch (632:11): [True: 0, False: 2]
  ------------------
  633|      0|        finishFileMgr(afflst);
  634|      0|        return 1;
  635|      0|      }
  636|      2|    }
  637|       |
  638|       |    /* parse in the word breakpoints table */
  639|    608|    if (line.compare(0, 5, "BREAK", 5) == 0) {
  ------------------
  |  Branch (639:9): [True: 4, False: 604]
  ------------------
  640|      4|      if (!parse_breaktable(line, afflst)) {
  ------------------
  |  Branch (640:11): [True: 0, False: 4]
  ------------------
  641|      0|        finishFileMgr(afflst);
  642|      0|        return 1;
  643|      0|      }
  644|      4|    }
  645|       |
  646|       |    /* parse in the language for language specific codes */
  647|    608|    if (line.compare(0, 4, "LANG", 4) == 0) {
  ------------------
  |  Branch (647:9): [True: 2, False: 606]
  ------------------
  648|      2|      if (!parse_string(line, lang, afflst->getlinenum())) {
  ------------------
  |  Branch (648:11): [True: 0, False: 2]
  ------------------
  649|      0|        finishFileMgr(afflst);
  650|      0|        return 1;
  651|      0|      }
  652|      2|      langnum = get_lang_num(lang);
  653|      2|    }
  654|       |
  655|    608|    if (line.compare(0, 7, "VERSION", 7) == 0) {
  ------------------
  |  Branch (655:9): [True: 0, False: 608]
  ------------------
  656|      0|      size_t startpos = line.find_first_not_of(" \t", 7);
  657|      0|      if (startpos != std::string::npos) {
  ------------------
  |  Branch (657:11): [True: 0, False: 0]
  ------------------
  658|      0|          version = line.substr(startpos);
  659|      0|      }
  660|      0|    }
  661|       |
  662|    608|    if (line.compare(0, 12, "MAXNGRAMSUGS", 12) == 0) {
  ------------------
  |  Branch (662:9): [True: 4, False: 604]
  ------------------
  663|      4|      if (!parse_num(line, &maxngramsugs, afflst)) {
  ------------------
  |  Branch (663:11): [True: 0, False: 4]
  ------------------
  664|      0|        finishFileMgr(afflst);
  665|      0|        return 1;
  666|      0|      }
  667|      4|    }
  668|       |
  669|    608|    if (line.compare(0, 11, "ONLYMAXDIFF", 11) == 0)
  ------------------
  |  Branch (669:9): [True: 0, False: 608]
  ------------------
  670|      0|      onlymaxdiff = 1;
  671|       |
  672|    608|    if (line.compare(0, 7, "MAXDIFF", 7) == 0) {
  ------------------
  |  Branch (672:9): [True: 0, False: 608]
  ------------------
  673|      0|      if (!parse_num(line, &maxdiff, afflst)) {
  ------------------
  |  Branch (673:11): [True: 0, False: 0]
  ------------------
  674|      0|        finishFileMgr(afflst);
  675|      0|        return 1;
  676|      0|      }
  677|      0|    }
  678|       |
  679|    608|    if (line.compare(0, 10, "MAXCPDSUGS", 10) == 0) {
  ------------------
  |  Branch (679:9): [True: 0, False: 608]
  ------------------
  680|      0|      if (!parse_num(line, &maxcpdsugs, afflst)) {
  ------------------
  |  Branch (680:11): [True: 0, False: 0]
  ------------------
  681|      0|        finishFileMgr(afflst);
  682|      0|        return 1;
  683|      0|      }
  684|      0|    }
  685|       |
  686|    608|    if (line.compare(0, 11, "NOSPLITSUGS", 11) == 0) {
  ------------------
  |  Branch (686:9): [True: 0, False: 608]
  ------------------
  687|      0|      nosplitsugs = 1;
  688|      0|    }
  689|       |
  690|    608|    if (line.compare(0, 9, "FULLSTRIP", 9) == 0) {
  ------------------
  |  Branch (690:9): [True: 0, False: 608]
  ------------------
  691|      0|      fullstrip = 1;
  692|      0|    }
  693|       |
  694|    608|    if (line.compare(0, 12, "SUGSWITHDOTS", 12) == 0) {
  ------------------
  |  Branch (694:9): [True: 0, False: 608]
  ------------------
  695|      0|      sugswithdots = 1;
  696|      0|    }
  697|       |
  698|       |    /* parse in the flag used by forbidden words */
  699|    608|    if (line.compare(0, 8, "KEEPCASE", 8) == 0) {
  ------------------
  |  Branch (699:9): [True: 2, False: 606]
  ------------------
  700|      2|      if (!parse_flag(line, &keepcase, afflst)) {
  ------------------
  |  Branch (700:11): [True: 0, False: 2]
  ------------------
  701|      0|        finishFileMgr(afflst);
  702|      0|        return 1;
  703|      0|      }
  704|      2|    }
  705|       |
  706|       |    /* parse in the flag used by `forceucase' */
  707|    608|    if (line.compare(0, 10, "FORCEUCASE", 10) == 0) {
  ------------------
  |  Branch (707:9): [True: 0, False: 608]
  ------------------
  708|      0|      if (!parse_flag(line, &forceucase, afflst)) {
  ------------------
  |  Branch (708:11): [True: 0, False: 0]
  ------------------
  709|      0|        finishFileMgr(afflst);
  710|      0|        return 1;
  711|      0|      }
  712|      0|    }
  713|       |
  714|       |    /* parse in the flag used by `warn' */
  715|    608|    if (line.compare(0, 4, "WARN", 4) == 0) {
  ------------------
  |  Branch (715:9): [True: 2, False: 606]
  ------------------
  716|      2|      if (!parse_flag(line, &warn, afflst)) {
  ------------------
  |  Branch (716:11): [True: 0, False: 2]
  ------------------
  717|      0|        finishFileMgr(afflst);
  718|      0|        return 1;
  719|      0|      }
  720|      2|    }
  721|       |
  722|    608|    if (line.compare(0, 10, "FORBIDWARN", 10) == 0) {
  ------------------
  |  Branch (722:9): [True: 0, False: 608]
  ------------------
  723|      0|      forbidwarn = 1;
  724|      0|    }
  725|       |
  726|       |    /* parse in the flag used by the affix generator */
  727|    608|    if (line.compare(0, 11, "SUBSTANDARD", 11) == 0) {
  ------------------
  |  Branch (727:9): [True: 0, False: 608]
  ------------------
  728|      0|      if (!parse_flag(line, &substandard, afflst)) {
  ------------------
  |  Branch (728:11): [True: 0, False: 0]
  ------------------
  729|      0|        finishFileMgr(afflst);
  730|      0|        return 1;
  731|      0|      }
  732|      0|    }
  733|       |
  734|    608|    if (line.compare(0, 11, "CHECKSHARPS", 11) == 0) {
  ------------------
  |  Branch (734:9): [True: 0, False: 608]
  ------------------
  735|      0|      checksharps = 1;
  736|      0|    }
  737|       |
  738|       |    /* parse this affix: P - prefix, S - suffix */
  739|       |    // affix type
  740|    608|    char ft = ' ';
  741|    608|    if (line.compare(0, 3, "PFX", 3) == 0)
  ------------------
  |  Branch (741:9): [True: 12, False: 596]
  ------------------
  742|     12|      ft = complexprefixes ? 'S' : 'P';
  ------------------
  |  Branch (742:12): [True: 4, False: 8]
  ------------------
  743|    608|    if (line.compare(0, 3, "SFX", 3) == 0)
  ------------------
  |  Branch (743:9): [True: 14, False: 594]
  ------------------
  744|     14|      ft = complexprefixes ? 'P' : 'S';
  ------------------
  |  Branch (744:12): [True: 0, False: 14]
  ------------------
  745|    608|    if (ft != ' ') {
  ------------------
  |  Branch (745:9): [True: 26, False: 582]
  ------------------
  746|     26|      if (dupflags_ini) {
  ------------------
  |  Branch (746:11): [True: 18, False: 8]
  ------------------
  747|     18|        memset(dupflags, 0, sizeof(dupflags));
  748|     18|        dupflags_ini = 0;
  749|     18|      }
  750|     26|      if (!parse_affix(line, ft, afflst, dupflags)) {
  ------------------
  |  Branch (750:11): [True: 0, False: 26]
  ------------------
  751|      0|        finishFileMgr(afflst);
  752|      0|        return 1;
  753|      0|      }
  754|     26|    }
  755|    608|  }
  756|       |
  757|     38|  finishFileMgr(afflst);
  758|       |  // affix trees are sorted now
  759|       |
  760|       |  // now we can speed up performance greatly taking advantage of the
  761|       |  // relationship between the affixes and the idea of "subsets".
  762|       |
  763|       |  // View each prefix as a potential leading subset of another and view
  764|       |  // each suffix (reversed) as a potential trailing subset of another.
  765|       |
  766|       |  // To illustrate this relationship if we know the prefix "ab" is found in the
  767|       |  // word to examine, only prefixes that "ab" is a leading subset of need be
  768|       |  // examined.
  769|       |  // Furthermore is "ab" is not present then none of the prefixes that "ab" is
  770|       |  // is a subset need be examined.
  771|       |  // The same argument goes for suffix string that are reversed.
  772|       |
  773|       |  // Then to top this off why not examine the first char of the word to quickly
  774|       |  // limit the set of prefixes to examine (i.e. the prefixes to examine must
  775|       |  // be leading supersets of the first character of the word (if they exist)
  776|       |
  777|       |  // To take advantage of this "subset" relationship, we need to add two links
  778|       |  // from entry.  One to take next if the current prefix is found (call it
  779|       |  // nexteq)
  780|       |  // and one to take next if the current prefix is not found (call it nextne).
  781|       |
  782|       |  // Since we have built ordered lists, all that remains is to properly
  783|       |  // initialize
  784|       |  // the nextne and nexteq pointers that relate them
  785|       |
  786|     38|  process_pfx_order();
  787|     38|  process_sfx_order();
  788|       |
  789|     38|  return 0;
  790|     38|}
_ZN8AffixMgr13build_pfxtreeEP8PfxEntry:
  796|      8|int AffixMgr::build_pfxtree(PfxEntry* pfxptr) {
  797|      8|  PfxEntry* ptr;
  798|      8|  PfxEntry* pptr;
  799|      8|  PfxEntry* ep = pfxptr;
  800|       |
  801|       |  // get the right starting points
  802|      8|  const char* key = ep->getKey();
  803|      8|  const auto flg = (unsigned char)(ep->getFlag() & 0x00FF);
  804|       |
  805|       |  // first index by flag which must exist
  806|      8|  ptr = pFlag[flg];
  807|      8|  ep->setFlgNxt(ptr);
  808|      8|  pFlag[flg] = ep;
  809|       |
  810|       |  // handle the special case of null affix string
  811|      8|  if (*key == '\0') {
  ------------------
  |  Branch (811:7): [True: 2, False: 6]
  ------------------
  812|       |    // always inset them at head of list at element 0
  813|      2|    ptr = pStart[0];
  814|      2|    ep->setNext(ptr);
  815|      2|    pStart[0] = ep;
  816|      2|    return 0;
  817|      2|  }
  818|       |
  819|       |  // now handle the normal case
  820|      6|  ep->setNextEQ(nullptr);
  821|      6|  ep->setNextNE(nullptr);
  822|       |
  823|      6|  unsigned char sp = *((const unsigned char*)key);
  824|      6|  ptr = pStart[sp];
  825|       |
  826|       |  // handle the first insert
  827|      6|  if (!ptr) {
  ------------------
  |  Branch (827:7): [True: 4, False: 2]
  ------------------
  828|      4|    pStart[sp] = ep;
  829|      4|    return 0;
  830|      4|  }
  831|       |
  832|       |  // otherwise use binary tree insertion so that a sorted
  833|       |  // list can easily be generated later
  834|      2|  pptr = nullptr;
  835|      2|  for (;;) {
  836|      2|    pptr = ptr;
  837|      2|    if (strcmp(ep->getKey(), ptr->getKey()) <= 0) {
  ------------------
  |  Branch (837:9): [True: 0, False: 2]
  ------------------
  838|      0|      ptr = ptr->getNextEQ();
  839|      0|      if (!ptr) {
  ------------------
  |  Branch (839:11): [True: 0, False: 0]
  ------------------
  840|      0|        pptr->setNextEQ(ep);
  841|      0|        break;
  842|      0|      }
  843|      2|    } else {
  844|      2|      ptr = ptr->getNextNE();
  845|      2|      if (!ptr) {
  ------------------
  |  Branch (845:11): [True: 2, False: 0]
  ------------------
  846|      2|        pptr->setNextNE(ep);
  847|      2|        break;
  848|      2|      }
  849|      2|    }
  850|      2|  }
  851|      2|  return 0;
  852|      6|}
_ZN8AffixMgr13build_sfxtreeEP8SfxEntry:
  857|     34|int AffixMgr::build_sfxtree(SfxEntry* sfxptr) {
  858|       |
  859|     34|  sfxptr->initReverseWord();
  860|       |
  861|     34|  SfxEntry* ptr;
  862|     34|  SfxEntry* pptr;
  863|     34|  SfxEntry* ep = sfxptr;
  864|       |
  865|       |  /* get the right starting point */
  866|     34|  const char* key = ep->getKey();
  867|     34|  const auto flg = (unsigned char)(ep->getFlag() & 0x00FF);
  868|       |
  869|       |  // first index by flag which must exist
  870|     34|  ptr = sFlag[flg];
  871|     34|  ep->setFlgNxt(ptr);
  872|     34|  sFlag[flg] = ep;
  873|       |
  874|       |  // next index by affix string
  875|       |
  876|       |  // handle the special case of null affix string
  877|     34|  if (*key == '\0') {
  ------------------
  |  Branch (877:7): [True: 0, False: 34]
  ------------------
  878|       |    // always inset them at head of list at element 0
  879|      0|    ptr = sStart[0];
  880|      0|    ep->setNext(ptr);
  881|      0|    sStart[0] = ep;
  882|      0|    return 0;
  883|      0|  }
  884|       |
  885|       |  // now handle the normal case
  886|     34|  ep->setNextEQ(nullptr);
  887|     34|  ep->setNextNE(nullptr);
  888|       |
  889|     34|  unsigned char sp = *((const unsigned char*)key);
  890|     34|  ptr = sStart[sp];
  891|       |
  892|       |  // handle the first insert
  893|     34|  if (!ptr) {
  ------------------
  |  Branch (893:7): [True: 22, False: 12]
  ------------------
  894|     22|    sStart[sp] = ep;
  895|     22|    return 0;
  896|     22|  }
  897|       |
  898|       |  // otherwise use binary tree insertion so that a sorted
  899|       |  // list can easily be generated later
  900|     12|  pptr = nullptr;
  901|     20|  for (;;) {
  902|     20|    pptr = ptr;
  903|     20|    if (strcmp(ep->getKey(), ptr->getKey()) <= 0) {
  ------------------
  |  Branch (903:9): [True: 18, False: 2]
  ------------------
  904|     18|      ptr = ptr->getNextEQ();
  905|     18|      if (!ptr) {
  ------------------
  |  Branch (905:11): [True: 10, False: 8]
  ------------------
  906|     10|        pptr->setNextEQ(ep);
  907|     10|        break;
  908|     10|      }
  909|     18|    } else {
  910|      2|      ptr = ptr->getNextNE();
  911|      2|      if (!ptr) {
  ------------------
  |  Branch (911:11): [True: 2, False: 0]
  ------------------
  912|      2|        pptr->setNextNE(ep);
  913|      2|        break;
  914|      2|      }
  915|      2|    }
  916|     20|  }
  917|     12|  return 0;
  918|     34|}
_ZN8AffixMgr24process_pfx_tree_to_listEv:
  921|     38|int AffixMgr::process_pfx_tree_to_list() {
  922|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (922:19): [True: 9.69k, False: 38]
  ------------------
  923|  9.69k|    pStart[i] = process_pfx_in_order(pStart[i], nullptr);
  924|  9.69k|  }
  925|     38|  return 0;
  926|     38|}
_ZN8AffixMgr20process_pfx_in_orderEP8PfxEntryS1_:
  928|  9.70k|PfxEntry* AffixMgr::process_pfx_in_order(PfxEntry* ptr, PfxEntry* nptr) {
  929|  9.70k|  if (ptr) {
  ------------------
  |  Branch (929:7): [True: 6, False: 9.69k]
  ------------------
  930|      6|    nptr = process_pfx_in_order(ptr->getNextNE(), nptr);
  931|      6|    ptr->setNext(nptr);
  932|      6|    nptr = process_pfx_in_order(ptr->getNextEQ(), ptr);
  933|      6|  }
  934|  9.70k|  return nptr;
  935|  9.70k|}
_ZN8AffixMgr24process_sfx_tree_to_listEv:
  938|     38|int AffixMgr::process_sfx_tree_to_list() {
  939|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (939:19): [True: 9.69k, False: 38]
  ------------------
  940|  9.69k|    sStart[i] = process_sfx_in_order(sStart[i], nullptr);
  941|  9.69k|  }
  942|     38|  return 0;
  943|     38|}
_ZN8AffixMgr20process_sfx_in_orderEP8SfxEntryS1_:
  945|  9.75k|SfxEntry* AffixMgr::process_sfx_in_order(SfxEntry* ptr, SfxEntry* nptr) {
  946|  9.75k|  if (ptr) {
  ------------------
  |  Branch (946:7): [True: 34, False: 9.72k]
  ------------------
  947|     34|    nptr = process_sfx_in_order(ptr->getNextNE(), nptr);
  948|     34|    ptr->setNext(nptr);
  949|     34|    nptr = process_sfx_in_order(ptr->getNextEQ(), ptr);
  950|     34|  }
  951|  9.75k|  return nptr;
  952|  9.75k|}
_ZN8AffixMgr17process_pfx_orderEv:
  956|     38|int AffixMgr::process_pfx_order() {
  957|     38|  PfxEntry* ptr;
  958|       |
  959|       |  // loop through each prefix list starting point
  960|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (960:19): [True: 9.69k, False: 38]
  ------------------
  961|  9.69k|    ptr = pStart[i];
  962|       |
  963|       |    // look through the remainder of the list
  964|       |    //  and find next entry with affix that
  965|       |    // the current one is not a subset of
  966|       |    // mark that as destination for NextNE
  967|       |    // use next in list that you are a subset
  968|       |    // of as NextEQ
  969|       |
  970|  9.69k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (970:12): [True: 6, False: 9.69k]
  ------------------
  971|      6|      PfxEntry* nptr = ptr->getNext();
  972|      8|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (972:14): [True: 2, False: 6]
  ------------------
  973|      2|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (973:13): [True: 0, False: 2]
  ------------------
  974|      0|          break;
  975|      2|      }
  976|      6|      ptr->setNextNE(nptr);
  977|      6|      ptr->setNextEQ(nullptr);
  978|      6|      if ((ptr->getNext()) &&
  ------------------
  |  Branch (978:11): [True: 2, False: 4]
  ------------------
  979|      2|          isSubset(ptr->getKey(), (ptr->getNext())->getKey()))
  ------------------
  |  Branch (979:11): [True: 2, False: 0]
  ------------------
  980|      2|        ptr->setNextEQ(ptr->getNext());
  981|      6|    }
  982|       |
  983|       |    // now clean up by adding smart search termination strings:
  984|       |    // if you are already a superset of the previous prefix
  985|       |    // but not a subset of the next, search can end here
  986|       |    // so set NextNE properly
  987|       |
  988|  9.69k|    ptr = pStart[i];
  989|  9.69k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (989:12): [True: 6, False: 9.69k]
  ------------------
  990|      6|      PfxEntry* nptr = ptr->getNext();
  991|      6|      PfxEntry* mptr = nullptr;
  992|      8|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (992:14): [True: 2, False: 6]
  ------------------
  993|      2|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (993:13): [True: 0, False: 2]
  ------------------
  994|      0|          break;
  995|      2|        mptr = nptr;
  996|      2|      }
  997|      6|      if (mptr)
  ------------------
  |  Branch (997:11): [True: 2, False: 4]
  ------------------
  998|      2|        mptr->setNextNE(nullptr);
  999|      6|    }
 1000|  9.69k|  }
 1001|     38|  return 0;
 1002|     38|}
_ZN8AffixMgr17process_sfx_orderEv:
 1006|     38|int AffixMgr::process_sfx_order() {
 1007|     38|  SfxEntry* ptr;
 1008|       |
 1009|       |  // loop through each prefix list starting point
 1010|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (1010:19): [True: 9.69k, False: 38]
  ------------------
 1011|  9.69k|    ptr = sStart[i];
 1012|       |
 1013|       |    // look through the remainder of the list
 1014|       |    //  and find next entry with affix that
 1015|       |    // the current one is not a subset of
 1016|       |    // mark that as destination for NextNE
 1017|       |    // use next in list that you are a subset
 1018|       |    // of as NextEQ
 1019|       |
 1020|  9.72k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (1020:12): [True: 34, False: 9.69k]
  ------------------
 1021|     34|      SfxEntry* nptr = ptr->getNext();
 1022|     52|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (1022:14): [True: 20, False: 32]
  ------------------
 1023|     20|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (1023:13): [True: 2, False: 18]
  ------------------
 1024|      2|          break;
 1025|     20|      }
 1026|     34|      ptr->setNextNE(nptr);
 1027|     34|      ptr->setNextEQ(nullptr);
 1028|     34|      if ((ptr->getNext()) &&
  ------------------
  |  Branch (1028:11): [True: 12, False: 22]
  ------------------
 1029|     12|          isSubset(ptr->getKey(), (ptr->getNext())->getKey()))
  ------------------
  |  Branch (1029:11): [True: 10, False: 2]
  ------------------
 1030|     10|        ptr->setNextEQ(ptr->getNext());
 1031|     34|    }
 1032|       |
 1033|       |    // now clean up by adding smart search termination strings:
 1034|       |    // if you are already a superset of the previous suffix
 1035|       |    // but not a subset of the next, search can end here
 1036|       |    // so set NextNE properly
 1037|       |
 1038|  9.69k|    ptr = sStart[i];
 1039|  9.72k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (1039:12): [True: 34, False: 9.69k]
  ------------------
 1040|     34|      SfxEntry* nptr = ptr->getNext();
 1041|     34|      SfxEntry* mptr = nullptr;
 1042|     52|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (1042:14): [True: 20, False: 32]
  ------------------
 1043|     20|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (1043:13): [True: 2, False: 18]
  ------------------
 1044|      2|          break;
 1045|     18|        mptr = nptr;
 1046|     18|      }
 1047|     34|      if (mptr)
  ------------------
  |  Branch (1047:11): [True: 10, False: 24]
  ------------------
 1048|     10|        mptr->setNextNE(nullptr);
 1049|     34|    }
 1050|  9.69k|  }
 1051|     38|  return 0;
 1052|     38|}
_ZN8AffixMgr7condlenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1065|      8|int AffixMgr::condlen(const std::string& s) {
 1066|      8|  int l = 0;
 1067|      8|  bool group = false;
 1068|      8|  size_t i = 0;
 1069|     42|  while (i < s.size()) {
  ------------------
  |  Branch (1069:10): [True: 34, False: 8]
  ------------------
 1070|     34|    if (s[i] == '[') {
  ------------------
  |  Branch (1070:9): [True: 4, False: 30]
  ------------------
 1071|      4|      group = true;
 1072|      4|      ++l;
 1073|      4|      ++i;
 1074|     30|    } else if (s[i] == ']') {
  ------------------
  |  Branch (1074:16): [True: 4, False: 26]
  ------------------
 1075|      4|      group = false;
 1076|      4|      ++i;
 1077|     26|    } else if (group) {
  ------------------
  |  Branch (1077:16): [True: 18, False: 8]
  ------------------
 1078|     18|      ++i;
 1079|     18|    } else {
 1080|      8|      ++l;
 1081|      8|      i = utf8 ? utf8_next(s, i) : i + 1;
  ------------------
  |  Branch (1081:11): [True: 8, False: 0]
  ------------------
 1082|      8|    }
 1083|     34|  }
 1084|      8|  return l;
 1085|      8|}
_ZN8AffixMgr8encodeitER8AffEntryRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1087|     42|int AffixMgr::encodeit(AffEntry& entry, const std::string& cs) {
 1088|     42|  if (cs.compare(".") != 0) {
  ------------------
  |  Branch (1088:7): [True: 8, False: 34]
  ------------------
 1089|      8|    entry.numconds = (char)condlen(cs);
 1090|      8|    const size_t cslen = cs.size();
 1091|      8|    const size_t short_part = std::min<size_t>(MAXCONDLEN, cslen);
  ------------------
  |  |   93|      8|#define MAXCONDLEN 20
  ------------------
 1092|      8|    memcpy(entry.c.conds, cs.data(), short_part);
 1093|      8|    if (short_part < MAXCONDLEN) {
  ------------------
  |  |   93|      8|#define MAXCONDLEN 20
  ------------------
  |  Branch (1093:9): [True: 8, False: 0]
  ------------------
 1094|       |      //blank out the remaining space
 1095|      8|      memset(entry.c.conds + short_part, 0, MAXCONDLEN - short_part);
  ------------------
  |  |   93|      8|#define MAXCONDLEN 20
  ------------------
 1096|      8|    } else if (cs[MAXCONDLEN]) {
  ------------------
  |  |   93|      0|#define MAXCONDLEN 20
  ------------------
  |  Branch (1096:16): [True: 0, False: 0]
  ------------------
 1097|       |      //there is more conditions than fit in fixed space, so its
 1098|       |      //a long condition
 1099|      0|      entry.opts |= aeLONGCOND;
  ------------------
  |  |   69|      0|#define aeLONGCOND (1 << 4)
  ------------------
 1100|      0|      size_t remaining = cs.size() - MAXCONDLEN_1;
  ------------------
  |  |   94|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   93|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
 1101|      0|      entry.c.l.conds2 = new char[1 + remaining];
 1102|      0|      memcpy(entry.c.l.conds2, cs.data() + MAXCONDLEN_1, remaining);
  ------------------
  |  |   94|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   93|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
 1103|      0|      entry.c.l.conds2[remaining] = 0;
 1104|      0|    }
 1105|     34|  } else {
 1106|     34|    entry.numconds = 0;
 1107|     34|    entry.c.conds[0] = '\0';
 1108|     34|  }
 1109|     42|  return 0;
 1110|     42|}
_ZN8AffixMgr12prefix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratchtt:
 1128|   576M|                                      const FLAG avoidflag) {
 1129|   576M|  struct hentry* rv = nullptr;
 1130|       |
 1131|   576M|  pfx = nullptr;
 1132|   576M|  pfxappnd = nullptr;
 1133|   576M|  sfxappnd = nullptr;
 1134|   576M|  sfxextra = 0;
 1135|       |
 1136|   576M|  TraceCtx* t = trace_on(scratch.trace);
 1137|   576M|  int candidates = 0;
 1138|       |
 1139|       |  // first handle the special case of 0 length prefixes
 1140|   576M|  PfxEntry* pe = pStart[0];
 1141|   577M|  while (pe) {
  ------------------
  |  Branch (1141:10): [True: 1.51M, False: 576M]
  ------------------
 1142|  1.51M|    if (
 1143|       |        // fogemorpheme
 1144|  1.51M|        ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   75|  1.51M|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1144:10): [True: 0, False: 1.51M]
  ------------------
 1145|  1.51M|         !(pe->getCont() &&
  ------------------
  |  Branch (1145:12): [True: 1.51M, False: 0]
  ------------------
 1146|  1.51M|           (TESTAFF(pe->getCont(), onlyincompound, pe->getContLen())))) &&
  ------------------
  |  |  102|  1.51M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1146:12): [True: 0, False: 1.51M]
  ------------------
 1147|       |        // permit prefixes in compounds
 1148|  1.51M|        ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   77|  1.51M|#define IN_CPD_END 2
  ------------------
  |  Branch (1148:10): [True: 1.51M, False: 0]
  ------------------
 1149|      0|         (pe->getCont() &&
  ------------------
  |  Branch (1149:11): [True: 0, False: 0]
  ------------------
 1150|  1.51M|          (TESTAFF(pe->getCont(), compoundpermitflag, pe->getContLen()))))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1150:11): [True: 0, False: 0]
  ------------------
 1151|       |      // check prefix
 1152|  1.51M|      ++candidates;
 1153|  1.51M|      rv = pe->checkword(word, start, len, in_compound, needflag, scratch);
 1154|       |      // Skip a stem with the avoid flag and keep scanning the other prefixes.
 1155|  1.51M|      if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |   99|  1.51M|#define FLAG_NULL 0x00
  ------------------
                    if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1155:11): [True: 0, False: 1.51M]
  |  Branch (1155:17): [True: 0, False: 0]
  ------------------
 1156|      0|        trace_avoidflag(t, avoidflag, rv);
 1157|      0|        rv = nullptr;
 1158|      0|      }
 1159|  1.51M|      if (rv) {
  ------------------
  |  Branch (1159:11): [True: 0, False: 1.51M]
  ------------------
 1160|      0|        pfx = pe;  // BUG: pfx not stateless
 1161|      0|        return rv;
 1162|      0|      }
 1163|  1.51M|    }
 1164|  1.51M|    pe = pe->getNext();
 1165|  1.51M|  }
 1166|       |
 1167|       |  // now handle the general case
 1168|   576M|  unsigned char sp = word[start];
 1169|   576M|  PfxEntry* pptr = pStart[sp];
 1170|       |
 1171|   576M|  while (pptr) {
  ------------------
  |  Branch (1171:10): [True: 83.3k, False: 576M]
  ------------------
 1172|  83.3k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1172:9): [True: 65.8k, False: 17.5k]
  ------------------
 1173|  65.8k|      if (
 1174|       |          // fogemorpheme
 1175|  65.8k|          ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   75|  65.8k|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1175:12): [True: 0, False: 65.8k]
  ------------------
 1176|  65.8k|           !(pptr->getCont() &&
  ------------------
  |  Branch (1176:14): [True: 57.4k, False: 8.31k]
  ------------------
 1177|  57.4k|             (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen())))) &&
  ------------------
  |  |  102|  57.4k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1177:14): [True: 0, False: 57.4k]
  ------------------
 1178|       |          // permit prefixes in compounds
 1179|  65.8k|          ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   77|  65.8k|#define IN_CPD_END 2
  ------------------
  |  Branch (1179:12): [True: 65.8k, False: 0]
  ------------------
 1180|      0|           (pptr->getCont() && (TESTAFF(pptr->getCont(), compoundpermitflag,
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1180:13): [True: 0, False: 0]
  |  Branch (1180:32): [True: 0, False: 0]
  ------------------
 1181|  65.8k|                                        pptr->getContLen()))))) {
 1182|       |        // check prefix
 1183|  65.8k|        ++candidates;
 1184|  65.8k|        rv = pptr->checkword(word, start, len, in_compound, needflag, scratch);
 1185|  65.8k|        if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |   99|  65.8k|#define FLAG_NULL 0x00
  ------------------
                      if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1185:13): [True: 0, False: 65.8k]
  |  Branch (1185:19): [True: 0, False: 0]
  ------------------
 1186|      0|          trace_avoidflag(t, avoidflag, rv);
 1187|      0|          rv = nullptr;
 1188|      0|        }
 1189|  65.8k|        if (rv) {
  ------------------
  |  Branch (1189:13): [True: 0, False: 65.8k]
  ------------------
 1190|      0|          pfx = pptr;  // BUG: pfx not stateless
 1191|      0|          return rv;
 1192|      0|        }
 1193|  65.8k|      }
 1194|  65.8k|      pptr = pptr->getNextEQ();
 1195|  65.8k|    } else {
 1196|  17.5k|      pptr = pptr->getNextNE();
 1197|  17.5k|    }
 1198|  83.3k|  }
 1199|       |
 1200|       |  // a pass that had nothing to try says so, which is different from a pass that
 1201|       |  // did not run
 1202|   576M|  if (t && candidates == 0)
  ------------------
  |  Branch (1202:7): [True: 0, False: 576M]
  |  Branch (1202:12): [True: 0, False: 0]
  ------------------
 1203|      0|    trace(*t, "pfx \"%s\" candidates=0", word.substr(start, len).c_str());
 1204|       |
 1205|   576M|  return nullptr;
 1206|   576M|}
_ZN8AffixMgr19prefix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1214|  17.3M|                                             const FLAG needflag) {
 1215|  17.3M|  struct hentry* rv = nullptr;
 1216|       |
 1217|  17.3M|  pfx = nullptr;
 1218|  17.3M|  sfxappnd = nullptr;
 1219|  17.3M|  sfxextra = 0;
 1220|       |
 1221|       |  // first handle the special case of 0 length prefixes
 1222|  17.3M|  PfxEntry* pe = pStart[0];
 1223|       |
 1224|  18.8M|  while (pe) {
  ------------------
  |  Branch (1224:10): [True: 1.51M, False: 17.3M]
  ------------------
 1225|  1.51M|    rv = pe->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1226|  1.51M|    if (rv)
  ------------------
  |  Branch (1226:9): [True: 0, False: 1.51M]
  ------------------
 1227|      0|      return rv;
 1228|  1.51M|    pe = pe->getNext();
 1229|  1.51M|  }
 1230|       |
 1231|       |  // now handle the general case
 1232|  17.3M|  unsigned char sp = word[start];
 1233|  17.3M|  PfxEntry* pptr = pStart[sp];
 1234|       |
 1235|  17.3M|  while (pptr) {
  ------------------
  |  Branch (1235:10): [True: 75.0k, False: 17.3M]
  ------------------
 1236|  75.0k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1236:9): [True: 57.4k, False: 17.5k]
  ------------------
 1237|  57.4k|      rv = pptr->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1238|  57.4k|      if (rv) {
  ------------------
  |  Branch (1238:11): [True: 0, False: 57.4k]
  ------------------
 1239|      0|        pfx = pptr;
 1240|      0|        return rv;
 1241|      0|      }
 1242|  57.4k|      pptr = pptr->getNextEQ();
 1243|  57.4k|    } else {
 1244|  17.5k|      pptr = pptr->getNextNE();
 1245|  17.5k|    }
 1246|  75.0k|  }
 1247|       |
 1248|  17.3M|  return nullptr;
 1249|  17.3M|}
_ZN8AffixMgr18prefix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1257|  13.1k|                                         const FLAG needflag) {
 1258|       |
 1259|       |  // many prefixes can analyse a word the same way
 1260|  13.1k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  122|  13.1k|#define MSEP_REC '\n'
  ------------------
 1261|       |
 1262|  13.1k|  pfx = nullptr;
 1263|  13.1k|  sfxappnd = nullptr;
 1264|  13.1k|  sfxextra = 0;
 1265|       |
 1266|       |  // first handle the special case of 0 length prefixes
 1267|  13.1k|  PfxEntry* pe = pStart[0];
 1268|  13.7k|  while (pe) {
  ------------------
  |  Branch (1268:10): [True: 690, False: 13.1k]
  ------------------
 1269|    690|    std::string st = pe->check_morph(word, start, len, in_compound, needflag, scratch);
 1270|    690|    if (!st.empty()) {
  ------------------
  |  Branch (1270:9): [True: 0, False: 690]
  ------------------
 1271|      0|      result.append(st);
 1272|      0|    }
 1273|    690|    pe = pe->getNext();
 1274|    690|  }
 1275|       |
 1276|       |  // now handle the general case
 1277|  13.1k|  unsigned char sp = word[start];
 1278|  13.1k|  PfxEntry* pptr = pStart[sp];
 1279|       |
 1280|  13.1k|  while (pptr) {
  ------------------
  |  Branch (1280:10): [True: 0, False: 13.1k]
  ------------------
 1281|      0|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1281:9): [True: 0, False: 0]
  ------------------
 1282|      0|      std::string st = pptr->check_morph(word, start, len, in_compound, needflag, scratch);
 1283|      0|      if (!st.empty()) {
  ------------------
  |  Branch (1283:11): [True: 0, False: 0]
  ------------------
 1284|       |        // fogemorpheme
 1285|      0|        if ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   75|      0|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1285:13): [True: 0, False: 0]
  ------------------
 1286|      0|            !((pptr->getCont() && (TESTAFF(pptr->getCont(), onlyincompound,
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1286:16): [True: 0, False: 0]
  |  Branch (1286:35): [True: 0, False: 0]
  ------------------
 1287|      0|                                           pptr->getContLen()))))) {
 1288|      0|          result.append(st);
 1289|      0|          pfx = pptr;
 1290|      0|        }
 1291|      0|      }
 1292|      0|      pptr = pptr->getNextEQ();
 1293|      0|    } else {
 1294|      0|      pptr = pptr->getNextNE();
 1295|      0|    }
 1296|      0|  }
 1297|       |
 1298|  13.1k|  return result.join();
 1299|  13.1k|}
_ZN8AffixMgr25prefix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1307|  4.14k|                                                const FLAG needflag) {
 1308|       |  // every prefix crosses with every pair of suffixes
 1309|  4.14k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  122|  4.14k|#define MSEP_REC '\n'
  ------------------
 1310|       |
 1311|  4.14k|  pfx = nullptr;
 1312|  4.14k|  sfxappnd = nullptr;
 1313|  4.14k|  sfxextra = 0;
 1314|       |
 1315|       |  // first handle the special case of 0 length prefixes
 1316|  4.14k|  PfxEntry* pe = pStart[0];
 1317|  4.83k|  while (pe) {
  ------------------
  |  Branch (1317:10): [True: 690, False: 4.14k]
  ------------------
 1318|    690|    std::string st = pe->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1319|    690|    if (!st.empty()) {
  ------------------
  |  Branch (1319:9): [True: 0, False: 690]
  ------------------
 1320|      0|      result.append(st);
 1321|      0|    }
 1322|    690|    pe = pe->getNext();
 1323|    690|  }
 1324|       |
 1325|       |  // now handle the general case
 1326|  4.14k|  unsigned char sp = word[start];
 1327|  4.14k|  PfxEntry* pptr = pStart[sp];
 1328|       |
 1329|  4.14k|  while (pptr) {
  ------------------
  |  Branch (1329:10): [True: 0, False: 4.14k]
  ------------------
 1330|      0|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1330:9): [True: 0, False: 0]
  ------------------
 1331|      0|      std::string st = pptr->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1332|      0|      if (!st.empty()) {
  ------------------
  |  Branch (1332:11): [True: 0, False: 0]
  ------------------
 1333|      0|        result.append(st);
 1334|      0|        pfx = pptr;
 1335|      0|      }
 1336|      0|      pptr = pptr->getNextEQ();
 1337|      0|    } else {
 1338|      0|      pptr = pptr->getNextNE();
 1339|      0|    }
 1340|      0|  }
 1341|       |
 1342|  4.14k|  return result.join();
 1343|  4.14k|}
_ZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1689|    728|short AffixMgr::get_syllable(const std::string& word) {
 1690|    728|  if (cpdmaxsyllable == 0)
  ------------------
  |  Branch (1690:7): [True: 0, False: 728]
  ------------------
 1691|      0|    return 0;
 1692|       |
 1693|    728|  short num = 0;
 1694|       |
 1695|    728|  if (!utf8) {
  ------------------
  |  Branch (1695:7): [True: 0, False: 728]
  ------------------
 1696|      0|    num = (short)std::count_if(word.begin(), word.end(),
 1697|      0|          [&](char c) {
 1698|      0|            return std::binary_search(cpdvowels.begin(), cpdvowels.end(), c);
 1699|      0|          });
 1700|    728|  } else if (!cpdvowels_utf16.empty()) {
  ------------------
  |  Branch (1700:14): [True: 728, False: 0]
  ------------------
 1701|    728|    std::vector<w_char> w;
 1702|    728|    u8_u16(w, word);
 1703|    728|    num = (short)std::count_if(w.begin(), w.end(),
 1704|    728|          [&](w_char wc) {
 1705|    728|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1706|    728|          });
 1707|    728|  }
 1708|       |
 1709|    728|  return num;
 1710|    728|}
_ZN8AffixMgr10setcminmaxEPmS0_PKcm:
 1712|  24.1M|void AffixMgr::setcminmax(size_t* cmin, size_t* cmax, const char* word, size_t len) {
 1713|  24.1M|  if (utf8) {
  ------------------
  |  Branch (1713:7): [True: 1.69M, False: 22.4M]
  ------------------
 1714|  1.69M|    int i;
 1715|  5.04M|    for (*cmin = 0, i = 0; (i < cpdmin) && *cmin < len; i++) {
  ------------------
  |  Branch (1715:28): [True: 3.37M, False: 1.66M]
  |  Branch (1715:44): [True: 3.35M, False: 27.3k]
  ------------------
 1716|  3.75M|      for ((*cmin)++; *cmin < len && is_utf8_cont(word[*cmin]); (*cmin)++)
  ------------------
  |  Branch (1716:23): [True: 3.71M, False: 44.5k]
  |  Branch (1716:38): [True: 404k, False: 3.30M]
  ------------------
 1717|   404k|        ;
 1718|  3.35M|    }
 1719|  3.37M|    for (*cmax = len, i = 0; (i < (cpdmin - 1)) && *cmax > 0; i++) {
  ------------------
  |  Branch (1719:30): [True: 1.69M, False: 1.68M]
  |  Branch (1719:52): [True: 1.68M, False: 3.96k]
  ------------------
 1720|  2.62M|      for ((*cmax)--; *cmax > 0 && is_utf8_cont(word[*cmax]); (*cmax)--)
  ------------------
  |  Branch (1720:23): [True: 2.60M, False: 23.3k]
  |  Branch (1720:36): [True: 941k, False: 1.66M]
  ------------------
 1721|   941k|        ;
 1722|  1.68M|    }
 1723|  22.4M|  } else {
 1724|  22.4M|    *cmin = cpdmin;
 1725|  22.4M|    *cmax = len - cpdmin + 1;
 1726|  22.4M|  }
 1727|  24.1M|}
_ZN8AffixMgr14compound_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEssssPP6hentrySB_ccPiR12AffixScratch:
 1741|  24.1M|                                        AffixScratch& scratch) {
 1742|  24.1M|  short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2;
 1743|  24.1M|  hentry *rv = nullptr, *rv_first;
 1744|  24.1M|  std::string st;
 1745|  24.1M|  char ch = '\0', affixed;
 1746|  24.1M|  size_t cmin, cmax;
 1747|  24.1M|  int striple = 0, soldi = 0, oldcmin = 0, oldcmax = 0, oldlen = 0, checkedstriple = 0;
 1748|  24.1M|  hentry** oldwords = words;
 1749|  24.1M|  size_t scpd = 0, len = word.size();
 1750|       |
 1751|  24.1M|  TraceCtx* t = trace_on(scratch.trace);
 1752|       |
 1753|       |  // protect subsequent words[wnum + 1] reads and any recursion
 1754|  24.1M|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (1754:7): [True: 0, False: 24.1M]
  ------------------
 1755|      0|    return nullptr;
 1756|       |
 1757|  24.1M|  int checked_prefix;
 1758|       |
 1759|       |  // add a time limit to handle possible
 1760|       |  // combinatorical explosion of the overlapping words
 1761|       |
 1762|  24.1M|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  24.1M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1763|  24.1M|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  24.1M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1764|       |
 1765|       |  // get the current time
 1766|  24.1M|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 1767|       |
 1768|  24.1M|  if (wnum == 0) {
  ------------------
  |  Branch (1768:7): [True: 24.1M, False: 361]
  ------------------
 1769|       |      // set the start time
 1770|  24.1M|      clock_time_start = clock_now;
 1771|  24.1M|      timelimit_exceeded = false;
 1772|  24.1M|  }
 1773|    361|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  109|    361|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1773:12): [True: 0, False: 361]
  ------------------
 1774|      0|      timelimit_exceeded = true;
 1775|       |
 1776|  24.1M|  setcminmax(&cmin, &cmax, word.c_str(), len);
 1777|       |
 1778|  24.1M|  st.assign(word);
 1779|       |
 1780|   549M|  for (size_t i = cmin; i < cmax; ++i) {
  ------------------
  |  Branch (1780:25): [True: 526M, False: 22.9M]
  ------------------
 1781|       |    // go to end of the UTF-8 character
 1782|   526M|    if (utf8) {
  ------------------
  |  Branch (1782:9): [True: 41.4M, False: 485M]
  ------------------
 1783|  49.2M|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (1783:14): [True: 7.79M, False: 41.4M]
  ------------------
 1784|  7.79M|        ;
 1785|  41.4M|      if (i >= cmax)
  ------------------
  |  Branch (1785:11): [True: 158k, False: 41.3M]
  ------------------
 1786|   158k|        return nullptr;
 1787|  41.4M|    }
 1788|       |
 1789|   526M|    words = oldwords;
 1790|   526M|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (1790:23): [True: 0, False: 526M]
  ------------------
 1791|       |
 1792|   526M|    do {  // onlycpdrule loop
 1793|       |
 1794|   526M|      oldnumsyllable = numsyllable;
 1795|   526M|      oldwordnum = wordnum;
 1796|   526M|      checked_prefix = 0;
 1797|       |
 1798|   526M|      do {  // simplified checkcompoundpattern loop
 1799|       |
 1800|   526M|        if (timelimit_exceeded ||
  ------------------
  |  Branch (1800:13): [True: 0, False: 526M]
  |  Branch (1800:13): [True: 0, False: 526M]
  ------------------
 1801|   526M|            std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  109|   526M|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1801:13): [True: 0, False: 526M]
  ------------------
 1802|      0|          if (t && !timelimit_exceeded)
  ------------------
  |  Branch (1802:15): [True: 0, False: 0]
  |  Branch (1802:20): [True: 0, False: 0]
  ------------------
 1803|      0|            trace(*t, "test timelimit -> fail, the compound search stops here and gives up");
 1804|      0|          timelimit_exceeded = true;
 1805|      0|          return nullptr;
 1806|      0|        }
 1807|       |
 1808|   526M|        if (scpd > 0) {
  ------------------
  |  Branch (1808:13): [True: 0, False: 526M]
  ------------------
 1809|      0|          for (; scpd <= checkcpdtable.size() &&
  ------------------
  |  Branch (1809:18): [True: 0, False: 0]
  ------------------
 1810|      0|                 (checkcpdtable[scpd - 1].pattern3.empty() ||
  ------------------
  |  Branch (1810:19): [True: 0, False: 0]
  ------------------
 1811|      0|                  i > word.size() ||
  ------------------
  |  Branch (1811:19): [True: 0, False: 0]
  ------------------
 1812|      0|                  word.compare(i, checkcpdtable[scpd - 1].pattern3.size(), checkcpdtable[scpd - 1].pattern3) != 0);
  ------------------
  |  Branch (1812:19): [True: 0, False: 0]
  ------------------
 1813|      0|               scpd++)
 1814|      0|            ;
 1815|       |
 1816|      0|          if (scpd > checkcpdtable.size())
  ------------------
  |  Branch (1816:15): [True: 0, False: 0]
  ------------------
 1817|      0|            break;  // break simplified checkcompoundpattern loop
 1818|      0|          st.replace(i, std::string::npos, checkcpdtable[scpd - 1].pattern);
 1819|      0|          soldi = i;
 1820|      0|          i += checkcpdtable[scpd - 1].pattern.size();
 1821|      0|          st.replace(i, std::string::npos, checkcpdtable[scpd - 1].pattern2);
 1822|      0|          st.replace(i + checkcpdtable[scpd - 1].pattern2.size(), std::string::npos,
 1823|      0|                 word.substr(soldi + checkcpdtable[scpd - 1].pattern3.size()));
 1824|       |
 1825|      0|          oldlen = len;
 1826|      0|          len += checkcpdtable[scpd - 1].pattern.size() +
 1827|      0|                 checkcpdtable[scpd - 1].pattern2.size() -
 1828|      0|                 checkcpdtable[scpd - 1].pattern3.size();
 1829|      0|          oldcmin = cmin;
 1830|      0|          oldcmax = cmax;
 1831|      0|          setcminmax(&cmin, &cmax, st.c_str(), len);
 1832|       |
 1833|      0|          cmax = len - cpdmin + 1;
 1834|      0|        }
 1835|       |
 1836|   526M|        if (i >= st.size())
  ------------------
  |  Branch (1836:13): [True: 1.04M, False: 525M]
  ------------------
 1837|  1.04M|          return nullptr;
 1838|       |
 1839|   525M|        ch = st[i];
 1840|   525M|        if (t) {
  ------------------
  |  Branch (1840:13): [True: 0, False: 525M]
  ------------------
 1841|       |          // a non-zero scpd means this split is the retry that one CHECKCOMPOUNDPATTERN entry asks
 1842|       |          // for, with the text at the join replaced by the two sides of that entry
 1843|      0|          if (scpd != 0)
  ------------------
  |  Branch (1843:15): [True: 0, False: 0]
  ------------------
 1844|      0|            trace(*t, "split at=%d left=\"%s\" right=\"%s\" cpdpattern=%d", (int)i,
 1845|      0|                  st.substr(0, i).c_str(), st.substr(i).c_str(), (int)scpd);
 1846|      0|          else
 1847|      0|            trace(*t, "split at=%d left=\"%s\" right=\"%s\"", (int)i,
 1848|      0|                  st.substr(0, i).c_str(), st.substr(i).c_str());
 1849|      0|        }
 1850|       |        // everything this split point tries belongs to the split
 1851|   525M|        TraceScope split_depth(t);
 1852|   525M|        st[i] = '\0';
 1853|       |
 1854|   525M|        sfx = nullptr;
 1855|   525M|        pfx = nullptr;
 1856|       |
 1857|       |        // FIRST WORD
 1858|       |
 1859|   525M|        affixed = 1;
 1860|   525M|        rv = lookup(st.c_str(), i);  // perhaps without prefix
 1861|   525M|        if (t) {
  ------------------
  |  Branch (1861:13): [True: 0, False: 525M]
  ------------------
 1862|      0|          if (rv)
  ------------------
  |  Branch (1862:15): [True: 0, False: 0]
  ------------------
 1863|      0|            trace(*t, "first \"%s\" -> entry \"%s\" flags=%s", st.c_str(),
 1864|      0|                  rv->word, trace_flags(this, rv->astr, rv->alen).c_str());
 1865|      0|          else
 1866|      0|            trace(*t, "first \"%s\" -> miss", st.c_str());
 1867|      0|        }
 1868|       |
 1869|       |        // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 1870|       |        // compound words, overriding the effect of COMPOUNDPERMITFLAG
 1871|   525M|        if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (1871:13): [True: 1.94M, False: 523M]
  |  Branch (1871:21): [True: 42.0k, False: 1.90M]
  ------------------
 1872|  42.0k|                TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule) {
  ------------------
  |  |  102|   525M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 42.0k]
  |  |  ------------------
  ------------------
  |  Branch (1872:68): [True: 0, False: 0]
  ------------------
 1873|      0|            bool would_continue = !onlycpdrule && simplifiedcpd;
  ------------------
  |  Branch (1873:35): [True: 0, False: 0]
  |  Branch (1873:51): [True: 0, False: 0]
  ------------------
 1874|      0|            if (!scpd && would_continue) {
  ------------------
  |  Branch (1874:17): [True: 0, False: 0]
  |  Branch (1874:26): [True: 0, False: 0]
  ------------------
 1875|       |                // given the while conditions that continue jumps to, this situation
 1876|       |                // never ends
 1877|      0|                HUNSPELL_WARNING(stderr, "break infinite loop\n");
 1878|      0|                break;
 1879|      0|            }
 1880|       |
 1881|      0|            if (scpd > 0 && would_continue) {
  ------------------
  |  Branch (1881:17): [True: 0, False: 0]
  |  Branch (1881:29): [True: 0, False: 0]
  ------------------
 1882|       |                // under these conditions we loop again, but the assumption above
 1883|       |                // appears to be that cmin and cmax are the original values they
 1884|       |                // had in the outside loop
 1885|      0|                cmin = oldcmin;
 1886|      0|                cmax = oldcmax;
 1887|      0|            }
 1888|      0|            continue;
 1889|      0|        }
 1890|       |
 1891|       |        // search homonym with compound flag
 1892|   527M|        while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1892:16): [True: 1.94M, False: 525M]
  |  Branch (1892:24): [True: 1.94M, False: 217]
  ------------------
 1893|  1.94M|               ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |  102|   636k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 636k]
  |  |  ------------------
  ------------------
  |  Branch (1893:18): [True: 636k, False: 1.30M]
  ------------------
 1894|  1.94M|                !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (1894:20): [True: 1.94M, False: 0]
  |  Branch (1894:36): [True: 1.94M, False: 0]
  |  Branch (1894:46): [True: 1.94M, False: 0]
  ------------------
 1895|  1.94M|                   TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|  1.94M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 598, False: 1.94M]
  |  |  ------------------
  ------------------
 1896|  1.94M|                  (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (1896:20): [True: 0, False: 1.94M]
  |  Branch (1896:37): [True: 0, False: 0]
  |  Branch (1896:49): [True: 0, False: 0]
  ------------------
 1897|      0|                   TESTAFF(rv->astr, compoundbegin, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1898|  1.94M|                  (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (1898:20): [True: 0, False: 1.94M]
  |  Branch (1898:38): [True: 0, False: 0]
  |  Branch (1898:49): [True: 0, False: 0]
  |  Branch (1898:59): [True: 0, False: 0]
  ------------------
 1899|      0|                   TESTAFF(rv->astr, compoundmiddle, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1900|  1.94M|                  (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (1900:20): [True: 0, False: 1.94M]
  |  Branch (1900:44): [True: 0, False: 0]
  ------------------
 1901|      0|                   ((!words && !wordnum &&
  ------------------
  |  Branch (1901:22): [True: 0, False: 0]
  |  Branch (1901:32): [True: 0, False: 0]
  ------------------
 1902|      0|                     defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (1902:22): [True: 0, False: 0]
  ------------------
 1903|      0|                    (words &&
  ------------------
  |  Branch (1903:22): [True: 0, False: 0]
  ------------------
 1904|      0|                     defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))) ||
  ------------------
  |  Branch (1904:22): [True: 0, False: 0]
  ------------------
 1905|    598|                (scpd != 0 && checkcpdtable[scpd - 1].cond != FLAG_NULL &&
  ------------------
  |  |   99|    598|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1905:18): [True: 0, False: 598]
  |  Branch (1905:31): [True: 0, False: 0]
  ------------------
 1906|  1.94M|                 !TESTAFF(rv->astr, checkcpdtable[scpd - 1].cond, rv->alen)))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1906:18): [True: 0, False: 0]
  ------------------
 1907|  1.94M|          rv = rv->next_homonym;
 1908|  1.94M|        }
 1909|       |
 1910|   525M|        if (rv)
  ------------------
  |  Branch (1910:13): [True: 815, False: 525M]
  ------------------
 1911|    815|          affixed = 0;
 1912|       |
 1913|   525M|        if (!rv) {
  ------------------
  |  Branch (1913:13): [True: 525M, False: 815]
  ------------------
 1914|   525M|          if (onlycpdrule)
  ------------------
  |  Branch (1914:15): [True: 0, False: 525M]
  ------------------
 1915|      0|            break;
 1916|   525M|          if (compoundflag &&
  ------------------
  |  Branch (1916:15): [True: 525M, False: 0]
  ------------------
 1917|   525M|              !(rv = prefix_check(st, 0, i,
  ------------------
  |  Branch (1917:15): [True: 525M, False: 0]
  ------------------
 1918|   525M|                                  hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   78|   123k|#define IN_CPD_OTHER 3
  ------------------
                                                hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   76|  1.05G|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1918:35): [True: 123k, False: 525M]
  ------------------
 1919|   525M|                                  scratch, compoundflag))) {
 1920|   525M|            if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   99|   525M|#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)) ||
  ------------------
  |  |   78|   123k|#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)) ||
  ------------------
  |  |   76|  1.05G|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1920:18): [True: 0, False: 525M]
  |  Branch (1920:93): [True: 123k, False: 525M]
  ------------------
 1921|   525M|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (1921:19): [True: 0, False: 525M]
  |  Branch (1921:43): [True: 0, False: 0]
  ------------------
 1922|      0|                !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (1922:17): [True: 0, False: 0]
  |  Branch (1922:33): [True: 0, False: 0]
  ------------------
 1923|      0|                ((compoundforbidflag && TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1923:19): [True: 0, False: 0]
  ------------------
 1924|      0|                 (compoundend && TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1924:19): [True: 0, False: 0]
  ------------------
 1925|      0|              rv = nullptr;
 1926|      0|            }
 1927|   525M|          }
 1928|       |
 1929|   525M|          if (rv ||
  ------------------
  |  Branch (1929:15): [True: 0, False: 525M]
  ------------------
 1930|   525M|              (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (1930:17): [True: 525M, False: 127k]
  |  Branch (1930:35): [True: 0, False: 525M]
  ------------------
 1931|      0|                ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   99|      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)) ||
  ------------------
  |  |   78|      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)) ||
  ------------------
  |  |   76|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1931:18): [True: 0, False: 0]
  |  Branch (1931:94): [True: 0, False: 0]
  ------------------
 1932|      0|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (1932:19): [True: 0, False: 0]
  |  Branch (1932:43): [True: 0, False: 0]
  ------------------
 1933|      0|                                                                    compoundbegin))) ||  // twofold suffixes + compound
 1934|      0|                 (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundbegin)))) ||
  ------------------
  |  |   78|      0|#define IN_CPD_OTHER 3
  ------------------
                               (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundbegin)))) ||
  ------------------
  |  |   76|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1934:18): [True: 0, False: 0]
  |  Branch (1934:47): [True: 0, False: 0]
  ------------------
 1935|   525M|               ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (1935:17): [True: 3.78k, False: 525M]
  |  Branch (1935:34): [True: 0, False: 3.78k]
  ------------------
 1936|      0|                ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   99|      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)) ||
  ------------------
  |  |   78|      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)) ||
  ------------------
  |  |   76|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1936:18): [True: 0, False: 0]
  |  Branch (1936:95): [True: 0, False: 0]
  ------------------
 1937|      0|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (1937:19): [True: 0, False: 0]
  |  Branch (1937:43): [True: 0, False: 0]
  ------------------
 1938|      0|                                                                    compoundmiddle))) ||  // twofold suffixes + compound
 1939|      0|                 (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundmiddle))))))
  ------------------
  |  |   78|      0|#define IN_CPD_OTHER 3
  ------------------
                               (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundmiddle))))))
  ------------------
  |  |   76|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1939:18): [True: 0, False: 0]
  |  Branch (1939:47): [True: 0, False: 0]
  ------------------
 1940|      0|            checked_prefix = 1;
 1941|       |          // else check forbiddenwords and needaffix
 1942|   525M|        } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|  1.32k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 661]
  |  |  ------------------
  ------------------
  |  Branch (1942:20): [True: 661, False: 154]
  |  Branch (1942:20): [True: 1, False: 814]
  ------------------
 1943|    661|                                TESTAFF(rv->astr, needaffix, rv->alen) ||
  ------------------
  |  |  102|  1.32k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 661]
  |  |  ------------------
  ------------------
 1944|    661|                                TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|  1.32k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 1, False: 660]
  |  |  ------------------
  ------------------
 1945|    660|                                (is_sug && nosuggest &&
  ------------------
  |  Branch (1945:34): [True: 0, False: 660]
  |  Branch (1945:44): [True: 0, False: 0]
  ------------------
 1946|      1|                                 TESTAFF(rv->astr, nosuggest, rv->alen)))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1947|      1|          st[i] = ch;
 1948|       |          // continue;
 1949|      1|          break;
 1950|      1|        }
 1951|       |
 1952|       |        // check non_compound flag in suffix and prefix
 1953|   525M|        if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1953:13): [True: 814, False: 525M]
  |  Branch (1953:21): [True: 598, False: 216]
  ------------------
 1954|    598|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1954:15): [True: 0, False: 598]
  |  Branch (1954:22): [True: 0, False: 0]
  ------------------
 1955|      0|              TESTAFF(pfx->getCont(), compoundforbidflag, pfx->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1956|    598|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1956:15): [True: 0, False: 598]
  |  Branch (1956:22): [True: 0, False: 0]
  ------------------
 1957|      0|              TESTAFF(sfx->getCont(), compoundforbidflag,
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1958|    598|                      sfx->getContLen())))) {
 1959|      0|          rv = nullptr;
 1960|      0|        }
 1961|       |
 1962|       |        // check compoundend flag in suffix and prefix
 1963|   525M|        if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (1963:13): [True: 814, False: 525M]
  |  Branch (1963:21): [True: 814, False: 0]
  |  Branch (1963:40): [True: 0, False: 814]
  |  Branch (1963:55): [True: 0, False: 0]
  ------------------
 1964|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1964:15): [True: 0, False: 0]
  |  Branch (1964:22): [True: 0, False: 0]
  ------------------
 1965|      0|              TESTAFF(pfx->getCont(), compoundend, pfx->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1966|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1966:15): [True: 0, False: 0]
  |  Branch (1966:22): [True: 0, False: 0]
  ------------------
 1967|      0|              TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1968|      0|          rv = nullptr;
 1969|      0|        }
 1970|       |
 1971|       |        // check compoundmiddle flag in suffix and prefix
 1972|   525M|        if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (1972:13): [True: 814, False: 525M]
  |  Branch (1972:21): [True: 814, False: 0]
  |  Branch (1972:40): [True: 598, False: 216]
  |  Branch (1972:58): [True: 0, False: 598]
  ------------------
 1973|      0|            !hu_mov_rule &&
  ------------------
  |  Branch (1973:13): [True: 0, False: 0]
  ------------------
 1974|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1974:15): [True: 0, False: 0]
  |  Branch (1974:22): [True: 0, False: 0]
  ------------------
 1975|      0|              TESTAFF(pfx->getCont(), compoundmiddle, pfx->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1976|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1976:15): [True: 0, False: 0]
  |  Branch (1976:22): [True: 0, False: 0]
  ------------------
 1977|      0|              TESTAFF(sfx->getCont(), compoundmiddle, sfx->getContLen())))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1978|      0|          rv = nullptr;
 1979|      0|        }
 1980|       |
 1981|       |        // check forbiddenwords
 1982|   525M|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1982:13): [True: 814, False: 525M]
  |  Branch (1982:13): [True: 0, False: 525M]
  |  Branch (1982:21): [True: 660, False: 154]
  ------------------
 1983|    660|            (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|  1.32k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 660]
  |  |  ------------------
  ------------------
 1984|    660|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|  1.32k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 660]
  |  |  ------------------
  ------------------
 1985|    660|             (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1985:15): [True: 0, False: 660]
  |  Branch (1985:25): [True: 0, False: 0]
  ------------------
 1986|      0|          return nullptr;
 1987|      0|        }
 1988|       |
 1989|       |        // increment word number, if the second root has a compoundroot flag
 1990|   525M|        if ((rv) && compoundroot &&
  ------------------
  |  Branch (1990:13): [True: 814, False: 525M]
  |  Branch (1990:21): [True: 0, False: 814]
  ------------------
 1991|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1991:13): [True: 0, False: 0]
  ------------------
 1992|      0|          wordnum++;
 1993|      0|        }
 1994|       |
 1995|       |        // first word is acceptable in compound words?
 1996|   525M|        if (((rv) &&
  ------------------
  |  Branch (1996:13): [True: 660, False: 525M]
  |  Branch (1996:14): [True: 814, False: 525M]
  ------------------
 1997|    814|             (checked_prefix || (words && words[wnum]) ||
  ------------------
  |  Branch (1997:15): [True: 0, False: 814]
  |  Branch (1997:34): [True: 0, False: 814]
  |  Branch (1997:43): [True: 0, False: 0]
  ------------------
 1998|    814|              (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|    814|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 660, False: 154]
  |  |  ------------------
  ------------------
  |  Branch (1998:16): [True: 814, False: 0]
  ------------------
 1999|    154|              ((oldwordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (1999:16): [True: 0, False: 154]
  |  Branch (1999:37): [True: 0, False: 0]
  ------------------
 2000|      0|               TESTAFF(rv->astr, compoundbegin, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2001|    154|              ((oldwordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (2001:16): [True: 0, False: 154]
  |  Branch (2001:36): [True: 0, False: 0]
  ------------------
 2002|      0|               TESTAFF(rv->astr, compoundmiddle, rv->alen))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2003|       |
 2004|       |              // LANG_hu section: spec. Hungarian rule
 2005|    154|              || ((langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (2005:19): [True: 154, False: 0]
  |  Branch (2005:43): [True: 154, False: 0]
  ------------------
 2006|    154|                  (TESTAFF(
  ------------------
  |  |  102|    308|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 154]
  |  |  ------------------
  ------------------
 2007|    154|                       rv->astr, 'F',
 2008|    154|                       rv->alen) ||  // XXX hardwired Hungarian dictionary codes
 2009|    154|                   TESTAFF(rv->astr, 'G', rv->alen) ||
  ------------------
  |  |  102|    308|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 154]
  |  |  ------------------
  ------------------
 2010|    154|                   TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |  102|    154|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 154]
  |  |  ------------------
  ------------------
 2011|       |              // END of LANG_hu section
 2012|    814|              ) &&
 2013|    660|             (
 2014|       |                 // test CHECKCOMPOUNDPATTERN conditions
 2015|    660|                 scpd == 0 || checkcpdtable[scpd - 1].cond == FLAG_NULL ||
  ------------------
  |  |   99|    660|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2015:18): [True: 660, False: 0]
  |  Branch (2015:31): [True: 0, False: 0]
  ------------------
 2016|      0|                 join_side_has_flag(rv, checkcpdtable[scpd - 1].cond, pfx, sfx)) &&
  ------------------
  |  Branch (2016:18): [True: 0, False: 0]
  ------------------
 2017|    660|             !((checkcompoundtriple && scpd == 0 &&
  ------------------
  |  Branch (2017:17): [True: 0, False: 660]
  |  Branch (2017:40): [True: 0, False: 0]
  ------------------
 2018|      0|                !words && i < word.size() && // test triple letters
  ------------------
  |  Branch (2018:17): [True: 0, False: 0]
  |  Branch (2018:27): [True: 0, False: 0]
  ------------------
 2019|      0|                (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (2019:17): [True: 0, False: 0]
  ------------------
 2020|      0|                (((i > 1) && (word[i - 1] == word[i - 2])) ||
  ------------------
  |  Branch (2020:19): [True: 0, False: 0]
  |  Branch (2020:30): [True: 0, False: 0]
  ------------------
 2021|      0|                 ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (2021:18): [True: 0, False: 0]
  ------------------
 2022|      0|                 )) ||
 2023|    660|               (checkcompoundcase && scpd == 0 && !words && i < word.size() &&
  ------------------
  |  Branch (2023:17): [True: 0, False: 660]
  |  Branch (2023:38): [True: 0, False: 0]
  |  Branch (2023:51): [True: 0, False: 0]
  |  Branch (2023:61): [True: 0, False: 0]
  ------------------
 2024|      0|                cpdcase_check(word, i))))
  ------------------
  |  Branch (2024:17): [True: 0, False: 0]
  ------------------
 2025|       |            // LANG_hu section: spec. Hungarian rule
 2026|   525M|            || ((!rv) && (langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (2026:17): [True: 525M, False: 154]
  |  Branch (2026:26): [True: 41.3M, False: 484M]
  |  Branch (2026:50): [True: 123k, False: 41.1M]
  ------------------
 2027|   123k|                (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (2027:17): [True: 0, False: 123k]
  ------------------
 2028|      0|                (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2028:18): [True: 0, False: 0]
  |  Branch (2028:25): [True: 0, False: 0]
  ------------------
 2029|      0|                 (  // XXX hardwired Hungarian dic. codes
 2030|      0|                     TESTAFF(sfx->getCont(), (unsigned short)'x',
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2031|      0|                             sfx->getContLen()) ||
 2032|      0|                     TESTAFF(
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2033|      0|                         sfx->getCont(), (unsigned short)'%',
 2034|    660|                         sfx->getContLen()))))) {  // first word is ok condition
 2035|       |
 2036|       |          // LANG_hu section: spec. Hungarian rule
 2037|    660|          if (langnum == LANG_hu) {
  ------------------
  |  Branch (2037:15): [True: 364, False: 296]
  ------------------
 2038|       |            // calculate syllable number of the word
 2039|    364|            numsyllable += get_syllable(st.substr(0, i));
 2040|       |            // + 1 word, if syllable number of the prefix > 1 (hungarian
 2041|       |            // convention)
 2042|    364|            if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2042:17): [True: 0, False: 364]
  |  Branch (2042:17): [True: 0, False: 364]
  |  Branch (2042:24): [True: 0, False: 0]
  ------------------
 2043|      0|              wordnum++;
 2044|    364|          }
 2045|       |          // END of LANG_hu section
 2046|       |
 2047|       |          // NEXT WORD(S)
 2048|    660|          rv_first = rv;
 2049|       |          // the affixes that built the first word, so its continuation classes stay reachable once
 2050|       |          // the second word has overwritten pfx and sfx
 2051|    660|          PfxEntry* rv_first_pfx = pfx;
 2052|    660|          SfxEntry* rv_first_sfx = sfx;
 2053|    660|          st[i] = ch;
 2054|       |
 2055|    660|          do {  // striple loop
 2056|       |
 2057|       |            // check simplifiedtriple
 2058|    660|            if (simplifiedtriple) {
  ------------------
  |  Branch (2058:17): [True: 0, False: 660]
  ------------------
 2059|      0|              if (striple) {
  ------------------
  |  Branch (2059:19): [True: 0, False: 0]
  ------------------
 2060|      0|                checkedstriple = 1;
 2061|      0|                i--;  // check "fahrt" instead of "ahrt" in "Schiffahrt"
 2062|      0|              } else if (i > 2 && i <= word.size() && word[i - 1] == word[i - 2])
  ------------------
  |  Branch (2062:26): [True: 0, False: 0]
  |  Branch (2062:35): [True: 0, False: 0]
  |  Branch (2062:55): [True: 0, False: 0]
  ------------------
 2063|      0|                striple = 1;
 2064|      0|            }
 2065|       |
 2066|    660|            rv = lookup(st.c_str() + i, st.size() - i);  // perhaps without prefix
 2067|    660|            if (t) {
  ------------------
  |  Branch (2067:17): [True: 0, False: 660]
  ------------------
 2068|      0|              if (rv)
  ------------------
  |  Branch (2068:19): [True: 0, False: 0]
  ------------------
 2069|      0|                trace(*t, "second \"%s\" -> entry \"%s\" flags=%s", st.c_str() + i,
 2070|      0|                      rv->word, trace_flags(this, rv->astr, rv->alen).c_str());
 2071|      0|              else
 2072|      0|                trace(*t, "second \"%s\" -> miss", st.c_str() + i);
 2073|      0|            }
 2074|       |
 2075|       |            // search homonym with compound flag
 2076|    660|            while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2076:20): [True: 0, False: 660]
  |  Branch (2076:30): [True: 0, False: 0]
  ------------------
 2077|      0|                            !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2077:32): [True: 0, False: 0]
  |  Branch (2077:48): [True: 0, False: 0]
  ------------------
 2078|      0|                              (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2078:32): [True: 0, False: 0]
  |  Branch (2078:47): [True: 0, False: 0]
  ------------------
 2079|      0|                              (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))) ||
  ------------------
  |  Branch (2079:32): [True: 0, False: 0]
  |  Branch (2079:56): [True: 0, False: 0]
  |  Branch (2079:65): [True: 0, False: 0]
  ------------------
 2080|      0|                            (scpd != 0 && checkcpdtable[scpd - 1].cond2 != FLAG_NULL &&
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2080:30): [True: 0, False: 0]
  |  Branch (2080:43): [True: 0, False: 0]
  ------------------
 2081|      0|                             !TESTAFF(rv->astr, checkcpdtable[scpd - 1].cond2, rv->alen)))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2081:30): [True: 0, False: 0]
  ------------------
 2082|      0|              rv = rv->next_homonym;
 2083|      0|            }
 2084|       |
 2085|       |            // check FORCEUCASE
 2086|    660|            if (rv && forceucase &&
  ------------------
  |  Branch (2086:17): [True: 0, False: 660]
  |  Branch (2086:23): [True: 0, False: 0]
  ------------------
 2087|      0|                (TESTAFF(rv->astr, forceucase, rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2087:17): [True: 0, False: 0]
  ------------------
 2088|      0|                !(info && *info & SPELL_ORIGCAP))
  ------------------
  |  |   86|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  |  Branch (2088:19): [True: 0, False: 0]
  |  Branch (2088:27): [True: 0, False: 0]
  ------------------
 2089|      0|              rv = nullptr;
 2090|       |
 2091|    660|            if (rv && words && words[wnum + 1])
  ------------------
  |  Branch (2091:17): [True: 0, False: 660]
  |  Branch (2091:23): [True: 0, False: 0]
  |  Branch (2091:32): [True: 0, False: 0]
  ------------------
 2092|      0|              return rv_first;
 2093|       |
 2094|    660|            oldnumsyllable2 = numsyllable;
 2095|    660|            oldwordnum2 = wordnum;
 2096|       |
 2097|       |            // LANG_hu section: spec. Hungarian rule, XXX hardwired dictionary
 2098|       |            // code
 2099|    660|            if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (2099:17): [True: 0, False: 660]
  |  Branch (2099:17): [True: 0, False: 660]
  |  Branch (2099:25): [True: 0, False: 0]
  ------------------
 2100|      0|                (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2100:17): [True: 0, False: 0]
  ------------------
 2101|      0|                !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2101:17): [True: 0, False: 0]
  ------------------
 2102|      0|              numsyllable--;
 2103|      0|            }
 2104|       |            // END of LANG_hu section
 2105|       |
 2106|       |            // increment word number, if the second root has a compoundroot flag
 2107|    660|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2107:17): [True: 0, False: 660]
  |  Branch (2107:25): [True: 0, False: 0]
  ------------------
 2108|      0|                (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2108:17): [True: 0, False: 0]
  ------------------
 2109|      0|              wordnum++;
 2110|      0|            }
 2111|       |
 2112|       |            // check forbiddenwords
 2113|    660|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2113:17): [True: 0, False: 660]
  |  Branch (2113:17): [True: 0, False: 660]
  |  Branch (2113:25): [True: 0, False: 0]
  ------------------
 2114|      0|                (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2115|      0|                 TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2116|      0|                 (is_sug && nosuggest &&
  ------------------
  |  Branch (2116:19): [True: 0, False: 0]
  |  Branch (2116:29): [True: 0, False: 0]
  ------------------
 2117|      0|                  TESTAFF(rv->astr, nosuggest, rv->alen))))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2118|      0|              return nullptr;
 2119|       |
 2120|       |            // second word is acceptable, as a root?
 2121|       |            // hungarian conventions: compounding is acceptable,
 2122|       |            // when compound forms consist of 2 words, or if more,
 2123|       |            // then the syllable number of root words must be 6, or lesser.
 2124|       |
 2125|    660|            if ((rv) &&
  ------------------
  |  Branch (2125:17): [True: 0, False: 660]
  |  Branch (2125:17): [True: 0, False: 660]
  ------------------
 2126|      0|                ((compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2126:19): [True: 0, False: 0]
  ------------------
 2127|      0|                 (compoundend && TESTAFF(rv->astr, compoundend, rv->alen))) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2127:19): [True: 0, False: 0]
  ------------------
 2128|      0|                (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2128:19): [True: 0, False: 0]
  |  Branch (2128:41): [True: 0, False: 0]
  ------------------
 2129|      0|                 ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (2129:19): [True: 0, False: 0]
  ------------------
 2130|      0|                  (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (2130:19): [True: 0, False: 0]
  ------------------
 2131|      0|                   cpdmaxsyllable))) &&
 2132|      0|                (
 2133|       |                    // test CHECKCOMPOUNDPATTERN
 2134|      0|                    checkcpdtable.empty() || scpd != 0 ||
  ------------------
  |  Branch (2134:21): [True: 0, False: 0]
  |  Branch (2134:46): [True: 0, False: 0]
  ------------------
 2135|      0|                    (i < word.size() && !cpdpat_check(word, i, rv_first, rv, 0, t, rv_first_pfx, rv_first_sfx, nullptr, nullptr))) &&
  ------------------
  |  Branch (2135:22): [True: 0, False: 0]
  |  Branch (2135:41): [True: 0, False: 0]
  ------------------
 2136|      0|                ((!checkcompounddup || (rv != rv_first)))
  ------------------
  |  Branch (2136:19): [True: 0, False: 0]
  |  Branch (2136:40): [True: 0, False: 0]
  ------------------
 2137|       |                // test CHECKCOMPOUNDPATTERN conditions
 2138|      0|                &&
 2139|      0|                (scpd == 0 || checkcpdtable[scpd - 1].cond2 == FLAG_NULL ||
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2139:18): [True: 0, False: 0]
  |  Branch (2139:31): [True: 0, False: 0]
  ------------------
 2140|      0|                 TESTAFF(rv->astr, checkcpdtable[scpd - 1].cond2, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2141|       |              // forbid compound word, if it is a non-compound word with typical
 2142|       |              // fault
 2143|      0|              if ((checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2143:20): [True: 0, False: 0]
  |  Branch (2143:40): [True: 0, False: 0]
  ------------------
 2144|      0|                  cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2144:19): [True: 0, False: 0]
  ------------------
 2145|      0|                return nullptr;
 2146|      0|              return rv_first;
 2147|      0|            }
 2148|       |
 2149|    660|            numsyllable = oldnumsyllable2;
 2150|    660|            wordnum = oldwordnum2;
 2151|       |
 2152|       |            // perhaps second word has prefix or/and suffix
 2153|    660|            sfx = nullptr;
 2154|    660|            sfxflag = FLAG_NULL;
  ------------------
  |  |   99|    660|#define FLAG_NULL 0x00
  ------------------
 2155|       |            // the affixes that built the second word, kept because affix_check clears the members
 2156|    660|            PfxEntry* rv_second_pfx = nullptr;
 2157|    660|            SfxEntry* rv_second_sfx = nullptr;
 2158|    660|            rv = (compoundflag && !onlycpdrule && i < word.size()) ? affix_check(word, i, word.size() - i, scratch, compoundflag, IN_CPD_END, FLAG_NULL, &rv_second_pfx, &rv_second_sfx)
  ------------------
  |  |   77|    660|#define IN_CPD_END 2
  ------------------
                          rv = (compoundflag && !onlycpdrule && i < word.size()) ? affix_check(word, i, word.size() - i, scratch, compoundflag, IN_CPD_END, FLAG_NULL, &rv_second_pfx, &rv_second_sfx)
  ------------------
  |  |   99|    660|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2158:19): [True: 660, False: 0]
  |  Branch (2158:35): [True: 660, False: 0]
  |  Branch (2158:51): [True: 660, False: 0]
  ------------------
 2159|    660|                                                                   : nullptr;
 2160|    660|            if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (2160:17): [True: 660, False: 0]
  |  Branch (2160:24): [True: 0, False: 660]
  |  Branch (2160:39): [True: 0, False: 0]
  ------------------
 2161|      0|              sfx = nullptr;
 2162|      0|              pfx = nullptr;
 2163|      0|              if (i < word.size())
  ------------------
  |  Branch (2163:19): [True: 0, False: 0]
  ------------------
 2164|      0|                rv = affix_check(word, i, word.size() - i, scratch, compoundend, IN_CPD_END, FLAG_NULL, &rv_second_pfx, &rv_second_sfx);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
                              rv = affix_check(word, i, word.size() - i, scratch, compoundend, IN_CPD_END, FLAG_NULL, &rv_second_pfx, &rv_second_sfx);
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
 2165|      0|            }
 2166|       |
 2167|    660|            if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (2167:17): [True: 660, False: 0]
  |  Branch (2167:24): [True: 0, False: 660]
  |  Branch (2167:48): [True: 0, False: 0]
  ------------------
 2168|      0|              if (i < word.size())
  ------------------
  |  Branch (2168:19): [True: 0, False: 0]
  ------------------
 2169|      0|                rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2170|      0|              if (rv && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))
  ------------------
  |  Branch (2170:19): [True: 0, False: 0]
  |  Branch (2170:25): [True: 0, False: 0]
  ------------------
 2171|      0|                return rv_first;
 2172|      0|              rv = nullptr;
 2173|      0|            }
 2174|       |
 2175|       |            // test CHECKCOMPOUNDPATTERN conditions (allowed forms)
 2176|    660|            if (rv &&
  ------------------
  |  Branch (2176:17): [True: 0, False: 660]
  ------------------
 2177|      0|                !(scpd == 0 || checkcpdtable[scpd - 1].cond2 == FLAG_NULL ||
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2177:19): [True: 0, False: 0]
  |  Branch (2177:32): [True: 0, False: 0]
  ------------------
 2178|      0|                  join_side_has_flag(rv, checkcpdtable[scpd - 1].cond2, rv_second_pfx,
  ------------------
  |  Branch (2178:19): [True: 0, False: 0]
  ------------------
 2179|      0|                                     rv_second_sfx)))
 2180|      0|              rv = nullptr;
 2181|       |
 2182|       |            // test CHECKCOMPOUNDPATTERN conditions (forbidden compounds)
 2183|    660|            if (rv && !checkcpdtable.empty() && scpd == 0 &&
  ------------------
  |  Branch (2183:17): [True: 0, False: 660]
  |  Branch (2183:23): [True: 0, False: 0]
  |  Branch (2183:49): [True: 0, False: 0]
  ------------------
 2184|      0|                cpdpat_check(word, i, rv_first, rv, affixed, t, rv_first_pfx, rv_first_sfx, rv_second_pfx, rv_second_sfx))
  ------------------
  |  Branch (2184:17): [True: 0, False: 0]
  ------------------
 2185|      0|              rv = nullptr;
 2186|       |
 2187|       |            // check non_compound flag in suffix and prefix
 2188|    660|            if ((rv) && ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2188:17): [True: 0, False: 660]
  |  Branch (2188:27): [True: 0, False: 0]
  |  Branch (2188:34): [True: 0, False: 0]
  ------------------
 2189|      0|                          TESTAFF(pfx->getCont(), compoundforbidflag,
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2190|      0|                                  pfx->getContLen())) ||
 2191|      0|                         (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2191:27): [True: 0, False: 0]
  |  Branch (2191:34): [True: 0, False: 0]
  ------------------
 2192|      0|                          TESTAFF(sfx->getCont(), compoundforbidflag,
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2193|      0|                                  sfx->getContLen())))) {
 2194|      0|              rv = nullptr;
 2195|      0|            }
 2196|       |
 2197|       |            // check FORCEUCASE
 2198|    660|            if (rv && forceucase &&
  ------------------
  |  Branch (2198:17): [True: 0, False: 660]
  |  Branch (2198:23): [True: 0, False: 0]
  ------------------
 2199|      0|                (TESTAFF(rv->astr, forceucase, rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2199:17): [True: 0, False: 0]
  ------------------
 2200|      0|                !(info && *info & SPELL_ORIGCAP))
  ------------------
  |  |   86|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  |  Branch (2200:19): [True: 0, False: 0]
  |  Branch (2200:27): [True: 0, False: 0]
  ------------------
 2201|      0|              rv = nullptr;
 2202|       |
 2203|       |            // check forbiddenwords
 2204|    660|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2204:17): [True: 0, False: 660]
  |  Branch (2204:17): [True: 0, False: 660]
  |  Branch (2204:25): [True: 0, False: 0]
  ------------------
 2205|      0|                (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2206|      0|                 TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2207|      0|                 (is_sug && nosuggest &&
  ------------------
  |  Branch (2207:19): [True: 0, False: 0]
  |  Branch (2207:29): [True: 0, False: 0]
  ------------------
 2208|      0|                  TESTAFF(rv->astr, nosuggest, rv->alen))))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2209|      0|              return nullptr;
 2210|       |
 2211|       |            // pfxappnd = prefix of word+i, or NULL
 2212|       |            // calculate syllable number of prefix.
 2213|       |            // hungarian convention: when syllable number of prefix is more,
 2214|       |            // than 1, the prefix+word counts as two words.
 2215|       |
 2216|    660|            if (langnum == LANG_hu) {
  ------------------
  |  Branch (2216:17): [True: 364, False: 296]
  ------------------
 2217|    364|              if (i < word.size()) {
  ------------------
  |  Branch (2217:19): [True: 364, False: 0]
  ------------------
 2218|       |                // calculate syllable number of the word
 2219|    364|                numsyllable += get_syllable(word.substr(i));
 2220|    364|              }
 2221|       |
 2222|       |              // - affix syllable num.
 2223|       |              // XXX only second suffix (inflections, not derivations)
 2224|    364|              if (sfxappnd) {
  ------------------
  |  Branch (2224:19): [True: 0, False: 364]
  ------------------
 2225|      0|                std::string tmp(sfxappnd);
 2226|      0|                reverseword(tmp);
 2227|      0|                numsyllable -= short(get_syllable(tmp) + sfxextra);
 2228|    364|              } else {
 2229|    364|                numsyllable -= short(sfxextra);
 2230|    364|              }
 2231|       |
 2232|       |              // + 1 word, if syllable number of the prefix > 1 (hungarian
 2233|       |              // convention)
 2234|    364|              if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2234:19): [True: 0, False: 364]
  |  Branch (2234:19): [True: 0, False: 364]
  |  Branch (2234:26): [True: 0, False: 0]
  ------------------
 2235|      0|                wordnum++;
 2236|       |
 2237|       |              // increment syllable num, if last word has a SYLLABLENUM flag
 2238|       |              // and the suffix is beginning `s'
 2239|       |
 2240|    364|              if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2240:19): [True: 0, False: 364]
  ------------------
 2241|      0|                switch (sfxflag) {
  ------------------
  |  Branch (2241:25): [True: 0, False: 0]
  ------------------
 2242|      0|                  case 'c': {
  ------------------
  |  Branch (2242:19): [True: 0, False: 0]
  ------------------
 2243|      0|                    numsyllable += 2;
 2244|      0|                    break;
 2245|      0|                  }
 2246|      0|                  case 'J': {
  ------------------
  |  Branch (2246:19): [True: 0, False: 0]
  ------------------
 2247|      0|                    numsyllable += 1;
 2248|      0|                    break;
 2249|      0|                  }
 2250|      0|                  case 'I': {
  ------------------
  |  Branch (2250:19): [True: 0, False: 0]
  ------------------
 2251|      0|                    if (rv && TESTAFF(rv->astr, 'J', rv->alen))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2251:25): [True: 0, False: 0]
  |  Branch (2251:25): [True: 0, False: 0]
  ------------------
 2252|      0|                      numsyllable += 1;
 2253|      0|                    break;
 2254|      0|                  }
 2255|      0|                }
 2256|      0|              }
 2257|    364|            }
 2258|       |
 2259|       |            // increment word number, if the second word has a compoundroot flag
 2260|    660|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2260:17): [True: 0, False: 660]
  |  Branch (2260:25): [True: 0, False: 0]
  ------------------
 2261|      0|                (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2261:17): [True: 0, False: 0]
  ------------------
 2262|      0|              wordnum++;
 2263|      0|            }
 2264|       |            // second word is acceptable, as a word with prefix or/and suffix?
 2265|       |            // hungarian conventions: compounding is acceptable,
 2266|       |            // when compound forms consist 2 word, otherwise
 2267|       |            // the syllable number of root words is 6, or lesser.
 2268|    660|            if ((rv) &&
  ------------------
  |  Branch (2268:17): [True: 0, False: 660]
  ------------------
 2269|      0|                (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2269:19): [True: 0, False: 0]
  |  Branch (2269:41): [True: 0, False: 0]
  ------------------
 2270|      0|                 ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2270:19): [True: 0, False: 0]
  |  Branch (2270:44): [True: 0, False: 0]
  ------------------
 2271|      0|                ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2271:19): [True: 0, False: 0]
  |  Branch (2271:40): [True: 0, False: 0]
  ------------------
 2272|       |              // forbid compound word, if it is a non-compound word with typical
 2273|       |              // fault
 2274|      0|              if ((checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2274:20): [True: 0, False: 0]
  |  Branch (2274:40): [True: 0, False: 0]
  ------------------
 2275|      0|                  cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2275:19): [True: 0, False: 0]
  ------------------
 2276|      0|                return nullptr;
 2277|      0|              return rv_first;
 2278|      0|            }
 2279|       |
 2280|    660|            numsyllable = oldnumsyllable2;
 2281|    660|            wordnum = oldwordnum2;
 2282|       |
 2283|       |            // perhaps second word is a compound word (recursive call)
 2284|       |            // (only if SPELL_COMPOUND_2 is not set and maxwordnum is not exceeded)
 2285|    660|            if ((!info || !(*info & SPELL_COMPOUND_2)) && wordnum + 2 < maxwordnum && wnum + 1 < maxwordnum) {
  ------------------
  |  |   88|    660|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (2285:18): [True: 0, False: 660]
  |  Branch (2285:27): [True: 361, False: 299]
  |  Branch (2285:59): [True: 361, False: 0]
  |  Branch (2285:87): [True: 361, False: 0]
  ------------------
 2286|    361|              rv = compound_check(st.substr(i), wordnum + 1,
 2287|    361|                                  numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2288|    361|                                  is_sug, info, scratch);
 2289|       |
 2290|    361|              if (rv && !checkcpdtable.empty() && i < word.size() &&
  ------------------
  |  Branch (2290:19): [True: 0, False: 361]
  |  Branch (2290:25): [True: 0, False: 0]
  |  Branch (2290:51): [True: 0, False: 0]
  ------------------
 2291|      0|                  ((scpd == 0 &&
  ------------------
  |  Branch (2291:21): [True: 0, False: 0]
  ------------------
 2292|      0|                    cpdpat_check(word, i, rv_first, rv, affixed, t, rv_first_pfx, rv_first_sfx, nullptr, nullptr)) ||
  ------------------
  |  Branch (2292:21): [True: 0, False: 0]
  ------------------
 2293|      0|                   (scpd != 0 &&
  ------------------
  |  Branch (2293:21): [True: 0, False: 0]
  ------------------
 2294|      0|                    !cpdpat_check(word, i, rv_first, rv, affixed, t, rv_first_pfx, rv_first_sfx, nullptr, nullptr))))
  ------------------
  |  Branch (2294:21): [True: 0, False: 0]
  ------------------
 2295|      0|                rv = nullptr;
 2296|    361|            } else {
 2297|    299|              rv = nullptr;
 2298|    299|            }
 2299|    660|            if (rv) {
  ------------------
  |  Branch (2299:17): [True: 0, False: 660]
  ------------------
 2300|       |              // forbid compound word, if it is a non-compound word with typical
 2301|       |              // fault, or a dictionary word pair
 2302|       |
 2303|      0|              if (cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2303:19): [True: 0, False: 0]
  ------------------
 2304|      0|                return nullptr;
 2305|       |
 2306|      0|              if (checkcompoundrep || forbiddenword) {
  ------------------
  |  Branch (2306:19): [True: 0, False: 0]
  |  Branch (2306:39): [True: 0, False: 0]
  ------------------
 2307|      0|                if (checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2307:21): [True: 0, False: 0]
  |  Branch (2307:41): [True: 0, False: 0]
  ------------------
 2308|      0|                  return nullptr;
 2309|       |
 2310|       |                // check first part
 2311|      0|                if (i < word.size() && word.compare(i, rv->blen, rv->word, rv->blen) == 0) {
  ------------------
  |  Branch (2311:21): [True: 0, False: 0]
  |  Branch (2311:40): [True: 0, False: 0]
  ------------------
 2312|      0|                  char r = st[i + rv->blen];
 2313|      0|                  st[i + rv->blen] = '\0';
 2314|       |
 2315|      0|                  if ((checkcompoundrep && cpdrep_check(st, i + rv->blen, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2315:24): [True: 0, False: 0]
  |  Branch (2315:44): [True: 0, False: 0]
  ------------------
 2316|      0|                      cpdwordpair_check(st, i + rv->blen, scratch, timelimit_exceeded, clock_time_start)) {
  ------------------
  |  Branch (2316:23): [True: 0, False: 0]
  ------------------
 2317|      0|                    st[ + i + rv->blen] = r;
 2318|      0|                    continue;
 2319|      0|                  }
 2320|       |
 2321|      0|                  if (forbiddenword) {
  ------------------
  |  Branch (2321:23): [True: 0, False: 0]
  ------------------
 2322|      0|                    struct hentry* rv2 = lookup(word.c_str(), word.size());
 2323|      0|                    if (!rv2 && len <= word.size())
  ------------------
  |  Branch (2323:25): [True: 0, False: 0]
  |  Branch (2323:33): [True: 0, False: 0]
  ------------------
 2324|      0|                      rv2 = affix_check(word, 0, len, scratch);
 2325|      0|                    if (rv2 && rv2->astr &&
  ------------------
  |  Branch (2325:25): [True: 0, False: 0]
  |  Branch (2325:32): [True: 0, False: 0]
  ------------------
 2326|      0|                        TESTAFF(rv2->astr, forbiddenword, rv2->alen) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2327|      0|                        (strncmp(rv2->word, st.c_str(), i + rv->blen) == 0)) {
  ------------------
  |  Branch (2327:25): [True: 0, False: 0]
  ------------------
 2328|      0|                      return nullptr;
 2329|      0|                    }
 2330|      0|                  }
 2331|      0|                  st[i + rv->blen] = r;
 2332|      0|                }
 2333|      0|              }
 2334|      0|              return rv_first;
 2335|      0|            }
 2336|    660|          } while (striple && !checkedstriple);  // end of striple loop
  ------------------
  |  Branch (2336:20): [True: 0, False: 660]
  |  Branch (2336:31): [True: 0, False: 0]
  ------------------
 2337|       |
 2338|    660|          if (checkedstriple) {
  ------------------
  |  Branch (2338:15): [True: 0, False: 660]
  ------------------
 2339|      0|            i++;
 2340|      0|            checkedstriple = 0;
 2341|      0|            striple = 0;
 2342|      0|          }
 2343|       |
 2344|    660|        }  // first word is ok condition
 2345|       |
 2346|   525M|        if (soldi != 0) {
  ------------------
  |  Branch (2346:13): [True: 0, False: 525M]
  ------------------
 2347|      0|          i = soldi;
 2348|      0|          soldi = 0;
 2349|      0|          len = oldlen;
 2350|      0|          cmin = oldcmin;
 2351|      0|          cmax = oldcmax;
 2352|      0|        }
 2353|   525M|        scpd++;
 2354|       |
 2355|   525M|      } while (!onlycpdrule && simplifiedcpd &&
  ------------------
  |  Branch (2355:16): [True: 525M, False: 0]
  |  Branch (2355:32): [True: 0, False: 525M]
  ------------------
 2356|      0|               scpd <= checkcpdtable.size());  // end of simplifiedcpd loop
  ------------------
  |  Branch (2356:16): [True: 0, False: 0]
  ------------------
 2357|       |
 2358|   525M|      scpd = 0;
 2359|   525M|      wordnum = oldwordnum;
 2360|   525M|      numsyllable = oldnumsyllable;
 2361|       |
 2362|   525M|      if (soldi != 0) {
  ------------------
  |  Branch (2362:11): [True: 0, False: 525M]
  ------------------
 2363|      0|        i = soldi;
 2364|      0|        st.assign(word);  // XXX add more optim.
 2365|      0|        soldi = 0;
 2366|      0|        len = oldlen;
 2367|      0|        cmin = oldcmin;
 2368|      0|        cmax = oldcmax;
 2369|      0|      } else
 2370|   525M|        st[i] = ch;
 2371|       |
 2372|   525M|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2372:14): [True: 0, False: 525M]
  |  Branch (2372:38): [True: 0, False: 0]
  ------------------
 2373|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2373:14): [True: 0, False: 0]
  ------------------
 2374|   526M|  }
 2375|       |
 2376|  22.9M|  return nullptr;
 2377|  24.1M|}
_ZN8AffixMgr20compound_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEssssPP6hentrySB_cRS6_PS7_R12AffixScratch:
 2391|  2.32k|                                   AffixScratch& scratch) {
 2392|  2.32k|  short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2;
 2393|  2.32k|  hentry *rv = nullptr, *rv_first;
 2394|  2.32k|  std::string st, presult;
 2395|  2.32k|  char ch, affixed = 0;
 2396|  2.32k|  int checked_prefix, ok = 0;
 2397|  2.32k|  size_t cmin, cmax;
 2398|  2.32k|  hentry** oldwords = words;
 2399|  2.32k|  size_t len = word.size();
 2400|       |
 2401|       |  // protect subsequent words[wnum + 1] reads and any recursion
 2402|  2.32k|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (2402:7): [True: 0, False: 2.32k]
  ------------------
 2403|      0|    return 0;
 2404|       |
 2405|       |  // add a time limit to handle possible
 2406|       |  // combinatorical explosion of the overlapping words
 2407|       |
 2408|  2.32k|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  2.32k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2409|  2.32k|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  2.32k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2410|       |
 2411|       |  // get the current time
 2412|  2.32k|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 2413|       |
 2414|  2.32k|  if (wnum == 0) {
  ------------------
  |  Branch (2414:7): [True: 2.32k, False: 0]
  ------------------
 2415|       |      // set the start time
 2416|  2.32k|      clock_time_start = clock_now;
 2417|  2.32k|      timelimit_exceeded = false;
 2418|  2.32k|  }
 2419|      0|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  109|      0|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2419:12): [True: 0, False: 0]
  ------------------
 2420|      0|      timelimit_exceeded = true;
 2421|       |
 2422|  2.32k|  setcminmax(&cmin, &cmax, word.c_str(), len);
 2423|       |
 2424|  2.32k|  st.assign(word);
 2425|       |
 2426|  44.6k|  for (size_t i = cmin; i < cmax; ++i) {
  ------------------
  |  Branch (2426:25): [True: 42.5k, False: 2.11k]
  ------------------
 2427|       |    // go to end of the UTF-8 character
 2428|  42.5k|    if (utf8) {
  ------------------
  |  Branch (2428:9): [True: 10.5k, False: 31.9k]
  ------------------
 2429|  13.4k|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (2429:14): [True: 2.83k, False: 10.5k]
  ------------------
 2430|  2.83k|        ;
 2431|  10.5k|      if (i >= cmax)
  ------------------
  |  Branch (2431:11): [True: 60, False: 10.5k]
  ------------------
 2432|     60|        return 0;
 2433|  10.5k|    }
 2434|       |
 2435|  42.4k|    words = oldwords;
 2436|  42.4k|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (2436:23): [True: 0, False: 42.4k]
  ------------------
 2437|       |
 2438|  42.4k|    do {  // onlycpdrule loop
 2439|       |
 2440|  42.4k|      if (timelimit_exceeded ||
  ------------------
  |  Branch (2440:11): [True: 0, False: 42.4k]
  |  Branch (2440:11): [True: 0, False: 42.4k]
  ------------------
 2441|  42.4k|          std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  109|  42.4k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2441:11): [True: 0, False: 42.4k]
  ------------------
 2442|      0|        timelimit_exceeded = true;
 2443|      0|        return 0;
 2444|      0|      }
 2445|       |
 2446|  42.4k|      if (result.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|  42.4k|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (2446:11): [True: 0, False: 42.4k]
  ------------------
 2447|      0|        return 0;
 2448|       |
 2449|  42.4k|      oldnumsyllable = numsyllable;
 2450|  42.4k|      oldwordnum = wordnum;
 2451|  42.4k|      checked_prefix = 0;
 2452|       |
 2453|  42.4k|      if (i >= st.size())
  ------------------
  |  Branch (2453:11): [True: 147, False: 42.3k]
  ------------------
 2454|    147|        return 0;
 2455|       |
 2456|  42.3k|      ch = st[i];
 2457|  42.3k|      st[i] = '\0';
 2458|  42.3k|      sfx = nullptr;
 2459|       |
 2460|       |      // FIRST WORD
 2461|       |
 2462|  42.3k|      affixed = 1;
 2463|       |
 2464|  42.3k|      presult.clear();
 2465|  42.3k|      if (partresult)
  ------------------
  |  Branch (2465:11): [True: 0, False: 42.3k]
  ------------------
 2466|      0|        presult.append(*partresult);
 2467|       |
 2468|  42.3k|      rv = lookup(st.c_str(), i);  // perhaps without prefix
 2469|       |
 2470|       |      // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 2471|       |      // compound words, overriding the effect of COMPOUNDPERMITFLAG
 2472|  42.3k|      if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (2472:11): [True: 989, False: 41.3k]
  |  Branch (2472:19): [True: 104, False: 885]
  ------------------
 2473|    104|              TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule)
  ------------------
  |  |  102|  42.4k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 104]
  |  |  ------------------
  ------------------
  |  Branch (2473:66): [True: 0, False: 0]
  ------------------
 2474|      0|          continue;
 2475|       |
 2476|       |      // search homonym with compound flag
 2477|  43.2k|      while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2477:14): [True: 989, False: 42.3k]
  |  Branch (2477:22): [True: 989, False: 0]
  ------------------
 2478|    989|             ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |  102|    295|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 295]
  |  |  ------------------
  ------------------
  |  Branch (2478:16): [True: 295, False: 694]
  ------------------
 2479|    989|              !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (2479:18): [True: 989, False: 0]
  |  Branch (2479:34): [True: 989, False: 0]
  |  Branch (2479:44): [True: 989, False: 0]
  ------------------
 2480|    989|                 TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|    989|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 989]
  |  |  ------------------
  ------------------
 2481|    989|                (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (2481:18): [True: 0, False: 989]
  |  Branch (2481:35): [True: 0, False: 0]
  |  Branch (2481:47): [True: 0, False: 0]
  ------------------
 2482|      0|                 TESTAFF(rv->astr, compoundbegin, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2483|    989|                (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (2483:18): [True: 0, False: 989]
  |  Branch (2483:36): [True: 0, False: 0]
  |  Branch (2483:47): [True: 0, False: 0]
  |  Branch (2483:57): [True: 0, False: 0]
  ------------------
 2484|      0|                 TESTAFF(rv->astr, compoundmiddle, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2485|    989|                (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (2485:18): [True: 0, False: 989]
  |  Branch (2485:42): [True: 0, False: 0]
  ------------------
 2486|      0|                 ((!words && !wordnum &&
  ------------------
  |  Branch (2486:20): [True: 0, False: 0]
  |  Branch (2486:30): [True: 0, False: 0]
  ------------------
 2487|      0|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (2487:20): [True: 0, False: 0]
  ------------------
 2488|      0|                  (words &&
  ------------------
  |  Branch (2488:20): [True: 0, False: 0]
  ------------------
 2489|    989|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))))) {
  ------------------
  |  Branch (2489:20): [True: 0, False: 0]
  ------------------
 2490|    989|        rv = rv->next_homonym;
 2491|    989|      }
 2492|       |
 2493|       |
 2494|  42.3k|      if (rv)
  ------------------
  |  Branch (2494:11): [True: 0, False: 42.3k]
  ------------------
 2495|      0|        affixed = 0;
 2496|       |
 2497|  42.3k|      if (rv) {
  ------------------
  |  Branch (2497:11): [True: 0, False: 42.3k]
  ------------------
 2498|      0|        presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2499|      0|        presult.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2500|      0|        presult.append(st, 0, i);
 2501|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2501:13): [True: 0, False: 0]
  ------------------
 2502|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2503|      0|          presult.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2504|      0|          presult.append(st, 0, i);
 2505|      0|        }
 2506|      0|        if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2506:13): [True: 0, False: 0]
  ------------------
 2507|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2508|      0|          presult.append(HENTRY_DATA2(rv));
 2509|      0|        }
 2510|      0|      }
 2511|       |
 2512|  42.3k|      if (!rv) {
  ------------------
  |  Branch (2512:11): [True: 42.3k, False: 0]
  ------------------
 2513|  42.3k|        if (compoundflag &&
  ------------------
  |  Branch (2513:13): [True: 42.3k, False: 0]
  ------------------
 2514|  42.3k|            !(rv =
  ------------------
  |  Branch (2514:13): [True: 42.3k, False: 0]
  ------------------
 2515|  42.3k|                  prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   78|      0|#define IN_CPD_OTHER 3
  ------------------
                                prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   76|  84.6k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2515:42): [True: 0, False: 42.3k]
  ------------------
 2516|  42.3k|                               scratch, compoundflag))) {
 2517|  42.3k|          if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   99|  42.3k|#define FLAG_NULL 0x00
  ------------------
                        if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   78|      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)) ||
  ------------------
  |  |   76|  84.6k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2517:16): [True: 0, False: 42.3k]
  |  Branch (2517:91): [True: 0, False: 42.3k]
  ------------------
 2518|  42.3k|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (2518:17): [True: 0, False: 42.3k]
  |  Branch (2518:41): [True: 0, False: 0]
  ------------------
 2519|      0|              !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (2519:15): [True: 0, False: 0]
  |  Branch (2519:31): [True: 0, False: 0]
  ------------------
 2520|      0|              ((compoundforbidflag && TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2520:17): [True: 0, False: 0]
  ------------------
 2521|      0|               (compoundend && TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2521:17): [True: 0, False: 0]
  ------------------
 2522|      0|            rv = nullptr;
 2523|      0|          }
 2524|  42.3k|        }
 2525|       |
 2526|  42.3k|        if (rv ||
  ------------------
  |  Branch (2526:13): [True: 0, False: 42.3k]
  ------------------
 2527|  42.3k|            (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (2527:15): [True: 42.3k, False: 0]
  |  Branch (2527:33): [True: 0, False: 42.3k]
  ------------------
 2528|      0|              ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   99|      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)) ||
  ------------------
  |  |   78|      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)) ||
  ------------------
  |  |   76|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2528:16): [True: 0, False: 0]
  |  Branch (2528:92): [True: 0, False: 0]
  ------------------
 2529|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2529:17): [True: 0, False: 0]
  |  Branch (2529:41): [True: 0, False: 0]
  ------------------
 2530|      0|                                                                  compoundbegin))) ||  // twofold suffix+compound
 2531|      0|               (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundbegin)))) ||
  ------------------
  |  |   78|      0|#define IN_CPD_OTHER 3
  ------------------
                             (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundbegin)))) ||
  ------------------
  |  |   76|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2531:16): [True: 0, False: 0]
  |  Branch (2531:45): [True: 0, False: 0]
  ------------------
 2532|  42.3k|             ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (2532:15): [True: 0, False: 42.3k]
  |  Branch (2532:32): [True: 0, False: 0]
  ------------------
 2533|      0|              ((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   99|      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)) ||
  ------------------
  |  |   78|      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)) ||
  ------------------
  |  |   76|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2533:16): [True: 0, False: 0]
  |  Branch (2533:93): [True: 0, False: 0]
  ------------------
 2534|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2534:17): [True: 0, False: 0]
  |  Branch (2534:41): [True: 0, False: 0]
  ------------------
 2535|      0|                                                                  compoundmiddle))) ||  // twofold suffix+compound
 2536|      0|               (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundmiddle)))))) {
  ------------------
  |  |   78|      0|#define IN_CPD_OTHER 3
  ------------------
                             (rv = prefix_check(st, 0, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, scratch, compoundmiddle)))))) {
  ------------------
  |  |   76|      0|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2536:16): [True: 0, False: 0]
  |  Branch (2536:45): [True: 0, False: 0]
  ------------------
 2537|      0|          std::string p;
 2538|      0|          if (compoundflag)
  ------------------
  |  Branch (2538:15): [True: 0, False: 0]
  ------------------
 2539|      0|            p = affix_check_morph(st, 0, i, scratch, compoundflag);
 2540|      0|          if (p.empty()) {
  ------------------
  |  Branch (2540:15): [True: 0, False: 0]
  ------------------
 2541|      0|            if ((wordnum == 0) && compoundbegin) {
  ------------------
  |  Branch (2541:17): [True: 0, False: 0]
  |  Branch (2541:35): [True: 0, False: 0]
  ------------------
 2542|      0|              p = affix_check_morph(st, 0, i, scratch, compoundbegin);
 2543|      0|            } else if ((wordnum > 0) && compoundmiddle) {
  ------------------
  |  Branch (2543:24): [True: 0, False: 0]
  |  Branch (2543:41): [True: 0, False: 0]
  ------------------
 2544|      0|              p = affix_check_morph(st, 0, i, scratch, compoundmiddle);
 2545|      0|            }
 2546|      0|          }
 2547|      0|          if (!p.empty()) {
  ------------------
  |  Branch (2547:15): [True: 0, False: 0]
  ------------------
 2548|      0|            presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2549|      0|            presult.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2550|      0|            presult.append(st, 0, i);
 2551|      0|            line_uniq_app(p, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2552|      0|            if (!p.empty() && p[0] != MSEP_FLD)
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  |  Branch (2552:17): [True: 0, False: 0]
  |  Branch (2552:31): [True: 0, False: 0]
  ------------------
 2553|      0|              presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2554|      0|            presult.append(p);
 2555|      0|          }
 2556|      0|          checked_prefix = 1;
 2557|      0|        }
 2558|       |        // else check forbiddenwords
 2559|  42.3k|      } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2559:18): [True: 0, False: 0]
  |  Branch (2559:18): [True: 0, False: 0]
  ------------------
 2560|      0|                              TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2561|      0|                              TESTAFF(rv->astr, needaffix, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2562|      0|        st[i] = ch;
 2563|      0|        continue;
 2564|      0|      }
 2565|       |
 2566|       |      // check non_compound flag in suffix and prefix
 2567|  42.3k|      if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2567:11): [True: 0, False: 42.3k]
  |  Branch (2567:19): [True: 0, False: 0]
  ------------------
 2568|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2568:13): [True: 0, False: 0]
  |  Branch (2568:20): [True: 0, False: 0]
  ------------------
 2569|      0|            TESTAFF(pfx->getCont(), compoundforbidflag, pfx->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2570|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2570:13): [True: 0, False: 0]
  |  Branch (2570:20): [True: 0, False: 0]
  ------------------
 2571|      0|            TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2572|      0|        continue;
 2573|      0|      }
 2574|       |
 2575|       |      // check compoundend flag in suffix and prefix
 2576|  42.3k|      if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (2576:11): [True: 0, False: 42.3k]
  |  Branch (2576:19): [True: 0, False: 0]
  |  Branch (2576:38): [True: 0, False: 0]
  |  Branch (2576:53): [True: 0, False: 0]
  ------------------
 2577|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2577:13): [True: 0, False: 0]
  |  Branch (2577:20): [True: 0, False: 0]
  ------------------
 2578|      0|            TESTAFF(pfx->getCont(), compoundend, pfx->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2579|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2579:13): [True: 0, False: 0]
  |  Branch (2579:20): [True: 0, False: 0]
  ------------------
 2580|      0|            TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2581|      0|        continue;
 2582|      0|      }
 2583|       |
 2584|       |      // check compoundmiddle flag in suffix and prefix
 2585|  42.3k|      if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (2585:11): [True: 0, False: 42.3k]
  |  Branch (2585:19): [True: 0, False: 0]
  |  Branch (2585:38): [True: 0, False: 0]
  |  Branch (2585:56): [True: 0, False: 0]
  ------------------
 2586|      0|          !hu_mov_rule &&
  ------------------
  |  Branch (2586:11): [True: 0, False: 0]
  ------------------
 2587|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2587:13): [True: 0, False: 0]
  |  Branch (2587:20): [True: 0, False: 0]
  ------------------
 2588|      0|            TESTAFF(pfx->getCont(), compoundmiddle, pfx->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2589|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2589:13): [True: 0, False: 0]
  |  Branch (2589:20): [True: 0, False: 0]
  ------------------
 2590|      0|            TESTAFF(sfx->getCont(), compoundmiddle, sfx->getContLen())))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2591|      0|        rv = nullptr;
 2592|      0|      }
 2593|       |
 2594|       |      // check forbiddenwords
 2595|  42.3k|      if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2595:11): [True: 0, False: 42.3k]
  |  Branch (2595:11): [True: 0, False: 42.3k]
  |  Branch (2595:19): [True: 0, False: 0]
  ------------------
 2596|      0|                                 TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen)))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2597|      0|        continue;
 2598|       |
 2599|       |      // increment word number, if the second root has a compoundroot flag
 2600|  42.3k|      if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2600:11): [True: 0, False: 42.3k]
  |  Branch (2600:19): [True: 0, False: 0]
  ------------------
 2601|      0|          (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2601:11): [True: 0, False: 0]
  ------------------
 2602|      0|        wordnum++;
 2603|      0|      }
 2604|       |
 2605|       |      // first word is acceptable in compound words?
 2606|  42.3k|      if (((rv) &&
  ------------------
  |  Branch (2606:11): [True: 0, False: 42.3k]
  |  Branch (2606:12): [True: 0, False: 42.3k]
  ------------------
 2607|      0|           (checked_prefix || (words && words[wnum]) || (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2607:13): [True: 0, False: 0]
  |  Branch (2607:32): [True: 0, False: 0]
  |  Branch (2607:41): [True: 0, False: 0]
  |  Branch (2607:58): [True: 0, False: 0]
  ------------------
 2608|      0|            ((oldwordnum == 0) && compoundbegin && TESTAFF(rv->astr, compoundbegin, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2608:14): [True: 0, False: 0]
  |  Branch (2608:35): [True: 0, False: 0]
  ------------------
 2609|      0|            ((oldwordnum > 0) && compoundmiddle && TESTAFF(rv->astr, compoundmiddle, rv->alen))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2609:14): [True: 0, False: 0]
  |  Branch (2609:34): [True: 0, False: 0]
  ------------------
 2610|       |            // LANG_hu section: spec. Hungarian rule
 2611|      0|            || ((langnum == LANG_hu) &&  // hu_mov_rule
  ------------------
  |  Branch (2611:17): [True: 0, False: 0]
  ------------------
 2612|      0|                hu_mov_rule &&
  ------------------
  |  Branch (2612:17): [True: 0, False: 0]
  ------------------
 2613|      0|                (TESTAFF(rv->astr, 'F', rv->alen) || TESTAFF(rv->astr, 'G', rv->alen) || TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              (TESTAFF(rv->astr, 'F', rv->alen) || TESTAFF(rv->astr, 'G', rv->alen) || TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              (TESTAFF(rv->astr, 'F', rv->alen) || TESTAFF(rv->astr, 'G', rv->alen) || TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2614|       |            // END of LANG_hu section
 2615|      0|            ) &&
 2616|      0|           !((checkcompoundtriple && !words &&  // test triple letters
  ------------------
  |  Branch (2616:15): [True: 0, False: 0]
  |  Branch (2616:38): [True: 0, False: 0]
  ------------------
 2617|      0|              (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (2617:15): [True: 0, False: 0]
  ------------------
 2618|      0|              (((i > 1) && (word[i - 1] == word[i - 2])) || ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (2618:17): [True: 0, False: 0]
  |  Branch (2618:28): [True: 0, False: 0]
  |  Branch (2618:61): [True: 0, False: 0]
  ------------------
 2619|      0|               )) ||
 2620|      0|             (
 2621|       |                 // test CHECKCOMPOUNDPATTERN
 2622|      0|                 !checkcpdtable.empty() && !words && cpdpat_check(word, i, rv, nullptr, affixed, nullptr, nullptr, nullptr, nullptr, nullptr)) ||
  ------------------
  |  Branch (2622:18): [True: 0, False: 0]
  |  Branch (2622:44): [True: 0, False: 0]
  |  Branch (2622:54): [True: 0, False: 0]
  ------------------
 2623|      0|             (checkcompoundcase && !words && cpdcase_check(word, i))))
  ------------------
  |  Branch (2623:15): [True: 0, False: 0]
  |  Branch (2623:36): [True: 0, False: 0]
  |  Branch (2623:46): [True: 0, False: 0]
  ------------------
 2624|       |          // LANG_hu section: spec. Hungarian rule
 2625|  42.3k|          || ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (2625:15): [True: 42.3k, False: 0]
  |  Branch (2625:24): [True: 10.5k, False: 31.7k]
  |  Branch (2625:48): [True: 0, False: 10.5k]
  |  Branch (2625:63): [True: 0, False: 0]
  ------------------
 2626|      0|              (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2626:16): [True: 0, False: 0]
  |  Branch (2626:23): [True: 0, False: 0]
  ------------------
 2627|      0|               (TESTAFF(sfx->getCont(), (unsigned short)'x', sfx->getContLen()) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2628|      0|                TESTAFF(sfx->getCont(), (unsigned short)'%', sfx->getContLen()))))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2629|       |          // END of LANG_hu section
 2630|  42.3k|      ) {
 2631|       |        // LANG_hu section: spec. Hungarian rule
 2632|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2632:13): [True: 0, False: 0]
  ------------------
 2633|       |          // calculate syllable number of the word
 2634|      0|          numsyllable += get_syllable(st.substr(0, i));
 2635|       |
 2636|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2637|       |          // convention)
 2638|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2638:15): [True: 0, False: 0]
  |  Branch (2638:15): [True: 0, False: 0]
  |  Branch (2638:22): [True: 0, False: 0]
  ------------------
 2639|      0|            wordnum++;
 2640|      0|        }
 2641|       |        // END of LANG_hu section
 2642|       |
 2643|       |        // NEXT WORD(S)
 2644|      0|        rv_first = rv;
 2645|      0|        rv = lookup(word.c_str() + i, word.size() - i);  // perhaps without prefix
 2646|       |
 2647|       |        // search homonym with compound flag
 2648|      0|        while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2648:16): [True: 0, False: 0]
  |  Branch (2648:26): [True: 0, False: 0]
  ------------------
 2649|      0|                        !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2649:28): [True: 0, False: 0]
  |  Branch (2649:44): [True: 0, False: 0]
  ------------------
 2650|      0|                          (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2650:28): [True: 0, False: 0]
  |  Branch (2650:43): [True: 0, False: 0]
  ------------------
 2651|      0|                          (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))))) {
  ------------------
  |  Branch (2651:28): [True: 0, False: 0]
  |  Branch (2651:52): [True: 0, False: 0]
  |  Branch (2651:61): [True: 0, False: 0]
  ------------------
 2652|      0|          rv = rv->next_homonym;
 2653|      0|        }
 2654|       |
 2655|      0|        if (rv && words && words[wnum + 1]) {
  ------------------
  |  Branch (2655:13): [True: 0, False: 0]
  |  Branch (2655:19): [True: 0, False: 0]
  |  Branch (2655:28): [True: 0, False: 0]
  ------------------
 2656|      0|          result.append(presult);
 2657|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2658|      0|          result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2659|      0|          result.append(word, i, word.size());
 2660|      0|          if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (2660:15): [True: 0, False: 0]
  |  Branch (2660:34): [True: 0, False: 0]
  ------------------
 2661|      0|            result.append(HENTRY_DATA2(rv));
 2662|      0|          if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2662:15): [True: 0, False: 0]
  ------------------
 2663|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2664|      0|            result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2665|      0|            result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2666|      0|          }
 2667|       |          // store the pointer of the hash entry
 2668|      0|          if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2668:15): [True: 0, False: 0]
  |  Branch (2668:35): [True: 0, False: 0]
  ------------------
 2669|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2670|      0|            result.append(HENTRY_DATA2(rv));
 2671|      0|          }
 2672|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2673|      0|          return 0;
 2674|      0|        }
 2675|       |
 2676|      0|        oldnumsyllable2 = numsyllable;
 2677|      0|        oldwordnum2 = wordnum;
 2678|       |
 2679|       |        // LANG_hu section: spec. Hungarian rule
 2680|      0|        if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (2680:13): [True: 0, False: 0]
  |  Branch (2680:13): [True: 0, False: 0]
  |  Branch (2680:21): [True: 0, False: 0]
  ------------------
 2681|      0|            (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2681:13): [True: 0, False: 0]
  ------------------
 2682|      0|            !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2682:13): [True: 0, False: 0]
  ------------------
 2683|      0|          numsyllable--;
 2684|      0|        }
 2685|       |        // END of LANG_hu section
 2686|       |        // increment word number, if the second root has a compoundroot flag
 2687|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2687:13): [True: 0, False: 0]
  |  Branch (2687:21): [True: 0, False: 0]
  ------------------
 2688|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2688:13): [True: 0, False: 0]
  ------------------
 2689|      0|          wordnum++;
 2690|      0|        }
 2691|       |
 2692|       |        // check forbiddenwords
 2693|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2693:13): [True: 0, False: 0]
  |  Branch (2693:13): [True: 0, False: 0]
  |  Branch (2693:21): [True: 0, False: 0]
  ------------------
 2694|      0|            (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2695|      0|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2696|      0|          st[i] = ch;
 2697|      0|          continue;
 2698|      0|        }
 2699|       |
 2700|       |        // second word is acceptable, as a root?
 2701|       |        // hungarian conventions: compounding is acceptable,
 2702|       |        // when compound forms consist of 2 words, or if more,
 2703|       |        // then the syllable number of root words must be 6, or lesser.
 2704|      0|        if ((rv) &&
  ------------------
  |  Branch (2704:13): [True: 0, False: 0]
  |  Branch (2704:13): [True: 0, False: 0]
  ------------------
 2705|      0|            ((compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2705:15): [True: 0, False: 0]
  ------------------
 2706|      0|             (compoundend && TESTAFF(rv->astr, compoundend, rv->alen))) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2706:15): [True: 0, False: 0]
  ------------------
 2707|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2707:15): [True: 0, False: 0]
  |  Branch (2707:37): [True: 0, False: 0]
  ------------------
 2708|      0|             ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (2708:15): [True: 0, False: 0]
  ------------------
 2709|      0|              (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (2709:15): [True: 0, False: 0]
  ------------------
 2710|      0|               cpdmaxsyllable))) &&
 2711|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2711:15): [True: 0, False: 0]
  |  Branch (2711:36): [True: 0, False: 0]
  ------------------
 2712|       |          // bad compound word
 2713|      0|          result.append(presult);
 2714|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2715|      0|          result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2716|      0|          result.append(word, i, word.size());
 2717|       |
 2718|      0|          if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2718:15): [True: 0, False: 0]
  ------------------
 2719|      0|            if (complexprefixes)
  ------------------
  |  Branch (2719:17): [True: 0, False: 0]
  ------------------
 2720|      0|              result.append(HENTRY_DATA2(rv));
 2721|      0|            if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2721:17): [True: 0, False: 0]
  ------------------
 2722|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2723|      0|              result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2724|      0|              result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2725|      0|            }
 2726|       |            // store the pointer of the hash entry
 2727|      0|            if (!complexprefixes) {
  ------------------
  |  Branch (2727:17): [True: 0, False: 0]
  ------------------
 2728|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2729|      0|              result.append(HENTRY_DATA2(rv));
 2730|      0|            }
 2731|      0|          }
 2732|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2733|      0|          ok = 1;
 2734|      0|        }
 2735|       |
 2736|      0|        numsyllable = oldnumsyllable2;
 2737|      0|        wordnum = oldwordnum2;
 2738|       |
 2739|       |        // perhaps second word has prefix or/and suffix
 2740|      0|        sfx = nullptr;
 2741|      0|        sfxflag = FLAG_NULL;
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
 2742|       |
 2743|      0|        if (compoundflag && !onlycpdrule)
  ------------------
  |  Branch (2743:13): [True: 0, False: 0]
  |  Branch (2743:29): [True: 0, False: 0]
  ------------------
 2744|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundflag);
 2745|      0|        else
 2746|      0|          rv = nullptr;
 2747|       |
 2748|      0|        if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (2748:13): [True: 0, False: 0]
  |  Branch (2748:20): [True: 0, False: 0]
  |  Branch (2748:35): [True: 0, False: 0]
  ------------------
 2749|      0|          sfx = nullptr;
 2750|      0|          pfx = nullptr;
 2751|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundend);
 2752|      0|        }
 2753|       |
 2754|      0|        if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (2754:13): [True: 0, False: 0]
  |  Branch (2754:20): [True: 0, False: 0]
  |  Branch (2754:44): [True: 0, False: 0]
  ------------------
 2755|      0|          rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2756|      0|          if (rv && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1)) {
  ------------------
  |  Branch (2756:15): [True: 0, False: 0]
  |  Branch (2756:21): [True: 0, False: 0]
  |  Branch (2756:30): [True: 0, False: 0]
  ------------------
 2757|      0|            std::string m;
 2758|      0|            if (compoundflag)
  ------------------
  |  Branch (2758:17): [True: 0, False: 0]
  ------------------
 2759|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag);
 2760|      0|            if (m.empty() && compoundend) {
  ------------------
  |  Branch (2760:17): [True: 0, False: 0]
  |  Branch (2760:30): [True: 0, False: 0]
  ------------------
 2761|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundend);
 2762|      0|            }
 2763|      0|            result.append(presult);
 2764|      0|            if (!m.empty()) {
  ------------------
  |  Branch (2764:17): [True: 0, False: 0]
  ------------------
 2765|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2766|      0|              result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2767|      0|              result.append(word, i, word.size());
 2768|      0|              line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2769|      0|              result.append(m);
 2770|      0|            }
 2771|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2772|      0|            ok = 1;
 2773|      0|          }
 2774|      0|        }
 2775|       |
 2776|       |        // check non_compound flag in suffix and prefix
 2777|      0|        if ((rv) &&
  ------------------
  |  Branch (2777:13): [True: 0, False: 0]
  ------------------
 2778|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2778:15): [True: 0, False: 0]
  |  Branch (2778:22): [True: 0, False: 0]
  ------------------
 2779|      0|              TESTAFF(pfx->getCont(), compoundforbidflag, pfx->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2780|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2780:15): [True: 0, False: 0]
  |  Branch (2780:22): [True: 0, False: 0]
  ------------------
 2781|      0|              TESTAFF(sfx->getCont(), compoundforbidflag,
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2782|      0|                      sfx->getContLen())))) {
 2783|      0|          rv = nullptr;
 2784|      0|        }
 2785|       |
 2786|       |        // check forbiddenwords
 2787|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2787:13): [True: 0, False: 0]
  |  Branch (2787:13): [True: 0, False: 0]
  |  Branch (2787:21): [True: 0, False: 0]
  ------------------
 2788|      0|            (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2789|      0|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2790|      0|            (!TESTAFF(rv->astr, needaffix, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2790:13): [True: 0, False: 0]
  ------------------
 2791|      0|          st[i] = ch;
 2792|      0|          continue;
 2793|      0|        }
 2794|       |
 2795|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2795:13): [True: 0, False: 0]
  ------------------
 2796|       |          // calculate syllable number of the word
 2797|      0|          numsyllable += get_syllable(word.c_str() + i);
 2798|       |
 2799|       |          // - affix syllable num.
 2800|       |          // XXX only second suffix (inflections, not derivations)
 2801|      0|          if (sfxappnd) {
  ------------------
  |  Branch (2801:15): [True: 0, False: 0]
  ------------------
 2802|      0|            std::string tmp(sfxappnd);
 2803|      0|            reverseword(tmp);
 2804|      0|            numsyllable -= short(get_syllable(tmp) + sfxextra);
 2805|      0|          } else {
 2806|      0|            numsyllable -= short(sfxextra);
 2807|      0|          }
 2808|       |
 2809|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2810|       |          // convention)
 2811|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2811:15): [True: 0, False: 0]
  |  Branch (2811:15): [True: 0, False: 0]
  |  Branch (2811:22): [True: 0, False: 0]
  ------------------
 2812|      0|            wordnum++;
 2813|       |
 2814|       |          // increment syllable num, if last word has a SYLLABLENUM flag
 2815|       |          // and the suffix is beginning `s'
 2816|       |
 2817|      0|          if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2817:15): [True: 0, False: 0]
  ------------------
 2818|      0|            switch (sfxflag) {
  ------------------
  |  Branch (2818:21): [True: 0, False: 0]
  ------------------
 2819|      0|              case 'c': {
  ------------------
  |  Branch (2819:15): [True: 0, False: 0]
  ------------------
 2820|      0|                numsyllable += 2;
 2821|      0|                break;
 2822|      0|              }
 2823|      0|              case 'J': {
  ------------------
  |  Branch (2823:15): [True: 0, False: 0]
  ------------------
 2824|      0|                numsyllable += 1;
 2825|      0|                break;
 2826|      0|              }
 2827|      0|              case 'I': {
  ------------------
  |  Branch (2827:15): [True: 0, False: 0]
  ------------------
 2828|      0|                if (rv && TESTAFF(rv->astr, 'J', rv->alen))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2828:21): [True: 0, False: 0]
  |  Branch (2828:21): [True: 0, False: 0]
  ------------------
 2829|      0|                  numsyllable += 1;
 2830|      0|                break;
 2831|      0|              }
 2832|      0|            }
 2833|      0|          }
 2834|      0|        }
 2835|       |
 2836|       |        // increment word number, if the second word has a compoundroot flag
 2837|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2837:13): [True: 0, False: 0]
  |  Branch (2837:21): [True: 0, False: 0]
  ------------------
 2838|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2838:13): [True: 0, False: 0]
  ------------------
 2839|      0|          wordnum++;
 2840|      0|        }
 2841|       |        // second word is acceptable, as a word with prefix or/and suffix?
 2842|       |        // hungarian conventions: compounding is acceptable,
 2843|       |        // when compound forms consist 2 word, otherwise
 2844|       |        // the syllable number of root words is 6, or lesser.
 2845|      0|        if ((rv) &&
  ------------------
  |  Branch (2845:13): [True: 0, False: 0]
  ------------------
 2846|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2846:15): [True: 0, False: 0]
  |  Branch (2846:37): [True: 0, False: 0]
  ------------------
 2847|      0|             ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2847:15): [True: 0, False: 0]
  |  Branch (2847:40): [True: 0, False: 0]
  ------------------
 2848|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2848:15): [True: 0, False: 0]
  |  Branch (2848:36): [True: 0, False: 0]
  ------------------
 2849|      0|          std::string m;
 2850|      0|          if (compoundflag)
  ------------------
  |  Branch (2850:15): [True: 0, False: 0]
  ------------------
 2851|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag);
 2852|      0|          if (m.empty() && compoundend) {
  ------------------
  |  Branch (2852:15): [True: 0, False: 0]
  |  Branch (2852:28): [True: 0, False: 0]
  ------------------
 2853|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundend);
 2854|      0|          }
 2855|      0|          result.append(presult);
 2856|      0|          if (!m.empty()) {
  ------------------
  |  Branch (2856:15): [True: 0, False: 0]
  ------------------
 2857|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2858|      0|            result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2859|      0|            result.append(word, i, word.size());
 2860|      0|            line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2861|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2862|      0|            result.append(m);
 2863|      0|          }
 2864|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2865|      0|          ok = 1;
 2866|      0|        }
 2867|       |
 2868|      0|        numsyllable = oldnumsyllable2;
 2869|      0|        wordnum = oldwordnum2;
 2870|       |
 2871|       |        // perhaps second word is a compound word (recursive call)
 2872|      0|        if ((wordnum + 2 < maxwordnum) && (wnum + 1 < maxwordnum) && (ok == 0)) {
  ------------------
  |  Branch (2872:13): [True: 0, False: 0]
  |  Branch (2872:43): [True: 0, False: 0]
  |  Branch (2872:70): [True: 0, False: 0]
  ------------------
 2873|      0|          compound_check_morph(word.substr(i), wordnum + 1,
 2874|      0|                               numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2875|      0|                               result, &presult, scratch);
 2876|      0|        } else {
 2877|      0|          rv = nullptr;
 2878|      0|        }
 2879|      0|      }
 2880|  42.3k|      st[i] = ch;
 2881|  42.3k|      wordnum = oldwordnum;
 2882|  42.3k|      numsyllable = oldnumsyllable;
 2883|       |
 2884|  42.3k|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2884:14): [True: 0, False: 42.3k]
  |  Branch (2884:38): [True: 0, False: 0]
  ------------------
 2885|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2885:14): [True: 0, False: 0]
  ------------------
 2886|  42.4k|  }
 2887|  2.11k|  return 0;
 2888|  2.32k|}
_ZNK8AffixMgr12circumfix_okEP8PfxEntryP8SfxEntryPK8TraceCtx:
 2904|  47.2k|bool AffixMgr::circumfix_ok(PfxEntry* pfx, SfxEntry* sfx, const TraceCtx* t) const {
 2905|  47.2k|  if (!circumfix)
  ------------------
  |  Branch (2905:7): [True: 47.2k, False: 0]
  ------------------
 2906|  47.2k|    return true;
 2907|      0|  bool in_prefix = pfx && pfx->getCont() &&
  ------------------
  |  Branch (2907:20): [True: 0, False: 0]
  |  Branch (2907:27): [True: 0, False: 0]
  ------------------
 2908|      0|                   TESTAFF(pfx->getCont(), circumfix, pfx->getContLen());
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2909|      0|  bool in_suffix = sfx->getCont() &&
  ------------------
  |  Branch (2909:20): [True: 0, False: 0]
  ------------------
 2910|      0|                   TESTAFF(sfx->getCont(), circumfix, sfx->getContLen());
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2911|      0|  if (t)
  ------------------
  |  Branch (2911:7): [True: 0, False: 0]
  ------------------
 2912|      0|    trace_circumfix(*t, this, circumfix, pfx, sfx, in_prefix, in_suffix);
 2913|      0|  return in_prefix == in_suffix;
 2914|  47.2k|}
_ZNK8AffixMgr17suffix_applicableEP8PfxEntryP8SfxEntrytcPK8TraceCtx:
 2934|   458k|                                 const TraceCtx* t) const {
 2935|       |  // suffixes are only allowed at the beginning of a compound when they are signed with the
 2936|       |  // compoundpermitflag flag
 2937|   458k|  if (in_compound == IN_CPD_BEGIN &&
  ------------------
  |  |   76|   917k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2937:7): [True: 411k, False: 47.2k]
  ------------------
 2938|   411k|      !(sfx->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2938:9): [True: 411k, False: 0]
  |  Branch (2938:27): [True: 0, False: 411k]
  ------------------
 2939|   411k|        TESTAFF(sfx->getCont(), compoundpermitflag, sfx->getContLen()))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2940|   411k|    if (t)
  ------------------
  |  Branch (2940:9): [True: 0, False: 411k]
  ------------------
 2941|      0|      trace_test(*t, "compoundpermit", this, compoundpermitflag, "sfx-cont",
 2942|      0|                 sfx->getCont(), sfx->getContLen(),
 2943|      0|                 "fail, a suffix at the start of a compound needs this flag");
 2944|   411k|    return false;
 2945|   411k|  }
 2946|       |
 2947|  47.2k|  if (!circumfix_ok(pfx, sfx, t))
  ------------------
  |  Branch (2947:7): [True: 0, False: 47.2k]
  ------------------
 2948|      0|    return false;
 2949|       |
 2950|       |  // a fogemorpheme is only allowed inside a compound
 2951|  47.2k|  if (!in_compound && sfx->getCont() &&
  ------------------
  |  Branch (2951:7): [True: 47.2k, False: 0]
  |  Branch (2951:23): [True: 14.7k, False: 32.4k]
  ------------------
 2952|  14.7k|      TESTAFF(sfx->getCont(), onlyincompound, sfx->getContLen())) {
  ------------------
  |  |  102|  14.7k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 14.7k]
  |  |  ------------------
  ------------------
 2953|      0|    if (t)
  ------------------
  |  Branch (2953:9): [True: 0, False: 0]
  ------------------
 2954|      0|      trace_test(*t, "onlyincompound", this, onlyincompound, "sfx-cont",
 2955|      0|                 sfx->getCont(), sfx->getContLen(),
 2956|      0|                 "fail, this suffix is only allowed inside a compound");
 2957|      0|    return false;
 2958|      0|  }
 2959|       |
 2960|       |  // a needaffix suffix needs a further affix, so it is allowed either as a second suffix or
 2961|       |  // when a prefix is present that does not itself need one
 2962|  47.2k|  if (!cclass && sfx->getCont() &&
  ------------------
  |  Branch (2962:7): [True: 47.1k, False: 47]
  |  Branch (2962:18): [True: 14.7k, False: 32.4k]
  ------------------
 2963|  14.7k|      TESTAFF(sfx->getCont(), needaffix, sfx->getContLen()) &&
  ------------------
  |  |  102|  62.0k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 14.7k]
  |  |  ------------------
  ------------------
 2964|      0|      !(pfx && !(pfx->getCont() &&
  ------------------
  |  Branch (2964:9): [True: 0, False: 0]
  |  Branch (2964:18): [True: 0, False: 0]
  ------------------
 2965|      0|                 TESTAFF(pfx->getCont(), needaffix, pfx->getContLen())))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2966|      0|    if (t)
  ------------------
  |  Branch (2966:9): [True: 0, False: 0]
  ------------------
 2967|      0|      trace_test(*t, "needaffix", this, needaffix, "sfx-cont", sfx->getCont(),
 2968|      0|                 sfx->getContLen(),
 2969|      0|                 "fail, this suffix needs a further affix and has none");
 2970|      0|    return false;
 2971|      0|  }
 2972|       |
 2973|  47.2k|  return true;
 2974|  47.2k|}
_ZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttct:
 2986|   576M|                                      const FLAG avoidflag) {
 2987|   576M|  struct hentry* rv = nullptr;
 2988|       |
 2989|   576M|  TraceCtx* t = trace_on(scratch.trace);
 2990|   576M|  int candidates = 0;
 2991|       |  // a pass that had nothing to try says so, which is different from a pass that
 2992|       |  // did not run
 2993|   576M|  auto report_empty_pass = [t, &word, start, len, sfxopts, &candidates]() {
 2994|   576M|    if (t && candidates == 0)
 2995|   576M|      trace(*t, "sfx \"%s\" candidates=0%s", word.substr(start, len).c_str(),
 2996|   576M|            (sfxopts & aeXPRODUCT) != 0 ? " xprod=Y" : "");
 2997|   576M|  };
 2998|       |  // a rule the suffix conditions turned away never reaches checkword, so name
 2999|       |  // the rule here and run the conditions again to say which of them refused it
 3000|   576M|  auto report_refused = [this, t, ppfx, cclass, in_compound,
 3001|   576M|                         &candidates](SfxEntry* se) {
 3002|   576M|    if (!t)
 3003|   576M|      return;
 3004|   576M|    ++candidates;
 3005|   576M|    trace_affix(*t, "sfx", this, *se);
 3006|   576M|    TraceScope trace_depth(t);
 3007|   576M|    suffix_applicable(ppfx, se, cclass, in_compound, t);
 3008|   576M|  };
 3009|       |
 3010|       |  // first handle the special case of 0 length suffixes
 3011|   576M|  SfxEntry* se = sStart[0];
 3012|       |
 3013|   576M|  while (se) {
  ------------------
  |  Branch (3013:10): [True: 0, False: 576M]
  ------------------
 3014|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (3014:9): [True: 0, False: 0]
  |  Branch (3014:20): [True: 0, False: 0]
  ------------------
 3015|      0|      if (suffix_applicable(ppfx, se, cclass, in_compound, nullptr)) {
  ------------------
  |  Branch (3015:11): [True: 0, False: 0]
  ------------------
 3016|      0|        ++candidates;
 3017|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx,
 3018|      0|                           (FLAG)cclass, needflag,
 3019|      0|                           (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (3019:29): [True: 0, False: 0]
  ------------------
 3020|      0|                           scratch);
 3021|       |        // Skip a stem with the avoid flag and keep scanning the other suffixes.
 3022|      0|        if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
                      if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3022:13): [True: 0, False: 0]
  |  Branch (3022:19): [True: 0, False: 0]
  ------------------
 3023|      0|          trace_avoidflag(t, avoidflag, rv);
 3024|      0|          rv = nullptr;
 3025|      0|        }
 3026|      0|        if (rv) {
  ------------------
  |  Branch (3026:13): [True: 0, False: 0]
  ------------------
 3027|      0|          sfx = se;  // BUG: sfx not stateless
 3028|      0|          return rv;
 3029|      0|        }
 3030|      0|      } else {
 3031|      0|        report_refused(se);
 3032|      0|      }
 3033|      0|    }
 3034|      0|    se = se->getNext();
 3035|      0|  }
 3036|       |
 3037|       |  // now handle the general case
 3038|   576M|  if (len == 0) {
  ------------------
  |  Branch (3038:7): [True: 47.2k, False: 576M]
  ------------------
 3039|  47.2k|    report_empty_pass();
 3040|  47.2k|    return nullptr;  // FULLSTRIP
 3041|  47.2k|  }
 3042|   576M|  unsigned char sp = word[start + len - 1];
 3043|   576M|  SfxEntry* sptr = sStart[sp];
 3044|       |
 3045|   576M|  while (sptr) {
  ------------------
  |  Branch (3045:10): [True: 505k, False: 576M]
  ------------------
 3046|   505k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3046:9): [True: 458k, False: 46.4k]
  ------------------
 3047|   458k|      if (!suffix_applicable(ppfx, sptr, cclass, in_compound, nullptr))
  ------------------
  |  Branch (3047:11): [True: 411k, False: 47.2k]
  ------------------
 3048|   411k|        report_refused(sptr);
 3049|  47.2k|      else if (in_compound != IN_CPD_END || ppfx ||
  ------------------
  |  |   77|  94.4k|#define IN_CPD_END 2
  ------------------
  |  Branch (3049:16): [True: 47.2k, False: 0]
  |  Branch (3049:45): [True: 0, False: 0]
  ------------------
 3050|      0|               !(sptr->getCont() &&
  ------------------
  |  Branch (3050:18): [True: 0, False: 0]
  ------------------
 3051|  47.2k|                 TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3052|  47.2k|        ++candidates;
 3053|  47.2k|        rv = sptr->checkword(word, start, len, sfxopts, ppfx,
 3054|  47.2k|                             cclass, needflag,
 3055|  47.2k|                             (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (3055:31): [True: 0, False: 47.2k]
  ------------------
 3056|  47.2k|                             scratch);
 3057|  47.2k|        if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |   99|  47.2k|#define FLAG_NULL 0x00
  ------------------
                      if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3057:13): [True: 0, False: 47.2k]
  |  Branch (3057:19): [True: 0, False: 0]
  ------------------
 3058|      0|          trace_avoidflag(t, avoidflag, rv);
 3059|      0|          rv = nullptr;
 3060|      0|        }
 3061|  47.2k|        if (rv) {
  ------------------
  |  Branch (3061:13): [True: 0, False: 47.2k]
  ------------------
 3062|      0|          sfx = sptr;                 // BUG: sfx not stateless
 3063|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 3064|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (3064:15): [True: 0, False: 0]
  ------------------
 3065|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 3066|       |          // LANG_hu section: spec. Hungarian rule
 3067|      0|          else if (langnum == LANG_hu && sptr->getKeyLen() &&
  ------------------
  |  Branch (3067:20): [True: 0, False: 0]
  |  Branch (3067:42): [True: 0, False: 0]
  ------------------
 3068|      0|                   sptr->getKey()[0] == 'i' && sptr->getKey()[1] != 'y' &&
  ------------------
  |  Branch (3068:20): [True: 0, False: 0]
  |  Branch (3068:48): [True: 0, False: 0]
  ------------------
 3069|      0|                   sptr->getKey()[1] != 't') {
  ------------------
  |  Branch (3069:20): [True: 0, False: 0]
  ------------------
 3070|      0|            sfxextra = 1;
 3071|      0|          }
 3072|       |          // END of LANG_hu section
 3073|      0|          return rv;
 3074|      0|        }
 3075|  47.2k|      }
 3076|   458k|      sptr = sptr->getNextEQ();
 3077|   458k|    } else {
 3078|  46.4k|      sptr = sptr->getNextNE();
 3079|  46.4k|    }
 3080|   505k|  }
 3081|       |
 3082|   576M|  report_empty_pass();
 3083|       |
 3084|   576M|  return nullptr;
 3085|   576M|}
_ZN8AffixMgr19suffix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratcht:
 3094|  17.3M|                                             const FLAG needflag) {
 3095|  17.3M|  struct hentry* rv = nullptr;
 3096|       |
 3097|       |  // first handle the special case of 0 length suffixes
 3098|  17.3M|  SfxEntry* se = sStart[0];
 3099|  17.3M|  while (se) {
  ------------------
  |  Branch (3099:10): [True: 0, False: 17.3M]
  ------------------
 3100|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (3100:9): [True: 0, False: 0]
  ------------------
 3101|      0|      rv = se->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 3102|      0|      if (rv)
  ------------------
  |  Branch (3102:11): [True: 0, False: 0]
  ------------------
 3103|      0|        return rv;
 3104|      0|    }
 3105|      0|    se = se->getNext();
 3106|      0|  }
 3107|       |
 3108|       |  // now handle the general case
 3109|  17.3M|  if (len == 0)
  ------------------
  |  Branch (3109:7): [True: 14.5k, False: 17.3M]
  ------------------
 3110|  14.5k|    return nullptr;  // FULLSTRIP
 3111|  17.3M|  unsigned char sp = word[start + len - 1];
 3112|  17.3M|  SfxEntry* sptr = sStart[sp];
 3113|       |
 3114|  17.3M|  while (sptr) {
  ------------------
  |  Branch (3114:10): [True: 81.4k, False: 17.3M]
  ------------------
 3115|  81.4k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3115:9): [True: 42.7k, False: 38.7k]
  ------------------
 3116|  42.7k|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (3116:11): [True: 28.0k, False: 14.7k]
  ------------------
 3117|  28.0k|        rv = sptr->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 3118|  28.0k|        if (rv) {
  ------------------
  |  Branch (3118:13): [True: 0, False: 28.0k]
  ------------------
 3119|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 3120|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (3120:15): [True: 0, False: 0]
  ------------------
 3121|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 3122|      0|          return rv;
 3123|      0|        }
 3124|  28.0k|      }
 3125|  42.7k|      sptr = sptr->getNextEQ();
 3126|  42.7k|    } else {
 3127|  38.7k|      sptr = sptr->getNextNE();
 3128|  38.7k|    }
 3129|  81.4k|  }
 3130|       |
 3131|  17.3M|  return nullptr;
 3132|  17.3M|}
_ZN8AffixMgr25suffix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratcht:
 3141|  4.14k|                                                const FLAG needflag) {
 3142|  4.14k|  std::string result2;
 3143|  4.14k|  std::string result3;
 3144|       |  // the second suffix runs the whole suffix table again for every first suffix
 3145|  4.14k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  122|  4.14k|#define MSEP_REC '\n'
  ------------------
 3146|       |
 3147|       |  // first handle the special case of 0 length suffixes
 3148|  4.14k|  SfxEntry* se = sStart[0];
 3149|  4.14k|  while (se) {
  ------------------
  |  Branch (3149:10): [True: 0, False: 4.14k]
  ------------------
 3150|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (3150:9): [True: 0, False: 0]
  ------------------
 3151|      0|      std::string st = se->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 3152|      0|      if (!st.empty()) {
  ------------------
  |  Branch (3152:11): [True: 0, False: 0]
  ------------------
 3153|      0|        std::string analysis;
 3154|      0|        if (ppfx) {
  ------------------
  |  Branch (3154:13): [True: 0, False: 0]
  ------------------
 3155|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3155:15): [True: 0, False: 0]
  ------------------
 3156|      0|            analysis.append(ppfx->getMorph());
 3157|      0|            analysis.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3158|      0|          } else
 3159|      0|            debugflag(analysis, ppfx->getFlag());
 3160|      0|        }
 3161|      0|        analysis.append(st);
 3162|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (3162:13): [True: 0, False: 0]
  ------------------
 3163|      0|          analysis.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3164|      0|          analysis.append(se->getMorph());
 3165|      0|        } else
 3166|      0|          debugflag(analysis, se->getFlag());
 3167|      0|        result.append(analysis);
 3168|      0|      }
 3169|      0|    }
 3170|      0|    se = se->getNext();
 3171|      0|  }
 3172|       |
 3173|       |  // now handle the general case
 3174|  4.14k|  if (len == 0)
  ------------------
  |  Branch (3174:7): [True: 0, False: 4.14k]
  ------------------
 3175|      0|    return { };  // FULLSTRIP
 3176|  4.14k|  unsigned char sp = word[start + len - 1];
 3177|  4.14k|  SfxEntry* sptr = sStart[sp];
 3178|       |
 3179|  4.14k|  while (sptr) {
  ------------------
  |  Branch (3179:10): [True: 0, False: 4.14k]
  ------------------
 3180|      0|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3180:9): [True: 0, False: 0]
  ------------------
 3181|      0|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (3181:11): [True: 0, False: 0]
  ------------------
 3182|      0|        std::string st = sptr->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 3183|      0|        if (!st.empty()) {
  ------------------
  |  Branch (3183:13): [True: 0, False: 0]
  ------------------
 3184|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 3185|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (3185:15): [True: 0, False: 0]
  ------------------
 3186|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 3187|      0|          result2.assign(st);
 3188|       |
 3189|      0|          result3.clear();
 3190|       |
 3191|      0|          if (sptr->getMorph()) {
  ------------------
  |  Branch (3191:15): [True: 0, False: 0]
  ------------------
 3192|      0|            result3.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3193|      0|            result3.append(sptr->getMorph());
 3194|      0|          } else
 3195|      0|            debugflag(result3, sptr->getFlag());
 3196|      0|          strlinecat(result2, result3);
 3197|      0|          result.append(result2);
 3198|      0|        }
 3199|      0|      }
 3200|      0|      sptr = sptr->getNextEQ();
 3201|      0|    } else {
 3202|      0|      sptr = sptr->getNextNE();
 3203|      0|    }
 3204|      0|  }
 3205|       |
 3206|  4.14k|  return result.join();
 3207|  4.14k|}
_ZN8AffixMgr18suffix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttc:
 3217|  13.1k|                                         char in_compound) {
 3218|  13.1k|  std::string result;
 3219|       |
 3220|  13.1k|  struct hentry* rv = nullptr;
 3221|       |
 3222|       |  // first handle the special case of 0 length suffixes
 3223|  13.1k|  SfxEntry* se = sStart[0];
 3224|  13.1k|  while (se) {
  ------------------
  |  Branch (3224:10): [True: 0, False: 13.1k]
  ------------------
 3225|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (3225:9): [True: 0, False: 0]
  |  Branch (3225:20): [True: 0, False: 0]
  ------------------
 3226|      0|      if (suffix_applicable(ppfx, se, cclass, in_compound, nullptr))
  ------------------
  |  Branch (3226:11): [True: 0, False: 0]
  ------------------
 3227|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx, cclass,
 3228|      0|                           needflag, FLAG_NULL, scratch);
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
 3229|      0|      while (rv) {
  ------------------
  |  Branch (3229:14): [True: 0, False: 0]
  ------------------
 3230|      0|        if (ppfx) {
  ------------------
  |  Branch (3230:13): [True: 0, False: 0]
  ------------------
 3231|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3231:15): [True: 0, False: 0]
  ------------------
 3232|      0|            result.append(ppfx->getMorph());
 3233|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3234|      0|          } else
 3235|      0|            debugflag(result, ppfx->getFlag());
 3236|      0|        }
 3237|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3237:13): [True: 0, False: 0]
  |  Branch (3237:32): [True: 0, False: 0]
  ------------------
 3238|      0|          result.append(HENTRY_DATA2(rv));
 3239|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (3239:13): [True: 0, False: 0]
  ------------------
 3240|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3241|      0|          result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 3242|      0|          result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 3243|      0|        }
 3244|       |
 3245|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3245:13): [True: 0, False: 0]
  |  Branch (3245:33): [True: 0, False: 0]
  ------------------
 3246|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3247|      0|          result.append(HENTRY_DATA2(rv));
 3248|      0|        }
 3249|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (3249:13): [True: 0, False: 0]
  ------------------
 3250|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3251|      0|          result.append(se->getMorph());
 3252|      0|        } else
 3253|      0|          debugflag(result, se->getFlag());
 3254|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 3255|      0|        rv = se->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3256|      0|      }
 3257|      0|    }
 3258|      0|    se = se->getNext();
 3259|      0|  }
 3260|       |
 3261|       |  // now handle the general case
 3262|  13.1k|  if (len == 0)
  ------------------
  |  Branch (3262:7): [True: 0, False: 13.1k]
  ------------------
 3263|      0|    return { };  // FULLSTRIP
 3264|  13.1k|  unsigned char sp = word[start + len - 1];
 3265|  13.1k|  SfxEntry* sptr = sStart[sp];
 3266|       |
 3267|  13.1k|  while (sptr) {
  ------------------
  |  Branch (3267:10): [True: 0, False: 13.1k]
  ------------------
 3268|      0|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3268:9): [True: 0, False: 0]
  ------------------
 3269|      0|      if (suffix_applicable(ppfx, sptr, cclass, in_compound, nullptr))
  ------------------
  |  Branch (3269:11): [True: 0, False: 0]
  ------------------
 3270|      0|        rv = sptr->checkword(word, start, len, sfxopts, ppfx, cclass,
 3271|      0|                             needflag, FLAG_NULL, scratch);
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
 3272|      0|      while (rv) {
  ------------------
  |  Branch (3272:14): [True: 0, False: 0]
  ------------------
 3273|      0|        if (ppfx) {
  ------------------
  |  Branch (3273:13): [True: 0, False: 0]
  ------------------
 3274|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3274:15): [True: 0, False: 0]
  ------------------
 3275|      0|            result.append(ppfx->getMorph());
 3276|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3277|      0|          } else
 3278|      0|            debugflag(result, ppfx->getFlag());
 3279|      0|        }
 3280|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3280:13): [True: 0, False: 0]
  |  Branch (3280:32): [True: 0, False: 0]
  ------------------
 3281|      0|          result.append(HENTRY_DATA2(rv));
 3282|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (3282:13): [True: 0, False: 0]
  ------------------
 3283|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3284|      0|          result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 3285|      0|          result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 3286|      0|        }
 3287|       |
 3288|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3288:13): [True: 0, False: 0]
  |  Branch (3288:33): [True: 0, False: 0]
  ------------------
 3289|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3290|      0|          result.append(HENTRY_DATA2(rv));
 3291|      0|        }
 3292|       |
 3293|      0|        if (sptr->getMorph()) {
  ------------------
  |  Branch (3293:13): [True: 0, False: 0]
  ------------------
 3294|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3295|      0|          result.append(sptr->getMorph());
 3296|      0|        } else
 3297|      0|          debugflag(result, sptr->getFlag());
 3298|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 3299|      0|        rv = sptr->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3300|      0|      }
 3301|      0|      sptr = sptr->getNextEQ();
 3302|      0|    } else {
 3303|      0|      sptr = sptr->getNextNE();
 3304|      0|    }
 3305|      0|  }
 3306|       |
 3307|  13.1k|  return result;
 3308|  13.1k|}
_ZN8AffixMgr11affix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtctPP8PfxEntryPP8SfxEntry:
 3319|  19.7M|                                     SfxEntry** found_sfx) {
 3320|       |
 3321|  19.7M|  TraceCtx* t = trace_on(scratch.trace);
 3322|       |  // the affixes that built the word are reported before the members holding them are cleared
 3323|  19.7M|  auto report_form = [this, t, &word, start, len, found_pfx, found_sfx](const struct hentry* rv) {
 3324|  19.7M|    if (!rv)
 3325|  19.7M|      return;
 3326|  19.7M|    if (t)
 3327|  19.7M|      trace_form(*t, this, word.substr(start, len), rv->word, pfx, sfx);
 3328|  19.7M|    if (found_pfx)
 3329|  19.7M|      *found_pfx = pfx;
 3330|  19.7M|    if (found_sfx)
 3331|  19.7M|      *found_sfx = sfx;
 3332|  19.7M|  };
 3333|       |
 3334|       |  // check all prefixes (also crossed with suffixes if allowed)
 3335|  19.7M|  struct hentry* rv = prefix_check(word, start, len, in_compound, scratch, needflag, avoidflag);
 3336|  19.7M|  if (rv) {
  ------------------
  |  Branch (3336:7): [True: 0, False: 19.7M]
  ------------------
 3337|      0|    report_form(rv);
 3338|      0|    return rv;
 3339|      0|  }
 3340|       |
 3341|       |  // if still not found check all suffixes
 3342|  19.7M|  rv = suffix_check(word, start, len, 0, nullptr, scratch, FLAG_NULL, needflag, in_compound, avoidflag);
  ------------------
  |  |   99|  19.7M|#define FLAG_NULL 0x00
  ------------------
 3343|       |
 3344|  19.7M|  if (havecontclass) {
  ------------------
  |  Branch (3344:7): [True: 6.55M, False: 13.1M]
  ------------------
 3345|  6.55M|    if (rv)
  ------------------
  |  Branch (3345:9): [True: 0, False: 6.55M]
  ------------------
 3346|      0|      report_form(rv);
 3347|       |
 3348|  6.55M|    sfx = nullptr;
 3349|  6.55M|    pfx = nullptr;
 3350|       |
 3351|  6.55M|    if (rv)
  ------------------
  |  Branch (3351:9): [True: 0, False: 6.55M]
  ------------------
 3352|      0|      return rv;
 3353|       |    // if still not found check all two-level suffixes
 3354|  6.55M|    rv = suffix_check_twosfx(word, start, len, 0, nullptr, scratch, needflag);
 3355|       |
 3356|  6.55M|    if (rv) {
  ------------------
  |  Branch (3356:9): [True: 0, False: 6.55M]
  ------------------
 3357|      0|      report_form(rv);
 3358|      0|      return rv;
 3359|      0|    }
 3360|       |    // if still not found check all two-level suffixes
 3361|  6.55M|    rv = prefix_check_twosfx(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   75|  6.55M|#define IN_CPD_NOT 0
  ------------------
 3362|  6.55M|  }
 3363|       |
 3364|  19.7M|  report_form(rv);
 3365|       |
 3366|  19.7M|  return rv;
 3367|  19.7M|}
_ZN8AffixMgr17affix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtc:
 3375|  13.1k|                                  char in_compound) {
 3376|       |  // the four checks below overlap
 3377|  13.1k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  122|  13.1k|#define MSEP_REC '\n'
  ------------------
 3378|       |
 3379|       |  // check all prefixes (also crossed with suffixes if allowed)
 3380|  13.1k|  std::string st = prefix_check_morph(word, start, len, in_compound, scratch);
 3381|  13.1k|  if (!st.empty()) {
  ------------------
  |  Branch (3381:7): [True: 0, False: 13.1k]
  ------------------
 3382|      0|    result.append(st);
 3383|      0|  }
 3384|       |
 3385|       |  // if still not found check all suffixes
 3386|  13.1k|  st = suffix_check_morph(word, start, len, 0, nullptr, scratch, '\0', needflag, in_compound);
 3387|  13.1k|  if (!st.empty()) {
  ------------------
  |  Branch (3387:7): [True: 0, False: 13.1k]
  ------------------
 3388|      0|    result.append(st);
 3389|      0|  }
 3390|       |
 3391|  13.1k|  if (havecontclass) {
  ------------------
  |  Branch (3391:7): [True: 4.14k, False: 8.96k]
  ------------------
 3392|  4.14k|    sfx = nullptr;
 3393|  4.14k|    pfx = nullptr;
 3394|       |    // if still not found check all two-level suffixes
 3395|  4.14k|    st = suffix_check_twosfx_morph(word, start, len, 0, nullptr, scratch, needflag);
 3396|  4.14k|    if (!st.empty()) {
  ------------------
  |  Branch (3396:9): [True: 0, False: 4.14k]
  ------------------
 3397|      0|      result.append(st);
 3398|      0|    }
 3399|       |
 3400|       |    // if still not found check all two-level suffixes
 3401|  4.14k|    st = prefix_check_twosfx_morph(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   75|  4.14k|#define IN_CPD_NOT 0
  ------------------
 3402|  4.14k|    if (!st.empty()) {
  ------------------
  |  Branch (3402:9): [True: 0, False: 4.14k]
  ------------------
 3403|      0|      result.append(st);
 3404|      0|    }
 3405|  4.14k|  }
 3406|       |
 3407|  13.1k|  return result.join();
 3408|  13.1k|}
_ZN8AffixMgr15expand_rootwordEP9guesswordiPKciPKttS3_iS3_:
 3604|   527k|                              const char* phon) {
 3605|   527k|  int nh = 0;
 3606|       |  // first add root word to list
 3607|   527k|  if ((nh < maxn) &&
  ------------------
  |  Branch (3607:7): [True: 527k, False: 0]
  ------------------
 3608|   527k|      !(al && ((needaffix && TESTAFF(ap, needaffix, al)) ||
  ------------------
  |  |  102|  4.17k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 2.08k, False: 2.08k]
  |  |  ------------------
  ------------------
  |  Branch (3608:9): [True: 91.7k, False: 436k]
  |  Branch (3608:17): [True: 4.17k, False: 87.5k]
  ------------------
 3609|   525k|               (onlyincompound && TESTAFF(ap, onlyincompound, al))))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3609:17): [True: 0, False: 89.6k]
  ------------------
 3610|   525k|    wlst[nh].word = mystrdup(ts);
 3611|   525k|    wlst[nh].allow = false;
 3612|   525k|    wlst[nh].orig = nullptr;
 3613|   525k|    nh++;
 3614|       |    // add special phonetic version
 3615|   525k|    if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3615:9): [True: 830, False: 525k]
  |  Branch (3615:17): [True: 830, False: 0]
  ------------------
 3616|    830|      wlst[nh].word = mystrdup(phon);
 3617|    830|      wlst[nh].allow = false;
 3618|    830|      wlst[nh].orig = mystrdup(ts);
 3619|    830|      nh++;
 3620|    830|    }
 3621|   525k|  }
 3622|       |
 3623|       |  // handle suffixes
 3624|   630k|  for (int i = 0; i < al; i++) {
  ------------------
  |  Branch (3624:19): [True: 102k, False: 527k]
  ------------------
 3625|   102k|    const auto c = (unsigned char)(ap[i] & 0x00FF);
 3626|   102k|    SfxEntry* sptr = sFlag[c];
 3627|   164k|    while (sptr) {
  ------------------
  |  Branch (3627:12): [True: 61.6k, False: 102k]
  ------------------
 3628|  61.6k|      if ((sptr->getFlag() == ap[i]) &&
  ------------------
  |  Branch (3628:11): [True: 61.6k, False: 0]
  ------------------
 3629|  61.6k|          (!sptr->getKeyLen() ||
  ------------------
  |  Branch (3629:12): [True: 0, False: 61.6k]
  ------------------
 3630|  61.6k|           ((badl > sptr->getKeyLen()) &&
  ------------------
  |  Branch (3630:13): [True: 35.0k, False: 26.5k]
  ------------------
 3631|  35.0k|            (strcmp(sptr->getAffix(), bad + badl - sptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3631:13): [True: 11, False: 35.0k]
  ------------------
 3632|       |          // check needaffix flag
 3633|     11|          !(sptr->getCont() &&
  ------------------
  |  Branch (3633:13): [True: 4, False: 7]
  ------------------
 3634|      4|            ((needaffix &&
  ------------------
  |  Branch (3634:15): [True: 1, False: 3]
  ------------------
 3635|      1|              TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) ||
  ------------------
  |  |  102|      1|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 3636|      4|             (circumfix &&
  ------------------
  |  Branch (3636:15): [True: 0, False: 4]
  ------------------
 3637|      0|              TESTAFF(sptr->getCont(), circumfix, sptr->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3638|      4|             (onlyincompound &&
  ------------------
  |  Branch (3638:15): [True: 0, False: 4]
  ------------------
 3639|     11|              TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3640|     11|        std::string newword = sptr->add(ts, wl);
 3641|     11|        if (!newword.empty()) {
  ------------------
  |  Branch (3641:13): [True: 11, False: 0]
  ------------------
 3642|     11|          if (nh < maxn) {
  ------------------
  |  Branch (3642:15): [True: 11, False: 0]
  ------------------
 3643|     11|            wlst[nh].word = mystrdup(newword.c_str());
 3644|     11|            wlst[nh].allow = sptr->allowCross();
 3645|     11|            wlst[nh].orig = nullptr;
 3646|     11|            nh++;
 3647|       |            // add special phonetic version
 3648|     11|            if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3648:17): [True: 0, False: 11]
  |  Branch (3648:25): [True: 0, False: 0]
  ------------------
 3649|      0|              std::string prefix(phon);
 3650|      0|              std::string key(sptr->getKey());
 3651|      0|              reverseword(key);
 3652|      0|              prefix.append(key);
 3653|      0|              wlst[nh].word = mystrdup(prefix.c_str());
 3654|      0|              wlst[nh].allow = false;
 3655|      0|              wlst[nh].orig = mystrdup(newword.c_str());
 3656|      0|              nh++;
 3657|      0|            }
 3658|     11|          }
 3659|     11|        }
 3660|     11|      }
 3661|  61.6k|      sptr = sptr->getFlgNxt();
 3662|  61.6k|    }
 3663|   102k|  }
 3664|       |
 3665|   527k|  int n = nh;
 3666|       |
 3667|       |  // handle cross products of prefixes and suffixes
 3668|   528k|  for (int j = 1; j < n; j++)
  ------------------
  |  Branch (3668:19): [True: 840, False: 527k]
  ------------------
 3669|    840|    if (wlst[j].allow) {
  ------------------
  |  Branch (3669:9): [True: 10, False: 830]
  ------------------
 3670|     30|      for (int k = 0; k < al; k++) {
  ------------------
  |  Branch (3670:23): [True: 20, False: 10]
  ------------------
 3671|     20|        const auto c = (unsigned char)(ap[k] & 0x00FF);
 3672|     20|        PfxEntry* cptr = pFlag[c];
 3673|     20|        while (cptr) {
  ------------------
  |  Branch (3673:16): [True: 0, False: 20]
  ------------------
 3674|      0|          if ((cptr->getFlag() == ap[k]) && cptr->allowCross() &&
  ------------------
  |  Branch (3674:15): [True: 0, False: 0]
  |  Branch (3674:45): [True: 0, False: 0]
  ------------------
 3675|      0|              (!cptr->getKeyLen() ||
  ------------------
  |  Branch (3675:16): [True: 0, False: 0]
  ------------------
 3676|      0|               ((badl > cptr->getKeyLen()) &&
  ------------------
  |  Branch (3676:17): [True: 0, False: 0]
  ------------------
 3677|      0|                (strncmp(cptr->getKey(), bad, cptr->getKeyLen()) == 0)))) {
  ------------------
  |  Branch (3677:17): [True: 0, False: 0]
  ------------------
 3678|      0|            int l1 = strlen(wlst[j].word);
 3679|      0|            std::string newword = cptr->add(wlst[j].word, l1);
 3680|      0|            if (!newword.empty()) {
  ------------------
  |  Branch (3680:17): [True: 0, False: 0]
  ------------------
 3681|      0|              if (nh < maxn) {
  ------------------
  |  Branch (3681:19): [True: 0, False: 0]
  ------------------
 3682|      0|                wlst[nh].word = mystrdup(newword.c_str());
 3683|      0|                wlst[nh].allow = cptr->allowCross();
 3684|      0|                wlst[nh].orig = nullptr;
 3685|      0|                nh++;
 3686|      0|              }
 3687|      0|            }
 3688|      0|          }
 3689|      0|          cptr = cptr->getFlgNxt();
 3690|      0|        }
 3691|     20|      }
 3692|     10|    }
 3693|       |
 3694|       |  // now handle pure prefixes
 3695|   630k|  for (int m = 0; m < al; m++) {
  ------------------
  |  Branch (3695:19): [True: 102k, False: 527k]
  ------------------
 3696|   102k|    const auto c = (unsigned char)(ap[m] & 0x00FF);
 3697|   102k|    PfxEntry* ptr = pFlag[c];
 3698|   103k|    while (ptr) {
  ------------------
  |  Branch (3698:12): [True: 840, False: 102k]
  ------------------
 3699|    840|      if ((ptr->getFlag() == ap[m]) &&
  ------------------
  |  Branch (3699:11): [True: 840, False: 0]
  ------------------
 3700|    840|          (!ptr->getKeyLen() ||
  ------------------
  |  Branch (3700:12): [True: 0, False: 840]
  ------------------
 3701|    840|           ((badl > ptr->getKeyLen()) &&
  ------------------
  |  Branch (3701:13): [True: 840, False: 0]
  ------------------
 3702|    840|            (strncmp(ptr->getKey(), bad, ptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3702:13): [True: 11, False: 829]
  ------------------
 3703|       |          // check needaffix flag
 3704|     11|          !(ptr->getCont() &&
  ------------------
  |  Branch (3704:13): [True: 0, False: 11]
  ------------------
 3705|      0|            ((needaffix &&
  ------------------
  |  Branch (3705:15): [True: 0, False: 0]
  ------------------
 3706|      0|              TESTAFF(ptr->getCont(), needaffix, ptr->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3707|      0|             (circumfix &&
  ------------------
  |  Branch (3707:15): [True: 0, False: 0]
  ------------------
 3708|      0|              TESTAFF(ptr->getCont(), circumfix, ptr->getContLen())) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3709|      0|             (onlyincompound &&
  ------------------
  |  Branch (3709:15): [True: 0, False: 0]
  ------------------
 3710|     11|              TESTAFF(ptr->getCont(), onlyincompound, ptr->getContLen()))))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3711|     11|        std::string newword = ptr->add(ts, wl);
 3712|     11|        if (!newword.empty()) {
  ------------------
  |  Branch (3712:13): [True: 11, False: 0]
  ------------------
 3713|     11|          if (nh < maxn) {
  ------------------
  |  Branch (3713:15): [True: 11, False: 0]
  ------------------
 3714|     11|            wlst[nh].word = mystrdup(newword.c_str());
 3715|     11|            wlst[nh].allow = ptr->allowCross();
 3716|     11|            wlst[nh].orig = nullptr;
 3717|     11|            nh++;
 3718|     11|          }
 3719|     11|        }
 3720|     11|      }
 3721|    840|      ptr = ptr->getFlgNxt();
 3722|    840|    }
 3723|   102k|  }
 3724|       |
 3725|   527k|  return nh;
 3726|   527k|}
_ZNK8AffixMgr12get_reptableEv:
 3729|   364k|const std::vector<replentry>& AffixMgr::get_reptable() const {
 3730|   364k|  return pHMgr->get_reptable();
 3731|   364k|}
_ZNK8AffixMgr14get_iconvtableEv:
 3734|  16.9M|RepList* AffixMgr::get_iconvtable() const {
 3735|  16.9M|  if (!iconvtable)
  ------------------
  |  Branch (3735:7): [True: 16.4M, False: 508k]
  ------------------
 3736|  16.4M|    return nullptr;
 3737|   508k|  return iconvtable;
 3738|  16.9M|}
_ZNK8AffixMgr14get_oconvtableEv:
 3741|  99.1k|RepList* AffixMgr::get_oconvtable() const {
 3742|  99.1k|  if (!oconvtable)
  ------------------
  |  Branch (3742:7): [True: 93.8k, False: 5.35k]
  ------------------
 3743|  93.8k|    return nullptr;
 3744|  5.35k|  return oconvtable;
 3745|  99.1k|}
_ZNK8AffixMgr14get_phonetableEv:
 3748|  59.5k|struct phonetable* AffixMgr::get_phonetable() const {
 3749|  59.5k|  if (!phone)
  ------------------
  |  Branch (3749:7): [True: 56.1k, False: 3.38k]
  ------------------
 3750|  56.1k|    return nullptr;
 3751|  3.38k|  return phone;
 3752|  59.5k|}
_ZNK8AffixMgr12get_maptableEv:
 3755|   364k|const std::vector<mapentry>& AffixMgr::get_maptable() const {
 3756|   364k|  return maptable;
 3757|   364k|}
_ZNK8AffixMgr14get_breaktableEv:
 3760|     38|const std::vector<std::string>& AffixMgr::get_breaktable() const {
 3761|     38|  return breaktable;
 3762|     38|}
_ZN8AffixMgr12get_encodingEv:
 3765|     78|const std::string& AffixMgr::get_encoding() {
 3766|     78|  if (encoding.empty())
  ------------------
  |  Branch (3766:7): [True: 20, False: 58]
  ------------------
 3767|     20|    encoding = SPELL_ENCODING;
  ------------------
  |  |   99|     20|#define SPELL_ENCODING "ISO8859-1"
  ------------------
 3768|     78|  return encoding;
 3769|     78|}
_ZNK8AffixMgr11get_langnumEv:
 3772|     76|int AffixMgr::get_langnum() const {
 3773|     76|  return langnum;
 3774|     76|}
_ZNK8AffixMgr19get_complexprefixesEv:
 3777|     76|int AffixMgr::get_complexprefixes() const {
 3778|     76|  return complexprefixes;
 3779|     76|}
_ZNK8AffixMgr13get_fullstripEv:
 3782|  7.78k|int AffixMgr::get_fullstrip() const {
 3783|  7.78k|  return fullstrip;
 3784|  7.78k|}
_ZNK8AffixMgr12get_keepcaseEv:
 3786|   100k|FLAG AffixMgr::get_keepcase() const {
 3787|   100k|  return keepcase;
 3788|   100k|}
_ZNK8AffixMgr14get_forceucaseEv:
 3790|  19.8k|FLAG AffixMgr::get_forceucase() const {
 3791|  19.8k|  return forceucase;
 3792|  19.8k|}
_ZNK8AffixMgr8get_warnEv:
 3794|  28.2k|FLAG AffixMgr::get_warn() const {
 3795|  28.2k|  return warn;
 3796|  28.2k|}
_ZNK8AffixMgr14get_forbidwarnEv:
 3798|      3|int AffixMgr::get_forbidwarn() const {
 3799|      3|  return forbidwarn;
 3800|      3|}
_ZNK8AffixMgr15get_checksharpsEv:
 3802|   596k|int AffixMgr::get_checksharps() const {
 3803|   596k|  return checksharps;
 3804|   596k|}
_ZNK8AffixMgr10get_ignoreEv:
 3811|  36.6M|const char* AffixMgr::get_ignore() const {
 3812|  36.6M|  if (ignorechars.empty())
  ------------------
  |  Branch (3812:7): [True: 32.8M, False: 3.80M]
  ------------------
 3813|  32.8M|    return nullptr;
 3814|  3.80M|  return ignorechars.c_str();
 3815|  36.6M|}
_ZNK8AffixMgr16get_ignore_utf16Ev:
 3818|   899k|const std::vector<w_char>& AffixMgr::get_ignore_utf16() const {
 3819|   899k|  return ignorechars_utf16;
 3820|   899k|}
_ZN8AffixMgr14get_key_stringEv:
 3823|     38|const std::string& AffixMgr::get_key_string() {
 3824|     38|  if (keystring.empty())
  ------------------
  |  Branch (3824:7): [True: 38, False: 0]
  ------------------
 3825|     38|    keystring = SPELL_KEYSTRING;
  ------------------
  |  |  100|     38|#define SPELL_KEYSTRING "qwertyuiop|asdfghjkl|zxcvbnm"
  ------------------
 3826|     38|  return keystring;
 3827|     38|}
_ZNK8AffixMgr14get_try_stringEv:
 3830|     38|const std::string& AffixMgr::get_try_string() const {
 3831|     38|  return trystring;
 3832|     38|}
_ZNK8AffixMgr12get_compoundEv:
 3844|  78.0M|int AffixMgr::get_compound() const {
 3845|  78.0M|  return compoundflag || compoundbegin || !defcpdtable.empty();
  ------------------
  |  Branch (3845:10): [True: 19.2M, False: 58.8M]
  |  Branch (3845:26): [True: 0, False: 58.8M]
  |  Branch (3845:43): [True: 0, False: 58.8M]
  ------------------
 3846|  78.0M|}
_ZNK8AffixMgr16get_compoundflagEv:
 3849|  44.0k|FLAG AffixMgr::get_compoundflag() const {
 3850|  44.0k|  return compoundflag;
 3851|  44.0k|}
_ZNK8AffixMgr17get_forbiddenwordEv:
 3854|   157k|FLAG AffixMgr::get_forbiddenword() const {
 3855|   157k|  return forbiddenword;
 3856|   157k|}
_ZNK8AffixMgr13get_nosuggestEv:
 3859|  59.7k|FLAG AffixMgr::get_nosuggest() const {
 3860|  59.7k|  return nosuggest;
 3861|  59.7k|}
_ZNK8AffixMgr18get_nongramsuggestEv:
 3864|  59.5k|FLAG AffixMgr::get_nongramsuggest() const {
 3865|  59.5k|  return nongramsuggest;
 3866|  59.5k|}
_ZNK8AffixMgr15get_substandardEv:
 3869|    152|FLAG AffixMgr::get_substandard() const {
 3870|    152|  return substandard;
 3871|    152|}
_ZNK8AffixMgr13get_needaffixEv:
 3874|  2.33k|FLAG AffixMgr::get_needaffix() const {
 3875|  2.33k|  return needaffix;
 3876|  2.33k|}
_ZNK8AffixMgr18get_onlyincompoundEv:
 3884|  61.6k|FLAG AffixMgr::get_onlyincompound() const {
 3885|  61.6k|  return onlyincompound;
 3886|  61.6k|}
_ZN8AffixMgr6lookupEPKcm:
 3894|   557M|struct hentry* AffixMgr::lookup(const char* word, size_t len) {
 3895|   557M|  struct hentry* he = nullptr;
 3896|  1.11G|  for (size_t i = 0; i < alldic.size() && !he; ++i) {
  ------------------
  |  Branch (3896:22): [True: 557M, False: 557M]
  |  Branch (3896:43): [True: 557M, False: 0]
  ------------------
 3897|   557M|    he = alldic[i]->lookup(word, len);
 3898|   557M|  }
 3899|   557M|  return he;
 3900|   557M|}
_ZNK8AffixMgr14have_contclassEv:
 3903|  31.0M|int AffixMgr::have_contclass() const {
 3904|  31.0M|  return havecontclass;
 3905|  31.0M|}
_ZNK8AffixMgr8get_utf8Ev:
 3908|     76|int AffixMgr::get_utf8() const {
 3909|     76|  return utf8;
 3910|     76|}
_ZNK8AffixMgr16get_maxngramsugsEv:
 3912|  66.9k|int AffixMgr::get_maxngramsugs() const {
 3913|  66.9k|  return maxngramsugs;
 3914|  66.9k|}
_ZNK8AffixMgr14get_maxcpdsugsEv:
 3916|     38|int AffixMgr::get_maxcpdsugs() const {
 3917|     38|  return maxcpdsugs;
 3918|     38|}
_ZNK8AffixMgr11get_maxdiffEv:
 3920|  45.3k|int AffixMgr::get_maxdiff() const {
 3921|  45.3k|  return maxdiff;
 3922|  45.3k|}
_ZNK8AffixMgr15get_onlymaxdiffEv:
 3924|  7.32k|int AffixMgr::get_onlymaxdiff() const {
 3925|  7.32k|  return onlymaxdiff;
 3926|  7.32k|}
_ZNK8AffixMgr15get_nosplitsugsEv:
 3929|     38|int AffixMgr::get_nosplitsugs() const {
 3930|     38|  return nosplitsugs;
 3931|     38|}
_ZNK8AffixMgr16get_sugswithdotsEv:
 3934|  3.96k|int AffixMgr::get_sugswithdots() const {
 3935|  3.96k|  return sugswithdots;
 3936|  3.96k|}
_ZN8AffixMgr10parse_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPtP7FileMgr:
 3939|     22|bool AffixMgr::parse_flag(const std::string& line, unsigned short* out, FileMgr* af) {
 3940|     22|  if (*out != FLAG_NULL && !(*out >= DEFAULTFLAGS)) {
  ------------------
  |  |   99|     44|#define FLAG_NULL 0x00
  ------------------
                if (*out != FLAG_NULL && !(*out >= DEFAULTFLAGS)) {
  ------------------
  |  |  126|      2|#define DEFAULTFLAGS 65510
  ------------------
  |  Branch (3940:7): [True: 2, False: 20]
  |  Branch (3940:28): [True: 0, False: 2]
  ------------------
 3941|      0|    HUNSPELL_WARNING(
 3942|      0|        stderr,
 3943|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 3944|      0|        af->getlinenum());
 3945|      0|    return false;
 3946|      0|  }
 3947|     22|  std::string s;
 3948|     22|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (3948:7): [True: 0, False: 22]
  ------------------
 3949|      0|    return false;
 3950|     22|  *out = pHMgr->decode_flag(s);
 3951|     22|  return true;
 3952|     22|}
_ZN8AffixMgr9parse_numERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiP7FileMgr:
 3955|     10|bool AffixMgr::parse_num(const std::string& line, int* out, FileMgr* af) {
 3956|     10|  if (*out != -1) {
  ------------------
  |  Branch (3956:7): [True: 0, False: 10]
  ------------------
 3957|      0|    HUNSPELL_WARNING(
 3958|      0|        stderr,
 3959|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 3960|      0|        af->getlinenum());
 3961|      0|    return false;
 3962|      0|  }
 3963|     10|  std::string s;
 3964|     10|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (3964:7): [True: 0, False: 10]
  ------------------
 3965|      0|    return false;
 3966|     10|  *out = atoi(s.c_str());
 3967|     10|  return true;
 3968|     10|}
_ZN8AffixMgr17parse_cpdsyllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 3971|      2|bool AffixMgr::parse_cpdsyllable(const std::string& line, FileMgr* af) {
 3972|      2|  int i = 0;
 3973|      2|  int np = 0;
 3974|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 3975|      8|  while (start_piece != line.end()) {
  ------------------
  |  Branch (3975:10): [True: 6, False: 2]
  ------------------
 3976|      6|    switch (i) {
 3977|      2|      case 0: {
  ------------------
  |  Branch (3977:7): [True: 2, False: 4]
  ------------------
 3978|      2|        np++;
 3979|      2|        break;
 3980|      0|      }
 3981|      2|      case 1: {
  ------------------
  |  Branch (3981:7): [True: 2, False: 4]
  ------------------
 3982|      2|        cpdmaxsyllable = atoi(std::string(start_piece, iter).c_str());
 3983|      2|        np++;
 3984|      2|        break;
 3985|      0|      }
 3986|      2|      case 2: {
  ------------------
  |  Branch (3986:7): [True: 2, False: 4]
  ------------------
 3987|      2|        if (!utf8) {
  ------------------
  |  Branch (3987:13): [True: 0, False: 2]
  ------------------
 3988|      0|          cpdvowels.assign(start_piece, iter);
 3989|      0|          std::sort(cpdvowels.begin(), cpdvowels.end());
 3990|      2|        } else {
 3991|      2|          std::string piece(start_piece, iter);
 3992|      2|          u8_u16(cpdvowels_utf16, piece);
 3993|      2|          std::sort(cpdvowels_utf16.begin(), cpdvowels_utf16.end());
 3994|      2|        }
 3995|      2|        np++;
 3996|      2|        break;
 3997|      0|      }
 3998|      0|      default:
  ------------------
  |  Branch (3998:7): [True: 0, False: 6]
  ------------------
 3999|      0|        break;
 4000|      6|    }
 4001|      6|    ++i;
 4002|      6|    start_piece = mystrsep(line, iter);
 4003|      6|  }
 4004|      2|  if (np < 2) {
  ------------------
  |  Branch (4004:7): [True: 0, False: 2]
  ------------------
 4005|      0|    HUNSPELL_WARNING(stderr,
 4006|      0|                     "error: line %d: missing compoundsyllable information\n",
 4007|      0|                     af->getlinenum());
 4008|      0|    return false;
 4009|      0|  }
 4010|      2|  if (np == 2)
  ------------------
  |  Branch (4010:7): [True: 0, False: 2]
  ------------------
 4011|      0|    cpdvowels = "AEIOUaeiou";
 4012|      2|  return true;
 4013|      2|}
_ZN8AffixMgr15parse_convtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgrPP7RepListS8_:
 4018|      4|                              const std::string& keyword) {
 4019|      4|  if (*rl) {
  ------------------
  |  Branch (4019:7): [True: 0, False: 4]
  ------------------
 4020|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4021|      0|                     af->getlinenum());
 4022|      0|    return false;
 4023|      0|  }
 4024|      4|  int i = 0;
 4025|      4|  int np = 0;
 4026|      4|  int numrl = 0;
 4027|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4028|     18|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4028:10): [True: 14, False: 4]
  ------------------
 4029|     14|    switch (i) {
 4030|      4|      case 0: {
  ------------------
  |  Branch (4030:7): [True: 4, False: 10]
  ------------------
 4031|      4|        np++;
 4032|      4|        break;
 4033|      0|      }
 4034|      4|      case 1: {
  ------------------
  |  Branch (4034:7): [True: 4, False: 10]
  ------------------
 4035|      4|        numrl = atoi(std::string(start_piece, iter).c_str());
 4036|      4|        if (numrl < 1) {
  ------------------
  |  Branch (4036:13): [True: 0, False: 4]
  ------------------
 4037|      0|          HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n",
 4038|      0|                           af->getlinenum());
 4039|      0|          return false;
 4040|      0|        }
 4041|      4|        *rl = new RepList(numrl);
 4042|      4|        if (!*rl)
  ------------------
  |  Branch (4042:13): [True: 0, False: 4]
  ------------------
 4043|      0|          return false;
 4044|      4|        np++;
 4045|      4|        break;
 4046|      4|      }
 4047|      6|      default:
  ------------------
  |  Branch (4047:7): [True: 6, False: 8]
  ------------------
 4048|      6|        break;
 4049|     14|    }
 4050|     14|    ++i;
 4051|     14|    start_piece = mystrsep(line, iter);
 4052|     14|  }
 4053|      4|  if (np != 2) {
  ------------------
  |  Branch (4053:7): [True: 0, False: 4]
  ------------------
 4054|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4055|      0|                     af->getlinenum());
 4056|      0|    return false;
 4057|      0|  }
 4058|       |
 4059|       |  /* now parse the num lines to read in the remainder of the table */
 4060|     26|  for (int j = 0; j < numrl; j++) {
  ------------------
  |  Branch (4060:19): [True: 22, False: 4]
  ------------------
 4061|     22|    std::string nl;
 4062|     22|    if (!af->getline(nl))
  ------------------
  |  Branch (4062:9): [True: 0, False: 22]
  ------------------
 4063|      0|      return false;
 4064|     22|    mychomp(nl);
 4065|     22|    i = 0;
 4066|     22|    std::string pattern;
 4067|     22|    std::string pattern2;
 4068|     22|    iter = nl.begin();
 4069|     22|    start_piece = mystrsep(nl, iter);
 4070|    130|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4070:12): [True: 108, False: 22]
  ------------------
 4071|    108|      {
 4072|    108|        switch (i) {
 4073|     22|          case 0: {
  ------------------
  |  Branch (4073:11): [True: 22, False: 86]
  ------------------
 4074|     22|            if (nl.compare(start_piece - nl.begin(), keyword.size(), keyword, 0, keyword.size()) != 0) {
  ------------------
  |  Branch (4074:17): [True: 0, False: 22]
  ------------------
 4075|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4076|      0|                               af->getlinenum());
 4077|      0|              delete *rl;
 4078|      0|              *rl = nullptr;
 4079|      0|              return false;
 4080|      0|            }
 4081|     22|            break;
 4082|     22|          }
 4083|     22|          case 1: {
  ------------------
  |  Branch (4083:11): [True: 22, False: 86]
  ------------------
 4084|     22|            pattern.assign(start_piece, iter);
 4085|     22|            break;
 4086|     22|          }
 4087|     22|          case 2: {
  ------------------
  |  Branch (4087:11): [True: 22, False: 86]
  ------------------
 4088|     22|            pattern2.assign(start_piece, iter);
 4089|     22|            break;
 4090|     22|          }
 4091|     42|          default:
  ------------------
  |  Branch (4091:11): [True: 42, False: 66]
  ------------------
 4092|     42|            break;
 4093|    108|        }
 4094|    108|        ++i;
 4095|    108|      }
 4096|      0|      start_piece = mystrsep(nl, iter);
 4097|    108|    }
 4098|     22|    if (pattern.empty() || pattern2.empty()) {
  ------------------
  |  Branch (4098:9): [True: 0, False: 22]
  |  Branch (4098:28): [True: 0, False: 22]
  ------------------
 4099|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4100|      0|                       af->getlinenum());
 4101|      0|      return false;
 4102|      0|    }
 4103|       |
 4104|     22|    (*rl)->add(pattern, pattern2);
 4105|     22|  }
 4106|      4|  return true;
 4107|      4|}
_ZN8AffixMgr16parse_phonetableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4110|      2|bool AffixMgr::parse_phonetable(const std::string& line, FileMgr* af) {
 4111|      2|  if (phone) {
  ------------------
  |  Branch (4111:7): [True: 0, False: 2]
  ------------------
 4112|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4113|      0|                     af->getlinenum());
 4114|      0|    return false;
 4115|      0|  }
 4116|      2|  std::unique_ptr<phonetable> new_phone;
 4117|      2|  int num = -1;
 4118|      2|  int i = 0;
 4119|      2|  int np = 0;
 4120|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4121|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4121:10): [True: 4, False: 2]
  ------------------
 4122|      4|    switch (i) {
 4123|      2|      case 0: {
  ------------------
  |  Branch (4123:7): [True: 2, False: 2]
  ------------------
 4124|      2|        np++;
 4125|      2|        break;
 4126|      0|      }
 4127|      2|      case 1: {
  ------------------
  |  Branch (4127:7): [True: 2, False: 2]
  ------------------
 4128|      2|        num = atoi(std::string(start_piece, iter).c_str());
 4129|      2|        if (num < 1) {
  ------------------
  |  Branch (4129:13): [True: 0, False: 2]
  ------------------
 4130|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4131|      0|                           af->getlinenum());
 4132|      0|          return false;
 4133|      0|        }
 4134|      2|        new_phone = std::make_unique<phonetable>();
 4135|      2|        new_phone->utf8 = (char)utf8;
 4136|      2|        np++;
 4137|      2|        break;
 4138|      2|      }
 4139|      0|      default:
  ------------------
  |  Branch (4139:7): [True: 0, False: 4]
  ------------------
 4140|      0|        break;
 4141|      4|    }
 4142|      4|    ++i;
 4143|      4|    start_piece = mystrsep(line, iter);
 4144|      4|  }
 4145|      2|  if (np != 2) {
  ------------------
  |  Branch (4145:7): [True: 0, False: 2]
  ------------------
 4146|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4147|      0|                     af->getlinenum());
 4148|      0|    return false;
 4149|      0|  }
 4150|       |
 4151|       |  /* now parse the phone->num lines to read in the remainder of the table */
 4152|    212|  for (int j = 0; j < num; ++j) {
  ------------------
  |  Branch (4152:19): [True: 210, False: 2]
  ------------------
 4153|    210|    std::string nl;
 4154|    210|    if (!af->getline(nl))
  ------------------
  |  Branch (4154:9): [True: 0, False: 210]
  ------------------
 4155|      0|      return false;
 4156|    210|    mychomp(nl);
 4157|    210|    i = 0;
 4158|    210|    const size_t old_size = new_phone->rules.size();
 4159|    210|    iter = nl.begin();
 4160|    210|    start_piece = mystrsep(nl, iter);
 4161|    840|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4161:12): [True: 630, False: 210]
  ------------------
 4162|    630|      {
 4163|    630|        switch (i) {
 4164|    210|          case 0: {
  ------------------
  |  Branch (4164:11): [True: 210, False: 420]
  ------------------
 4165|    210|            if (nl.compare(start_piece - nl.begin(), 5, "PHONE", 5) != 0) {
  ------------------
  |  Branch (4165:17): [True: 0, False: 210]
  ------------------
 4166|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4167|      0|                               af->getlinenum());
 4168|      0|              return false;
 4169|      0|            }
 4170|    210|            break;
 4171|    210|          }
 4172|    210|          case 1: {
  ------------------
  |  Branch (4172:11): [True: 210, False: 420]
  ------------------
 4173|    210|            new_phone->rules.emplace_back(start_piece, iter);
 4174|    210|            break;
 4175|    210|          }
 4176|    210|          case 2: {
  ------------------
  |  Branch (4176:11): [True: 210, False: 420]
  ------------------
 4177|    210|            new_phone->rules.emplace_back(start_piece, iter);
 4178|    210|            mystrrep(new_phone->rules.back(), "_", "");
 4179|    210|            break;
 4180|    210|          }
 4181|      0|          default:
  ------------------
  |  Branch (4181:11): [True: 0, False: 630]
  ------------------
 4182|      0|            break;
 4183|    630|        }
 4184|    630|        ++i;
 4185|    630|      }
 4186|      0|      start_piece = mystrsep(nl, iter);
 4187|    630|    }
 4188|    210|    if (new_phone->rules.size() != old_size + 2) {
  ------------------
  |  Branch (4188:9): [True: 0, False: 210]
  ------------------
 4189|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4190|      0|                       af->getlinenum());
 4191|      0|      return false;
 4192|      0|    }
 4193|    210|  }
 4194|      2|  new_phone->rules.emplace_back("");
 4195|      2|  new_phone->rules.emplace_back("");
 4196|      2|  init_phonet_hash(*new_phone);
 4197|      2|  phone = new_phone.release();
 4198|      2|  return true;
 4199|      2|}
_ZN8AffixMgr19parse_checkcpdtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4202|      2|bool AffixMgr::parse_checkcpdtable(const std::string& line, FileMgr* af) {
 4203|      2|  if (parsedcheckcpd) {
  ------------------
  |  Branch (4203:7): [True: 0, False: 2]
  ------------------
 4204|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4205|      0|                     af->getlinenum());
 4206|      0|    return false;
 4207|      0|  }
 4208|      2|  parsedcheckcpd = true;
 4209|      2|  int numcheckcpd = -1;
 4210|      2|  int i = 0;
 4211|      2|  int np = 0;
 4212|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4213|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4213:10): [True: 4, False: 2]
  ------------------
 4214|      4|    switch (i) {
 4215|      2|      case 0: {
  ------------------
  |  Branch (4215:7): [True: 2, False: 2]
  ------------------
 4216|      2|        np++;
 4217|      2|        break;
 4218|      0|      }
 4219|      2|      case 1: {
  ------------------
  |  Branch (4219:7): [True: 2, False: 2]
  ------------------
 4220|      2|        numcheckcpd = atoi(std::string(start_piece, iter).c_str());
 4221|      2|        if (numcheckcpd < 1) {
  ------------------
  |  Branch (4221:13): [True: 0, False: 2]
  ------------------
 4222|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4223|      0|                           af->getlinenum());
 4224|      0|          return false;
 4225|      0|        }
 4226|      2|        checkcpdtable.reserve(std::min(numcheckcpd, 16384));
 4227|      2|        np++;
 4228|      2|        break;
 4229|      2|      }
 4230|      0|      default:
  ------------------
  |  Branch (4230:7): [True: 0, False: 4]
  ------------------
 4231|      0|        break;
 4232|      4|    }
 4233|      4|    ++i;
 4234|      4|    start_piece = mystrsep(line, iter);
 4235|      4|  }
 4236|      2|  if (np != 2) {
  ------------------
  |  Branch (4236:7): [True: 0, False: 2]
  ------------------
 4237|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4238|      0|                     af->getlinenum());
 4239|      0|    return false;
 4240|      0|  }
 4241|       |
 4242|       |  /* now parse the numcheckcpd lines to read in the remainder of the table */
 4243|      6|  for (int j = 0; j < numcheckcpd; ++j) {
  ------------------
  |  Branch (4243:19): [True: 4, False: 2]
  ------------------
 4244|      4|    std::string nl;
 4245|      4|    if (!af->getline(nl))
  ------------------
  |  Branch (4245:9): [True: 0, False: 4]
  ------------------
 4246|      0|      return false;
 4247|      4|    mychomp(nl);
 4248|      4|    i = 0;
 4249|      4|    checkcpdtable.emplace_back();
 4250|      4|    iter = nl.begin();
 4251|      4|    start_piece = mystrsep(nl, iter);
 4252|     16|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4252:12): [True: 12, False: 4]
  ------------------
 4253|     12|      switch (i) {
 4254|      4|        case 0: {
  ------------------
  |  Branch (4254:9): [True: 4, False: 8]
  ------------------
 4255|      4|          if (nl.compare(start_piece - nl.begin(), 20, "CHECKCOMPOUNDPATTERN", 20) != 0) {
  ------------------
  |  Branch (4255:15): [True: 0, False: 4]
  ------------------
 4256|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4257|      0|                             af->getlinenum());
 4258|      0|            checkcpdtable.clear();
 4259|      0|            return false;
 4260|      0|          }
 4261|      4|          break;
 4262|      4|        }
 4263|      4|        case 1: {
  ------------------
  |  Branch (4263:9): [True: 4, False: 8]
  ------------------
 4264|      4|          checkcpdtable.back().pattern.assign(start_piece, iter);
 4265|      4|          size_t slash_pos = checkcpdtable.back().pattern.find('/');
 4266|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4266:15): [True: 0, False: 4]
  ------------------
 4267|      0|            std::string chunk(checkcpdtable.back().pattern, slash_pos + 1);
 4268|      0|            checkcpdtable.back().pattern.resize(slash_pos);
 4269|      0|            checkcpdtable.back().cond = pHMgr->decode_flag(chunk);
 4270|      0|          }
 4271|      4|          break;
 4272|      4|        }
 4273|      4|        case 2: {
  ------------------
  |  Branch (4273:9): [True: 4, False: 8]
  ------------------
 4274|      4|          checkcpdtable.back().pattern2.assign(start_piece, iter);
 4275|      4|          size_t slash_pos = checkcpdtable.back().pattern2.find('/');
 4276|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4276:15): [True: 0, False: 4]
  ------------------
 4277|      0|            std::string chunk(checkcpdtable.back().pattern2, slash_pos + 1);
 4278|      0|            checkcpdtable.back().pattern2.resize(slash_pos);
 4279|      0|            checkcpdtable.back().cond2 = pHMgr->decode_flag(chunk);
 4280|      0|          }
 4281|      4|          break;
 4282|      4|        }
 4283|      0|        case 3: {
  ------------------
  |  Branch (4283:9): [True: 0, False: 12]
  ------------------
 4284|      0|          checkcpdtable.back().pattern3.assign(start_piece, iter);
 4285|      0|          simplifiedcpd = 1;
 4286|      0|          break;
 4287|      4|        }
 4288|      0|        default:
  ------------------
  |  Branch (4288:9): [True: 0, False: 12]
  ------------------
 4289|      0|          break;
 4290|     12|      }
 4291|     12|      i++;
 4292|     12|      start_piece = mystrsep(nl, iter);
 4293|     12|    }
 4294|      4|  }
 4295|      2|  return true;
 4296|      2|}
_ZN8AffixMgr14parse_maptableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4400|      2|bool AffixMgr::parse_maptable(const std::string& line, FileMgr* af) {
 4401|      2|  if (parsedmaptable) {
  ------------------
  |  Branch (4401:7): [True: 0, False: 2]
  ------------------
 4402|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4403|      0|                     af->getlinenum());
 4404|      0|    return false;
 4405|      0|  }
 4406|      2|  parsedmaptable = true;
 4407|      2|  int nummap = -1;
 4408|      2|  int i = 0;
 4409|      2|  int np = 0;
 4410|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4411|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4411:10): [True: 4, False: 2]
  ------------------
 4412|      4|    switch (i) {
 4413|      2|      case 0: {
  ------------------
  |  Branch (4413:7): [True: 2, False: 2]
  ------------------
 4414|      2|        np++;
 4415|      2|        break;
 4416|      0|      }
 4417|      2|      case 1: {
  ------------------
  |  Branch (4417:7): [True: 2, False: 2]
  ------------------
 4418|      2|        nummap = atoi(std::string(start_piece, iter).c_str());
 4419|      2|        if (nummap < 1) {
  ------------------
  |  Branch (4419:13): [True: 0, False: 2]
  ------------------
 4420|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4421|      0|                           af->getlinenum());
 4422|      0|          return false;
 4423|      0|        }
 4424|      2|        maptable.reserve(std::min(nummap, 16384));
 4425|      2|        np++;
 4426|      2|        break;
 4427|      2|      }
 4428|      0|      default:
  ------------------
  |  Branch (4428:7): [True: 0, False: 4]
  ------------------
 4429|      0|        break;
 4430|      4|    }
 4431|      4|    ++i;
 4432|      4|    start_piece = mystrsep(line, iter);
 4433|      4|  }
 4434|      2|  if (np != 2) {
  ------------------
  |  Branch (4434:7): [True: 0, False: 2]
  ------------------
 4435|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4436|      0|                     af->getlinenum());
 4437|      0|    return false;
 4438|      0|  }
 4439|       |
 4440|       |  /* now parse the nummap lines to read in the remainder of the table */
 4441|      8|  for (int j = 0; j < nummap; ++j) {
  ------------------
  |  Branch (4441:19): [True: 6, False: 2]
  ------------------
 4442|      6|    std::string nl;
 4443|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4443:9): [True: 0, False: 6]
  ------------------
 4444|      0|      return false;
 4445|      6|    mychomp(nl);
 4446|      6|    i = 0;
 4447|      6|    maptable.emplace_back();
 4448|      6|    iter = nl.begin();
 4449|      6|    start_piece = mystrsep(nl, iter);
 4450|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4450:12): [True: 12, False: 6]
  ------------------
 4451|     12|      switch (i) {
 4452|      6|        case 0: {
  ------------------
  |  Branch (4452:9): [True: 6, False: 6]
  ------------------
 4453|      6|          if (nl.compare(start_piece - nl.begin(), 3, "MAP", 3) != 0) {
  ------------------
  |  Branch (4453:15): [True: 0, False: 6]
  ------------------
 4454|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4455|      0|                             af->getlinenum());
 4456|      0|            nummap = 0;
 4457|      0|            return false;
 4458|      0|          }
 4459|      6|          break;
 4460|      6|        }
 4461|      6|        case 1: {
  ------------------
  |  Branch (4461:9): [True: 6, False: 6]
  ------------------
 4462|     22|          for (auto k = start_piece; k != iter; ++k) {
  ------------------
  |  Branch (4462:38): [True: 16, False: 6]
  ------------------
 4463|     16|            auto chb = k, che = k + 1;
 4464|     16|            if (*k == '(') {
  ------------------
  |  Branch (4464:17): [True: 2, False: 14]
  ------------------
 4465|      2|              auto parpos = std::find(k, iter, ')');
 4466|      2|              if (parpos != iter) {
  ------------------
  |  Branch (4466:19): [True: 2, False: 0]
  ------------------
 4467|      2|                chb = k + 1;
 4468|      2|                che = parpos;
 4469|      2|                k = parpos;
 4470|      2|              }
 4471|     14|            } else {
 4472|     14|              if (utf8 && (*k & 0xc0) == 0xc0) {
  ------------------
  |  Branch (4472:19): [True: 14, False: 0]
  |  Branch (4472:27): [True: 10, False: 4]
  ------------------
 4473|     10|                ++k;
 4474|     20|                while (k != iter && is_utf8_cont(*k))
  ------------------
  |  Branch (4474:24): [True: 18, False: 2]
  |  Branch (4474:37): [True: 10, False: 8]
  ------------------
 4475|     10|                    ++k;
 4476|     10|                che = k;
 4477|     10|                --k;
 4478|     10|              }
 4479|     14|            }
 4480|     16|            if (chb == che) {
  ------------------
  |  Branch (4480:17): [True: 0, False: 16]
  ------------------
 4481|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4482|      0|                              af->getlinenum());
 4483|      0|            }
 4484|       |
 4485|     16|            maptable.back().emplace_back(chb, che);
 4486|     16|          }
 4487|      6|          break;
 4488|      6|        }
 4489|      0|        default:
  ------------------
  |  Branch (4489:9): [True: 0, False: 12]
  ------------------
 4490|      0|          break;
 4491|     12|      }
 4492|     12|      ++i;
 4493|     12|      start_piece = mystrsep(nl, iter);
 4494|     12|    }
 4495|      6|    if (maptable.back().empty()) {
  ------------------
  |  Branch (4495:9): [True: 0, False: 6]
  ------------------
 4496|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4497|      0|                       af->getlinenum());
 4498|      0|      return false;
 4499|      0|    }
 4500|      6|  }
 4501|      2|  return true;
 4502|      2|}
_ZN8AffixMgr16parse_breaktableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4505|      4|bool AffixMgr::parse_breaktable(const std::string& line, FileMgr* af) {
 4506|      4|  if (parsedbreaktable) {
  ------------------
  |  Branch (4506:7): [True: 0, False: 4]
  ------------------
 4507|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4508|      0|                     af->getlinenum());
 4509|      0|    return false;
 4510|      0|  }
 4511|      4|  parsedbreaktable = true;
 4512|      4|  int numbreak = -1;
 4513|      4|  int i = 0;
 4514|      4|  int np = 0;
 4515|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4516|     12|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4516:10): [True: 8, False: 4]
  ------------------
 4517|      8|    switch (i) {
 4518|      4|      case 0: {
  ------------------
  |  Branch (4518:7): [True: 4, False: 4]
  ------------------
 4519|      4|        np++;
 4520|      4|        break;
 4521|      0|      }
 4522|      4|      case 1: {
  ------------------
  |  Branch (4522:7): [True: 4, False: 4]
  ------------------
 4523|      4|        numbreak = atoi(std::string(start_piece, iter).c_str());
 4524|      4|        if (numbreak < 0) {
  ------------------
  |  Branch (4524:13): [True: 0, False: 4]
  ------------------
 4525|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4526|      0|                           af->getlinenum());
 4527|      0|          return false;
 4528|      0|        }
 4529|      4|        if (numbreak == 0)
  ------------------
  |  Branch (4529:13): [True: 0, False: 4]
  ------------------
 4530|      0|          return true;
 4531|      4|        breaktable.reserve(std::min(numbreak, 16384));
 4532|      4|        np++;
 4533|      4|        break;
 4534|      4|      }
 4535|      0|      default:
  ------------------
  |  Branch (4535:7): [True: 0, False: 8]
  ------------------
 4536|      0|        break;
 4537|      8|    }
 4538|      8|    ++i;
 4539|      8|    start_piece = mystrsep(line, iter);
 4540|      8|  }
 4541|      4|  if (np != 2) {
  ------------------
  |  Branch (4541:7): [True: 0, False: 4]
  ------------------
 4542|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4543|      0|                     af->getlinenum());
 4544|      0|    return false;
 4545|      0|  }
 4546|       |
 4547|       |  /* now parse the numbreak lines to read in the remainder of the table */
 4548|     10|  for (int j = 0; j < numbreak; ++j) {
  ------------------
  |  Branch (4548:19): [True: 6, False: 4]
  ------------------
 4549|      6|    std::string nl;
 4550|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4550:9): [True: 0, False: 6]
  ------------------
 4551|      0|      return false;
 4552|      6|    mychomp(nl);
 4553|      6|    i = 0;
 4554|      6|    iter = nl.begin();
 4555|      6|    start_piece = mystrsep(nl, iter);
 4556|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4556:12): [True: 12, False: 6]
  ------------------
 4557|     12|      switch (i) {
 4558|      6|        case 0: {
  ------------------
  |  Branch (4558:9): [True: 6, False: 6]
  ------------------
 4559|      6|          if (nl.compare(start_piece - nl.begin(), 5, "BREAK", 5) != 0) {
  ------------------
  |  Branch (4559:15): [True: 0, False: 6]
  ------------------
 4560|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4561|      0|                             af->getlinenum());
 4562|      0|            numbreak = 0;
 4563|      0|            return false;
 4564|      0|          }
 4565|      6|          break;
 4566|      6|        }
 4567|      6|        case 1: {
  ------------------
  |  Branch (4567:9): [True: 6, False: 6]
  ------------------
 4568|      6|          breaktable.emplace_back(start_piece, iter);
 4569|      6|          break;
 4570|      6|        }
 4571|      0|        default:
  ------------------
  |  Branch (4571:9): [True: 0, False: 12]
  ------------------
 4572|      0|          break;
 4573|     12|      }
 4574|     12|      ++i;
 4575|     12|      start_piece = mystrsep(nl, iter);
 4576|     12|    }
 4577|      6|  }
 4578|       |
 4579|      4|  if (breaktable.size() != static_cast<size_t>(numbreak)) {
  ------------------
  |  Branch (4579:7): [True: 0, False: 4]
  ------------------
 4580|      0|    HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4581|      0|                     af->getlinenum());
 4582|      0|    return false;
 4583|      0|  }
 4584|       |
 4585|      4|  return true;
 4586|      4|}
_ZN8AffixMgr17reverse_conditionERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 4588|     38|void AffixMgr::reverse_condition(std::string& piece) {
 4589|     38|  if (piece.empty())
  ------------------
  |  Branch (4589:7): [True: 0, False: 38]
  ------------------
 4590|      0|      return;
 4591|       |
 4592|     38|  int neg = 0;
 4593|       |  // iterate backwards; k wraps to npos (SIZE_MAX) when decremented past 0
 4594|     92|  for (size_t k = piece.size() - 1; k != std::string::npos; --k) {
  ------------------
  |  Branch (4594:37): [True: 54, False: 38]
  ------------------
 4595|     54|    switch (piece[k]) {
 4596|      2|      case '[': {
  ------------------
  |  Branch (4596:7): [True: 2, False: 52]
  ------------------
 4597|      2|        if (neg)
  ------------------
  |  Branch (4597:13): [True: 0, False: 2]
  ------------------
 4598|      0|          piece[k + 1] = '[';
 4599|      2|        else
 4600|      2|          piece[k] = ']';
 4601|      2|        break;
 4602|      0|      }
 4603|      2|      case ']': {
  ------------------
  |  Branch (4603:7): [True: 2, False: 52]
  ------------------
 4604|      2|        piece[k] = '[';
 4605|      2|        if (neg)
  ------------------
  |  Branch (4605:13): [True: 0, False: 2]
  ------------------
 4606|      0|          piece[k + 1] = '^';
 4607|      2|        neg = 0;
 4608|      2|        break;
 4609|      0|      }
 4610|      0|      case '^': {
  ------------------
  |  Branch (4610:7): [True: 0, False: 54]
  ------------------
 4611|      0|        if (piece[k + 1] == ']')
  ------------------
  |  Branch (4611:13): [True: 0, False: 0]
  ------------------
 4612|      0|          neg = 1;
 4613|      0|        else if (neg)
  ------------------
  |  Branch (4613:18): [True: 0, False: 0]
  ------------------
 4614|      0|          piece[k + 1] = piece[k];
 4615|      0|        break;
 4616|      0|      }
 4617|     50|      default: {
  ------------------
  |  Branch (4617:7): [True: 50, False: 4]
  ------------------
 4618|     50|        if (neg)
  ------------------
  |  Branch (4618:13): [True: 0, False: 50]
  ------------------
 4619|      0|          piece[k + 1] = piece[k];
 4620|     50|      }
 4621|     54|    }
 4622|     54|  }
 4623|     38|}
_ZN8AffixMgr11parse_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEcP7FileMgrPc:
 4677|     26|                          char* dupflags) {
 4678|     26|  int numents = 0;  // number of AffEntry structures to parse
 4679|       |
 4680|     26|  unsigned short aflag = 0;  // affix char identifier
 4681|       |
 4682|     26|  char ff = 0;
 4683|     26|  char xprod = 0;
 4684|     26|  int headerline = af->getlinenum();
 4685|     26|  entries_container affentries(at, this);
 4686|       |
 4687|     26|  int i = 0;
 4688|       |
 4689|       |// checking lines with bad syntax
 4690|       |#ifdef DEBUG
 4691|       |  int basefieldnum = 0;
 4692|       |#endif
 4693|       |
 4694|       |  // split affix header line into pieces
 4695|       |
 4696|     26|  int np = 0;
 4697|     26|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4698|    130|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4698:10): [True: 104, False: 26]
  ------------------
 4699|    104|    switch (i) {
 4700|       |      // piece 1 - is type of affix
 4701|     26|      case 0: {
  ------------------
  |  Branch (4701:7): [True: 26, False: 78]
  ------------------
 4702|     26|        np++;
 4703|     26|        break;
 4704|      0|      }
 4705|       |
 4706|       |      // piece 2 - is affix char
 4707|     26|      case 1: {
  ------------------
  |  Branch (4707:7): [True: 26, False: 78]
  ------------------
 4708|     26|        np++;
 4709|     26|        aflag = pHMgr->decode_flag(std::string(start_piece, iter));
 4710|     26|        if (((at == 'S') && (dupflags[aflag] & dupSFX)) ||
  ------------------
  |  |   88|     18|#define dupSFX (1 << 0)
  ------------------
  |  Branch (4710:14): [True: 18, False: 8]
  |  Branch (4710:29): [True: 0, False: 18]
  ------------------
 4711|     26|            ((at == 'P') && (dupflags[aflag] & dupPFX))) {
  ------------------
  |  |   89|      8|#define dupPFX (1 << 1)
  ------------------
  |  Branch (4711:14): [True: 8, False: 18]
  |  Branch (4711:29): [True: 0, False: 8]
  ------------------
 4712|      0|          HUNSPELL_WARNING(
 4713|      0|              stderr,
 4714|      0|              "error: line %d: multiple definitions of an affix flag\n",
 4715|      0|              af->getlinenum());
 4716|      0|        }
 4717|     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 (4717:35): [True: 18, False: 8]
  ------------------
 4718|     26|        break;
 4719|      0|      }
 4720|       |      // piece 3 - is cross product indicator
 4721|     26|      case 2: {
  ------------------
  |  Branch (4721:7): [True: 26, False: 78]
  ------------------
 4722|     26|        np++;
 4723|     26|        xprod = *start_piece;
 4724|     26|        if (xprod == 'Y')
  ------------------
  |  Branch (4724:13): [True: 26, False: 0]
  ------------------
 4725|     26|          ff = aeXPRODUCT;
  ------------------
  |  |   65|     26|#define aeXPRODUCT (1 << 0)
  ------------------
 4726|     26|        break;
 4727|      0|      }
 4728|       |
 4729|       |      // piece 4 - is number of affentries
 4730|     26|      case 3: {
  ------------------
  |  Branch (4730:7): [True: 26, False: 78]
  ------------------
 4731|     26|        np++;
 4732|     26|        numents = atoi(std::string(start_piece, iter).c_str());
 4733|     26|        if ((numents <= 0) || ((std::numeric_limits<size_t>::max() /
  ------------------
  |  Branch (4733:13): [True: 0, False: 26]
  |  Branch (4733:31): [True: 0, False: 26]
  ------------------
 4734|     26|                                sizeof(AffEntry)) < static_cast<size_t>(numents))) {
 4735|      0|          std::string err = pHMgr->encode_flag(aflag);
 4736|      0|          HUNSPELL_WARNING(stderr, "error: line %d: affix %s: bad entry number\n",
 4737|      0|                           af->getlinenum(), err.c_str());
 4738|      0|          return false;
 4739|      0|        }
 4740|       |
 4741|     26|        char opts = ff;
 4742|     26|        if (utf8)
  ------------------
  |  Branch (4742:13): [True: 6, False: 20]
  ------------------
 4743|      6|          opts |= aeUTF8;
  ------------------
  |  |   66|      6|#define aeUTF8 (1 << 1)
  ------------------
 4744|     26|        if (pHMgr->is_aliasf())
  ------------------
  |  Branch (4744:13): [True: 4, False: 22]
  ------------------
 4745|      4|          opts |= aeALIASF;
  ------------------
  |  |   67|      4|#define aeALIASF (1 << 2)
  ------------------
 4746|     26|        if (pHMgr->is_aliasm())
  ------------------
  |  Branch (4746:13): [True: 0, False: 26]
  ------------------
 4747|      0|          opts |= aeALIASM;
  ------------------
  |  |   68|      0|#define aeALIASM (1 << 3)
  ------------------
 4748|     26|        affentries.initialize(numents, opts, aflag);
 4749|     26|      }
 4750|       |
 4751|     26|      default:
  ------------------
  |  Branch (4751:7): [True: 0, False: 104]
  ------------------
 4752|     26|        break;
 4753|    104|    }
 4754|    104|    ++i;
 4755|    104|    start_piece = mystrsep(line, iter);
 4756|    104|  }
 4757|       |  // check to make sure we parsed enough pieces
 4758|     26|  if (np != 4) {
  ------------------
  |  Branch (4758:7): [True: 0, False: 26]
  ------------------
 4759|      0|    std::string err = pHMgr->encode_flag(aflag);
 4760|      0|    HUNSPELL_WARNING(stderr, "error: line %d: affix %s: missing data\n",
 4761|      0|                     af->getlinenum(), err.c_str());
 4762|      0|    return false;
 4763|      0|  }
 4764|       |
 4765|       |  // now parse numents affentries for this affix
 4766|     26|  AffEntry* entry = affentries.first_entry();
 4767|     68|  for (int ent = 0; ent < numents; ++ent) {
  ------------------
  |  Branch (4767:21): [True: 42, False: 26]
  ------------------
 4768|     42|    std::string nl;
 4769|     42|    if (!af->getline(nl))
  ------------------
  |  Branch (4769:9): [True: 0, False: 42]
  ------------------
 4770|      0|      return false;
 4771|     42|    mychomp(nl);
 4772|     42|    int ruleline = af->getlinenum();
 4773|       |
 4774|     42|    iter = nl.begin();
 4775|     42|    i = 0;
 4776|     42|    np = 0;
 4777|       |
 4778|       |    // split line into pieces
 4779|     42|    start_piece = mystrsep(nl, iter);
 4780|    258|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4780:12): [True: 216, False: 42]
  ------------------
 4781|    216|      switch (i) {
 4782|       |        // piece 1 - is type
 4783|     42|        case 0: {
  ------------------
  |  Branch (4783:9): [True: 42, False: 174]
  ------------------
 4784|     42|          np++;
 4785|     42|          if (ent != 0)
  ------------------
  |  Branch (4785:15): [True: 16, False: 26]
  ------------------
 4786|     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)
  ------------------
 4787|     42|          break;
 4788|      0|        }
 4789|       |
 4790|       |        // piece 2 - is affix char
 4791|     42|        case 1: {
  ------------------
  |  Branch (4791:9): [True: 42, False: 174]
  ------------------
 4792|     42|          np++;
 4793|     42|          std::string chunk(start_piece, iter);
 4794|     42|          if (pHMgr->decode_flag(chunk) != aflag) {
  ------------------
  |  Branch (4794:15): [True: 0, False: 42]
  ------------------
 4795|      0|            std::string err = pHMgr->encode_flag(aflag);
 4796|      0|            HUNSPELL_WARNING(stderr,
 4797|      0|                             "error: line %d: affix %s is corrupt\n",
 4798|      0|                             af->getlinenum(), err.c_str());
 4799|      0|            return false;
 4800|      0|          }
 4801|       |
 4802|     42|          if (ent != 0) {
  ------------------
  |  Branch (4802:15): [True: 16, False: 26]
  ------------------
 4803|     16|            AffEntry* start_entry = affentries.first_entry();
 4804|     16|            entry->aflag = start_entry->aflag;
 4805|     16|          }
 4806|     42|          break;
 4807|     42|        }
 4808|       |
 4809|       |        // piece 3 - is string to strip or 0 for null
 4810|     42|        case 2: {
  ------------------
  |  Branch (4810:9): [True: 42, False: 174]
  ------------------
 4811|     42|          np++;
 4812|     42|          entry->strip = std::string(start_piece, iter);
 4813|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4813:15): [True: 4, False: 38]
  ------------------
 4814|      4|            if (utf8)
  ------------------
  |  Branch (4814:17): [True: 0, False: 4]
  ------------------
 4815|      0|              reverseword_utf(entry->strip);
 4816|      4|            else
 4817|      4|              reverseword(entry->strip);
 4818|      4|          }
 4819|     42|          if (entry->strip.compare("0") == 0) {
  ------------------
  |  Branch (4819:15): [True: 36, False: 6]
  ------------------
 4820|     36|            entry->strip.clear();
 4821|     36|          }
 4822|     42|          break;
 4823|     42|        }
 4824|       |
 4825|       |        // piece 4 - is affix string or 0 for null
 4826|     42|        case 3: {
  ------------------
  |  Branch (4826:9): [True: 42, False: 174]
  ------------------
 4827|     42|          entry->morphcode = nullptr;
 4828|     42|          entry->contclass = nullptr;
 4829|     42|          entry->contclasslen = 0;
 4830|     42|          np++;
 4831|     42|          std::string::const_iterator dash = std::find(start_piece, iter, '/');
 4832|     42|          if (dash != iter) {
  ------------------
  |  Branch (4832:15): [True: 18, False: 24]
  ------------------
 4833|     18|            entry->appnd = std::string(start_piece, dash);
 4834|     18|            std::string dash_str(dash + 1, iter);
 4835|       |
 4836|     18|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4836:17): [True: 2, False: 16]
  |  Branch (4836:41): [True: 0, False: 2]
  ------------------
 4837|      0|              if (utf8) {
  ------------------
  |  Branch (4837:19): [True: 0, False: 0]
  ------------------
 4838|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4839|      0|              } else {
 4840|      0|                remove_ignored_chars(entry->appnd, ignorechars);
 4841|      0|              }
 4842|      0|            }
 4843|       |
 4844|     18|            if (complexprefixes) {
  ------------------
  |  Branch (4844:17): [True: 2, False: 16]
  ------------------
 4845|      2|              if (utf8)
  ------------------
  |  Branch (4845:19): [True: 0, False: 2]
  ------------------
 4846|      0|                reverseword_utf(entry->appnd);
 4847|      2|              else
 4848|      2|                reverseword(entry->appnd);
 4849|      2|            }
 4850|       |
 4851|     18|            if (pHMgr->is_aliasf()) {
  ------------------
  |  Branch (4851:17): [True: 2, False: 16]
  ------------------
 4852|      2|              int index = atoi(dash_str.c_str());
 4853|      2|              entry->contclasslen = (unsigned short)pHMgr->get_aliasf(
 4854|      2|                  index, &(entry->contclass), af);
 4855|      2|              if (!entry->contclasslen)
  ------------------
  |  Branch (4855:19): [True: 0, False: 2]
  ------------------
 4856|      0|                HUNSPELL_WARNING(stderr,
 4857|      0|                                 "error: bad affix flag alias: \"%s\"\n",
 4858|      0|                                 dash_str.c_str());
 4859|     16|            } else {
 4860|     16|              entry->contclasslen = (unsigned short)pHMgr->decode_flags(
 4861|     16|                  &(entry->contclass), dash_str, af);
 4862|     16|              std::sort(entry->contclass, entry->contclass + entry->contclasslen);
 4863|     16|            }
 4864|       |
 4865|     18|            havecontclass = 1;
 4866|     44|            for (unsigned short _i = 0; _i < entry->contclasslen; _i++) {
  ------------------
  |  Branch (4866:41): [True: 26, False: 18]
  ------------------
 4867|     26|              contclasses[(entry->contclass)[_i]] = 1;
 4868|     26|            }
 4869|     24|          } else {
 4870|     24|            entry->appnd = std::string(start_piece, iter);
 4871|       |
 4872|     24|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4872:17): [True: 2, False: 22]
  |  Branch (4872:41): [True: 2, False: 0]
  ------------------
 4873|      2|              if (utf8) {
  ------------------
  |  Branch (4873:19): [True: 0, False: 2]
  ------------------
 4874|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4875|      2|              } else {
 4876|      2|                remove_ignored_chars(entry->appnd, ignorechars);
 4877|      2|              }
 4878|      2|            }
 4879|       |
 4880|     24|            if (complexprefixes) {
  ------------------
  |  Branch (4880:17): [True: 2, False: 22]
  ------------------
 4881|      2|              if (utf8)
  ------------------
  |  Branch (4881:19): [True: 0, False: 2]
  ------------------
 4882|      0|                reverseword_utf(entry->appnd);
 4883|      2|              else
 4884|      2|                reverseword(entry->appnd);
 4885|      2|            }
 4886|     24|          }
 4887|       |
 4888|     42|          if (entry->appnd.compare("0") == 0) {
  ------------------
  |  Branch (4888:15): [True: 2, False: 40]
  ------------------
 4889|      2|            entry->appnd.clear();
 4890|      2|          }
 4891|     42|          break;
 4892|     42|        }
 4893|       |
 4894|       |        // piece 5 - is the conditions descriptions
 4895|     42|        case 4: {
  ------------------
  |  Branch (4895:9): [True: 42, False: 174]
  ------------------
 4896|     42|          std::string chunk(start_piece, iter);
 4897|     42|          np++;
 4898|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4898:15): [True: 4, False: 38]
  ------------------
 4899|      4|            if (utf8)
  ------------------
  |  Branch (4899:17): [True: 0, False: 4]
  ------------------
 4900|      0|              reverseword_utf(chunk);
 4901|      4|            else
 4902|      4|              reverseword(chunk);
 4903|      4|            reverse_condition(chunk);
 4904|      4|          }
 4905|     42|          if (!entry->strip.empty() && chunk != "." &&
  ------------------
  |  Branch (4905:15): [True: 6, False: 36]
  |  Branch (4905:40): [True: 6, False: 0]
  ------------------
 4906|      6|              redundant_condition(at, entry->strip, chunk,
  ------------------
  |  Branch (4906:15): [True: 6, False: 0]
  ------------------
 4907|      6|                                  af->getlinenum())) {
 4908|      6|            chunk = ".";
 4909|      6|            entry->opts |= aeREDUNDANTCOND;
  ------------------
  |  |   72|      6|#define aeREDUNDANTCOND (1 << 5)
  ------------------
 4910|      6|          }
 4911|     42|          if (at == 'S') {
  ------------------
  |  Branch (4911:15): [True: 34, False: 8]
  ------------------
 4912|     34|            reverseword(chunk);
 4913|     34|            reverse_condition(chunk);
 4914|     34|          }
 4915|     42|          if (encodeit(*entry, chunk))
  ------------------
  |  Branch (4915:15): [True: 0, False: 42]
  ------------------
 4916|      0|            return false;
 4917|     42|          break;
 4918|     42|        }
 4919|       |
 4920|     42|        case 5: {
  ------------------
  |  Branch (4920:9): [True: 6, False: 210]
  ------------------
 4921|      6|          std::string chunk(start_piece, iter);
 4922|      6|          np++;
 4923|      6|          if (pHMgr->is_aliasm()) {
  ------------------
  |  Branch (4923:15): [True: 0, False: 6]
  ------------------
 4924|      0|            int index = atoi(chunk.c_str());
 4925|      0|            entry->morphcode = pHMgr->get_aliasm(index);
 4926|      6|          } else {
 4927|      6|            if (complexprefixes) {  // XXX - fix me for morph. gen.
  ------------------
  |  Branch (4927:17): [True: 0, False: 6]
  ------------------
 4928|      0|              if (utf8)
  ------------------
  |  Branch (4928:19): [True: 0, False: 0]
  ------------------
 4929|      0|                reverseword_utf(chunk);
 4930|      0|              else
 4931|      0|                reverseword(chunk);
 4932|      0|            }
 4933|       |            // add the remaining of the line
 4934|      6|            std::string::const_iterator end = nl.end();
 4935|      6|            if (iter != end) {
  ------------------
  |  Branch (4935:17): [True: 0, False: 6]
  ------------------
 4936|      0|              chunk.append(iter, end);
 4937|      0|            }
 4938|      6|            entry->morphcode = mystrdup(chunk.c_str());
 4939|      6|          }
 4940|      6|          break;
 4941|     42|        }
 4942|      0|        default:
  ------------------
  |  Branch (4942:9): [True: 0, False: 216]
  ------------------
 4943|      0|          break;
 4944|    216|      }
 4945|    216|      i++;
 4946|    216|      start_piece = mystrsep(nl, iter);
 4947|    216|    }
 4948|       |    // check to make sure we parsed enough pieces
 4949|     42|    if (np < 4) {
  ------------------
  |  Branch (4949:9): [True: 0, False: 42]
  ------------------
 4950|      0|      std::string err = pHMgr->encode_flag(aflag);
 4951|      0|      HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n",
 4952|      0|                       af->getlinenum(), err.c_str());
 4953|      0|      return false;
 4954|      0|    }
 4955|       |
 4956|     42|    entry->line = ruleline;
 4957|     42|    entry->headerline = headerline;
 4958|     42|    entry->xprod = xprod;
 4959|       |
 4960|       |#ifdef DEBUG
 4961|       |    // detect unnecessary fields, excepting comments
 4962|       |    if (basefieldnum) {
 4963|       |      int fieldnum =
 4964|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 4965|       |      if (fieldnum != basefieldnum)
 4966|       |        HUNSPELL_WARNING(stderr, "warning: line %d: bad field number\n",
 4967|       |                         af->getlinenum());
 4968|       |    } else {
 4969|       |      basefieldnum =
 4970|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 4971|       |    }
 4972|       |#endif
 4973|     42|  }
 4974|       |
 4975|       |  // now create SfxEntry or PfxEntry objects and use links to
 4976|       |  // build an ordered (sorted by affix string) list
 4977|     26|  auto start = affentries.begin(), end = affentries.end();
 4978|     68|  for (auto affentry = start; affentry != end; ++affentry) {
  ------------------
  |  Branch (4978:31): [True: 42, False: 26]
  ------------------
 4979|     42|    if (at == 'P') {
  ------------------
  |  Branch (4979:9): [True: 8, False: 34]
  ------------------
 4980|      8|      build_pfxtree(static_cast<PfxEntry*>(*affentry));
 4981|     34|    } else {
 4982|     34|      build_sfxtree(static_cast<SfxEntry*>(*affentry));
 4983|     34|    }
 4984|     42|  }
 4985|       |
 4986|       |  //contents belong to AffixMgr now
 4987|     26|  affentries.release();
 4988|       |
 4989|     26|  return true;
 4990|     26|}
_ZN8AffixMgr19redundant_conditionEcRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 4995|      6|                                  int linenum) {
 4996|      6|  int stripl = strip.size(), condl = cond.size(), i, j, neg, in;
 4997|      6|  if (ft == 'P') {  // prefix
  ------------------
  |  Branch (4997:7): [True: 0, False: 6]
  ------------------
 4998|      0|    if (strip.compare(0, condl, cond) == 0)
  ------------------
  |  Branch (4998:9): [True: 0, False: 0]
  ------------------
 4999|      0|      return 1;
 5000|      0|    if (utf8) {
  ------------------
  |  Branch (5000:9): [True: 0, False: 0]
  ------------------
 5001|      0|    } else {
 5002|      0|      for (i = 0, j = 0; (i < stripl) && (j < condl); i++, j++) {
  ------------------
  |  Branch (5002:26): [True: 0, False: 0]
  |  Branch (5002:42): [True: 0, False: 0]
  ------------------
 5003|      0|        if (cond[j] != '[') {
  ------------------
  |  Branch (5003:13): [True: 0, False: 0]
  ------------------
 5004|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (5004:15): [True: 0, False: 0]
  ------------------
 5005|      0|            HUNSPELL_WARNING(stderr,
 5006|      0|                             "warning: line %d: incompatible stripping "
 5007|      0|                             "characters and condition\n",
 5008|      0|                             linenum);
 5009|      0|            return 0;
 5010|      0|          }
 5011|      0|        } else {
 5012|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (5012:17): [True: 0, False: 0]
  ------------------
 5013|      0|          in = 0;
 5014|      0|          do {
 5015|      0|            j++;
 5016|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (5016:17): [True: 0, False: 0]
  ------------------
 5017|      0|              in = 1;
 5018|      0|          } while ((j < (condl - 1)) && (cond[j] != ']'));
  ------------------
  |  Branch (5018:20): [True: 0, False: 0]
  |  Branch (5018:41): [True: 0, False: 0]
  ------------------
 5019|      0|          if (j == (condl - 1) && (cond[j] != ']')) {
  ------------------
  |  Branch (5019:15): [True: 0, False: 0]
  |  Branch (5019:35): [True: 0, False: 0]
  ------------------
 5020|      0|            HUNSPELL_WARNING(stderr,
 5021|      0|                             "error: line %d: missing ] in condition:\n%s\n",
 5022|      0|                             linenum, cond.c_str());
 5023|      0|            return 0;
 5024|      0|          }
 5025|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (5025:16): [True: 0, False: 0]
  |  Branch (5025:24): [True: 0, False: 0]
  |  Branch (5025:33): [True: 0, False: 0]
  |  Branch (5025:40): [True: 0, False: 0]
  ------------------
 5026|      0|            HUNSPELL_WARNING(stderr,
 5027|      0|                             "warning: line %d: incompatible stripping "
 5028|      0|                             "characters and condition\n",
 5029|      0|                             linenum);
 5030|      0|            return 0;
 5031|      0|          }
 5032|      0|        }
 5033|      0|      }
 5034|      0|      if (j >= condl)
  ------------------
  |  Branch (5034:11): [True: 0, False: 0]
  ------------------
 5035|      0|        return 1;
 5036|      0|    }
 5037|      6|  } else {  // suffix
 5038|      6|    if ((stripl >= condl) && strip.compare(stripl - condl, std::string::npos, cond) == 0)
  ------------------
  |  Branch (5038:9): [True: 6, False: 0]
  |  Branch (5038:30): [True: 6, False: 0]
  ------------------
 5039|      6|      return 1;
 5040|      0|    if (utf8) {
  ------------------
  |  Branch (5040:9): [True: 0, False: 0]
  ------------------
 5041|      0|    } else {
 5042|      0|      for (i = stripl - 1, j = condl - 1; (i >= 0) && (j >= 0); i--, j--) {
  ------------------
  |  Branch (5042:43): [True: 0, False: 0]
  |  Branch (5042:55): [True: 0, False: 0]
  ------------------
 5043|      0|        if (cond[j] != ']') {
  ------------------
  |  Branch (5043:13): [True: 0, False: 0]
  ------------------
 5044|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (5044:15): [True: 0, False: 0]
  ------------------
 5045|      0|            HUNSPELL_WARNING(stderr,
 5046|      0|                             "warning: line %d: incompatible stripping "
 5047|      0|                             "characters and condition\n",
 5048|      0|                             linenum);
 5049|      0|            return 0;
 5050|      0|          }
 5051|      0|        } else if (j > 0) {
  ------------------
  |  Branch (5051:20): [True: 0, False: 0]
  ------------------
 5052|      0|          in = 0;
 5053|      0|          do {
 5054|      0|            j--;
 5055|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (5055:17): [True: 0, False: 0]
  ------------------
 5056|      0|              in = 1;
 5057|      0|          } while ((j > 0) && (cond[j] != '['));
  ------------------
  |  Branch (5057:20): [True: 0, False: 0]
  |  Branch (5057:31): [True: 0, False: 0]
  ------------------
 5058|      0|          if ((j == 0) && (cond[j] != '[')) {
  ------------------
  |  Branch (5058:15): [True: 0, False: 0]
  |  Branch (5058:27): [True: 0, False: 0]
  ------------------
 5059|      0|            HUNSPELL_WARNING(stderr,
 5060|      0|                             "error: line: %d: missing ] in condition:\n%s\n",
 5061|      0|                             linenum, cond.c_str());
 5062|      0|            return 0;
 5063|      0|          }
 5064|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (5064:17): [True: 0, False: 0]
  ------------------
 5065|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (5065:16): [True: 0, False: 0]
  |  Branch (5065:24): [True: 0, False: 0]
  |  Branch (5065:33): [True: 0, False: 0]
  |  Branch (5065:40): [True: 0, False: 0]
  ------------------
 5066|      0|            HUNSPELL_WARNING(stderr,
 5067|      0|                             "warning: line %d: incompatible stripping "
 5068|      0|                             "characters and condition\n",
 5069|      0|                             linenum);
 5070|      0|            return 0;
 5071|      0|          }
 5072|      0|        }
 5073|      0|      }
 5074|      0|      if (j < 0)
  ------------------
  |  Branch (5074:11): [True: 0, False: 0]
  ------------------
 5075|      0|        return 1;
 5076|      0|    }
 5077|      0|  }
 5078|      0|  return 0;
 5079|      6|}
_ZN8AffixMgr8isSubsetEPKcS1_:
 1113|   158k|inline int AffixMgr::isSubset(const char* s1, const char* s2) {
 1114|   201k|  while (((*s1 == *s2) || (*s1 == '.')) && (*s1 != '\0') && (*s2 != '\0')) {
  ------------------
  |  Branch (1114:11): [True: 159k, False: 42.7k]
  |  Branch (1114:27): [True: 0, False: 42.7k]
  |  Branch (1114:44): [True: 43.4k, False: 115k]
  |  Branch (1114:61): [True: 43.4k, False: 0]
  ------------------
 1115|  43.4k|    s1++;
 1116|  43.4k|    s2++;
 1117|  43.4k|  }
 1118|   158k|  return (*s1 == '\0');
 1119|   158k|}
affixmgr.cxx:_ZN12_GLOBAL__N_115DistinctRecordsC2Ec:
   97|  34.4k|    explicit DistinctRecords(char breakchar) : sep(breakchar) {}
affixmgr.cxx:_ZNK12_GLOBAL__N_115DistinctRecords4joinEv:
  117|  34.4k|    std::string join() const {
  118|  34.4k|      std::string text;
  119|  34.4k|      for (const std::string& record : records) {
  ------------------
  |  Branch (119:38): [True: 0, False: 34.4k]
  ------------------
  120|      0|        text.append(record);
  121|      0|        text.push_back(sep);
  122|      0|      }
  123|  34.4k|      return text;
  124|  34.4k|    }
affixmgr.cxx:_ZZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttctENK3$_1clEP8SfxEntry:
 3001|   411k|                         &candidates](SfxEntry* se) {
 3002|   411k|    if (!t)
  ------------------
  |  Branch (3002:9): [True: 411k, False: 0]
  ------------------
 3003|   411k|      return;
 3004|      0|    ++candidates;
 3005|      0|    trace_affix(*t, "sfx", this, *se);
 3006|      0|    TraceScope trace_depth(t);
 3007|      0|    suffix_applicable(ppfx, se, cclass, in_compound, t);
 3008|      0|  };
affixmgr.cxx:_ZZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttctENK3$_0clEv:
 2993|   576M|  auto report_empty_pass = [t, &word, start, len, sfxopts, &candidates]() {
 2994|   576M|    if (t && candidates == 0)
  ------------------
  |  Branch (2994:9): [True: 0, False: 576M]
  |  Branch (2994:14): [True: 0, False: 0]
  ------------------
 2995|      0|      trace(*t, "sfx \"%s\" candidates=0%s", word.substr(start, len).c_str(),
 2996|      0|            (sfxopts & aeXPRODUCT) != 0 ? " xprod=Y" : "");
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (2996:13): [True: 0, False: 0]
  ------------------
 2997|   576M|  };
_ZN8AffixMgr11isRevSubsetEPKcS1_i:
 2893|   586k|                                 int len) {
 2894|  1.17M|  while ((len > 0) && (*s1 != '\0') && ((*s1 == *end_of_s2) || (*s1 == '.'))) {
  ------------------
  |  Branch (2894:10): [True: 1.16M, False: 8.51k]
  |  Branch (2894:23): [True: 667k, False: 499k]
  |  Branch (2894:41): [True: 588k, False: 79.3k]
  |  Branch (2894:64): [True: 0, False: 79.3k]
  ------------------
 2895|   588k|    s1++;
 2896|   588k|    end_of_s2--;
 2897|   588k|    len--;
 2898|   588k|  }
 2899|   586k|  return (*s1 == '\0');
 2900|   586k|}
affixmgr.cxx:_ZZN8AffixMgr11affix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtctPP8PfxEntryPP8SfxEntryENK3$_0clEPK6hentry:
 3323|  19.7M|  auto report_form = [this, t, &word, start, len, found_pfx, found_sfx](const struct hentry* rv) {
 3324|  19.7M|    if (!rv)
  ------------------
  |  Branch (3324:9): [True: 19.7M, False: 0]
  ------------------
 3325|  19.7M|      return;
 3326|      0|    if (t)
  ------------------
  |  Branch (3326:9): [True: 0, False: 0]
  ------------------
 3327|      0|      trace_form(*t, this, word.substr(start, len), rv->word, pfx, sfx);
 3328|      0|    if (found_pfx)
  ------------------
  |  Branch (3328:9): [True: 0, False: 0]
  ------------------
 3329|      0|      *found_pfx = pfx;
 3330|      0|    if (found_sfx)
  ------------------
  |  Branch (3330:9): [True: 0, False: 0]
  ------------------
 3331|      0|      *found_sfx = sfx;
 3332|      0|  };
affixmgr.cxx:_ZN12_GLOBAL__N_18mystrdupEPKc:
 3585|   527k|  char* mystrdup(const char* s) {
 3586|   527k|    char* d = nullptr;
 3587|   527k|    if (s) {
  ------------------
  |  Branch (3587:9): [True: 527k, False: 0]
  ------------------
 3588|   527k|      size_t sl = strlen(s) + 1;
 3589|   527k|      d = new char[sl];
 3590|   527k|      memcpy(d, s, sl);
 3591|   527k|    }
 3592|   527k|    return d;
 3593|   527k|  }
_ZN17entries_containerC2EcP8AffixMgr:
 4631|     26|    : m_mgr(mgr)
 4632|     26|    , m_at(at) {
 4633|     26|  }
_ZN17entries_container10initializeEict:
 4638|     26|                  char opts, unsigned short aflag) {
 4639|     26|    entries.reserve(std::min(numents, 16384));
 4640|       |
 4641|     26|    if (m_at == 'P') {
  ------------------
  |  Branch (4641:9): [True: 8, False: 18]
  ------------------
 4642|      8|      entries.push_back(new PfxEntry(m_mgr));
 4643|     18|    } else {
 4644|     18|      entries.push_back(new SfxEntry(m_mgr));
 4645|     18|    }
 4646|       |
 4647|     26|    entries.back()->opts = opts;
 4648|     26|    entries.back()->aflag = aflag;
 4649|     26|  }
_ZN17entries_container11first_entryEv:
 4662|     42|  AffEntry* first_entry() { return entries.empty() ? nullptr : entries[0]; }
  ------------------
  |  Branch (4662:36): [True: 0, False: 42]
  ------------------
_ZN17entries_container9add_entryEc:
 4651|     16|  AffEntry* add_entry(char opts) {
 4652|     16|    if (m_at == 'P') {
  ------------------
  |  Branch (4652:9): [True: 0, False: 16]
  ------------------
 4653|      0|      entries.push_back(new PfxEntry(m_mgr));
 4654|     16|    } else {
 4655|     16|      entries.push_back(new SfxEntry(m_mgr));
 4656|     16|    }
 4657|     16|    AffEntry* ret = entries.back();
 4658|     16|    ret->opts = entries[0]->opts & opts;
 4659|     16|    return ret;
 4660|     16|  }
_ZN17entries_container5beginEv:
 4670|     26|  std::vector<AffEntry*>::iterator begin() { return entries.begin(); }
_ZN17entries_container3endEv:
 4671|     26|  std::vector<AffEntry*>::iterator end() { return entries.end(); }
_ZN17entries_container7releaseEv:
 4634|     26|  void release() {
 4635|     26|    entries.clear();
 4636|     26|  }
_ZN17entries_containerD2Ev:
 4664|     26|  ~entries_container() {
 4665|     26|    for (auto& entry : entries) {
  ------------------
  |  Branch (4665:22): [True: 0, False: 26]
  ------------------
 4666|      0|      delete entry;
 4667|      0|    }
 4668|     26|  }
affixmgr.cxx:_ZZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEENK3$_1clE6w_char:
 1704|  4.21k|          [&](w_char wc) {
 1705|  4.21k|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1706|  4.21k|          });

_ZN9guesswordC2Ev:
  121|  4.53M|    : word(nullptr)
  122|  4.53M|    , allow(false)
  123|  4.53M|    , orig(nullptr)
  124|  4.53M|  {
  125|  4.53M|  }
_ZN8patentryC2Ev:
  138|      4|    : cond(FLAG_NULL)
  ------------------
  |  |   99|      4|#define FLAG_NULL 0x00
  ------------------
  139|      4|    , cond2(FLAG_NULL) {
  ------------------
  |  |   99|      4|#define FLAG_NULL 0x00
  ------------------
  140|      4|  }
csutil.cxx:_ZL16HUNSPELL_WARNINGP8_IO_FILEPKcz:
   48|  1.15M|static inline void HUNSPELL_WARNING(FILE*, const char*, ...) {}

_ZN8AffEntryC2Ev:
   46|     42|      : morphcode(nullptr)
   47|     42|      , contclass(nullptr)
   48|     42|      , line(0)
   49|     42|      , headerline(0)
   50|     42|      , aflag(0)
   51|     42|      , contclasslen(0)
   52|     42|      , numconds(0)
   53|     42|      , opts(0)
   54|     42|      , xprod(0) {}

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

_Z12is_utf8_contc:
  143|  61.5M|inline bool is_utf8_cont(char c) {
  144|  61.5M|  return (static_cast<unsigned char>(c) & 0xc0) == 0x80;
  145|  61.5M|}
_Z9utf8_nextRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEm:
  148|  22.2k|inline size_t utf8_next(const std::string& s, size_t pos) {
  149|  22.2k|  if (pos < s.size()) {
  ------------------
  |  Branch (149:7): [True: 22.2k, False: 0]
  ------------------
  150|  22.2k|    ++pos;
  151|  26.1k|    while (pos < s.size() && is_utf8_cont(s[pos]))
  ------------------
  |  Branch (151:12): [True: 23.8k, False: 2.27k]
  |  Branch (151:30): [True: 3.88k, False: 20.0k]
  ------------------
  152|  3.88k|      ++pos;
  153|  22.2k|  }
  154|  22.2k|  return pos;
  155|  22.2k|}
_Z20has_no_ignored_charsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_:
  295|    876|                            const std::string& ignored_chars) {
  296|    876|  return std::all_of(ignored_chars.begin(), ignored_chars.end(),
  297|    876|    [&word](char ic) { return word.find(ic) == std::string::npos; });
  298|    876|}
_Z11HENTRY_DATAP6hentry:
  301|  1.52M|inline char* HENTRY_DATA(struct hentry* h) {
  302|  1.52M|  char* ret;
  303|  1.52M|  if (!(h->var & H_OPT))
  ------------------
  |  |   47|  1.52M|#define H_OPT (1 << 0)          // is there optional morphological data?
  ------------------
  |  Branch (303:7): [True: 1.52M, False: 1.66k]
  ------------------
  304|  1.52M|    ret = nullptr;
  305|  1.66k|  else if (h->var & H_OPT_ALIASM)
  ------------------
  |  |   48|  1.66k|#define H_OPT_ALIASM (1 << 1)   // using alias compression?
  ------------------
  |  Branch (305:12): [True: 0, False: 1.66k]
  ------------------
  306|      0|    ret = get_stored_pointer(HENTRY_WORD(h) + h->blen + 1);
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  307|  1.66k|  else
  308|  1.66k|    ret = HENTRY_WORD(h) + h->blen + 1;
  ------------------
  |  |   54|  1.66k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  309|  1.52M|  return ret;
  310|  1.52M|}
_Z11HENTRY_FINDP6hentryPKc:
  337|  1.99k|inline char* HENTRY_FIND(struct hentry* h, const char* p) {
  338|  1.99k|  char* data = HENTRY_DATA(h);
  339|  1.99k|  return data ? strstr(data, p) : nullptr;
  ------------------
  |  Branch (339:10): [True: 4, False: 1.98k]
  ------------------
  340|  1.99k|}
_ZZ20has_no_ignored_charsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEES7_ENKUlcE_clEc:
  297|  6.86k|    [&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|    164|int FileMgr::getlinenum() {
  120|    164|  return linenum;
  121|    164|}

_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|    694|void HashMgr::release_flags(unsigned short* astr, bool owned) {
  113|    694|  if (owned)
  ------------------
  |  Branch (113:7): [True: 385, False: 309]
  ------------------
  114|    385|    delete[] astr;
  115|    694|}
_ZNK7HashMgr6lookupEPKcm:
  154|   576M|struct hentry* HashMgr::lookup(const char* word, size_t len) const {
  155|   576M|  struct hentry* dp = tableptr[hash(word, len)];
  156|   576M|  if (!dp)
  ------------------
  |  Branch (156:7): [True: 521M, False: 55.3M]
  ------------------
  157|   521M|    return nullptr;
  158|   114M|  for (; dp != nullptr; dp = dp->next) {
  ------------------
  |  Branch (158:10): [True: 61.6M, False: 53.0M]
  ------------------
  159|  61.6M|    if (strcmp(word, dp->word) == 0)
  ------------------
  |  Branch (159:9): [True: 2.26M, False: 59.4M]
  ------------------
  160|  2.26M|      return dp;
  161|  61.6M|  }
  162|  53.0M|  return nullptr;
  163|  55.3M|}
_ZN7HashMgr8add_wordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPtiPS7_bib:
  173|  8.52k|                      bool own_aff) {
  174|       |
  175|  8.52k|  if (al > std::numeric_limits<short>::max()) {
  ------------------
  |  Branch (175:7): [True: 0, False: 8.52k]
  ------------------
  176|      0|    HUNSPELL_WARNING(stderr, "error: affix len %d is over max limit\n", al);
  177|      0|    release_flags(aff, own_aff);
  178|      0|    return 1;
  179|      0|  }
  180|       |
  181|  8.52k|  const std::string* word = &in_word;
  182|  8.52k|  const std::string* desc = in_desc;
  183|       |
  184|  8.52k|  std::string* word_copy = nullptr;
  185|  8.52k|  std::string* desc_copy = nullptr;
  186|  8.52k|  if ((!ignorechars.empty() && !has_no_ignored_chars(in_word, ignorechars)) || complexprefixes) {
  ------------------
  |  Branch (186:8): [True: 872, False: 7.64k]
  |  Branch (186:32): [True: 188, False: 684]
  |  Branch (186:80): [True: 514, False: 7.81k]
  ------------------
  187|    702|    word_copy = new std::string(in_word);
  188|       |
  189|    702|    if (!ignorechars.empty()) {
  ------------------
  |  Branch (189:9): [True: 188, False: 514]
  ------------------
  190|    188|      if (utf8) {
  ------------------
  |  Branch (190:11): [True: 47, False: 141]
  ------------------
  191|     47|        wcl = remove_ignored_chars_utf(*word_copy, ignorechars_utf16);
  192|    141|      } else {
  193|    141|        remove_ignored_chars(*word_copy, ignorechars);
  194|    141|      }
  195|    188|    }
  196|       |
  197|    702|    if (complexprefixes) {
  ------------------
  |  Branch (197:9): [True: 514, False: 188]
  ------------------
  198|    514|      if (utf8)
  ------------------
  |  Branch (198:11): [True: 0, False: 514]
  ------------------
  199|      0|        wcl = reverseword_utf(*word_copy);
  200|    514|      else
  201|    514|        reverseword(*word_copy);
  202|       |
  203|    514|      if (in_desc && aliasm.empty()) {
  ------------------
  |  Branch (203:11): [True: 0, False: 514]
  |  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|    514|    }
  215|       |
  216|    702|    word = word_copy;
  217|    702|  }
  218|       |
  219|       |  // limit of hp->blen
  220|  8.52k|  if (word->size() > std::numeric_limits<unsigned short>::max()) {
  ------------------
  |  Branch (220:7): [True: 0, False: 8.52k]
  ------------------
  221|      0|    HUNSPELL_WARNING(stderr, "error: word len %ld is over max limit\n", word->size());
  222|      0|    delete desc_copy;
  223|      0|    delete word_copy;
  224|      0|    release_flags(aff, own_aff);
  225|      0|    return 1;
  226|      0|  }
  227|       |
  228|  8.52k|  bool upcasehomonym = false;
  229|  8.52k|  int descl = desc ? (!aliasm.empty() ? sizeof(char*) : desc->size() + 1) : 0;
  ------------------
  |  Branch (229:15): [True: 4, False: 8.51k]
  |  Branch (229:23): [True: 0, False: 4]
  ------------------
  230|       |  // variable-length hash record with word and optional fields
  231|  8.52k|  auto hp =
  232|  8.52k|      (struct hentry*)arena_alloc(sizeof(struct hentry) + word->size() + descl,
  233|  8.52k|                                  alignof(struct hentry));
  234|  8.52k|  if (!hp) {
  ------------------
  |  Branch (234:7): [True: 0, False: 8.52k]
  ------------------
  235|      0|    delete desc_copy;
  236|      0|    delete word_copy;
  237|      0|    release_flags(aff, own_aff);
  238|      0|    return 1;
  239|      0|  }
  240|       |
  241|  8.52k|  char* hpw = hp->word;
  242|  8.52k|  memcpy(hpw, word->data(), word->size());
  243|  8.52k|  hpw[word->size()] = 0;
  244|       |
  245|  8.52k|  int i = hash(hpw, word->size());
  246|       |
  247|  8.52k|  hp->blen = (unsigned short)word->size();
  248|  8.52k|  hp->clen = (unsigned short)wcl;
  249|  8.52k|  hp->alen = (short)al;
  250|  8.52k|  hp->astr = aff;
  251|  8.52k|  hp->next = nullptr;
  252|  8.52k|  hp->next_homonym = nullptr;
  253|  8.52k|  hp->var = (captype == INITCAP) ? H_OPT_INITCAP : 0;
  ------------------
  |  |   93|  8.52k|#define INITCAP 1
  ------------------
                hp->var = (captype == INITCAP) ? H_OPT_INITCAP : 0;
  ------------------
  |  |   50|  4.89k|#define H_OPT_INITCAP (1 << 3)  // is dictionary word capitalized?
  ------------------
  |  Branch (253:13): [True: 4.89k, False: 3.62k]
  ------------------
  254|  8.52k|  if (own_aff)
  ------------------
  |  Branch (254:7): [True: 5.77k, False: 2.74k]
  ------------------
  255|  5.77k|    hp->var |= H_OPT_OWNFLAGS;
  ------------------
  |  |   51|  5.77k|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  256|       |
  257|       |  // store the description string or its pointer
  258|  8.52k|  if (desc) {
  ------------------
  |  Branch (258:7): [True: 4, False: 8.51k]
  ------------------
  259|      4|    hp->var |= H_OPT;
  ------------------
  |  |   47|      4|#define H_OPT (1 << 0)          // is there optional morphological data?
  ------------------
  260|      4|    if (!aliasm.empty()) {
  ------------------
  |  Branch (260:9): [True: 0, False: 4]
  ------------------
  261|      0|      hp->var |= H_OPT_ALIASM;
  ------------------
  |  |   48|      0|#define H_OPT_ALIASM (1 << 1)   // using alias compression?
  ------------------
  262|      0|      store_pointer(hpw + word->size() + 1, get_aliasm(atoi(desc->c_str())));
  263|      4|    } else {
  264|      4|      strcpy(hpw + word->size() + 1, desc->c_str());
  265|      4|    }
  266|      4|    if (HENTRY_FIND(hp, MORPH_PHON)) {
  ------------------
  |  |  114|      4|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (266:9): [True: 2, False: 2]
  ------------------
  267|      2|      hp->var |= H_OPT_PHON;
  ------------------
  |  |   49|      2|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  268|       |      // store ph: fields (pronounciation, misspellings, old orthography etc.)
  269|       |      // of a morphological description in reptable to use in REP replacements.
  270|      2|      size_t predicted = tableptr.size() / MORPH_PHON_RATIO;
  ------------------
  |  |   90|      2|#define MORPH_PHON_RATIO 500
  ------------------
  271|      2|      if (reptable.capacity() < predicted)
  ------------------
  |  Branch (271:11): [True: 2, False: 0]
  ------------------
  272|      2|          reptable.reserve(predicted);
  273|      2|      std::string fields = HENTRY_DATA(hp);
  274|      2|      std::string::const_iterator iter = fields.begin(), start_piece = mystrsep(fields, iter);
  275|      4|      while (start_piece != fields.end()) {
  ------------------
  |  Branch (275:14): [True: 2, False: 2]
  ------------------
  276|      2|        if (std::string(start_piece, iter).find(MORPH_PHON) == 0) {
  ------------------
  |  |  114|      2|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (276:13): [True: 2, False: 0]
  ------------------
  277|      2|          std::string ph = std::string(start_piece, iter).substr(sizeof MORPH_PHON - 1);
  ------------------
  |  |  114|      2|#define MORPH_PHON "ph:"
  ------------------
  278|      2|          if (!ph.empty()) {
  ------------------
  |  Branch (278:15): [True: 2, False: 0]
  ------------------
  279|      2|            std::vector<w_char> w;
  280|      2|            size_t strippatt;
  281|      2|            std::string wordpart;
  282|       |            // dictionary based REP replacement, separated by "->"
  283|       |            // for example "pretty ph:prity ph:priti->pretti" to handle
  284|       |            // both prity -> pretty and pritier -> prettiest suggestions.
  285|      2|            if (((strippatt = ph.find("->")) != std::string::npos) &&
  ------------------
  |  Branch (285:17): [True: 0, False: 2]
  ------------------
  286|      0|                    (strippatt > 0) && (strippatt < ph.size() - 2)) {
  ------------------
  |  Branch (286:21): [True: 0, False: 0]
  |  Branch (286:40): [True: 0, False: 0]
  ------------------
  287|      0|                wordpart = ph.substr(strippatt + 2);
  288|      0|                ph.erase(ph.begin() + strippatt, ph.end());
  289|      0|            } else
  290|      2|                wordpart = in_word;
  291|       |            // when the ph: field ends with the character *,
  292|       |            // strip last character of the pattern and the replacement
  293|       |            // to match in REP suggestions also at character changes,
  294|       |            // for example, "pretty ph:prity*" results "prit->prett"
  295|       |            // REP replacement instead of "prity->pretty", to get
  296|       |            // prity->pretty and pritiest->prettiest suggestions.
  297|      2|            if (ph.at(ph.size()-1) == '*') {
  ------------------
  |  Branch (297:17): [True: 0, False: 2]
  ------------------
  298|      0|              strippatt = 1;
  299|      0|              size_t stripword = 0;
  300|      0|              if (utf8) {
  ------------------
  |  Branch (300:19): [True: 0, False: 0]
  ------------------
  301|      0|                while ((strippatt < ph.size()) &&
  ------------------
  |  Branch (301:24): [True: 0, False: 0]
  ------------------
  302|      0|                  is_utf8_cont(ph.at(ph.size()-strippatt-1)))
  ------------------
  |  Branch (302:19): [True: 0, False: 0]
  ------------------
  303|      0|                     ++strippatt;
  304|      0|                while ((stripword < wordpart.size()) &&
  ------------------
  |  Branch (304:24): [True: 0, False: 0]
  ------------------
  305|      0|                  is_utf8_cont(wordpart.at(wordpart.size()-stripword-1)))
  ------------------
  |  Branch (305:19): [True: 0, False: 0]
  ------------------
  306|      0|                     ++stripword;
  307|      0|              }
  308|      0|              ++strippatt;
  309|      0|              ++stripword;
  310|      0|              if ((ph.size() > strippatt) && (wordpart.size() > stripword)) {
  ------------------
  |  Branch (310:19): [True: 0, False: 0]
  |  Branch (310:46): [True: 0, False: 0]
  ------------------
  311|      0|                ph.erase(ph.size()-strippatt, strippatt);
  312|      0|                wordpart.erase(wordpart.size()-stripword, stripword);
  313|      0|              }
  314|      0|            }
  315|       |            // capitalize lowercase pattern for capitalized words to support
  316|       |            // good suggestions also for capitalized misspellings, eg.
  317|       |            // Wednesday ph:wendsay
  318|       |            // results wendsay -> Wednesday and Wendsay -> Wednesday, too.
  319|      2|            if (captype == INITCAP) {
  ------------------
  |  |   93|      2|#define INITCAP 1
  ------------------
  |  Branch (319:17): [True: 0, False: 2]
  ------------------
  320|      0|              std::string ph_capitalized;
  321|      0|              if (utf8) {
  ------------------
  |  Branch (321:19): [True: 0, False: 0]
  ------------------
  322|      0|                u8_u16(w, ph);
  323|      0|                if (get_captype_utf8(w, langnum) == NOCAP) {
  ------------------
  |  |   92|      0|#define NOCAP 0
  ------------------
  |  Branch (323:21): [True: 0, False: 0]
  ------------------
  324|      0|                  mkinitcap_utf(w, langnum);
  325|      0|                  u16_u8(ph_capitalized, w);
  326|      0|                }
  327|      0|              } else if (get_captype(ph, csconv) == NOCAP)
  ------------------
  |  |   92|      0|#define NOCAP 0
  ------------------
  |  Branch (327:26): [True: 0, False: 0]
  ------------------
  328|      0|                  mkinitcap(ph_capitalized, csconv);
  329|       |
  330|      0|              if (!ph_capitalized.empty()) {
  ------------------
  |  Branch (330:19): [True: 0, False: 0]
  ------------------
  331|       |                // add also lowercase word in the case of German or
  332|       |                // Hungarian to support lowercase suggestions lowercased by
  333|       |                // compound word generation or derivational suffixes
  334|       |                // (for example by adjectival suffix "-i" of geographical
  335|       |                // names in Hungarian:
  336|       |                // Massachusetts ph:messzecsuzec
  337|       |                // messzecsuzeci -> massachusettsi (adjective)
  338|       |                // For lowercasing by conditional PFX rules, see
  339|       |                // tests/germancompounding test example or the
  340|       |                // Hungarian dictionary.)
  341|      0|                if (langnum == LANG_de || langnum == LANG_hu) {
  ------------------
  |  Branch (341:21): [True: 0, False: 0]
  |  Branch (341:43): [True: 0, False: 0]
  ------------------
  342|      0|                  std::string wordpart_lower(wordpart);
  343|      0|                  if (utf8) {
  ------------------
  |  Branch (343:23): [True: 0, False: 0]
  ------------------
  344|      0|                    u8_u16(w, wordpart_lower);
  345|      0|                    mkallsmall_utf(w, langnum);
  346|      0|                    u16_u8(wordpart_lower, w);
  347|      0|                  } else {
  348|      0|                    mkallsmall(wordpart_lower, csconv);
  349|      0|                  }
  350|      0|                  reptable.emplace_back();
  351|      0|                  reptable.back().pattern.assign(ph);
  352|      0|                  reptable.back().outstrings[0].assign(wordpart_lower);
  353|      0|                }
  354|      0|                reptable.emplace_back();
  355|      0|                reptable.back().pattern.assign(ph_capitalized);
  356|      0|                reptable.back().outstrings[0].assign(wordpart);
  357|      0|              }
  358|      0|            }
  359|      2|            reptable.emplace_back();
  360|      2|            reptable.back().pattern.assign(ph);
  361|      2|            reptable.back().outstrings[0].assign(wordpart);
  362|      2|          }
  363|      2|        }
  364|      2|        start_piece = mystrsep(fields, iter);
  365|      2|      }
  366|      2|    }
  367|      4|  }
  368|       |
  369|  8.52k|  struct hentry* dp = tableptr[i];
  370|  8.52k|  if (!dp) {
  ------------------
  |  Branch (370:7): [True: 6.32k, False: 2.20k]
  ------------------
  371|  6.32k|    tableptr[i] = hp;
  372|  6.32k|    delete desc_copy;
  373|  6.32k|    delete word_copy;
  374|  6.32k|    return 0;
  375|  6.32k|  }
  376|  2.72k|  while (dp->next != nullptr) {
  ------------------
  |  Branch (376:10): [True: 536, False: 2.18k]
  ------------------
  377|    536|    if ((!dp->next_homonym) && (strcmp(hp->word, dp->word) == 0)) {
  ------------------
  |  Branch (377:9): [True: 479, False: 57]
  |  Branch (377:32): [True: 15, False: 464]
  ------------------
  378|       |      // remove hidden onlyupcase homonym
  379|     15|      if (!onlyupcase) {
  ------------------
  |  Branch (379:11): [True: 13, False: 2]
  ------------------
  380|     13|        if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) {
  ------------------
  |  |  102|      9|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 9, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (380:13): [True: 9, False: 4]
  |  Branch (380:13): [True: 9, False: 4]
  ------------------
  381|      9|          release_flags(dp->astr, dp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|      9|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  382|      9|          dp->astr = hp->astr;
  383|      9|          dp->alen = hp->alen;
  384|      9|          dp->var &= ~H_OPT_OWNFLAGS;
  ------------------
  |  |   51|      9|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  385|      9|          dp->var |= (hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|      9|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  386|      9|          arena_free(hp);
  387|      9|          delete desc_copy;
  388|      9|          delete word_copy;
  389|      9|          return 0;
  390|      9|        } else if (!dp->astr && dp->alen == 0 &&
  ------------------
  |  Branch (390:20): [True: 4, False: 0]
  |  Branch (390:33): [True: 4, False: 0]
  ------------------
  391|      4|                   !hp->astr && hp->alen == 0) {
  ------------------
  |  Branch (391:20): [True: 4, False: 0]
  |  Branch (391:33): [True: 4, False: 0]
  ------------------
  392|       |          // word already exists with no flags, skip duplicate
  393|      4|          release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|      4|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  394|      4|          arena_free(hp);
  395|      4|          delete desc_copy;
  396|      4|          delete word_copy;
  397|      4|          return 0;
  398|      4|        } else {
  399|      0|          dp->next_homonym = hp;
  400|      0|        }
  401|     13|      } else {
  402|      2|        upcasehomonym = true;
  403|      2|      }
  404|     15|    }
  405|    523|    dp = dp->next;
  406|    523|  }
  407|  2.18k|  if (strcmp(hp->word, dp->word) == 0) {
  ------------------
  |  Branch (407:7): [True: 706, False: 1.48k]
  ------------------
  408|       |    // remove hidden onlyupcase homonym
  409|    706|    if (!onlyupcase) {
  ------------------
  |  Branch (409:9): [True: 408, False: 298]
  ------------------
  410|    408|      if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) {
  ------------------
  |  |  102|     27|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 27, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (410:11): [True: 27, False: 381]
  |  Branch (410:11): [True: 27, False: 381]
  ------------------
  411|     27|        release_flags(dp->astr, dp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     27|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  412|     27|        dp->astr = hp->astr;
  413|     27|        dp->alen = hp->alen;
  414|     27|        dp->var &= ~H_OPT_OWNFLAGS;
  ------------------
  |  |   51|     27|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  415|     27|        dp->var |= (hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|     27|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  416|     27|        arena_free(hp);
  417|     27|        delete desc_copy;
  418|     27|        delete word_copy;
  419|     27|        return 0;
  420|    381|      } else if (!dp->astr && dp->alen == 0 &&
  ------------------
  |  Branch (420:18): [True: 381, False: 0]
  |  Branch (420:31): [True: 381, False: 0]
  ------------------
  421|    381|                 !hp->astr && hp->alen == 0) {
  ------------------
  |  Branch (421:18): [True: 354, False: 27]
  |  Branch (421:31): [True: 354, False: 0]
  ------------------
  422|       |        // word already exists with no flags, skip duplicate
  423|    354|        release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|    354|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  424|    354|        arena_free(hp);
  425|    354|        delete desc_copy;
  426|    354|        delete word_copy;
  427|    354|        return 0;
  428|    354|      } else {
  429|     27|        dp->next_homonym = hp;
  430|     27|      }
  431|    408|    } else {
  432|    298|      upcasehomonym = true;
  433|    298|    }
  434|    706|  }
  435|  1.80k|  if (!upcasehomonym) {
  ------------------
  |  Branch (435:7): [True: 1.50k, False: 300]
  ------------------
  436|  1.50k|    dp->next = hp;
  437|  1.50k|  } else {
  438|       |    // remove hidden onlyupcase homonym
  439|    300|    release_flags(hp->astr, hp->var & H_OPT_OWNFLAGS);
  ------------------
  |  |   51|    300|#define H_OPT_OWNFLAGS (1 << 4) // astr is independently allocated?
  ------------------
  440|    300|    arena_free(hp);
  441|    300|  }
  442|       |
  443|  1.80k|  delete desc_copy;
  444|  1.80k|  delete word_copy;
  445|  1.80k|  return 0;
  446|  2.18k|}
_ZN7HashMgr27add_hidden_capitalized_wordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPtiPS7_i:
  453|  5.93k|                                         int captype) {
  454|  5.93k|  if (flags == nullptr)
  ------------------
  |  Branch (454:7): [True: 5.79k, False: 145]
  ------------------
  455|  5.79k|    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.93k|  if (((captype == HUHCAP) || (captype == HUHINITCAP) ||
  ------------------
  |  |   95|  5.93k|#define HUHCAP 3
  ------------------
                if (((captype == HUHCAP) || (captype == HUHINITCAP) ||
  ------------------
  |  |   96|  5.52k|#define HUHINITCAP 4
  ------------------
  |  Branch (460:8): [True: 418, False: 5.52k]
  |  Branch (460:31): [True: 2.14k, False: 3.37k]
  ------------------
  461|  3.37k|       ((captype == ALLCAP) && (flagslen != 0))) &&
  ------------------
  |  |   94|  3.37k|#define ALLCAP 2
  ------------------
  |  Branch (461:9): [True: 146, False: 3.22k]
  |  Branch (461:32): [True: 18, False: 128]
  ------------------
  462|  2.58k|      !((flagslen != 0) && TESTAFF(flags, forbiddenword, flagslen))) {
  ------------------
  |  |  102|     36|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 36]
  |  |  ------------------
  ------------------
  |  Branch (462:9): [True: 36, False: 2.54k]
  ------------------
  463|  2.58k|    auto flags2 = (unsigned short*)arena_alloc((flagslen + 1) * sizeof(unsigned short),
  464|  2.58k|                                                alignof(unsigned short));
  465|  2.58k|    flags2[flagslen] = ONLYUPCASEFLAG;
  ------------------
  |  |  128|  2.58k|#define ONLYUPCASEFLAG 65511
  ------------------
  466|  2.58k|    if (flagslen) {
  ------------------
  |  Branch (466:9): [True: 36, False: 2.54k]
  ------------------
  467|     36|      memcpy(flags2, flags, flagslen * sizeof(unsigned short));
  468|     36|      std::sort(flags2, flags2 + flagslen + 1);
  469|     36|    }
  470|  2.58k|    if (utf8) {
  ------------------
  |  Branch (470:9): [True: 459, False: 2.12k]
  ------------------
  471|    459|      std::string st;
  472|    459|      std::vector<w_char> w;
  473|    459|      u8_u16(w, word);
  474|    459|      mkallsmall_utf(w, langnum);
  475|    459|      mkinitcap_utf(w, langnum);
  476|    459|      u16_u8(st, w);
  477|    459|      return add_word(st, wcl, flags2, flagslen + 1, dp, true, INITCAP, false);
  ------------------
  |  |   93|    459|#define INITCAP 1
  ------------------
  478|  2.12k|    } else {
  479|  2.12k|      std::string new_word(word);
  480|  2.12k|      mkallsmall(new_word, csconv);
  481|  2.12k|      mkinitcap(new_word, csconv);
  482|  2.12k|      int ret = add_word(new_word, wcl, flags2, flagslen + 1, dp, true, INITCAP, false);
  ------------------
  |  |   93|  2.12k|#define INITCAP 1
  ------------------
  483|  2.12k|      return ret;
  484|  2.12k|    }
  485|  2.58k|  }
  486|  3.35k|  return 0;
  487|  5.93k|}
_ZN7HashMgr20get_clen_and_captypeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiRNS0_6vectorI6w_charNS4_ISB_EEEE:
  490|  5.93k|int HashMgr::get_clen_and_captype(const std::string& word, int* captype, std::vector<w_char> &workbuf) {
  491|  5.93k|  int len;
  492|  5.93k|  if (utf8) {
  ------------------
  |  Branch (492:7): [True: 2.80k, False: 3.13k]
  ------------------
  493|  2.80k|    len = u8_u16(workbuf, word);
  494|  2.80k|    *captype = get_captype_utf8(workbuf, langnum);
  495|  3.13k|  } else {
  496|  3.13k|    len = word.size();
  497|  3.13k|    *captype = get_captype(word, csconv);
  498|  3.13k|  }
  499|  5.93k|  return len;
  500|  5.93k|}
_ZN7HashMgr20get_clen_and_captypeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPi:
  502|  5.77k|int HashMgr::get_clen_and_captype(const std::string& word, int* captype) {
  503|  5.77k|  std::vector<w_char> workbuf;
  504|  5.77k|  return get_clen_and_captype(word, captype, workbuf);
  505|  5.77k|}
_ZN7HashMgr21remove_forbidden_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  528|  7.83k|void HashMgr::remove_forbidden_flag(const std::string& word) {
  529|  7.83k|  struct hentry* dp = lookup(word.c_str(), word.size());
  530|  7.83k|  if (!dp)
  ------------------
  |  Branch (530:7): [True: 7.34k, False: 494]
  ------------------
  531|  7.34k|    return;
  532|  1.04k|  while (dp) {
  ------------------
  |  Branch (532:10): [True: 548, False: 494]
  ------------------
  533|    548|    if (dp->astr && TESTAFF(dp->astr, forbiddenword, dp->alen)) {
  ------------------
  |  |  102|     53|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 53]
  |  |  ------------------
  ------------------
  |  Branch (533:9): [True: 53, False: 495]
  ------------------
  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|    548|    dp = dp->next_homonym;
  553|    548|  }
  554|    494|}
_ZN7HashMgr3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  557|  5.71k|int HashMgr::add(const std::string& word) {
  558|  5.71k|  remove_forbidden_flag(word);
  559|  5.71k|  int captype, al = 0;
  560|  5.71k|  unsigned short* flags = nullptr;
  561|  5.71k|  int wcl = get_clen_and_captype(word, &captype);
  562|  5.71k|  if (add_word(word, wcl, flags, al, nullptr, false, captype, true))
  ------------------
  |  Branch (562:7): [True: 0, False: 5.71k]
  ------------------
  563|      0|    return 1;
  564|  5.71k|  return add_hidden_capitalized_word(word, wcl, flags, al, nullptr, captype);
  565|  5.71k|}
_ZN7HashMgr14add_with_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
  578|  2.12k|int HashMgr::add_with_affix(const std::string& word, const std::string& example) {
  579|       |  // detect captype and modify word length for UTF-8 encoding
  580|  2.12k|  struct hentry* dp = lookup(example.c_str(), example.size());
  581|  2.12k|  remove_forbidden_flag(word);
  582|  2.12k|  if (dp && dp->astr) {
  ------------------
  |  Branch (582:7): [True: 225, False: 1.89k]
  |  Branch (582:13): [True: 63, False: 162]
  ------------------
  583|     63|    int captype;
  584|     63|    int wcl = get_clen_and_captype(word, &captype);
  585|     63|    auto flags = new unsigned short[dp->alen];
  586|     63|    memcpy(flags, dp->astr, dp->alen * sizeof(unsigned short));
  587|     63|    if (add_word(word, wcl, flags, dp->alen, nullptr, false, captype, true))
  ------------------
  |  Branch (587:9): [True: 0, False: 63]
  ------------------
  588|      0|      return 1;
  589|     63|    return add_hidden_capitalized_word(word, wcl, flags, dp->alen, nullptr, captype);
  590|     63|  }
  591|  2.06k|  return 1;
  592|  2.12k|}
_ZNK7HashMgr14walk_hashtableERiP6hentry:
  596|  1.80M|struct hentry* HashMgr::walk_hashtable(int& col, struct hentry* hp) const {
  597|  1.80M|  if (hp && hp->next != nullptr)
  ------------------
  |  Branch (597:7): [True: 1.74M, False: 59.5k]
  |  Branch (597:13): [True: 117k, False: 1.62M]
  ------------------
  598|   117k|    return hp->next;
  599|  60.2M|  for (col++; col < (int)tableptr.size(); ++col) {
  ------------------
  |  Branch (599:15): [True: 60.1M, False: 59.5k]
  ------------------
  600|  60.1M|    if (tableptr[col])
  ------------------
  |  Branch (600:9): [True: 1.62M, False: 58.5M]
  ------------------
  601|  1.62M|      return tableptr[col];
  602|  60.1M|  }
  603|       |  // null at end and reset to start
  604|  59.5k|  col = -1;
  605|  59.5k|  return nullptr;
  606|  1.68M|}
_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|   576M|int HashMgr::hash(const char* word, size_t len) const {
  763|   576M|  unsigned long hv = 0;
  764|   576M|  size_t i = 0;
  765|  2.84G|  while (i < 4 && i < len)
  ------------------
  |  Branch (765:10): [True: 2.29G, False: 549M]
  |  Branch (765:19): [True: 2.27G, False: 26.9M]
  ------------------
  766|  2.27G|    hv = (hv << 8) | word[i++];
  767|  12.1G|  while (i < len) {
  ------------------
  |  Branch (767:10): [True: 11.5G, False: 576M]
  ------------------
  768|  11.5G|    ROTATE(hv, ROTATE_LEN);
  ------------------
  |  |   44|  11.5G|  (v) = ((v) << (q)) | (((v) >> (32 - q)) & ((1 << (q)) - 1));
  ------------------
  769|  11.5G|    hv ^= word[i++];
  770|  11.5G|  }
  771|   576M|  return (unsigned long)hv % tableptr.size();
  772|   576M|}
_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|   364k|const std::vector<replentry>& HashMgr::get_reptable() const {
 1437|   364k|  return reptable;
 1438|   364k|}
_ZNK7HashMgr11arena_allocEmm:
 1440|  11.1k|void* HashMgr::arena_alloc(size_t num_bytes, size_t alignment) const {
 1441|       |  // Fixed-size 64KB chunks: small enough to avoid significant waste on small
 1442|       |  // dictionaries, large enough to amortize per-chunk malloc overhead on large
 1443|       |  // ones. make_unique throws std::bad_alloc on OOM.
 1444|  11.1k|  static const size_t MIN_CHUNK_SIZE = 65536;
 1445|  11.1k|  static const size_t MAX_ALIGNMENT = alignof(max_align_t);
 1446|       |  // Chunk sizes are rounded up to MAX_ALIGNMENT below; with this invariant,
 1447|       |  // any alignment that divides MAX_ALIGNMENT keeps aligned_offset within bounds.
 1448|  11.1k|  assert(alignment > 0 && alignment <= MAX_ALIGNMENT);
  ------------------
  |  Branch (1448:3): [True: 11.1k, False: 0]
  |  Branch (1448:3): [True: 11.1k, False: 0]
  |  Branch (1448:3): [True: 11.1k, False: 0]
  ------------------
 1449|       |  // Pad the offset up to the requested alignment before placing this allocation.
 1450|       |  // make_unique returns memory aligned for any scalar, so chunk-start is fine.
 1451|  11.1k|  size_t aligned_offset = (current_chunk_offset + alignment - 1) & ~(alignment - 1);
 1452|  11.1k|  if (arena.empty() || current_chunk_size - aligned_offset < num_bytes) {
  ------------------
  |  Branch (1452:7): [True: 38, False: 11.1k]
  |  Branch (1452:24): [True: 48, False: 11.1k]
  ------------------
 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|     86|    size_t new_size = std::max(MIN_CHUNK_SIZE, num_bytes);
 1459|     86|    new_size = (new_size + MAX_ALIGNMENT - 1) & ~(MAX_ALIGNMENT - 1);
 1460|     86|    arena.push_back(std::make_unique<uint8_t[]>(new_size));
 1461|     86|    current_chunk_size = new_size;
 1462|     86|    aligned_offset = 0;
 1463|     86|  }
 1464|       |
 1465|  11.1k|  uint8_t* ptr = &arena.back()[aligned_offset];
 1466|  11.1k|  current_chunk_offset = aligned_offset + num_bytes;
 1467|  11.1k|  ++outstanding_arena_allocations;
 1468|  11.1k|  return ptr;
 1469|  11.1k|}
_ZNK7HashMgr10arena_freeEPv:
 1471|    694|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|    694|  if (outstanding_arena_allocations == 0) {
  ------------------
  |  Branch (1477:7): [True: 0, False: 694]
  ------------------
 1478|      0|    std::abort();
 1479|      0|  }
 1480|    694|  --outstanding_arena_allocations;
 1481|    694|}
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_:
  197|     38|  : affixpath(affpath) {
  198|     38|  csconv = nullptr;
  199|     38|  utf8 = 0;
  200|     38|  complexprefixes = 0;
  201|       |
  202|       |  /* first set up the hash manager */
  203|     38|  m_HMgrs.push_back(std::make_unique<HashMgr>(dpath, affpath, key));
  204|       |
  205|       |  /* next set up the affix manager */
  206|       |  /* it needs access to the hash manager lookup methods */
  207|     38|  pAMgr = std::make_unique<AffixMgr>(affpath, m_HMgrs, key);
  208|       |
  209|       |  /* get the preferred try string and the dictionary */
  210|       |  /* encoding from the Affix Manager for that dictionary */
  211|     38|  std::string try_string = pAMgr->get_try_string();
  212|     38|  encoding = pAMgr->get_encoding();
  213|     38|  langnum = pAMgr->get_langnum();
  214|     38|  utf8 = pAMgr->get_utf8();
  215|     38|  if (!utf8)
  ------------------
  |  Branch (215:7): [True: 20, False: 18]
  ------------------
  216|     20|    csconv = get_current_cs(encoding);
  217|     38|  complexprefixes = pAMgr->get_complexprefixes();
  218|     38|  wordbreak = pAMgr->get_breaktable();
  219|       |
  220|       |  /* and finally set up the suggestion manager */
  221|     38|  pSMgr = std::make_unique<SuggestMgr>(try_string, MAXSUGGESTION, pAMgr.get());
  ------------------
  |  |   83|     38|#define MAXSUGGESTION 15
  ------------------
  222|     38|}
_ZN12HunspellImpl12clean_ignoreERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
  241|  36.6M|                                const std::string& src) {
  242|  36.6M|  dest.clear();
  243|  36.6M|  dest.assign(src);
  244|  36.6M|  const char* ignoredchars = pAMgr ? pAMgr->get_ignore() : nullptr;
  ------------------
  |  Branch (244:30): [True: 36.6M, False: 0]
  ------------------
  245|  36.6M|  if (ignoredchars != nullptr) {
  ------------------
  |  Branch (245:7): [True: 3.80M, False: 32.8M]
  ------------------
  246|  3.80M|    if (utf8) {
  ------------------
  |  Branch (246:9): [True: 899k, False: 2.90M]
  ------------------
  247|   899k|      const std::vector<w_char>& ignoredchars_utf16 =
  248|   899k|          pAMgr->get_ignore_utf16();
  249|   899k|      remove_ignored_chars_utf(dest, ignoredchars_utf16);
  250|  2.90M|    } else {
  251|  2.90M|      remove_ignored_chars(dest, ignoredchars);
  252|  2.90M|    }
  253|  3.80M|  }
  254|  36.6M|}
_ZN12HunspellImpl10cleanword2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEERKS6_PiPm:
  268|  16.9M|                         size_t* pabbrev) {
  269|  16.9M|  dest.clear();
  270|  16.9M|  dest_utf.clear();
  271|       |
  272|       |  // remove IGNORE characters from the string
  273|  16.9M|  std::string w2;
  274|  16.9M|  clean_ignore(w2, src);
  275|       |
  276|  16.9M|  const char* q = w2.c_str();
  277|  16.9M|  int nl = (int)w2.size();
  278|       |
  279|       |  // first skip over any leading blanks
  280|  17.1M|  while (*q == ' ') {
  ------------------
  |  Branch (280:10): [True: 129k, False: 16.9M]
  ------------------
  281|   129k|    ++q;
  282|   129k|    nl--;
  283|   129k|  }
  284|       |
  285|       |  // now strip off any trailing periods (recording their presence)
  286|  16.9M|  *pabbrev = 0;
  287|       |
  288|  18.8M|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (288:10): [True: 18.4M, False: 382k]
  |  Branch (288:22): [True: 1.84M, False: 16.6M]
  ------------------
  289|  1.84M|    nl--;
  290|  1.84M|    (*pabbrev)++;
  291|  1.84M|  }
  292|       |
  293|       |  // if no characters are left it can't be capitalized
  294|  16.9M|  if (nl <= 0) {
  ------------------
  |  Branch (294:7): [True: 382k, False: 16.6M]
  ------------------
  295|   382k|    *pcaptype = NOCAP;
  ------------------
  |  |   92|   382k|#define NOCAP 0
  ------------------
  296|   382k|    return 0;
  297|   382k|  }
  298|       |
  299|  16.6M|  dest.append(q, nl);
  300|  16.6M|  nl = dest.size();
  301|  16.6M|  if (utf8) {
  ------------------
  |  Branch (301:7): [True: 3.44M, False: 13.1M]
  ------------------
  302|  3.44M|    u8_u16(dest_utf, dest);
  303|  3.44M|    *pcaptype = get_captype_utf8(dest_utf, langnum);
  304|  13.1M|  } else {
  305|  13.1M|    *pcaptype = get_captype(dest, csconv);
  306|  13.1M|  }
  307|  16.6M|  return nl;
  308|  16.9M|}
_ZN12HunspellImpl9cleanwordERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_PiSA_:
  313|  6.96k|                        int* pabbrev) {
  314|  6.96k|  dest.clear();
  315|  6.96k|  const unsigned char* q = (const unsigned char*)src.c_str();
  316|  6.96k|  int firstcap = 0, nl = (int)src.size();
  317|       |
  318|       |  // first skip over any leading blanks
  319|  13.2k|  while (*q == ' ') {
  ------------------
  |  Branch (319:10): [True: 6.27k, False: 6.96k]
  ------------------
  320|  6.27k|    ++q;
  321|  6.27k|    nl--;
  322|  6.27k|  }
  323|       |
  324|       |  // now strip off any trailing periods (recording their presence)
  325|  6.96k|  *pabbrev = 0;
  326|       |
  327|  24.5k|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (327:10): [True: 24.2k, False: 266]
  |  Branch (327:22): [True: 17.5k, False: 6.69k]
  ------------------
  328|  17.5k|    nl--;
  329|  17.5k|    (*pabbrev)++;
  330|  17.5k|  }
  331|       |
  332|       |  // if no characters are left it can't be capitalized
  333|  6.96k|  if (nl <= 0) {
  ------------------
  |  Branch (333:7): [True: 266, False: 6.69k]
  ------------------
  334|    266|    *pcaptype = NOCAP;
  ------------------
  |  |   92|    266|#define NOCAP 0
  ------------------
  335|    266|    return;
  336|    266|  }
  337|       |
  338|       |  // now determine the capitalization type of the first nl letters
  339|  6.69k|  int ncap = 0;
  340|  6.69k|  int nneutral = 0;
  341|  6.69k|  int nc = 0;
  342|       |
  343|  6.69k|  if (!utf8) {
  ------------------
  |  Branch (343:7): [True: 3.54k, False: 3.14k]
  ------------------
  344|   680k|    while (nl > 0) {
  ------------------
  |  Branch (344:12): [True: 677k, False: 3.54k]
  ------------------
  345|   677k|      nc++;
  346|   677k|      if (csconv[(*q)].ccase)
  ------------------
  |  Branch (346:11): [True: 492k, False: 184k]
  ------------------
  347|   492k|        ncap++;
  348|   677k|      if (csconv[(*q)].cupper == csconv[(*q)].clower)
  ------------------
  |  Branch (348:11): [True: 158k, False: 518k]
  ------------------
  349|   158k|        nneutral++;
  350|   677k|      dest.push_back(*q++);
  351|   677k|      nl--;
  352|   677k|    }
  353|       |    // remember to terminate the destination string
  354|  3.54k|    firstcap = csconv[static_cast<unsigned char>(dest[0])].ccase;
  355|  3.54k|  } else {
  356|  3.14k|    std::vector<w_char> t;
  357|  3.14k|    u8_u16(t, src);
  358|   248k|    for (auto& wc : t) {
  ------------------
  |  Branch (358:19): [True: 248k, False: 3.14k]
  ------------------
  359|   248k|      const auto idx = (unsigned short)wc;
  360|   248k|      const auto low = unicodetolower(idx, langnum);
  361|   248k|      if (idx != low)
  ------------------
  |  Branch (361:11): [True: 152k, False: 96.0k]
  ------------------
  362|   152k|        ncap++;
  363|   248k|      if (unicodetoupper(idx, langnum) == low)
  ------------------
  |  Branch (363:11): [True: 90.0k, False: 158k]
  ------------------
  364|  90.0k|        nneutral++;
  365|   248k|    }
  366|  3.14k|    u16_u8(dest, t);
  367|  3.14k|    if (ncap) {
  ------------------
  |  Branch (367:9): [True: 1.78k, False: 1.36k]
  ------------------
  368|  1.78k|      const auto idx = (unsigned short)t[0];
  369|  1.78k|      firstcap = (idx != unicodetolower(idx, langnum));
  370|  1.78k|    }
  371|  3.14k|  }
  372|       |
  373|       |  // now finally set the captype
  374|  6.69k|  if (ncap == 0) {
  ------------------
  |  Branch (374:7): [True: 2.32k, False: 4.37k]
  ------------------
  375|  2.32k|    *pcaptype = NOCAP;
  ------------------
  |  |   92|  2.32k|#define NOCAP 0
  ------------------
  376|  4.37k|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (376:14): [True: 2.86k, False: 1.50k]
  |  Branch (376:29): [True: 2.43k, False: 429]
  ------------------
  377|  2.43k|    *pcaptype = INITCAP;
  ------------------
  |  |   93|  2.43k|#define INITCAP 1
  ------------------
  378|  2.43k|  } else if ((ncap == nc) || ((ncap + nneutral) == nc)) {
  ------------------
  |  Branch (378:14): [True: 60, False: 1.87k]
  |  Branch (378:30): [True: 250, False: 1.62k]
  ------------------
  379|    310|    *pcaptype = ALLCAP;
  ------------------
  |  |   94|    310|#define ALLCAP 2
  ------------------
  380|  1.62k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (380:14): [True: 1.20k, False: 419]
  |  Branch (380:28): [True: 1.02k, False: 183]
  ------------------
  381|  1.02k|    *pcaptype = HUHINITCAP;
  ------------------
  |  |   96|  1.02k|#define HUHINITCAP 4
  ------------------
  382|  1.02k|  } else {
  383|    602|    *pcaptype = HUHCAP;
  ------------------
  |  |   95|    602|#define HUHCAP 3
  ------------------
  384|    602|  }
  385|  6.69k|}
_ZN12HunspellImpl8mkallcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  387|  2.48k|void HunspellImpl::mkallcap(std::string& u8) {
  388|  2.48k|  if (utf8) {
  ------------------
  |  Branch (388:7): [True: 1.32k, False: 1.16k]
  ------------------
  389|  1.32k|    std::vector<w_char> u16;
  390|  1.32k|    u8_u16(u16, u8);
  391|  1.32k|    ::mkallcap_utf(u16, langnum);
  392|  1.32k|    u16_u8(u8, u16);
  393|  1.32k|  } else {
  394|  1.16k|    ::mkallcap(u8, csconv);
  395|  1.16k|  }
  396|  2.48k|}
_ZN12HunspellImpl11mkallsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
  398|  1.83M|int HunspellImpl::mkallsmall2(std::string& u8, std::vector<w_char>& u16) {
  399|  1.83M|  if (utf8) {
  ------------------
  |  Branch (399:7): [True: 342k, False: 1.48M]
  ------------------
  400|   342k|    ::mkallsmall_utf(u16, langnum);
  401|   342k|    u16_u8(u8, u16);
  402|  1.48M|  } else {
  403|  1.48M|    ::mkallsmall(u8, csconv);
  404|  1.48M|  }
  405|  1.83M|  return u8.size();
  406|  1.83M|}
_ZN12HunspellImpl11is_keepcaseEPK6hentry:
  444|  13.1k|int HunspellImpl::is_keepcase(const hentry* rv) {
  445|  13.1k|  return pAMgr && rv->astr && pAMgr->get_keepcase() &&
  ------------------
  |  Branch (445:10): [True: 13.1k, False: 0]
  |  Branch (445:19): [True: 368, False: 12.8k]
  |  Branch (445:31): [True: 45, False: 323]
  ------------------
  446|     45|         TESTAFF(rv->astr, pAMgr->get_keepcase(), rv->alen);
  ------------------
  |  |  102|  13.2k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 35, False: 10]
  |  |  ------------------
  ------------------
  447|  13.1k|}
_ZN12HunspellImpl10insert_sugERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_:
  450|  15.4k|void HunspellImpl::insert_sug(std::vector<std::string>& slst, const std::string& word) {
  451|  15.4k|  slst.insert(slst.begin(), word);
  452|  15.4k|}
_ZN12HunspellImpl5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  456|  17.3M|                         std::chrono::steady_clock::time_point suggest_start) {
  457|       |  // something very broken if spell ends up calling itself with the same word
  458|  17.3M|  if (std::find(candidate_stack.begin(), candidate_stack.end(), word) != candidate_stack.end())
  ------------------
  |  Branch (458:7): [True: 0, False: 17.3M]
  ------------------
  459|      0|    return false;
  460|       |
  461|  17.3M|  if (candidate_stack.size() >= MAXBREAKDEPTH)
  ------------------
  |  |   87|  17.3M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (461:7): [True: 0, False: 17.3M]
  ------------------
  462|      0|    return false;
  463|       |
  464|  17.3M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  17.3M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (464:7): [True: 34, False: 17.3M]
  ------------------
  465|     34|    return false;
  466|       |
  467|  17.3M|  TraceCtx* t = active_trace();
  468|  17.3M|  if (t)
  ------------------
  |  Branch (468:7): [True: 0, False: 17.3M]
  ------------------
  469|      0|    trace(*t, "word \"%s\"", word.c_str());
  470|       |  // A word split on a BREAK pattern nests its parts a further level in.
  471|  17.3M|  TraceScope trace_depth(t);
  472|       |
  473|  17.3M|  candidate_stack.push_back(word);
  474|  17.3M|  bool r = spell_internal(word, candidate_stack, info, root, suggest_start);
  475|  17.3M|  candidate_stack.pop_back();
  476|       |
  477|  17.3M|  if (t)
  ------------------
  |  Branch (477:7): [True: 0, False: 17.3M]
  ------------------
  478|      0|    trace(*t, "result %s", r ? "correct" : "incorrect");
  ------------------
  |  Branch (478:28): [True: 0, False: 0]
  ------------------
  479|       |
  480|  17.3M|  if (r && root) {
  ------------------
  |  Branch (480:7): [True: 2.47M, False: 14.8M]
  |  Branch (480:12): [True: 0, False: 2.47M]
  ------------------
  481|       |    // output conversion
  482|      0|    RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (482:19): [True: 0, False: 0]
  ------------------
  483|      0|    if (rl) {
  ------------------
  |  Branch (483:9): [True: 0, False: 0]
  ------------------
  484|      0|      std::string wspace;
  485|      0|      if (rl->conv(*root, wspace)) {
  ------------------
  |  Branch (485:11): [True: 0, False: 0]
  ------------------
  486|      0|        *root = std::move(wspace);
  487|      0|      }
  488|      0|    }
  489|      0|  }
  490|  17.3M|  return r;
  491|  17.3M|}
_ZN12HunspellImpl14spell_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  495|  17.3M|                                  std::chrono::steady_clock::time_point suggest_start) {
  496|  17.3M|  struct hentry* rv = nullptr;
  497|       |
  498|  17.3M|  int info2 = 0;
  499|  17.3M|  if (!info)
  ------------------
  |  Branch (499:7): [True: 17.3M, False: 116]
  ------------------
  500|  17.3M|    info = &info2;
  501|    116|  else
  502|    116|    *info = 0;
  503|       |
  504|       |  // Hunspell supports XML input of the simplified API (see manual)
  505|  17.3M|  if (word == SPELL_XML)
  ------------------
  |  |   80|  17.3M|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (505:7): [True: 387k, False: 16.9M]
  ------------------
  506|   387k|    return true;
  507|  16.9M|  if (utf8) {
  ------------------
  |  Branch (507:7): [True: 3.47M, False: 13.4M]
  ------------------
  508|  3.47M|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   87|  3.47M|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  3.47M|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (508:9): [True: 4.30k, False: 3.47M]
  ------------------
  509|  4.30k|      return false;
  510|  13.4M|  } else {
  511|  13.4M|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  13.4M|#define MAXWORDLEN 100
  ------------------
  |  Branch (511:9): [True: 7.31k, False: 13.4M]
  ------------------
  512|  7.31k|      return false;
  513|  13.4M|  }
  514|  16.9M|  int captype = NOCAP;
  ------------------
  |  |   92|  16.9M|#define NOCAP 0
  ------------------
  515|  16.9M|  size_t abbv = 0;
  516|  16.9M|  size_t wl = 0;
  517|       |
  518|  16.9M|  std::string scw;
  519|  16.9M|  std::vector<w_char> sunicw;
  520|       |
  521|       |  // input conversion
  522|  16.9M|  RepList* rl = pAMgr ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (522:17): [True: 16.9M, False: 0]
  ------------------
  523|  16.9M|  {
  524|  16.9M|    std::string wspace;
  525|       |
  526|  16.9M|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (526:23): [True: 504k, False: 16.4M]
  ------------------
  527|  16.9M|    if (convstatus) {
  ------------------
  |  Branch (527:9): [True: 0, False: 16.9M]
  ------------------
  528|       |      // the input conversion can grow the word without limit, so hold the
  529|       |      // converted word to the same maximum length as the raw word
  530|      0|      if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   87|      0|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                    if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   90|      0|#define MAXWORDLEN 100
  ------------------
  |  Branch (530:11): [True: 0, False: 0]
  |  Branch (530:11): [True: 0, False: 0]
  ------------------
  531|      0|        return false;
  532|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
  533|      0|    } else
  534|  16.9M|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
  535|  16.9M|  }
  536|       |
  537|  16.9M|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  538|  16.9M|    if (wl > 32768)
  ------------------
  |  Branch (538:9): [True: 0, False: 16.9M]
  ------------------
  539|      0|      return false;
  540|  16.9M|#endif
  541|       |
  542|       |#ifdef MOZILLA_CLIENT
  543|       |  // accept the abbreviated words without dots
  544|       |  // workaround for the incomplete tokenization of Mozilla
  545|       |  abbv = 1;
  546|       |#endif
  547|       |
  548|  16.9M|  if (wl == 0 || m_HMgrs.empty())
  ------------------
  |  Branch (548:7): [True: 381k, False: 16.5M]
  |  Branch (548:18): [True: 0, False: 16.5M]
  ------------------
  549|   381k|    return true;
  550|  16.5M|  if (root)
  ------------------
  |  Branch (550:7): [True: 0, False: 16.5M]
  ------------------
  551|      0|    root->clear();
  552|       |
  553|       |  // allow numbers with dots, dashes and commas (but forbid double separators:
  554|       |  // "..", "--" etc.). Besides the ASCII digits, accept the Arabic-Indic and
  555|       |  // Extended Arabic-Indic (Persian) digit ranges so those numbers are passed
  556|       |  // over the same way ASCII numbers are.
  557|  16.5M|  enum { NBEGIN, NNUM, NSEP };
  558|  16.5M|  int nstate = NBEGIN;
  559|  16.5M|  size_t i;
  560|  16.5M|  size_t n = utf8 ? sunicw.size() : wl;
  ------------------
  |  Branch (560:14): [True: 3.40M, False: 13.1M]
  ------------------
  561|       |
  562|  33.7M|  for (i = 0; (i < n); i++) {
  ------------------
  |  Branch (562:15): [True: 32.8M, False: 856k]
  ------------------
  563|  32.8M|    unsigned short c = utf8 ? static_cast<unsigned short>(sunicw[i]) : static_cast<unsigned char>(scw[i]);
  ------------------
  |  Branch (563:24): [True: 7.35M, False: 25.5M]
  ------------------
  564|  32.8M|    if ((c >= '0' && c <= '9') || (c >= 0x0660 && c <= 0x0669) ||  // Arabic-Indic digits
  ------------------
  |  Branch (564:10): [True: 23.6M, False: 9.26M]
  |  Branch (564:22): [True: 16.4M, False: 7.16M]
  |  Branch (564:36): [True: 281k, False: 16.1M]
  |  Branch (564:51): [True: 0, False: 281k]
  ------------------
  565|  16.4M|        (c >= 0x06F0 && c <= 0x06F9)) {                            // Extended Arabic-Indic (Persian) digits
  ------------------
  |  Branch (565:10): [True: 280k, False: 16.1M]
  |  Branch (565:25): [True: 0, False: 280k]
  ------------------
  566|  16.4M|      nstate = NNUM;
  567|  16.4M|    } else if ((c == ',') || (c == '.') || (c == '-')) {
  ------------------
  |  Branch (567:16): [True: 72.1k, False: 16.3M]
  |  Branch (567:30): [True: 1.80M, False: 14.5M]
  |  Branch (567:44): [True: 3.06M, False: 11.4M]
  ------------------
  568|  4.94M|      if ((nstate == NSEP) || (i == 0))
  ------------------
  |  Branch (568:11): [True: 84.0k, False: 4.85M]
  |  Branch (568:31): [True: 4.11M, False: 744k]
  ------------------
  569|  4.19M|        break;
  570|   744k|      nstate = NSEP;
  571|   744k|    } else
  572|  11.4M|      break;
  573|  32.8M|  }
  574|  16.5M|  if ((i == n) && (nstate == NNUM))
  ------------------
  |  Branch (574:7): [True: 856k, False: 15.6M]
  |  Branch (574:19): [True: 662k, False: 193k]
  ------------------
  575|   662k|    return true;
  576|       |
  577|  15.8M|  switch (captype) {
  ------------------
  |  Branch (577:11): [True: 15.8M, False: 0]
  ------------------
  578|  1.16M|    case HUHCAP:
  ------------------
  |  |   95|  1.16M|#define HUHCAP 3
  ------------------
  |  Branch (578:5): [True: 1.16M, False: 14.7M]
  ------------------
  579|       |    /* FALLTHROUGH */
  580|  1.48M|    case HUHINITCAP:
  ------------------
  |  |   96|  1.48M|#define HUHINITCAP 4
  ------------------
  |  Branch (580:5): [True: 316k, False: 15.5M]
  ------------------
  581|  1.48M|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   86|  1.48M|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  582|       |    /* FALLTHROUGH */
  583|  14.8M|    case NOCAP:
  ------------------
  |  |   92|  14.8M|#define NOCAP 0
  ------------------
  |  Branch (583:5): [True: 13.3M, False: 2.49M]
  ------------------
  584|  14.8M|      rv = checkword(scw, info, root, suggest_start);
  585|  14.8M|      if ((abbv) && !(rv)) {
  ------------------
  |  Branch (585:11): [True: 1.15M, False: 13.7M]
  |  Branch (585:21): [True: 1.15M, False: 3]
  ------------------
  586|  1.15M|        std::string u8buffer(scw);
  587|  1.15M|        u8buffer.push_back('.');
  588|  1.15M|        rv = checkword(u8buffer, info, root, suggest_start);
  589|  1.15M|      }
  590|       |      // A stem with an inner capital, capitalised at the start of a sentence
  591|       |      // (uLinda written ULinda), is found by lowering only the first letter.
  592|  14.8M|      if (!rv && captype == HUHINITCAP) {
  ------------------
  |  |   96|  14.8M|#define HUHINITCAP 4
  ------------------
  |  Branch (592:11): [True: 14.8M, False: 14.9k]
  |  Branch (592:18): [True: 313k, False: 14.5M]
  ------------------
  593|   313k|        std::string u8buffer(scw);
  594|   313k|        std::vector<w_char> u16buffer(sunicw);
  595|   313k|        mkinitsmall2(u8buffer, u16buffer);
  596|   313k|        rv = checkword(u8buffer, info, root, suggest_start);
  597|   313k|        if (rv && is_keepcase(rv))
  ------------------
  |  Branch (597:13): [True: 2, False: 313k]
  |  Branch (597:19): [True: 0, False: 2]
  ------------------
  598|      0|          rv = nullptr;
  599|   313k|      }
  600|  14.8M|      break;
  601|   596k|    case ALLCAP: {
  ------------------
  |  |   94|   596k|#define ALLCAP 2
  ------------------
  |  Branch (601:5): [True: 596k, False: 15.2M]
  ------------------
  602|   596k|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   86|   596k|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  603|   596k|      rv = checkword(scw, info, root, suggest_start);
  604|   596k|      if (rv)
  ------------------
  |  Branch (604:11): [True: 153, False: 596k]
  ------------------
  605|    153|        break;
  606|   596k|      if (abbv) {
  ------------------
  |  Branch (606:11): [True: 106k, False: 490k]
  ------------------
  607|   106k|        std::string u8buffer(scw);
  608|   106k|        u8buffer.push_back('.');
  609|   106k|        rv = checkword(u8buffer, info, root, suggest_start);
  610|   106k|        if (rv)
  ------------------
  |  Branch (610:13): [True: 0, False: 106k]
  ------------------
  611|      0|          break;
  612|   106k|      }
  613|       |      // Spec. prefix handling for Catalan, French, Italian:
  614|       |      // prefixes separated by apostrophe (SANT'ELIA -> Sant'+Elia).
  615|   596k|      size_t apos = pAMgr ? scw.find('\'') : std::string::npos;
  ------------------
  |  Branch (615:21): [True: 596k, False: 0]
  ------------------
  616|   596k|      if (apos != std::string::npos) {
  ------------------
  |  Branch (616:11): [True: 130k, False: 466k]
  ------------------
  617|   130k|        mkallsmall2(scw, sunicw);
  618|       |        //conversion may result in string with different len to pre-mkallsmall2
  619|       |        //so re-scan
  620|   130k|        if (apos != std::string::npos && apos < scw.size() - 1) {
  ------------------
  |  Branch (620:13): [True: 130k, False: 0]
  |  Branch (620:42): [True: 122k, False: 7.68k]
  ------------------
  621|   122k|          std::string part1 = scw.substr(0, apos + 1), part2 = scw.substr(apos + 1);
  622|   122k|          if (utf8) {
  ------------------
  |  Branch (622:15): [True: 30.1k, False: 92.2k]
  ------------------
  623|  30.1k|            std::vector<w_char> part1u, part2u;
  624|  30.1k|            u8_u16(part1u, part1);
  625|  30.1k|            u8_u16(part2u, part2);
  626|  30.1k|            mkinitcap2(part2, part2u);
  627|  30.1k|            scw = part1 + part2;
  628|  30.1k|            sunicw = std::move(part1u);
  629|  30.1k|            sunicw.insert(sunicw.end(), part2u.begin(), part2u.end());
  630|  30.1k|            rv = checkword(scw, info, root, suggest_start);
  631|  30.1k|            if (rv)
  ------------------
  |  Branch (631:17): [True: 0, False: 30.1k]
  ------------------
  632|      0|              break;
  633|  92.2k|          } else {
  634|  92.2k|            mkinitcap2(part2, sunicw);
  635|  92.2k|            scw = part1 + part2;
  636|  92.2k|            rv = checkword(scw, info, root, suggest_start);
  637|  92.2k|            if (rv)
  ------------------
  |  Branch (637:17): [True: 1, False: 92.2k]
  ------------------
  638|      1|              break;
  639|  92.2k|          }
  640|   122k|          mkinitcap2(scw, sunicw);
  641|   122k|          rv = checkword(scw, info, root, suggest_start);
  642|   122k|          if (rv)
  ------------------
  |  Branch (642:15): [True: 0, False: 122k]
  ------------------
  643|      0|            break;
  644|   122k|        }
  645|   130k|      }
  646|   596k|      if (pAMgr && pAMgr->get_checksharps() && scw.find("SS") != std::string::npos) {
  ------------------
  |  Branch (646:11): [True: 596k, False: 0]
  |  Branch (646:20): [True: 0, False: 596k]
  |  Branch (646:48): [True: 0, False: 0]
  ------------------
  647|       |
  648|      0|        mkallsmall2(scw, sunicw);
  649|      0|        std::string u8buffer(scw);
  650|      0|        rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  651|      0|        if (!rv) {
  ------------------
  |  Branch (651:13): [True: 0, False: 0]
  ------------------
  652|      0|          mkinitcap2(scw, sunicw);
  653|      0|          rv = spellsharps(scw, 0, 0, 0, info, root, suggest_start);
  654|      0|        }
  655|      0|        if ((abbv) && !(rv)) {
  ------------------
  |  Branch (655:13): [True: 0, False: 0]
  |  Branch (655:23): [True: 0, False: 0]
  ------------------
  656|      0|          u8buffer.push_back('.');
  657|      0|          rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  658|      0|          if (!rv) {
  ------------------
  |  Branch (658:15): [True: 0, False: 0]
  ------------------
  659|      0|            u8buffer = std::string(scw);
  660|      0|            u8buffer.push_back('.');
  661|      0|            rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  662|      0|          }
  663|      0|        }
  664|      0|        if (rv)
  ------------------
  |  Branch (664:13): [True: 0, False: 0]
  ------------------
  665|      0|          break;
  666|      0|      }
  667|   596k|    }
  668|       |      /* FALLTHROUGH */
  669|  1.00M|    case INITCAP: {
  ------------------
  |  |   93|  1.00M|#define INITCAP 1
  ------------------
  |  Branch (669:5): [True: 411k, False: 15.4M]
  ------------------
  670|       |      // handle special capitalization of dotted I
  671|  1.00M|      bool Idot = (utf8 && (unsigned char) scw[0] == 0xc4 && (unsigned char) scw[1] == 0xb0);
  ------------------
  |  Branch (671:20): [True: 177k, False: 830k]
  |  Branch (671:28): [True: 0, False: 177k]
  |  Branch (671:62): [True: 0, False: 0]
  ------------------
  672|  1.00M|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   86|  1.00M|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  673|  1.00M|      if (captype == ALLCAP) {
  ------------------
  |  |   94|  1.00M|#define ALLCAP 2
  ------------------
  |  Branch (673:11): [True: 596k, False: 411k]
  ------------------
  674|   596k|          mkallsmall2(scw, sunicw);
  675|   596k|          mkinitcap2(scw, sunicw);
  676|   596k|          if (Idot)
  ------------------
  |  Branch (676:15): [True: 0, False: 596k]
  ------------------
  677|      0|             scw.replace(0, 1, "\xc4\xb0");
  678|   596k|      }
  679|  1.00M|      if (captype == INITCAP)
  ------------------
  |  |   93|  1.00M|#define INITCAP 1
  ------------------
  |  Branch (679:11): [True: 411k, False: 596k]
  ------------------
  680|   411k|        *info |= SPELL_INITCAP;
  ------------------
  |  |   85|   411k|#define SPELL_INITCAP (1 << 4)
  ------------------
  681|  1.00M|      rv = checkword(scw, info, root, suggest_start);
  682|  1.00M|      if (captype == INITCAP)
  ------------------
  |  |   93|  1.00M|#define INITCAP 1
  ------------------
  |  Branch (682:11): [True: 411k, False: 596k]
  ------------------
  683|   411k|        *info &= ~SPELL_INITCAP;
  ------------------
  |  |   85|   411k|#define SPELL_INITCAP (1 << 4)
  ------------------
  684|       |      // forbid bad capitalization
  685|       |      // (for example, ijs -> Ijs instead of IJs in Dutch)
  686|       |      // use explicit forms in dic: Ijs/F (F = FORBIDDENWORD flag)
  687|  1.00M|      if (*info & SPELL_FORBIDDEN) {
  ------------------
  |  |   82|  1.00M|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (687:11): [True: 0, False: 1.00M]
  ------------------
  688|      0|        rv = nullptr;
  689|      0|        break;
  690|      0|      }
  691|  1.00M|      if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   94|     11|#define ALLCAP 2
  ------------------
  |  Branch (691:11): [True: 11.3k, False: 996k]
  |  Branch (691:17): [True: 11, False: 11.3k]
  |  Branch (691:36): [True: 0, False: 11]
  ------------------
  692|      0|        rv = nullptr;
  693|  1.00M|      if (rv || (Idot && langnum != LANG_az && langnum != LANG_tr && langnum != LANG_crh))
  ------------------
  |  Branch (693:11): [True: 11.3k, False: 996k]
  |  Branch (693:18): [True: 0, False: 996k]
  |  Branch (693:26): [True: 0, False: 0]
  |  Branch (693:48): [True: 0, False: 0]
  |  Branch (693:70): [True: 0, False: 0]
  ------------------
  694|  11.3k|        break;
  695|       |
  696|   996k|      mkallsmall2(scw, sunicw);
  697|   996k|      std::string u8buffer(scw);
  698|   996k|      mkinitcap2(scw, sunicw);
  699|       |
  700|   996k|      rv = checkword(u8buffer, info, root, suggest_start);
  701|   996k|      if (abbv && !rv) {
  ------------------
  |  Branch (701:11): [True: 173k, False: 823k]
  |  Branch (701:19): [True: 173k, False: 0]
  ------------------
  702|   173k|        u8buffer.push_back('.');
  703|   173k|        rv = checkword(u8buffer, info, root, suggest_start);
  704|   173k|        if (!rv) {
  ------------------
  |  Branch (704:13): [True: 173k, False: 0]
  ------------------
  705|   173k|          u8buffer = scw;
  706|   173k|          u8buffer.push_back('.');
  707|   173k|          if (captype == INITCAP)
  ------------------
  |  |   93|   173k|#define INITCAP 1
  ------------------
  |  Branch (707:15): [True: 67.1k, False: 106k]
  ------------------
  708|  67.1k|            *info |= SPELL_INITCAP;
  ------------------
  |  |   85|  67.1k|#define SPELL_INITCAP (1 << 4)
  ------------------
  709|   173k|          rv = checkword(u8buffer, info, root, suggest_start);
  710|   173k|          if (captype == INITCAP)
  ------------------
  |  |   93|   173k|#define INITCAP 1
  ------------------
  |  Branch (710:15): [True: 67.1k, False: 106k]
  ------------------
  711|  67.1k|            *info &= ~SPELL_INITCAP;
  ------------------
  |  |   85|  67.1k|#define SPELL_INITCAP (1 << 4)
  ------------------
  712|   173k|          if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   94|     22|#define ALLCAP 2
  ------------------
  |  Branch (712:15): [True: 22, False: 173k]
  |  Branch (712:21): [True: 22, False: 0]
  |  Branch (712:40): [True: 3, False: 19]
  ------------------
  713|      3|            rv = nullptr;
  714|   173k|          break;
  715|   173k|        }
  716|   173k|      }
  717|   823k|      if (rv && is_keepcase(rv) &&
  ------------------
  |  Branch (717:11): [True: 1.77k, False: 821k]
  |  Branch (717:17): [True: 2, False: 1.77k]
  ------------------
  718|      2|          ((captype == ALLCAP) ||
  ------------------
  |  |   94|      2|#define ALLCAP 2
  ------------------
  |  Branch (718:12): [True: 0, False: 2]
  ------------------
  719|       |           // if CHECKSHARPS: KEEPCASE words with \xDF  are allowed
  720|       |           // in INITCAP form, too.
  721|      2|           !(pAMgr->get_checksharps() &&
  ------------------
  |  Branch (721:14): [True: 0, False: 2]
  ------------------
  722|      0|             ((utf8 && u8buffer.find("\xC3\x9F") != std::string::npos) ||
  ------------------
  |  Branch (722:16): [True: 0, False: 0]
  |  Branch (722:24): [True: 0, False: 0]
  ------------------
  723|      0|              (!utf8 && u8buffer.find('\xDF') != std::string::npos)))))
  ------------------
  |  Branch (723:16): [True: 0, False: 0]
  |  Branch (723:25): [True: 0, False: 0]
  ------------------
  724|      2|        rv = nullptr;
  725|   823k|      break;
  726|   996k|    }
  727|  15.8M|  }
  728|       |
  729|  15.8M|  if (rv) {
  ------------------
  |  Branch (729:7): [True: 28.2k, False: 15.8M]
  ------------------
  730|  28.2k|    if (pAMgr && pAMgr->get_warn() && rv->astr &&
  ------------------
  |  Branch (730:9): [True: 28.2k, False: 0]
  |  Branch (730:9): [True: 3, False: 28.2k]
  |  Branch (730:18): [True: 1.91k, False: 26.3k]
  |  Branch (730:39): [True: 14, False: 1.90k]
  ------------------
  731|     14|        TESTAFF(rv->astr, pAMgr->get_warn(), rv->alen)) {
  ------------------
  |  |  102|     14|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 3, False: 11]
  |  |  ------------------
  ------------------
  732|      3|      *info |= SPELL_WARN;
  ------------------
  |  |   87|      3|#define SPELL_WARN (1 << 6)
  ------------------
  733|      3|      if (pAMgr->get_forbidwarn())
  ------------------
  |  Branch (733:11): [True: 0, False: 3]
  ------------------
  734|      0|        return false;
  735|      3|      return true;
  736|      3|    }
  737|  28.2k|    return true;
  738|  28.2k|  }
  739|       |
  740|       |  // recursive breaking at break points
  741|  15.8M|  if (!wordbreak.empty() && !(*info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   82|  15.8M|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (741:7): [True: 15.8M, False: 0]
  |  Branch (741:29): [True: 15.8M, False: 0]
  ------------------
  742|       |
  743|  15.8M|    int nbr = 0;
  744|  15.8M|    wl = scw.size();
  745|       |
  746|       |    // calculate break points for recursion limit
  747|  47.4M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (747:18): [True: 47.4M, False: 15.8M]
  ------------------
  748|  47.4M|      size_t pos = 0;
  749|  64.4M|      while ((pos = scw.find(j, pos)) != std::string::npos) {
  ------------------
  |  Branch (749:14): [True: 17.0M, False: 47.4M]
  ------------------
  750|  17.0M|        ++nbr;
  751|  17.0M|        pos += j.size();
  752|  17.0M|      }
  753|  47.4M|    }
  754|  15.8M|    if (nbr >= MAXBREAKDEPTH)
  ------------------
  |  |   87|  15.8M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (754:9): [True: 7.90k, False: 15.8M]
  ------------------
  755|  7.90k|      return false;
  756|       |
  757|       |    // check boundary patterns (^begin and end$)
  758|  47.3M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (758:18): [True: 47.3M, False: 14.8M]
  ------------------
  759|  47.3M|      size_t plen = j.size();
  760|  47.3M|      if (plen == 1 || plen > wl)
  ------------------
  |  Branch (760:11): [True: 15.8M, False: 31.4M]
  |  Branch (760:24): [True: 4.04M, False: 27.4M]
  ------------------
  761|  19.8M|        continue;
  762|       |
  763|  27.4M|      if (j[0] == '^' && scw.compare(0, plen - 1, j, 1, plen - 1) == 0 &&
  ------------------
  |  Branch (763:11): [True: 13.7M, False: 13.6M]
  |  Branch (763:11): [True: 104k, False: 27.3M]
  |  Branch (763:26): [True: 1.08M, False: 12.6M]
  ------------------
  764|  1.08M|          spell(scw.substr(plen - 1), candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (764:11): [True: 104k, False: 976k]
  ------------------
  765|   104k|        *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|   104k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  766|   104k|        return true;
  767|   104k|      }
  768|       |
  769|  27.3M|      if (j[plen - 1] == '$' &&
  ------------------
  |  Branch (769:11): [True: 13.6M, False: 13.6M]
  ------------------
  770|  13.6M|          scw.compare(wl - plen + 1, plen - 1, j, 0, plen - 1) == 0) {
  ------------------
  |  Branch (770:11): [True: 5.08M, False: 8.57M]
  ------------------
  771|  5.08M|        std::string suffix(scw.substr(wl - plen + 1));
  772|  5.08M|        scw.resize(wl - plen + 1);
  773|  5.08M|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (773:13): [True: 852k, False: 4.23M]
  ------------------
  774|   852k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|   852k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  775|   852k|          return true;
  776|   852k|        }
  777|  4.23M|        scw.append(suffix);
  778|  4.23M|      }
  779|  27.3M|    }
  780|       |
  781|       |    // other patterns
  782|  44.4M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (782:18): [True: 44.4M, False: 14.8M]
  ------------------
  783|  44.4M|      size_t plen = j.size();
  784|  44.4M|      size_t found = scw.find(j);
  785|  44.4M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (785:11): [True: 42.0M, False: 2.47M]
  |  Branch (785:26): [True: 4.78M, False: 37.2M]
  ------------------
  786|  4.78M|        size_t found2 = scw.find(j, found + 1);
  787|       |        // try to break at the second occurance
  788|       |        // to recognize dictionary words with wordbreak
  789|  4.78M|        if (found2 > 0 && (found2 < wl - plen))
  ------------------
  |  Branch (789:13): [True: 4.78M, False: 0]
  |  Branch (789:27): [True: 1.85M, False: 2.92M]
  ------------------
  790|  1.85M|            found = found2;
  791|  4.78M|        std::string substring(scw.substr(found + plen));
  792|  4.78M|        if (!spell(substring, candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (792:13): [True: 4.00M, False: 783k]
  ------------------
  793|  4.00M|          continue;
  794|   783k|        std::string suffix(scw.substr(found));
  795|   783k|        scw.resize(found);
  796|       |        // examine 2 sides of the break point
  797|   783k|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (797:13): [True: 48.8k, False: 735k]
  ------------------
  798|  48.8k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|  48.8k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  799|  48.8k|          return true;
  800|  48.8k|        }
  801|   735k|        scw.append(suffix);
  802|       |
  803|       |        // LANG_hu: spec. dash rule
  804|   735k|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (804:13): [True: 146, False: 734k]
  |  Branch (804:35): [True: 146, False: 0]
  ------------------
  805|    146|          suffix = scw.substr(found + 1);
  806|    146|          scw.resize(found + 1);
  807|    146|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (807:15): [True: 0, False: 146]
  ------------------
  808|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  809|      0|            return true;  // check the first part with dash
  810|      0|          }
  811|    146|          scw.append(suffix);
  812|    146|        }
  813|       |        // end of LANG specific region
  814|   735k|      }
  815|  44.4M|    }
  816|       |
  817|       |    // other patterns (break at first break point)
  818|  44.4M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (818:18): [True: 44.4M, False: 14.8M]
  ------------------
  819|  44.4M|      size_t plen = j.size(), found = scw.find(j);
  820|  44.4M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (820:11): [True: 41.9M, False: 2.47M]
  |  Branch (820:26): [True: 4.72M, False: 37.2M]
  ------------------
  821|  4.72M|        if (!spell(scw.substr(found + plen), candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (821:13): [True: 4.10M, False: 619k]
  ------------------
  822|  4.10M|          continue;
  823|   619k|        std::string suffix(scw.substr(found));
  824|   619k|        scw.resize(found);
  825|       |        // examine 2 sides of the break point
  826|   619k|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (826:13): [True: 5.13k, False: 614k]
  ------------------
  827|  5.13k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|  5.13k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  828|  5.13k|          return true;
  829|  5.13k|        }
  830|   614k|        scw.append(suffix);
  831|       |
  832|       |        // LANG_hu: spec. dash rule
  833|   614k|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (833:13): [True: 76, False: 613k]
  |  Branch (833:35): [True: 76, False: 0]
  ------------------
  834|     76|          suffix = scw.substr(found + 1);
  835|     76|          scw.resize(found + 1);
  836|     76|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (836:15): [True: 0, False: 76]
  ------------------
  837|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  838|      0|            return true;  // check the first part with dash
  839|      0|          }
  840|     76|          scw.append(suffix);
  841|     76|        }
  842|       |        // end of LANG specific region
  843|   614k|      }
  844|  44.4M|    }
  845|  14.8M|  }
  846|       |
  847|  14.8M|  return false;
  848|  15.8M|}
_ZN12HunspellImpl9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_NS0_6chrono10time_pointINSB_12steady_clockENSB_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  851|  19.6M|                                       std::chrono::steady_clock::time_point suggest_start) {
  852|       |  // check overall suggest time limit
  853|  19.6M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  19.6M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (853:7): [True: 1, False: 19.6M]
  ------------------
  854|      1|    return nullptr;
  855|       |
  856|  19.6M|  std::string word;
  857|       |
  858|       |  // remove IGNORE characters from the string
  859|  19.6M|  clean_ignore(word, w);
  860|       |
  861|  19.6M|  if (word.empty())
  ------------------
  |  Branch (861:7): [True: 103, False: 19.6M]
  ------------------
  862|    103|    return nullptr;
  863|       |
  864|       |  // word reversing wrapper for complex prefixes
  865|  19.6M|  if (complexprefixes) {
  ------------------
  |  Branch (865:7): [True: 1.06M, False: 18.5M]
  ------------------
  866|  1.06M|    if (utf8)
  ------------------
  |  Branch (866:9): [True: 0, False: 1.06M]
  ------------------
  867|      0|      reverseword_utf(word);
  868|  1.06M|    else
  869|  1.06M|      reverseword(word);
  870|  1.06M|  }
  871|       |
  872|  19.6M|  int len = word.size();
  873|       |
  874|       |  // look word in hash table
  875|  19.6M|  struct hentry* he = nullptr;
  876|  19.6M|  TraceCtx* t = active_trace();
  877|  39.2M|  for (size_t i = 0; (i < m_HMgrs.size()) && !he; ++i) {
  ------------------
  |  Branch (877:22): [True: 19.6M, False: 19.6M]
  |  Branch (877:46): [True: 19.6M, False: 0]
  ------------------
  878|  19.6M|    he = m_HMgrs[i]->lookup(word.c_str(), word.size());
  879|       |
  880|  19.6M|    if (t) {
  ------------------
  |  Branch (880:9): [True: 0, False: 19.6M]
  ------------------
  881|      0|      std::string dic;
  882|      0|      if (m_HMgrs.size() > 1)
  ------------------
  |  Branch (882:11): [True: 0, False: 0]
  ------------------
  883|      0|        dic = " dic=" + std::to_string(i);
  884|      0|      if (he)
  ------------------
  |  Branch (884:11): [True: 0, False: 0]
  ------------------
  885|      0|        trace(*t, "lookup \"%s\"%s -> entry \"%s\" flags=%s", word.c_str(),
  886|      0|              dic.c_str(), he->word,
  887|      0|              trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  888|      0|      else
  889|      0|        trace(*t, "lookup \"%s\"%s -> miss", word.c_str(), dic.c_str());
  890|      0|    }
  891|       |
  892|       |    // check forbidden and onlyincompound words
  893|  19.6M|    if ((he) && (he->astr) && (pAMgr) &&
  ------------------
  |  Branch (893:9): [True: 28.9k, False: 19.6M]
  |  Branch (893:9): [True: 0, False: 19.6M]
  |  Branch (893:17): [True: 1.72k, False: 27.2k]
  |  Branch (893:31): [True: 1.72k, False: 0]
  ------------------
  894|  1.72k|        TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) {
  ------------------
  |  |  102|  1.72k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 1.72k]
  |  |  ------------------
  ------------------
  895|      0|      if (t)
  ------------------
  |  Branch (895:11): [True: 0, False: 0]
  ------------------
  896|      0|        trace(*t, "test forbidden flag=%s in=dic have=%s"
  897|      0|                  " -> fail, the word is forbidden",
  898|      0|              pAMgr->encode_flag(pAMgr->get_forbiddenword()).c_str(),
  899|      0|              trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  900|      0|      if (info)
  ------------------
  |  Branch (900:11): [True: 0, False: 0]
  ------------------
  901|      0|        *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   82|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  902|       |      // LANG_hu section: set dash information for suggestions
  903|      0|      if (langnum == LANG_hu) {
  ------------------
  |  Branch (903:11): [True: 0, False: 0]
  ------------------
  904|      0|        if (pAMgr->get_compoundflag() &&
  ------------------
  |  Branch (904:13): [True: 0, False: 0]
  |  Branch (904:13): [True: 0, False: 0]
  ------------------
  905|      0|            TESTAFF(he->astr, pAMgr->get_compoundflag(), he->alen)) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  906|      0|          if (info)
  ------------------
  |  Branch (906:15): [True: 0, False: 0]
  ------------------
  907|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  908|      0|        }
  909|      0|      }
  910|      0|      return nullptr;
  911|      0|    }
  912|       |
  913|       |    // he = next not needaffix, onlyincompound homonym or onlyupcase word
  914|  19.6M|    const struct hentry* first_he = he;
  915|  19.6M|    while (he && (he->astr) && pAMgr &&
  ------------------
  |  Branch (915:12): [True: 28.9k, False: 19.6M]
  |  Branch (915:12): [True: 713, False: 19.6M]
  |  Branch (915:18): [True: 1.72k, False: 27.2k]
  |  Branch (915:32): [True: 1.72k, False: 0]
  ------------------
  916|  1.72k|           ((pAMgr->get_needaffix() &&
  ------------------
  |  Branch (916:14): [True: 100, False: 1.62k]
  ------------------
  917|    100|             TESTAFF(he->astr, pAMgr->get_needaffix(), he->alen)) ||
  ------------------
  |  |  102|    100|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 100]
  |  |  ------------------
  ------------------
  918|  1.72k|            (pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (918:14): [True: 0, False: 1.72k]
  ------------------
  919|      0|             TESTAFF(he->astr, pAMgr->get_onlyincompound(), he->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  920|  1.72k|            (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   85|  1.72k|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (920:14): [True: 1.72k, False: 0]
  |  Branch (920:22): [True: 743, False: 982]
  ------------------
  921|    743|             TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen)))) {
  ------------------
  |  |  102|    743|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 713, False: 30]
  |  |  ------------------
  ------------------
  922|    713|      if (t) {
  ------------------
  |  Branch (922:11): [True: 0, False: 713]
  ------------------
  923|       |        // Name the branch that fired, in the order the condition tests them.
  924|      0|        const char* reason = "onlyupcase";
  925|      0|        FLAG flag = ONLYUPCASEFLAG;
  ------------------
  |  |   98|      0|#define FLAG unsigned short
  ------------------
                      FLAG flag = ONLYUPCASEFLAG;
  ------------------
  |  |  128|      0|#define ONLYUPCASEFLAG 65511
  ------------------
  926|      0|        if (pAMgr->get_needaffix() &&
  ------------------
  |  Branch (926:13): [True: 0, False: 0]
  |  Branch (926:13): [True: 0, False: 0]
  ------------------
  927|      0|            TESTAFF(he->astr, pAMgr->get_needaffix(), he->alen)) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  928|      0|          reason = "needaffix";
  929|      0|          flag = pAMgr->get_needaffix();
  930|      0|        } else if (pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (930:20): [True: 0, False: 0]
  |  Branch (930:20): [True: 0, False: 0]
  ------------------
  931|      0|                   TESTAFF(he->astr, pAMgr->get_onlyincompound(), he->alen)) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  932|      0|          reason = "onlyincompound";
  933|      0|          flag = pAMgr->get_onlyincompound();
  934|      0|        }
  935|      0|        trace(*t, "test %s flag=%s in=dic have=%s"
  936|      0|                  " -> fail, on to the next homonym",
  937|      0|              reason, trace_flag(pAMgr.get(), flag).c_str(),
  938|      0|              trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  939|      0|      }
  940|    713|      he = he->next_homonym;
  941|    713|    }
  942|       |
  943|       |    // Say which entry the walk left in hand, so the transcript does not end
  944|       |    // on a homonym that was passed over.
  945|  19.6M|    if (t && he != first_he) {
  ------------------
  |  Branch (945:9): [True: 0, False: 19.6M]
  |  Branch (945:14): [True: 0, False: 0]
  ------------------
  946|      0|      if (he)
  ------------------
  |  Branch (946:11): [True: 0, False: 0]
  ------------------
  947|      0|        trace(*t, "lookup \"%s\" -> entry \"%s\" flags=%s", word.c_str(),
  948|      0|              he->word, trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  949|      0|      else
  950|      0|        trace(*t, "lookup \"%s\" -> no more homonyms", word.c_str());
  951|      0|    }
  952|  19.6M|  }
  953|       |
  954|       |  // check with affixes
  955|  19.6M|  if (!he && pAMgr) {
  ------------------
  |  Branch (955:7): [True: 19.6M, False: 28.2k]
  |  Branch (955:14): [True: 19.6M, False: 0]
  ------------------
  956|       |    // try stripping off affixes
  957|  19.6M|    AffixScratch scratch;
  958|  19.6M|    scratch.trace = t;
  959|       |    // For an initial-capital query, make affix_check skip an all-uppercase-only
  960|       |    // stem and keep looking, so a valid mixed-case match behind it is found.
  961|  19.6M|    FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   98|  19.6M|#define FLAG unsigned short
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   85|  19.6M|#define SPELL_INITCAP (1 << 4)
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |  128|   468k|#define ONLYUPCASEFLAG 65511
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   99|  38.7M|#define FLAG_NULL 0x00
  ------------------
  |  Branch (961:23): [True: 19.6M, False: 0]
  |  Branch (961:31): [True: 468k, False: 19.1M]
  ------------------
  962|  19.6M|    he = pAMgr->affix_check(word, 0, len, scratch, 0, IN_CPD_NOT, avoidflag);
  ------------------
  |  |   75|  19.6M|#define IN_CPD_NOT 0
  ------------------
  963|       |
  964|       |    // check compound restriction and onlyupcase
  965|  19.6M|    if (he && he->astr &&
  ------------------
  |  Branch (965:9): [True: 0, False: 19.6M]
  |  Branch (965:9): [True: 0, False: 19.6M]
  |  Branch (965:15): [True: 0, False: 0]
  ------------------
  966|      0|        ((pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (966:11): [True: 0, False: 0]
  ------------------
  967|      0|          TESTAFF(he->astr, pAMgr->get_onlyincompound(), he->alen)) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  968|      0|         (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   85|      0|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (968:11): [True: 0, False: 0]
  |  Branch (968:19): [True: 0, False: 0]
  ------------------
  969|      0|          TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen)))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  970|      0|      he = nullptr;
  971|      0|    }
  972|       |
  973|  19.6M|    if (he) {
  ------------------
  |  Branch (973:9): [True: 0, False: 19.6M]
  ------------------
  974|      0|      if ((he->astr) && (pAMgr) &&
  ------------------
  |  Branch (974:11): [True: 0, False: 0]
  |  Branch (974:11): [True: 0, False: 0]
  |  Branch (974:25): [True: 0, False: 0]
  ------------------
  975|      0|          TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  976|      0|        if (info)
  ------------------
  |  Branch (976:13): [True: 0, False: 0]
  ------------------
  977|      0|          *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   82|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  978|      0|        return nullptr;
  979|      0|      }
  980|      0|      if (root) {
  ------------------
  |  Branch (980:11): [True: 0, False: 0]
  ------------------
  981|      0|        root->assign(he->word);
  982|      0|        if (complexprefixes) {
  ------------------
  |  Branch (982:13): [True: 0, False: 0]
  ------------------
  983|      0|          if (utf8)
  ------------------
  |  Branch (983:15): [True: 0, False: 0]
  ------------------
  984|      0|            reverseword_utf(*root);
  985|      0|          else
  986|      0|            reverseword(*root);
  987|      0|        }
  988|      0|      }
  989|       |      // try check compound word
  990|  19.6M|    } else if (pAMgr->get_compound()) {
  ------------------
  |  Branch (990:16): [True: 4.91M, False: 14.6M]
  ------------------
  991|  4.91M|      struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
  992|       |
  993|       |      // first allow only 2 words in the compound
  994|  4.91M|      int setinfo = SPELL_COMPOUND_2;
  ------------------
  |  |   88|  4.91M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  995|  4.91M|      if (info)
  ------------------
  |  Branch (995:11): [True: 4.91M, False: 0]
  ------------------
  996|  4.91M|        setinfo |= *info;
  997|  4.91M|      if (TraceCtx* t = trace_on(scratch.trace))
  ------------------
  |  Branch (997:21): [True: 0, False: 4.91M]
  ------------------
  998|      0|        trace(*t, "compound words=2");
  999|  4.91M|      {
 1000|  4.91M|        TraceScope compound_depth(trace_on(scratch.trace));
 1001|  4.91M|        he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, &setinfo, scratch);
 1002|  4.91M|      }
 1003|  4.91M|      if (info)
  ------------------
  |  Branch (1003:11): [True: 4.91M, False: 0]
  ------------------
 1004|  4.91M|        *info = setinfo & ~SPELL_COMPOUND_2;
  ------------------
  |  |   88|  4.91M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
 1005|       |      // if not 2-word compoud word, try with 3 or more words
 1006|       |      // (only if original info didn't forbid it)
 1007|  4.91M|      if (!he && info && !(*info & SPELL_COMPOUND_2)) {
  ------------------
  |  |   88|  4.91M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (1007:11): [True: 4.91M, False: 0]
  |  Branch (1007:18): [True: 4.91M, False: 0]
  |  Branch (1007:26): [True: 4.91M, False: 0]
  ------------------
 1008|  4.91M|        *info &= ~SPELL_COMPOUND_2;
  ------------------
  |  |   88|  4.91M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
 1009|  4.91M|        if (TraceCtx* t = trace_on(scratch.trace))
  ------------------
  |  Branch (1009:23): [True: 0, False: 4.91M]
  ------------------
 1010|      0|          trace(*t, "compound words=3+");
 1011|  4.91M|        {
 1012|  4.91M|          TraceScope compound_depth(trace_on(scratch.trace));
 1013|  4.91M|          he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, info, scratch);
 1014|  4.91M|        }
 1015|       |        // accept the compound with 3 or more words only if it is
 1016|       |        // - not a dictionary word with a typo and
 1017|       |        // - not two words written separately,
 1018|       |        // - or if it's an arbitrary number accepted by compound rules (e.g. 999%)
 1019|  4.91M|        if (he && !isdigit(word[0]))
  ------------------
  |  Branch (1019:13): [True: 0, False: 4.91M]
  |  Branch (1019:19): [True: 0, False: 0]
  ------------------
 1020|      0|        {
 1021|      0|          std::vector<std::string> slst;
 1022|      0|          bool simple;
 1023|      0|          {
 1024|       |            // the suggester runs its whole search here, so report what it
 1025|       |            // decided rather than every candidate it tried
 1026|      0|            TraceSuppress no_trace(scratch.trace);
 1027|      0|            simple = pSMgr->suggest(slst, word, nullptr, /*test_simplesug=*/true);
 1028|      0|          }
 1029|      0|          if (TraceCtx* t = trace_on(scratch.trace))
  ------------------
  |  Branch (1029:25): [True: 0, False: 0]
  ------------------
 1030|      0|            trace(*t, "test simplesug -> %s",
 1031|      0|                  simple ? "fail, a simpler form of this word exists"
  ------------------
  |  Branch (1031:19): [True: 0, False: 0]
  ------------------
 1032|      0|                         : "pass, no simpler form of this word exists");
 1033|      0|          if (simple)
  ------------------
  |  Branch (1033:15): [True: 0, False: 0]
  ------------------
 1034|      0|            he = nullptr;
 1035|      0|        }
 1036|  4.91M|      }
 1037|       |
 1038|       |      // LANG_hu section: `moving rule' with last dash
 1039|  4.91M|      if ((!he) && (langnum == LANG_hu) && (word[len - 1] == '-')) {
  ------------------
  |  Branch (1039:11): [True: 4.91M, False: 0]
  |  Branch (1039:20): [True: 36.1k, False: 4.88M]
  |  Branch (1039:44): [True: 15.9k, False: 20.2k]
  ------------------
 1040|  15.9k|        std::string dup(word, 0, len - 1);
 1041|  15.9k|        he = pAMgr->compound_check(dup, -5, 0, 100, 0, nullptr, (hentry**)&rwords, 1, 0, info, scratch);
 1042|  15.9k|      }
 1043|       |      // end of LANG specific region
 1044|  4.91M|      if (he) {
  ------------------
  |  Branch (1044:11): [True: 0, False: 4.91M]
  ------------------
 1045|      0|        if (root) {
  ------------------
  |  Branch (1045:13): [True: 0, False: 0]
  ------------------
 1046|      0|          root->assign(he->word);
 1047|      0|          if (complexprefixes) {
  ------------------
  |  Branch (1047:15): [True: 0, False: 0]
  ------------------
 1048|      0|            if (utf8)
  ------------------
  |  Branch (1048:17): [True: 0, False: 0]
  ------------------
 1049|      0|              reverseword_utf(*root);
 1050|      0|            else
 1051|      0|              reverseword(*root);
 1052|      0|          }
 1053|      0|        }
 1054|      0|        if (info)
  ------------------
  |  Branch (1054:13): [True: 0, False: 0]
  ------------------
 1055|      0|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
 1056|      0|      }
 1057|  4.91M|    }
 1058|  19.6M|  }
 1059|       |
 1060|  19.6M|  return he;
 1061|  19.6M|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEENS0_6chrono10time_pointINSD_12steady_clockENSD_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1069|  90.6k|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) {
 1070|       |
 1071|  90.6k|  if (suggest_candidate_stack.size() > MAX_CANDIDATE_STACK_DEPTH || // apply a fairly arbitrary depth limit
  ------------------
  |  | 1064|   181k|#define MAX_CANDIDATE_STACK_DEPTH 512
  ------------------
  |  Branch (1071:7): [True: 0, False: 90.6k]
  |  Branch (1071:7): [True: 0, False: 90.6k]
  ------------------
 1072|       |      // something very broken if suggest ends up calling itself with the same word
 1073|  90.6k|      std::find(suggest_candidate_stack.begin(), suggest_candidate_stack.end(), word) != suggest_candidate_stack.end()) {
  ------------------
  |  Branch (1073:7): [True: 0, False: 90.6k]
  ------------------
 1074|      0|    return { };
 1075|      0|  }
 1076|       |
 1077|  90.6k|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  90.6k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1077:7): [True: 0, False: 90.6k]
  ------------------
 1078|      0|    return { };
 1079|       |
 1080|  90.6k|  bool capwords;
 1081|  90.6k|  size_t abbv;
 1082|  90.6k|  int captype;
 1083|  90.6k|  std::vector<std::string> spell_candidate_stack;
 1084|  90.6k|  suggest_candidate_stack.push_back(word);
 1085|  90.6k|  std::vector<std::string> slst = suggest_internal(word, spell_candidate_stack, suggest_candidate_stack,
 1086|  90.6k|                                                   capwords, abbv, captype, suggest_start);
 1087|  90.6k|  suggest_candidate_stack.pop_back();
 1088|       |  // word reversing wrapper for complex prefixes
 1089|  90.6k|  if (complexprefixes) {
  ------------------
  |  Branch (1089:7): [True: 4.64k, False: 85.9k]
  ------------------
 1090|  4.64k|    for (auto& j : slst) {
  ------------------
  |  Branch (1090:18): [True: 2.16k, False: 4.64k]
  ------------------
 1091|  2.16k|      if (utf8)
  ------------------
  |  Branch (1091:11): [True: 0, False: 2.16k]
  ------------------
 1092|      0|        reverseword_utf(j);
 1093|  2.16k|      else
 1094|  2.16k|        reverseword(j);
 1095|  2.16k|    }
 1096|  4.64k|  }
 1097|       |
 1098|       |  // capitalize
 1099|  90.6k|  if (capwords) {
  ------------------
  |  Branch (1099:7): [True: 24.7k, False: 65.8k]
  ------------------
 1100|  24.7k|    for (auto& j : slst) {
  ------------------
  |  Branch (1100:18): [True: 15.7k, False: 24.7k]
  ------------------
 1101|  15.7k|      std::string capitalized(j);
 1102|  15.7k|      mkinitcap(capitalized);
 1103|  15.7k|      if (capitalized == word)
  ------------------
  |  Branch (1103:11): [True: 6, False: 15.7k]
  ------------------
 1104|      6|        continue;  // capitalizing would just reproduce the misspelled word
 1105|  15.7k|      j = std::move(capitalized);
 1106|  15.7k|    }
 1107|  24.7k|  }
 1108|       |
 1109|       |  // expand suggestions with dot(s)
 1110|  90.6k|  if (abbv && pAMgr && pAMgr->get_sugswithdots() && word.size() >= abbv) {
  ------------------
  |  Branch (1110:7): [True: 3.96k, False: 86.6k]
  |  Branch (1110:15): [True: 3.96k, False: 0]
  |  Branch (1110:24): [True: 0, False: 3.96k]
  |  Branch (1110:53): [True: 0, False: 0]
  ------------------
 1111|      0|    for (auto& j : slst) {
  ------------------
  |  Branch (1111:18): [True: 0, False: 0]
  ------------------
 1112|      0|      j.append(word.substr(word.size() - abbv));
 1113|      0|    }
 1114|      0|  }
 1115|       |
 1116|       |  // remove bad capitalized and forbidden forms
 1117|  90.6k|  if (pAMgr && (pAMgr->get_keepcase() || pAMgr->get_forbiddenword())) {
  ------------------
  |  Branch (1117:7): [True: 90.6k, False: 0]
  |  Branch (1117:17): [True: 4.68k, False: 85.9k]
  |  Branch (1117:42): [True: 85.9k, False: 0]
  ------------------
 1118|  90.6k|    switch (captype) {
  ------------------
  |  Branch (1118:13): [True: 47.3k, False: 43.3k]
  ------------------
 1119|  11.4k|      case INITCAP:
  ------------------
  |  |   93|  11.4k|#define INITCAP 1
  ------------------
  |  Branch (1119:7): [True: 11.4k, False: 79.1k]
  ------------------
 1120|  20.6k|      case ALLCAP:
  ------------------
  |  |   94|  20.6k|#define ALLCAP 2
  ------------------
  |  Branch (1120:7): [True: 9.21k, False: 81.3k]
  ------------------
 1121|  34.0k|      case HUHCAP:
  ------------------
  |  |   95|  34.0k|#define HUHCAP 3
  ------------------
  |  Branch (1121:7): [True: 13.3k, False: 77.2k]
  ------------------
 1122|  47.3k|      case HUHINITCAP: {
  ------------------
  |  |   96|  47.3k|#define HUHINITCAP 4
  ------------------
  |  Branch (1122:7): [True: 13.2k, False: 77.3k]
  ------------------
 1123|  47.3k|        size_t l = 0;
 1124|  76.8k|        for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1124:28): [True: 29.5k, False: 47.3k]
  ------------------
 1125|       |          // A space-containing suggestion can be an "insert a space" split
 1126|       |          // whose parts each spell on their own, so it is good when every
 1127|       |          // part spells even though the whole string does not.
 1128|  29.5k|          bool bad = !spell(slst[j], spell_candidate_stack, nullptr, nullptr, suggest_start);
 1129|  29.5k|          if (bad && slst[j].find(' ') != std::string::npos) {
  ------------------
  |  Branch (1129:15): [True: 16.1k, False: 13.4k]
  |  Branch (1129:22): [True: 7.22k, False: 8.88k]
  ------------------
 1130|  7.22k|            bad = false;
 1131|  14.6k|            for (size_t start = 0; start <= slst[j].size(); ) {
  ------------------
  |  Branch (1131:36): [True: 14.6k, False: 0]
  ------------------
 1132|  14.6k|              size_t sp = slst[j].find(' ', start);
 1133|  14.6k|              size_t end = (sp == std::string::npos) ? slst[j].size() : sp;
  ------------------
  |  Branch (1133:28): [True: 1.62k, False: 13.0k]
  ------------------
 1134|  14.6k|              std::string part = slst[j].substr(start, end - start);
 1135|  14.6k|              if (!part.empty() &&
  ------------------
  |  Branch (1135:19): [True: 9.21k, False: 5.46k]
  ------------------
 1136|  9.21k|                  !spell(part, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1136:19): [True: 6.41k, False: 2.79k]
  ------------------
 1137|  6.41k|                bad = true;
 1138|  6.41k|                break;
 1139|  6.41k|              }
 1140|  8.26k|              if (sp == std::string::npos)
  ------------------
  |  Branch (1140:19): [True: 810, False: 7.45k]
  ------------------
 1141|    810|                break;
 1142|  7.45k|              start = sp + 1;
 1143|  7.45k|            }
 1144|  7.22k|          }
 1145|  29.5k|          if (bad) {
  ------------------
  |  Branch (1145:15): [True: 15.2k, False: 14.2k]
  ------------------
 1146|  15.2k|            std::string s;
 1147|  15.2k|            std::vector<w_char> w;
 1148|  15.2k|            if (utf8) {
  ------------------
  |  Branch (1148:17): [True: 6.17k, False: 9.12k]
  ------------------
 1149|  6.17k|              u8_u16(w, slst[j]);
 1150|  9.12k|            } else {
 1151|  9.12k|              s = slst[j];
 1152|  9.12k|            }
 1153|  15.2k|            mkallsmall2(s, w);
 1154|  15.2k|            if (spell(s, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1154:17): [True: 52, False: 15.2k]
  ------------------
 1155|     52|              slst[l] = std::move(s);
 1156|     52|              ++l;
 1157|  15.2k|            } else {
 1158|  15.2k|              mkinitcap2(s, w);
 1159|  15.2k|              if (spell(s, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1159:19): [True: 44, False: 15.2k]
  ------------------
 1160|     44|                slst[l] = std::move(s);
 1161|     44|                ++l;
 1162|     44|              }
 1163|  15.2k|            }
 1164|  15.2k|          } else {
 1165|  14.2k|            slst[l] = slst[j];
 1166|  14.2k|            ++l;
 1167|  14.2k|          }
 1168|  29.5k|        }
 1169|  47.3k|        slst.resize(l);
 1170|  47.3k|      }
 1171|  90.6k|    }
 1172|  90.6k|  }
 1173|       |
 1174|       |  // remove duplications
 1175|  90.6k|  size_t l = 0;
 1176|   107k|  for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1176:22): [True: 17.0k, False: 90.6k]
  ------------------
 1177|  17.0k|    slst[l] = slst[j];
 1178|  25.1k|    for (size_t k = 0; k < l; ++k) {
  ------------------
  |  Branch (1178:24): [True: 8.70k, False: 16.4k]
  ------------------
 1179|  8.70k|      if (slst[k] == slst[j]) {
  ------------------
  |  Branch (1179:11): [True: 623, False: 8.07k]
  ------------------
 1180|    623|        --l;
 1181|    623|        break;
 1182|    623|      }
 1183|  8.70k|    }
 1184|  17.0k|    ++l;
 1185|  17.0k|  }
 1186|  90.6k|  slst.resize(l);
 1187|       |
 1188|       |  // output conversion
 1189|  90.6k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1189:17): [True: 90.6k, False: 0]
  ------------------
 1190|  90.6k|  if (rl) {
  ------------------
  |  Branch (1190:7): [True: 4.90k, False: 85.6k]
  ------------------
 1191|  4.90k|    size_t l = 0;
 1192|  5.60k|    for (size_t i = 0; i < slst.size(); ++i) {
  ------------------
  |  Branch (1192:24): [True: 701, False: 4.90k]
  ------------------
 1193|    701|      std::string wspace;
 1194|    701|      if (rl->conv(slst[i], wspace)) {
  ------------------
  |  Branch (1194:11): [True: 224, False: 477]
  ------------------
 1195|    224|        slst[i] = std::move(wspace);
 1196|    224|      }
 1197|       |      // gh#1002: OCONV can map a generated form back to the input word
 1198|       |      // (e.g. "románórum" -> "romanórum" when the user typed "romanórum"),
 1199|       |      // leaving the misspelled word as its own suggestion.
 1200|    701|      if (slst[i] == word)
  ------------------
  |  Branch (1200:11): [True: 0, False: 701]
  ------------------
 1201|      0|        continue;
 1202|    701|      if (l != i)
  ------------------
  |  Branch (1202:11): [True: 0, False: 701]
  ------------------
 1203|      0|        slst[l] = std::move(slst[i]);
 1204|    701|      ++l;
 1205|    701|    }
 1206|  4.90k|    slst.resize(l);
 1207|  4.90k|  }
 1208|  90.6k|  return slst;
 1209|  90.6k|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1211|  62.5k|std::vector<std::string> HunspellImpl::suggest(const std::string& word) {
 1212|  62.5k|  std::vector<std::string> suggest_candidate_stack;
 1213|  62.5k|  auto suggest_start = std::chrono::steady_clock::now();
 1214|  62.5k|  return suggest(word, suggest_candidate_stack, suggest_start);
 1215|  62.5k|}
_ZN12HunspellImpl16suggest_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEESC_RbRmRiNS0_6chrono10time_pointINSG_12steady_clockENSG_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1221|  90.6k|        std::chrono::steady_clock::time_point suggest_start) {
 1222|       |  // The candidates tried here are the tool's own guesses, not the word the
 1223|       |  // user asked about.
 1224|  90.6k|  TraceSuppress no_trace(m_trace.get());
 1225|       |
 1226|  90.6k|  captype = NOCAP;
  ------------------
  |  |   92|  90.6k|#define NOCAP 0
  ------------------
 1227|  90.6k|  abbv = 0;
 1228|  90.6k|  capwords = false;
 1229|       |
 1230|  90.6k|  std::vector<std::string> slst;
 1231|       |
 1232|  90.6k|  int onlycmpdsug = 0;
 1233|  90.6k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1233:7): [True: 0, False: 90.6k]
  |  Branch (1233:17): [True: 0, False: 90.6k]
  ------------------
 1234|      0|    return slst;
 1235|       |
 1236|       |  // process XML input of the simplified API (see manual)
 1237|  90.6k|  if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  90.6k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  90.6k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  90.6k|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (1237:7): [True: 23.1k, False: 67.4k]
  ------------------
 1238|  23.1k|    if (word.size() > MAXSPELLMLLEN)
  ------------------
  |  |   88|  23.1k|#define MAXSPELLMLLEN 8192
  ------------------
  |  Branch (1238:9): [True: 589, False: 22.5k]
  ------------------
 1239|    589|      return slst;
 1240|  22.5k|    return spellml(word);
 1241|  23.1k|  }
 1242|  67.4k|  if (utf8) {
  ------------------
  |  Branch (1242:7): [True: 32.8k, False: 34.6k]
  ------------------
 1243|  32.8k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   87|  32.8k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  32.8k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1243:9): [True: 117, False: 32.7k]
  ------------------
 1244|    117|      return slst;
 1245|  34.6k|  } else {
 1246|  34.6k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  34.6k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1246:9): [True: 160, False: 34.4k]
  ------------------
 1247|    160|      return slst;
 1248|  34.6k|  }
 1249|  67.1k|  size_t wl = 0;
 1250|       |
 1251|  67.1k|  std::string scw;
 1252|  67.1k|  std::vector<w_char> sunicw;
 1253|       |
 1254|       |  // input conversion
 1255|  67.1k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1255:17): [True: 67.1k, False: 0]
  ------------------
 1256|  67.1k|  {
 1257|  67.1k|    std::string wspace;
 1258|       |
 1259|  67.1k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1259:23): [True: 3.67k, False: 63.5k]
  ------------------
 1260|  67.1k|    if (convstatus) {
  ------------------
  |  Branch (1260:9): [True: 0, False: 67.1k]
  ------------------
 1261|       |      // the input conversion can grow the word without limit, so hold the
 1262|       |      // converted word to the same maximum length as the raw word
 1263|      0|      if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   87|      0|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                    if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   90|      0|#define MAXWORDLEN 100
  ------------------
  |  Branch (1263:11): [True: 0, False: 0]
  |  Branch (1263:11): [True: 0, False: 0]
  ------------------
 1264|      0|        return slst;
 1265|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1266|      0|    } else
 1267|  67.1k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1268|       |
 1269|  67.1k|    if (wl == 0)
  ------------------
  |  Branch (1269:9): [True: 0, False: 67.1k]
  ------------------
 1270|      0|      return slst;
 1271|       |
 1272|  67.1k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1273|  67.1k|    if (wl > 32768)
  ------------------
  |  Branch (1273:9): [True: 0, False: 67.1k]
  ------------------
 1274|      0|      return slst;
 1275|  67.1k|#endif
 1276|  67.1k|  }
 1277|       |
 1278|  67.1k|  bool good = false;
 1279|       |
 1280|       |  // check capitalized form for FORCEUCASE
 1281|  67.1k|  if (pAMgr && captype == NOCAP && pAMgr->get_forceucase()) {
  ------------------
  |  |   92|   134k|#define NOCAP 0
  ------------------
  |  Branch (1281:7): [True: 67.1k, False: 0]
  |  Branch (1281:16): [True: 19.8k, False: 47.3k]
  |  Branch (1281:36): [True: 0, False: 19.8k]
  ------------------
 1282|      0|    int info = SPELL_ORIGCAP;
  ------------------
  |  |   86|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
 1283|      0|    if (checkword(scw, &info, nullptr, suggest_start)) {
  ------------------
  |  Branch (1283:9): [True: 0, False: 0]
  ------------------
 1284|      0|      std::string form(std::move(scw));
 1285|      0|      mkinitcap(form);
 1286|      0|      slst.push_back(std::move(form));
 1287|      0|      return slst;
 1288|      0|    }
 1289|      0|  }
 1290|       |
 1291|  67.1k|  switch (captype) {
  ------------------
  |  Branch (1291:11): [True: 67.1k, False: 0]
  ------------------
 1292|  19.8k|    case NOCAP: {
  ------------------
  |  |   92|  19.8k|#define NOCAP 0
  ------------------
  |  Branch (1292:5): [True: 19.8k, False: 47.3k]
  ------------------
 1293|  19.8k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1294|  19.8k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  19.8k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1294:11): [True: 0, False: 19.8k]
  ------------------
 1295|      0|          return slst;
 1296|  19.8k|      if (abbv) {
  ------------------
  |  Branch (1296:11): [True: 1.94k, False: 17.9k]
  ------------------
 1297|  1.94k|        std::string wspace(scw);
 1298|  1.94k|        wspace.push_back('.');
 1299|  1.94k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1300|  1.94k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  1.94k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1300:13): [True: 0, False: 1.94k]
  ------------------
 1301|      0|            return slst;
 1302|  1.94k|      }
 1303|  19.8k|      break;
 1304|  19.8k|    }
 1305|       |
 1306|  19.8k|    case INITCAP: {
  ------------------
  |  |   93|  11.4k|#define INITCAP 1
  ------------------
  |  Branch (1306:5): [True: 11.4k, False: 55.7k]
  ------------------
 1307|  11.4k|      capwords = true;
 1308|  11.4k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1309|  11.4k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  11.4k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1309:11): [True: 0, False: 11.4k]
  ------------------
 1310|      0|          return slst;
 1311|  11.4k|      std::string wspace(scw);
 1312|  11.4k|      mkallsmall2(wspace, sunicw);
 1313|  11.4k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1314|  11.4k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  11.4k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1314:11): [True: 0, False: 11.4k]
  ------------------
 1315|      0|          return slst;
 1316|  11.4k|      break;
 1317|  11.4k|    }
 1318|  13.2k|    case HUHINITCAP:
  ------------------
  |  |   96|  13.2k|#define HUHINITCAP 4
  ------------------
  |  Branch (1318:5): [True: 13.2k, False: 53.9k]
  ------------------
 1319|  13.2k|      capwords = true;
 1320|       |      /* FALLTHROUGH */
 1321|  26.6k|    case HUHCAP: {
  ------------------
  |  |   95|  26.6k|#define HUHCAP 3
  ------------------
  |  Branch (1321:5): [True: 13.3k, False: 53.8k]
  ------------------
 1322|  26.6k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1323|  26.6k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  26.6k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1323:11): [True: 0, False: 26.6k]
  ------------------
 1324|      0|          return slst;
 1325|       |      // something.The -> something. The
 1326|  26.6k|      size_t dot_pos = scw.find('.');
 1327|  26.6k|      if (dot_pos != std::string::npos) {
  ------------------
  |  Branch (1327:11): [True: 10.0k, False: 16.6k]
  ------------------
 1328|  10.0k|        std::string postdot = scw.substr(dot_pos + 1);
 1329|  10.0k|        int captype_;
 1330|  10.0k|        if (utf8) {
  ------------------
  |  Branch (1330:13): [True: 2.53k, False: 7.47k]
  ------------------
 1331|  2.53k|          std::vector<w_char> postdotu;
 1332|  2.53k|          u8_u16(postdotu, postdot);
 1333|  2.53k|          captype_ = get_captype_utf8(postdotu, langnum);
 1334|  7.47k|        } else {
 1335|  7.47k|          captype_ = get_captype(postdot, csconv);
 1336|  7.47k|        }
 1337|  10.0k|        if (captype_ == INITCAP) {
  ------------------
  |  |   93|  10.0k|#define INITCAP 1
  ------------------
  |  Branch (1337:13): [True: 4.89k, False: 5.12k]
  ------------------
 1338|  4.89k|          std::string str(scw);
 1339|  4.89k|          str.insert(dot_pos + 1, 1, ' ');
 1340|  4.89k|          insert_sug(slst, str);
 1341|  4.89k|        }
 1342|  10.0k|      }
 1343|       |
 1344|  26.6k|      std::string wspace;
 1345|       |
 1346|  26.6k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   96|  26.6k|#define HUHINITCAP 4
  ------------------
  |  Branch (1346:11): [True: 13.2k, False: 13.3k]
  ------------------
 1347|       |        // TheOpenOffice.org -> The OpenOffice.org
 1348|  13.2k|        wspace = scw;
 1349|  13.2k|        mkinitsmall2(wspace, sunicw);
 1350|  13.2k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1351|  13.2k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  13.2k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1351:13): [True: 0, False: 13.2k]
  ------------------
 1352|      0|            return slst;
 1353|  13.2k|      }
 1354|  26.6k|      wspace = scw;
 1355|  26.6k|      mkallsmall2(wspace, sunicw);
 1356|  26.6k|      if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1356:11): [True: 927, False: 25.6k]
  ------------------
 1357|    927|        insert_sug(slst, wspace);
 1358|  26.6k|      size_t prevns = slst.size();
 1359|  26.6k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1360|  26.6k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  26.6k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1360:11): [True: 3, False: 26.6k]
  ------------------
 1361|      3|          return slst;
 1362|  26.6k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   96|  26.6k|#define HUHINITCAP 4
  ------------------
  |  Branch (1362:11): [True: 13.2k, False: 13.3k]
  ------------------
 1363|  13.2k|        mkinitcap2(wspace, sunicw);
 1364|  13.2k|        if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1364:13): [True: 215, False: 13.0k]
  ------------------
 1365|    215|          insert_sug(slst, wspace);
 1366|  13.2k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1367|  13.2k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  13.2k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1367:13): [True: 11, False: 13.2k]
  ------------------
 1368|     11|            return slst;
 1369|  13.2k|      }
 1370|       |      // aNew -> "a New" (instead of "a new")
 1371|  26.9k|      for (size_t j = prevns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1371:31): [True: 368, False: 26.6k]
  ------------------
 1372|    368|        const char* space = strchr(slst[j].c_str(), ' ');
 1373|    368|        if (space) {
  ------------------
  |  Branch (1373:13): [True: 206, False: 162]
  ------------------
 1374|    206|          size_t slen = strlen(space + 1);
 1375|       |          // different case after space (need capitalisation)
 1376|    206|          if ((slen < wl) && strcmp(scw.c_str() + wl - slen, space + 1) != 0) {
  ------------------
  |  Branch (1376:15): [True: 206, False: 0]
  |  Branch (1376:30): [True: 206, False: 0]
  ------------------
 1377|    206|            std::string first(slst[j].c_str(), space + 1);
 1378|    206|            std::string second(space + 1);
 1379|    206|            std::vector<w_char> w;
 1380|    206|            if (utf8)
  ------------------
  |  Branch (1380:17): [True: 56, False: 150]
  ------------------
 1381|     56|              u8_u16(w, second);
 1382|    206|            mkinitcap2(second, w);
 1383|       |            // set as first suggestion
 1384|    206|            slst.erase(slst.begin() + j);
 1385|    206|            slst.insert(slst.begin(), first + second);
 1386|    206|          }
 1387|    206|        }
 1388|    368|      }
 1389|  26.6k|      break;
 1390|  26.6k|    }
 1391|       |
 1392|  9.21k|    case ALLCAP: {
  ------------------
  |  |   94|  9.21k|#define ALLCAP 2
  ------------------
  |  Branch (1392:5): [True: 9.21k, False: 57.9k]
  ------------------
 1393|  9.21k|      std::string wspace(scw);
 1394|  9.21k|      mkallsmall2(wspace, sunicw);
 1395|  9.21k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1396|  9.21k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  9.21k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1396:11): [True: 2, False: 9.20k]
  ------------------
 1397|      2|          return slst;
 1398|  9.20k|      if (pAMgr && pAMgr->get_keepcase() && spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1398:11): [True: 9.20k, False: 0]
  |  Branch (1398:20): [True: 386, False: 8.82k]
  |  Branch (1398:45): [True: 0, False: 386]
  ------------------
 1399|      0|        insert_sug(slst, wspace);
 1400|  9.20k|      mkinitcap2(wspace, sunicw);
 1401|  9.20k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1402|  9.20k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  9.20k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1402:11): [True: 0, False: 9.20k]
  ------------------
 1403|      0|          return slst;
 1404|  9.20k|      for (auto& j : slst) {
  ------------------
  |  Branch (1404:20): [True: 496, False: 9.20k]
  ------------------
 1405|    496|        mkallcap(j);
 1406|    496|        if (pAMgr && pAMgr->get_checksharps()) {
  ------------------
  |  Branch (1406:13): [True: 496, False: 0]
  |  Branch (1406:22): [True: 0, False: 496]
  ------------------
 1407|      0|          if (utf8) {
  ------------------
  |  Branch (1407:15): [True: 0, False: 0]
  ------------------
 1408|      0|            mystrrep(j, "\xC3\x9F", "SS");
 1409|      0|          } else {
 1410|      0|            mystrrep(j, "\xDF", "SS");
 1411|      0|          }
 1412|      0|        }
 1413|    496|      }
 1414|  9.20k|      break;
 1415|  9.20k|    }
 1416|  67.1k|  }
 1417|       |
 1418|       |  // LANG_hu section: replace '-' with ' ' in Hungarian
 1419|  67.1k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1419:7): [True: 3.72k, False: 63.4k]
  ------------------
 1420|  3.72k|    for (auto& j : slst) {
  ------------------
  |  Branch (1420:18): [True: 287, False: 3.72k]
  ------------------
 1421|    287|      size_t pos = j.find('-');
 1422|    287|      if (pos != std::string::npos) {
  ------------------
  |  Branch (1422:11): [True: 116, False: 171]
  ------------------
 1423|    116|        int info = 0;
 1424|    116|        std::string w(j.substr(0, pos));
 1425|    116|        w.append(j.substr(pos + 1));
 1426|    116|        (void)spell(w, spell_candidate_stack, &info, nullptr, suggest_start);
 1427|    116|        if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   81|    116|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
                      if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   82|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (1427:13): [True: 0, False: 116]
  |  Branch (1427:40): [True: 0, False: 0]
  ------------------
 1428|      0|          j[pos] = ' ';
 1429|      0|        } else
 1430|    116|          j[pos] = '-';
 1431|    116|      }
 1432|    287|    }
 1433|  3.72k|  }
 1434|       |  // END OF LANG_hu section
 1435|       |  // try ngram approach since found nothing good suggestion
 1436|  67.1k|  if (!good && pAMgr && (slst.empty() || onlycmpdsug) && (pAMgr->get_maxngramsugs() != 0)) {
  ------------------
  |  Branch (1436:7): [True: 67.1k, False: 55]
  |  Branch (1436:16): [True: 67.1k, False: 0]
  |  Branch (1436:26): [True: 58.8k, False: 8.29k]
  |  Branch (1436:42): [True: 8.09k, False: 202]
  |  Branch (1436:58): [True: 59.5k, False: 7.33k]
  ------------------
 1437|  59.5k|    switch (captype) {
  ------------------
  |  Branch (1437:13): [True: 59.5k, False: 0]
  ------------------
 1438|  17.0k|      case NOCAP: {
  ------------------
  |  |   92|  17.0k|#define NOCAP 0
  ------------------
  |  Branch (1438:7): [True: 17.0k, False: 42.5k]
  ------------------
 1439|  17.0k|        pSMgr->ngsuggest(slst, scw.c_str(), m_HMgrs, NOCAP);
  ------------------
  |  |   92|  17.0k|#define NOCAP 0
  ------------------
 1440|  17.0k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  17.0k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1440:13): [True: 0, False: 17.0k]
  ------------------
 1441|      0|            return slst;
 1442|  17.0k|        break;
 1443|  17.0k|      }
 1444|       |      /* FALLTHROUGH */
 1445|  17.0k|      case HUHINITCAP:
  ------------------
  |  |   96|  12.5k|#define HUHINITCAP 4
  ------------------
  |  Branch (1445:7): [True: 12.5k, False: 47.0k]
  ------------------
 1446|  12.5k|        capwords = true;
 1447|       |      /* FALLTHROUGH */
 1448|  24.8k|      case HUHCAP: {
  ------------------
  |  |   95|  24.8k|#define HUHCAP 3
  ------------------
  |  Branch (1448:7): [True: 12.3k, False: 47.2k]
  ------------------
 1449|  24.8k|        std::string wspace(scw);
 1450|  24.8k|        mkallsmall2(wspace, sunicw);
 1451|  24.8k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, HUHCAP);
  ------------------
  |  |   95|  24.8k|#define HUHCAP 3
  ------------------
 1452|  24.8k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  24.8k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1452:13): [True: 0, False: 24.8k]
  ------------------
 1453|      0|            return slst;
 1454|  24.8k|        break;
 1455|  24.8k|      }
 1456|  24.8k|      case INITCAP: {
  ------------------
  |  |   93|  9.71k|#define INITCAP 1
  ------------------
  |  Branch (1456:7): [True: 9.71k, False: 49.8k]
  ------------------
 1457|  9.71k|        capwords = true;
 1458|  9.71k|        std::string wspace(scw);
 1459|  9.71k|        mkallsmall2(wspace, sunicw);
 1460|  9.71k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, INITCAP);
  ------------------
  |  |   93|  9.71k|#define INITCAP 1
  ------------------
 1461|  9.71k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  9.71k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1461:13): [True: 0, False: 9.71k]
  ------------------
 1462|      0|            return slst;
 1463|  9.71k|        break;
 1464|  9.71k|      }
 1465|  9.71k|      case ALLCAP: {
  ------------------
  |  |   94|  8.00k|#define ALLCAP 2
  ------------------
  |  Branch (1465:7): [True: 8.00k, False: 51.5k]
  ------------------
 1466|  8.00k|        std::string wspace(scw);
 1467|  8.00k|        mkallsmall2(wspace, sunicw);
 1468|  8.00k|        size_t oldns = slst.size();
 1469|  8.00k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, ALLCAP);
  ------------------
  |  |   94|  8.00k|#define ALLCAP 2
  ------------------
 1470|  8.00k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  8.00k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1470:13): [True: 0, False: 8.00k]
  ------------------
 1471|      0|            return slst;
 1472|  10.0k|        for (size_t j = oldns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1472:32): [True: 1.99k, False: 8.00k]
  ------------------
 1473|  1.99k|          mkallcap(slst[j]);
 1474|  1.99k|        }
 1475|  8.00k|        break;
 1476|  8.00k|      }
 1477|  59.5k|    }
 1478|  59.5k|  }
 1479|       |
 1480|       |  // try dash suggestion (Afo-American -> Afro-American)
 1481|       |  // Note: LibreOffice was modified to treat dashes as word
 1482|       |  // characters to check "scot-free" etc. word forms, but
 1483|       |  // we need to handle suggestions for "Afo-American", etc.,
 1484|       |  // while "Afro-American" is missing from the dictionary.
 1485|       |  // TODO avoid possible overgeneration
 1486|  67.1k|  size_t dash_pos = scw.find('-');
 1487|  67.1k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1487:7): [True: 33.6k, False: 33.5k]
  ------------------
 1488|  33.6k|    int nodashsug = 1;
 1489|  42.3k|    for (size_t j = 0; j < slst.size() && nodashsug == 1; ++j) {
  ------------------
  |  Branch (1489:24): [True: 9.32k, False: 32.9k]
  |  Branch (1489:43): [True: 8.70k, False: 618]
  ------------------
 1490|  8.70k|      if (slst[j].find('-') != std::string::npos)
  ------------------
  |  Branch (1490:11): [True: 4.99k, False: 3.71k]
  ------------------
 1491|  4.99k|        nodashsug = 0;
 1492|  8.70k|    }
 1493|       |
 1494|  33.6k|    size_t prev_pos = 0;
 1495|  33.6k|    bool last = false;
 1496|       |
 1497|   100k|    while (!good && nodashsug && !last) {
  ------------------
  |  Branch (1497:12): [True: 100k, False: 34]
  |  Branch (1497:21): [True: 67.8k, False: 32.9k]
  |  Branch (1497:34): [True: 67.2k, False: 574]
  ------------------
 1498|  67.2k|      if (dash_pos == scw.size())
  ------------------
  |  Branch (1498:11): [True: 5.32k, False: 61.9k]
  ------------------
 1499|  5.32k|        last = true;
 1500|  67.2k|      std::string chunk = scw.substr(prev_pos, dash_pos - prev_pos);
 1501|  67.2k|      if (chunk != word && !spell(chunk, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1501:11): [True: 67.2k, False: 0]
  |  Branch (1501:28): [True: 28.0k, False: 39.2k]
  ------------------
 1502|  28.0k|        std::vector<std::string> nlst = suggest(chunk, suggest_candidate_stack, suggest_start);
 1503|  28.0k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  28.0k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1503:13): [True: 6, False: 28.0k]
  ------------------
 1504|      6|            return slst;
 1505|  37.4k|        for (auto j = nlst.rbegin(); j != nlst.rend(); ++j) {
  ------------------
  |  Branch (1505:38): [True: 9.43k, False: 28.0k]
  ------------------
 1506|  9.43k|          std::string wspace = scw.substr(0, prev_pos);
 1507|  9.43k|          wspace.append(*j);
 1508|  9.43k|          if (!last) {
  ------------------
  |  Branch (1508:15): [True: 7.81k, False: 1.62k]
  ------------------
 1509|  7.81k|            wspace.append("-");
 1510|  7.81k|            wspace.append(scw.substr(dash_pos + 1));
 1511|  7.81k|          }
 1512|  9.43k|          int info = 0;
 1513|  9.43k|          if (pAMgr && pAMgr->get_forbiddenword())
  ------------------
  |  Branch (1513:15): [True: 9.43k, False: 0]
  |  Branch (1513:24): [True: 9.43k, False: 0]
  ------------------
 1514|  9.43k|            checkword(wspace, &info, nullptr, suggest_start);
 1515|  9.43k|          if (!(info & SPELL_FORBIDDEN))
  ------------------
  |  |   82|  9.43k|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (1515:15): [True: 9.43k, False: 0]
  ------------------
 1516|  9.43k|            insert_sug(slst, wspace);
 1517|  9.43k|        }
 1518|  28.0k|        nodashsug = 0;
 1519|  28.0k|      }
 1520|  67.2k|      if (!last) {
  ------------------
  |  Branch (1520:11): [True: 61.9k, False: 5.32k]
  ------------------
 1521|  61.9k|        prev_pos = dash_pos + 1;
 1522|  61.9k|        dash_pos = scw.find('-', prev_pos);
 1523|  61.9k|      }
 1524|  67.2k|      if (dash_pos == std::string::npos)
  ------------------
  |  Branch (1524:11): [True: 11.6k, False: 55.5k]
  ------------------
 1525|  11.6k|        dash_pos = scw.size();
 1526|  67.2k|    }
 1527|  33.6k|  }
 1528|  67.1k|  return slst;
 1529|  67.1k|}
_ZN12HunspellImpl4stemERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
 1535|    873|std::vector<std::string> HunspellImpl::stem(const std::vector<std::string>& desc) {
 1536|    873|  std::vector<std::string> slst;
 1537|       |
 1538|    873|  std::string result2;
 1539|    873|  if (desc.empty())
  ------------------
  |  Branch (1539:7): [True: 813, False: 60]
  ------------------
 1540|    813|    return slst;
 1541|     60|  for (const auto& i : desc) {
  ------------------
  |  Branch (1541:22): [True: 60, False: 60]
  ------------------
 1542|     60|    if (result2.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|     60|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1542:9): [True: 0, False: 60]
  ------------------
 1543|      0|      break;
 1544|       |
 1545|     60|    std::string result;
 1546|       |
 1547|       |    // add compound word parts (except the last one)
 1548|     60|    std::string tok(i, append_compound_parts(i, result));
 1549|     60|    size_t alt = 0;
 1550|     60|    while ((alt = tok.find(" | ", alt)) != std::string::npos) {
  ------------------
  |  Branch (1550:12): [True: 0, False: 60]
  ------------------
 1551|      0|      tok[alt + 1] = MSEP_ALT;
  ------------------
  |  |  123|      0|#define MSEP_ALT '\v'
  ------------------
 1552|      0|    }
 1553|     60|    std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  123|     60|#define MSEP_ALT '\v'
  ------------------
 1554|     60|    for (auto& k : pl) {
  ------------------
  |  Branch (1554:18): [True: 60, False: 60]
  ------------------
 1555|     60|      if (result2.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|     60|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1555:11): [True: 0, False: 60]
  ------------------
 1556|      0|        break;
 1557|       |
 1558|       |      // add derivational suffixes
 1559|     60|      if (k.find(MORPH_DERI_SFX) != std::string::npos) {
  ------------------
  |  |  109|     60|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (1559:11): [True: 0, False: 60]
  ------------------
 1560|       |        // remove inflectional suffixes
 1561|      0|        const size_t is = k.find(MORPH_INFL_SFX);
  ------------------
  |  |  110|      0|#define MORPH_INFL_SFX "is:"
  ------------------
 1562|      0|        if (is != std::string::npos)
  ------------------
  |  Branch (1562:13): [True: 0, False: 0]
  ------------------
 1563|      0|          k.resize(is);
 1564|      0|        std::vector<std::string> singlepl;
 1565|      0|        singlepl.push_back(k);
 1566|      0|        std::string sg = pSMgr->suggest_gen(singlepl, k);
 1567|      0|        if (!sg.empty()) {
  ------------------
  |  Branch (1567:13): [True: 0, False: 0]
  ------------------
 1568|      0|          std::vector<std::string> gen = line_tok(sg, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1569|      0|          for (auto& j : gen) {
  ------------------
  |  Branch (1569:24): [True: 0, False: 0]
  ------------------
 1570|      0|            result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1571|      0|            result2.append(result);
 1572|      0|            result2.append(j);
 1573|      0|          }
 1574|      0|        }
 1575|     60|      } else {
 1576|     60|        result2.push_back(MSEP_REC);
  ------------------
  |  |  122|     60|#define MSEP_REC '\n'
  ------------------
 1577|     60|        result2.append(result);
 1578|     60|        if (k.find(MORPH_SURF_PFX) != std::string::npos) {
  ------------------
  |  |  112|     60|#define MORPH_SURF_PFX "sp:"
  ------------------
  |  Branch (1578:13): [True: 0, False: 60]
  ------------------
 1579|      0|          std::string field;
 1580|      0|          copy_field(field, k, MORPH_SURF_PFX);
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
 1581|      0|          result2.append(field);
 1582|      0|        }
 1583|     60|        std::string field;
 1584|     60|        copy_field(field, k, MORPH_STEM);
  ------------------
  |  |  103|     60|#define MORPH_STEM "st:"
  ------------------
 1585|     60|        result2.append(field);
 1586|     60|      }
 1587|     60|    }
 1588|     60|  }
 1589|     60|  slst = line_tok(result2, MSEP_REC);
  ------------------
  |  |  122|     60|#define MSEP_REC '\n'
  ------------------
 1590|     60|  uniqlist(slst);
 1591|     60|  return slst;
 1592|    873|}
_ZN12HunspellImpl4stemERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1594|    873|std::vector<std::string> HunspellImpl::stem(const std::string& word) {
 1595|    873|  return stem(analyze(word));
 1596|    873|}
_ZN12HunspellImpl9mkinitcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1606|  15.7k|void HunspellImpl::mkinitcap(std::string& u8) {
 1607|  15.7k|  if (utf8) {
  ------------------
  |  Branch (1607:7): [True: 4.67k, False: 11.1k]
  ------------------
 1608|  4.67k|    std::vector<w_char> u16;
 1609|  4.67k|    u8_u16(u16, u8);
 1610|  4.67k|    ::mkinitcap_utf(u16, langnum);
 1611|  4.67k|    u16_u8(u8, u16);
 1612|  11.1k|  } else {
 1613|  11.1k|    ::mkinitcap(u8, csconv);
 1614|  11.1k|  }
 1615|  15.7k|}
_ZN12HunspellImpl10mkinitcap2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1617|  1.87M|int HunspellImpl::mkinitcap2(std::string& u8, std::vector<w_char>& u16) {
 1618|  1.87M|  if (utf8) {
  ------------------
  |  Branch (1618:7): [True: 342k, False: 1.53M]
  ------------------
 1619|   342k|    ::mkinitcap_utf(u16, langnum);
 1620|   342k|    u16_u8(u8, u16);
 1621|  1.53M|  } else {
 1622|  1.53M|    ::mkinitcap(u8, csconv);
 1623|  1.53M|  }
 1624|  1.87M|  return u8.size();
 1625|  1.87M|}
_ZN12HunspellImpl12mkinitsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1627|   326k|int HunspellImpl::mkinitsmall2(std::string& u8, std::vector<w_char>& u16) {
 1628|   326k|  if (utf8) {
  ------------------
  |  Branch (1628:7): [True: 33.8k, False: 292k]
  ------------------
 1629|  33.8k|    ::mkinitsmall_utf(u16, langnum);
 1630|  33.8k|    u16_u8(u8, u16);
 1631|   292k|  } else {
 1632|   292k|    ::mkinitsmall(u8, csconv);
 1633|   292k|  }
 1634|   326k|  return u8.size();
 1635|   326k|}
_ZN12HunspellImpl3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1637|  5.71k|int HunspellImpl::add(const std::string& word) {
 1638|  5.71k|  if (!m_HMgrs.empty())
  ------------------
  |  Branch (1638:7): [True: 5.71k, False: 0]
  ------------------
 1639|  5.71k|    return m_HMgrs[0]->add(word);
 1640|      0|  return 0;
 1641|  5.71k|}
_ZN12HunspellImpl14add_with_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 1649|  2.12k|int HunspellImpl::add_with_affix(const std::string& word, const std::string& example) {
 1650|  2.12k|  if (!m_HMgrs.empty())
  ------------------
  |  Branch (1650:7): [True: 2.12k, False: 0]
  ------------------
 1651|  2.12k|    return m_HMgrs[0]->add_with_affix(word, example);
 1652|      0|  return 0;
 1653|  2.12k|}
_ZN12HunspellImpl10cat_resultERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
 1672|   522k|void HunspellImpl::cat_result(std::string& result, const std::string& st) {
 1673|   522k|  if (result.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|   522k|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1673:7): [True: 0, False: 522k]
  ------------------
 1674|      0|    return;
 1675|   522k|  if (!st.empty()) {
  ------------------
  |  Branch (1675:7): [True: 1.95k, False: 520k]
  ------------------
 1676|  1.95k|    if (!result.empty())
  ------------------
  |  Branch (1676:9): [True: 0, False: 1.95k]
  ------------------
 1677|      0|      result.append("\n");
 1678|  1.95k|    result.append(st);
 1679|  1.95k|  }
 1680|   522k|}
_ZN12HunspellImpl7analyzeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1682|  8.57k|std::vector<std::string> HunspellImpl::analyze(const std::string& word) {
 1683|  8.57k|  std::vector<std::string> slst = analyze_internal(word);
 1684|       |  // output conversion
 1685|  8.57k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1685:17): [True: 8.57k, False: 0]
  ------------------
 1686|  8.57k|  if (rl) {
  ------------------
  |  Branch (1686:7): [True: 447, False: 8.12k]
  ------------------
 1687|       |    // the output conversion can multiply the length of every line, so hold the
 1688|       |    // converted analysis to the same ceiling as the raw analysis
 1689|    447|    size_t total = 0;
 1690|    447|    size_t i = 0;
 1691|    514|    for (; i < slst.size(); ++i) {
  ------------------
  |  Branch (1691:12): [True: 67, False: 447]
  ------------------
 1692|     67|      std::string wspace;
 1693|     67|      if (rl->conv(slst[i], wspace)) {
  ------------------
  |  Branch (1693:11): [True: 3, False: 64]
  ------------------
 1694|      3|        slst[i] = std::move(wspace);
 1695|      3|      }
 1696|     67|      total += slst[i].size();
 1697|     67|      if (total > MAXMORPHRESULT) {
  ------------------
  |  |  114|     67|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1697:11): [True: 0, False: 67]
  ------------------
 1698|      0|        ++i;
 1699|      0|        break;
 1700|      0|      }
 1701|     67|    }
 1702|    447|    slst.resize(i);
 1703|    447|  }
 1704|  8.57k|  return slst;
 1705|  8.57k|}
_ZN12HunspellImpl16analyze_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1707|  8.57k|std::vector<std::string> HunspellImpl::analyze_internal(const std::string& word) {
 1708|  8.57k|  std::vector<std::string> candidate_stack, slst;
 1709|  8.57k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1709:7): [True: 0, False: 8.57k]
  |  Branch (1709:17): [True: 0, False: 8.57k]
  ------------------
 1710|      0|    return slst;
 1711|  8.57k|  if (utf8) {
  ------------------
  |  Branch (1711:7): [True: 4.03k, False: 4.53k]
  ------------------
 1712|  4.03k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   87|  4.03k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  4.03k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1712:9): [True: 351, False: 3.68k]
  ------------------
 1713|    351|      return slst;
 1714|  4.53k|  } else {
 1715|  4.53k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  4.53k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1715:9): [True: 610, False: 3.92k]
  ------------------
 1716|    610|      return slst;
 1717|  4.53k|  }
 1718|  7.61k|  int captype = NOCAP;
  ------------------
  |  |   92|  7.61k|#define NOCAP 0
  ------------------
 1719|  7.61k|  size_t abbv = 0;
 1720|  7.61k|  size_t wl = 0;
 1721|       |
 1722|  7.61k|  std::string scw;
 1723|  7.61k|  std::vector<w_char> sunicw;
 1724|       |
 1725|       |  // input conversion
 1726|  7.61k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1726:17): [True: 7.61k, False: 0]
  ------------------
 1727|  7.61k|  {
 1728|  7.61k|    std::string wspace;
 1729|       |
 1730|  7.61k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1730:23): [True: 408, False: 7.20k]
  ------------------
 1731|  7.61k|    if (convstatus) {
  ------------------
  |  Branch (1731:9): [True: 0, False: 7.61k]
  ------------------
 1732|       |      // the input conversion can grow the word without limit, so hold the
 1733|       |      // converted word to the same maximum length as the raw word
 1734|      0|      if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   87|      0|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|      0|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                    if (utf8 ? wspace.size() >= MAXWORDUTF8LEN : wspace.size() >= MAXWORDLEN)
  ------------------
  |  |   90|      0|#define MAXWORDLEN 100
  ------------------
  |  Branch (1734:11): [True: 0, False: 0]
  |  Branch (1734:11): [True: 0, False: 0]
  ------------------
 1735|      0|        return slst;
 1736|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1737|      0|    } else
 1738|  7.61k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1739|       |
 1740|  7.61k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1741|  7.61k|    if (wl > 32768)
  ------------------
  |  Branch (1741:9): [True: 0, False: 7.61k]
  ------------------
 1742|      0|      return slst;
 1743|  7.61k|#endif
 1744|  7.61k|  }
 1745|       |
 1746|  7.61k|  if (wl == 0) {
  ------------------
  |  Branch (1746:7): [True: 457, False: 7.15k]
  ------------------
 1747|    457|    if (abbv) {
  ------------------
  |  Branch (1747:9): [True: 266, False: 191]
  ------------------
 1748|    266|      scw.clear();
 1749|  7.58k|      for (wl = 0; wl < abbv; wl++)
  ------------------
  |  Branch (1749:20): [True: 7.31k, False: 266]
  ------------------
 1750|  7.31k|        scw.push_back('.');
 1751|    266|      abbv = 0;
 1752|    266|    } else
 1753|    191|      return slst;
 1754|    457|  }
 1755|       |
 1756|  7.42k|  std::string result;
 1757|       |
 1758|  7.42k|  auto suggest_start = std::chrono::steady_clock::now();
 1759|       |
 1760|  7.42k|  size_t n = 0;
 1761|       |  // test numbers
 1762|       |  // LANG_hu section: set dash information for suggestions
 1763|  7.42k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1763:7): [True: 398, False: 7.02k]
  ------------------
 1764|    398|    size_t n2 = 0;
 1765|    398|    size_t n3 = 0;
 1766|       |
 1767|    468|    while ((n < wl) && (((scw[n] <= '9') && (scw[n] >= '0')) ||
  ------------------
  |  Branch (1767:12): [True: 448, False: 20]
  |  Branch (1767:26): [True: 209, False: 239]
  |  Branch (1767:45): [True: 70, False: 139]
  ------------------
 1768|    378|                        (((scw[n] == '.') || (scw[n] == ',')) && (n > 0)))) {
  ------------------
  |  Branch (1768:27): [True: 22, False: 356]
  |  Branch (1768:46): [True: 0, False: 356]
  |  Branch (1768:66): [True: 0, False: 22]
  ------------------
 1769|     70|      n++;
 1770|     70|      if ((scw[n] == '.') || (scw[n] == ',')) {
  ------------------
  |  Branch (1770:11): [True: 0, False: 70]
  |  Branch (1770:30): [True: 0, False: 70]
  ------------------
 1771|      0|        if (((n2 == 0) && (n > 3)) ||
  ------------------
  |  Branch (1771:14): [True: 0, False: 0]
  |  Branch (1771:27): [True: 0, False: 0]
  ------------------
 1772|      0|            ((n2 > 0) && ((scw[n - 1] == '.') || (scw[n - 1] == ','))))
  ------------------
  |  Branch (1772:14): [True: 0, False: 0]
  |  Branch (1772:27): [True: 0, False: 0]
  |  Branch (1772:50): [True: 0, False: 0]
  ------------------
 1773|      0|          break;
 1774|      0|        n2++;
 1775|      0|        n3 = n;
 1776|      0|      }
 1777|     70|    }
 1778|       |
 1779|    398|    if ((n == wl) && (n3 > 0) && (n - n3 > 3))
  ------------------
  |  Branch (1779:9): [True: 20, False: 378]
  |  Branch (1779:22): [True: 0, False: 20]
  |  Branch (1779:34): [True: 0, False: 0]
  ------------------
 1780|      0|      return slst;
 1781|    398|    if ((n == wl) || ((n > 0) && ((scw[n] == '%') || (scw[n] == '\xB0')) && checkword(scw.substr(n), nullptr, nullptr, suggest_start))) {
  ------------------
  |  Branch (1781:9): [True: 20, False: 378]
  |  Branch (1781:9): [True: 20, False: 378]
  |  Branch (1781:23): [True: 4, False: 374]
  |  Branch (1781:35): [True: 0, False: 4]
  |  Branch (1781:54): [True: 0, False: 4]
  |  Branch (1781:77): [True: 0, False: 0]
  ------------------
 1782|     20|      result.append(scw);
 1783|     20|      result.resize(n - 1);
 1784|     20|      if (n == wl)
  ------------------
  |  Branch (1784:11): [True: 20, False: 0]
  ------------------
 1785|     20|        cat_result(result, pSMgr->suggest_morph(scw.substr(n - 1)));
 1786|      0|      else {
 1787|      0|        std::string chunk = scw.substr(n - 1, 1);
 1788|      0|        cat_result(result, pSMgr->suggest_morph(chunk));
 1789|      0|        result.push_back('+');  // XXX SPEC. MORPHCODE
 1790|      0|        cat_result(result, pSMgr->suggest_morph(scw.substr(n)));
 1791|      0|      }
 1792|     20|      return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|     20|#define MSEP_REC '\n'
  ------------------
 1793|     20|    }
 1794|    398|  }
 1795|       |  // END OF LANG_hu section
 1796|       |
 1797|  7.40k|  switch (captype) {
  ------------------
  |  Branch (1797:11): [True: 7.40k, False: 0]
  ------------------
 1798|    551|    case HUHCAP:
  ------------------
  |  |   95|    551|#define HUHCAP 3
  ------------------
  |  Branch (1798:5): [True: 551, False: 6.85k]
  ------------------
 1799|    939|    case HUHINITCAP:
  ------------------
  |  |   96|    939|#define HUHINITCAP 4
  ------------------
  |  Branch (1799:5): [True: 388, False: 7.01k]
  ------------------
 1800|  3.81k|    case NOCAP: {
  ------------------
  |  |   92|  3.81k|#define NOCAP 0
  ------------------
  |  Branch (1800:5): [True: 2.87k, False: 4.52k]
  ------------------
 1801|  3.81k|      cat_result(result, pSMgr->suggest_morph(scw));
 1802|  3.81k|      if (abbv) {
  ------------------
  |  Branch (1802:11): [True: 214, False: 3.59k]
  ------------------
 1803|    214|        std::string u8buffer(scw);
 1804|    214|        u8buffer.push_back('.');
 1805|    214|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1806|    214|      }
 1807|  3.81k|      break;
 1808|    939|    }
 1809|  2.79k|    case INITCAP: {
  ------------------
  |  |   93|  2.79k|#define INITCAP 1
  ------------------
  |  Branch (1809:5): [True: 2.79k, False: 4.61k]
  ------------------
 1810|  2.79k|      mkallsmall2(scw, sunicw);
 1811|  2.79k|      std::string u8buffer(scw);
 1812|  2.79k|      mkinitcap2(scw, sunicw);
 1813|  2.79k|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1814|  2.79k|      cat_result(result, pSMgr->suggest_morph(scw));
 1815|  2.79k|      if (abbv) {
  ------------------
  |  Branch (1815:11): [True: 290, False: 2.50k]
  ------------------
 1816|    290|        u8buffer.push_back('.');
 1817|    290|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1818|       |
 1819|    290|        u8buffer = scw;
 1820|    290|        u8buffer.push_back('.');
 1821|       |
 1822|    290|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1823|    290|      }
 1824|  2.79k|      break;
 1825|    939|    }
 1826|    800|    case ALLCAP: {
  ------------------
  |  |   94|    800|#define ALLCAP 2
  ------------------
  |  Branch (1826:5): [True: 800, False: 6.60k]
  ------------------
 1827|    800|      cat_result(result, pSMgr->suggest_morph(scw));
 1828|    800|      if (abbv) {
  ------------------
  |  Branch (1828:11): [True: 167, False: 633]
  ------------------
 1829|    167|        std::string u8buffer(scw);
 1830|    167|        u8buffer.push_back('.');
 1831|    167|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1832|    167|      }
 1833|    800|      mkallsmall2(scw, sunicw);
 1834|    800|      std::string u8buffer(scw);
 1835|    800|      mkinitcap2(scw, sunicw);
 1836|       |
 1837|    800|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1838|    800|      cat_result(result, pSMgr->suggest_morph(scw));
 1839|    800|      if (abbv) {
  ------------------
  |  Branch (1839:11): [True: 167, False: 633]
  ------------------
 1840|    167|        u8buffer.push_back('.');
 1841|    167|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1842|       |
 1843|    167|        u8buffer = scw;
 1844|    167|        u8buffer.push_back('.');
 1845|       |
 1846|    167|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1847|    167|      }
 1848|    800|      break;
 1849|    939|    }
 1850|  7.40k|  }
 1851|       |
 1852|  7.40k|  if (!result.empty()) {
  ------------------
  |  Branch (1852:7): [True: 1.93k, False: 5.46k]
  ------------------
 1853|       |    // word reversing wrapper for complex prefixes
 1854|  1.93k|    if (complexprefixes) {
  ------------------
  |  Branch (1854:9): [True: 124, False: 1.81k]
  ------------------
 1855|    124|      if (utf8)
  ------------------
  |  Branch (1855:11): [True: 0, False: 124]
  ------------------
 1856|      0|        reverseword_utf(result);
 1857|    124|      else
 1858|    124|        reverseword(result);
 1859|    124|    }
 1860|  1.93k|    return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|  1.93k|#define MSEP_REC '\n'
  ------------------
 1861|  1.93k|  }
 1862|       |
 1863|       |  // compound word with dash (HU) I18n
 1864|       |  // LANG_hu section: set dash information for suggestions
 1865|       |
 1866|  5.46k|  size_t dash_pos = langnum == LANG_hu ? scw.find('-') : std::string::npos;
  ------------------
  |  Branch (1866:21): [True: 326, False: 5.13k]
  ------------------
 1867|  5.46k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1867:7): [True: 25, False: 5.43k]
  ------------------
 1868|     25|    int nresult = 0;
 1869|       |
 1870|     25|    std::string part1 = scw.substr(0, dash_pos), part2 = scw.substr(dash_pos + 1);
 1871|       |
 1872|       |    // examine 2 sides of the dash
 1873|     25|    if (part2.empty()) {  // base word ending with dash
  ------------------
  |  Branch (1873:9): [True: 4, False: 21]
  ------------------
 1874|      4|      if (spell(part1, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1874:11): [True: 0, False: 4]
  ------------------
 1875|      0|        std::string p = pSMgr->suggest_morph(part1);
 1876|      0|        if (!p.empty()) {
  ------------------
  |  Branch (1876:13): [True: 0, False: 0]
  ------------------
 1877|      0|          slst = line_tok(p, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1878|      0|          return slst;
 1879|      0|        }
 1880|      0|      }
 1881|     21|    } else if (part2.size() == 1 && part2[0] == 'e') {  // XXX (HU) -e hat.
  ------------------
  |  Branch (1881:16): [True: 0, False: 21]
  |  Branch (1881:37): [True: 0, False: 0]
  ------------------
 1882|      0|      if (spell(part1, candidate_stack, nullptr, nullptr, suggest_start) &&
  ------------------
  |  Branch (1882:11): [True: 0, False: 0]
  |  Branch (1882:11): [True: 0, False: 0]
  ------------------
 1883|      0|          (spell("-e", candidate_stack, nullptr, nullptr, suggest_start))) {
  ------------------
  |  Branch (1883:11): [True: 0, False: 0]
  ------------------
 1884|      0|        std::string st = pSMgr->suggest_morph(part1);
 1885|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1885:13): [True: 0, False: 0]
  ------------------
 1886|      0|          result.append(st);
 1887|      0|        }
 1888|      0|        result.push_back('+');  // XXX spec. separator in MORPHCODE
 1889|      0|        st = pSMgr->suggest_morph("-e");
 1890|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1890:13): [True: 0, False: 0]
  ------------------
 1891|      0|          result.append(st);
 1892|      0|        }
 1893|      0|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1894|      0|      }
 1895|     21|    } else {
 1896|       |      // first word ending with dash: word- XXX ???
 1897|     21|      part1.push_back(' ');
 1898|     21|      nresult = spell(part1, candidate_stack, nullptr, nullptr, suggest_start);
 1899|     21|      part1.erase(part1.size() - 1);
 1900|     21|      if (nresult && spell(part2, candidate_stack, nullptr, nullptr, suggest_start) &&
  ------------------
  |  Branch (1900:11): [True: 2, False: 19]
  |  Branch (1900:22): [True: 0, False: 2]
  ------------------
 1901|      0|          ((part2.size() > 1) || ((part2[0] > '0') && (part2[0] < '9')))) {
  ------------------
  |  Branch (1901:12): [True: 0, False: 0]
  |  Branch (1901:35): [True: 0, False: 0]
  |  Branch (1901:55): [True: 0, False: 0]
  ------------------
 1902|      0|        std::string st = pSMgr->suggest_morph(part1);
 1903|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1903:13): [True: 0, False: 0]
  ------------------
 1904|      0|          result.append(st);
 1905|      0|          result.push_back('+');  // XXX spec. separator in MORPHCODE
 1906|      0|        }
 1907|      0|        st = pSMgr->suggest_morph(part2);
 1908|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1908:13): [True: 0, False: 0]
  ------------------
 1909|      0|          result.append(st);
 1910|      0|        }
 1911|      0|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1912|      0|      }
 1913|     21|    }
 1914|       |    // affixed number in correct word
 1915|     25|    if (nresult && (dash_pos > 0) &&
  ------------------
  |  Branch (1915:9): [True: 2, False: 23]
  |  Branch (1915:20): [True: 0, False: 2]
  ------------------
 1916|      0|        (((scw[dash_pos - 1] <= '9') && (scw[dash_pos - 1] >= '0')) ||
  ------------------
  |  Branch (1916:11): [True: 0, False: 0]
  |  Branch (1916:41): [True: 0, False: 0]
  ------------------
 1917|      0|         (scw[dash_pos - 1] == '.'))) {
  ------------------
  |  Branch (1917:10): [True: 0, False: 0]
  ------------------
 1918|      0|      n = 1;
 1919|      0|      if (scw[dash_pos - n] == '.')
  ------------------
  |  Branch (1919:11): [True: 0, False: 0]
  ------------------
 1920|      0|        n++;
 1921|       |      // search first not a number character to left from dash
 1922|      0|      while ((dash_pos >= n) && ((scw[dash_pos - n] == '0') || (n < 3)) &&
  ------------------
  |  Branch (1922:14): [True: 0, False: 0]
  |  Branch (1922:34): [True: 0, False: 0]
  |  Branch (1922:64): [True: 0, False: 0]
  ------------------
 1923|      0|             (n < 6)) {
  ------------------
  |  Branch (1923:14): [True: 0, False: 0]
  ------------------
 1924|      0|        n++;
 1925|      0|      }
 1926|      0|      if (dash_pos < n)
  ------------------
  |  Branch (1926:11): [True: 0, False: 0]
  ------------------
 1927|      0|        n--;
 1928|       |      // numbers: valami1000000-hoz
 1929|       |      // examine 100000-hoz, 10000-hoz 1000-hoz, 10-hoz,
 1930|       |      // 56-hoz, 6-hoz
 1931|      0|      for (; n >= 1; n--) {
  ------------------
  |  Branch (1931:14): [True: 0, False: 0]
  ------------------
 1932|      0|        if (scw[dash_pos - n] < '0' || scw[dash_pos - n] > '9') {
  ------------------
  |  Branch (1932:13): [True: 0, False: 0]
  |  Branch (1932:40): [True: 0, False: 0]
  ------------------
 1933|      0|            continue;
 1934|      0|        }
 1935|      0|        std::string chunk = scw.substr(dash_pos - n);
 1936|      0|        if (checkword(chunk, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1936:13): [True: 0, False: 0]
  ------------------
 1937|      0|          result.append(chunk);
 1938|      0|          std::string st = pSMgr->suggest_morph(chunk);
 1939|      0|          if (!st.empty()) {
  ------------------
  |  Branch (1939:15): [True: 0, False: 0]
  ------------------
 1940|      0|            result.append(st);
 1941|      0|          }
 1942|      0|          return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1943|      0|        }
 1944|      0|      }
 1945|      0|    }
 1946|     25|  }
 1947|  5.46k|  return slst;
 1948|  5.46k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS0_6vectorIS6_NS4_IS6_EEEE:
 1950|  7.39k|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::vector<std::string>& pl) {
 1951|  7.39k|  std::vector<std::string> slst;
 1952|  7.39k|  if (!pSMgr || pl.empty())
  ------------------
  |  Branch (1952:7): [True: 0, False: 7.39k]
  |  Branch (1952:17): [True: 431, False: 6.96k]
  ------------------
 1953|    431|    return slst;
 1954|  6.96k|  std::vector<std::string> pl2 = analyze(word);
 1955|  6.96k|  int captype = NOCAP, abbv = 0;
  ------------------
  |  |   92|  6.96k|#define NOCAP 0
  ------------------
 1956|  6.96k|  std::string cw;
 1957|  6.96k|  cleanword(cw, word, &captype, &abbv);
 1958|  6.96k|  std::string result;
 1959|       |
 1960|  6.96k|  auto suggest_start = std::chrono::steady_clock::now();
 1961|   509k|  for (const auto& i : pl) {
  ------------------
  |  Branch (1961:22): [True: 509k, False: 6.96k]
  ------------------
 1962|   509k|    cat_result(result, pSMgr->suggest_gen(pl2, i, suggest_start));
 1963|   509k|  }
 1964|       |
 1965|  6.96k|  if (!result.empty()) {
  ------------------
  |  Branch (1965:7): [True: 0, False: 6.96k]
  ------------------
 1966|       |    // allcap
 1967|      0|    if (captype == ALLCAP)
  ------------------
  |  |   94|      0|#define ALLCAP 2
  ------------------
  |  Branch (1967:9): [True: 0, False: 0]
  ------------------
 1968|      0|      mkallcap(result);
 1969|       |
 1970|       |    // line split
 1971|      0|    slst = line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1972|       |
 1973|       |    // capitalize
 1974|      0|    if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   93|      0|#define INITCAP 1
  ------------------
                  if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   96|      0|#define HUHINITCAP 4
  ------------------
  |  Branch (1974:9): [True: 0, False: 0]
  |  Branch (1974:31): [True: 0, False: 0]
  ------------------
 1975|      0|      for (auto& str : slst) {
  ------------------
  |  Branch (1975:22): [True: 0, False: 0]
  ------------------
 1976|      0|        mkinitcap(str);
 1977|      0|      }
 1978|      0|    }
 1979|       |
 1980|       |    // temporary filtering of prefix related errors (eg.
 1981|       |    // generate("undrinkable", "eats") --> "undrinkables" and "*undrinks")
 1982|      0|    auto it = slst.begin();
 1983|      0|    while (it != slst.end()) {
  ------------------
  |  Branch (1983:12): [True: 0, False: 0]
  ------------------
 1984|      0|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|      0|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1984:11): [True: 0, False: 0]
  ------------------
 1985|      0|        break;
 1986|      0|      std::vector<std::string> candidate_stack;
 1987|      0|      if (!spell(*it, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1987:11): [True: 0, False: 0]
  ------------------
 1988|      0|        it = slst.erase(it);
 1989|      0|      } else  {
 1990|      0|        ++it;
 1991|      0|      }
 1992|      0|    }
 1993|      0|  }
 1994|  6.96k|  return slst;
 1995|  7.39k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 1997|    627|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::string& pattern) {
 1998|    627|  std::vector<std::string> pl = analyze(pattern);
 1999|    627|  std::vector<std::string> slst = generate(word, pl);
 2000|    627|  uniqlist(slst);
 2001|    627|  return slst;
 2002|    627|}
_ZN12HunspellImpl11get_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEm:
 2005|   606k|std::string HunspellImpl::get_xml_par(const std::string& in_par, std::string::size_type pos) {
 2006|   606k|  std::string dest;
 2007|   606k|  if (pos == std::string::npos)
  ------------------
  |  Branch (2007:7): [True: 6.44k, False: 599k]
  ------------------
 2008|  6.44k|    return dest;
 2009|   599k|  const char* par = in_par.c_str() + pos;
 2010|   599k|  char end = *par;
 2011|   599k|  if (end == '>')
  ------------------
  |  Branch (2011:7): [True: 596k, False: 3.40k]
  ------------------
 2012|   596k|    end = '<';
 2013|  3.40k|  else if (end != '\'' && end != '"')
  ------------------
  |  Branch (2013:12): [True: 2.79k, False: 608]
  |  Branch (2013:27): [True: 1.67k, False: 1.12k]
  ------------------
 2014|  1.67k|    return dest;  // bad XML
 2015|  10.3M|  for (par++; *par != '\0' && *par != end; ++par) {
  ------------------
  |  Branch (2015:15): [True: 10.3M, False: 33.9k]
  |  Branch (2015:31): [True: 9.74M, False: 564k]
  ------------------
 2016|  9.74M|    dest.push_back(*par);
 2017|  9.74M|  }
 2018|   598k|  mystrrep(dest, "&lt;", "<");
 2019|   598k|  mystrrep(dest, "&amp;", "&");
 2020|   598k|  return dest;
 2021|   599k|}
_ZN12HunspellImpl11get_xml_posERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 2037|  74.0k|std::string::size_type HunspellImpl::get_xml_pos(const std::string& s, std::string::size_type pos, const char* attr) {
 2038|  74.0k|  if (pos == std::string::npos)
  ------------------
  |  Branch (2038:7): [True: 0, False: 74.0k]
  ------------------
 2039|      0|    return std::string::npos;
 2040|       |
 2041|  74.0k|  std::string::size_type endpos = s.find('>', pos);
 2042|  74.0k|  if (attr == nullptr)
  ------------------
  |  Branch (2042:7): [True: 0, False: 74.0k]
  ------------------
 2043|      0|    return endpos;
 2044|   208k|  while (true) {
  ------------------
  |  Branch (2044:10): [True: 208k, Folded]
  ------------------
 2045|   208k|    pos = s.find(attr, pos);
 2046|   208k|    if (pos == std::string::npos || pos >= endpos)
  ------------------
  |  Branch (2046:9): [True: 3.57k, False: 205k]
  |  Branch (2046:37): [True: 1.74k, False: 203k]
  ------------------
 2047|  5.32k|      return std::string::npos;
 2048|   203k|    if (pos == 0 || s[pos - 1] == ' ' || s[pos - 1] == '\n')
  ------------------
  |  Branch (2048:9): [True: 0, False: 203k]
  |  Branch (2048:21): [True: 1.69k, False: 201k]
  |  Branch (2048:42): [True: 67.0k, False: 134k]
  ------------------
 2049|  68.7k|      break;
 2050|   134k|    pos += strlen(attr);
 2051|   134k|  }
 2052|  68.7k|  return pos + strlen(attr);
 2053|  74.0k|}
_ZN12HunspellImpl13check_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKcSA_:
 2057|  74.0k|                                const char* value) {
 2058|  74.0k|  const std::string cw = get_xml_par(q, get_xml_pos(q, pos, attr));
 2059|  74.0k|  return cw == value ? 1 : 0;
  ------------------
  |  Branch (2059:10): [True: 18.1k, False: 55.9k]
  ------------------
 2060|  74.0k|}
_ZN12HunspellImpl12get_xml_listERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 2062|  7.56k|std::vector<std::string> HunspellImpl::get_xml_list(const std::string& list, std::string::size_type pos, const char* tag) {
 2063|  7.56k|  std::vector<std::string> slst;
 2064|  7.56k|  if (pos == std::string::npos)
  ------------------
  |  Branch (2064:7): [True: 38, False: 7.52k]
  ------------------
 2065|     38|    return slst;
 2066|   516k|  while (true) {
  ------------------
  |  Branch (2066:10): [True: 516k, Folded]
  ------------------
 2067|   516k|    pos = list.find(tag, pos);
 2068|   516k|    if (pos == std::string::npos)
  ------------------
  |  Branch (2068:9): [True: 6.21k, False: 510k]
  ------------------
 2069|  6.21k|        break;
 2070|   510k|    std::string cw = get_xml_par(list, pos + strlen(tag) - 1);
 2071|   510k|    if (cw.empty()) {
  ------------------
  |  Branch (2071:9): [True: 1.31k, False: 509k]
  ------------------
 2072|  1.31k|      break;
 2073|  1.31k|    }
 2074|   509k|    slst.push_back(std::move(cw));
 2075|   509k|    ++pos;
 2076|   509k|  }
 2077|  7.52k|  return slst;
 2078|  7.56k|}
_ZN12HunspellImpl7spellmlERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 2080|  22.5k|std::vector<std::string> HunspellImpl::spellml(const std::string& in_word) {
 2081|       |  // The XML interface spell checks words of its own to answer the query.
 2082|  22.5k|  TraceSuppress no_trace(m_trace.get());
 2083|       |
 2084|  22.5k|  std::vector<std::string> slst;
 2085|       |
 2086|  22.5k|  std::string::size_type qpos = in_word.find("<query");
 2087|  22.5k|  if (qpos == std::string::npos)
  ------------------
  |  Branch (2087:7): [True: 484, False: 22.0k]
  ------------------
 2088|    484|    return slst;  // bad XML input
 2089|       |
 2090|  22.0k|  std::string::size_type q2pos = in_word.find('>', qpos);
 2091|  22.0k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (2091:7): [True: 171, False: 21.8k]
  ------------------
 2092|    171|    return slst;  // bad XML input
 2093|       |
 2094|  21.8k|  q2pos = in_word.find("<word", q2pos);
 2095|  21.8k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (2095:7): [True: 303, False: 21.5k]
  ------------------
 2096|    303|    return slst;  // bad XML input
 2097|       |
 2098|  21.5k|  if (check_xml_par(in_word, qpos, "type=", "analyze")) {
  ------------------
  |  Branch (2098:7): [True: 437, False: 21.1k]
  ------------------
 2099|    437|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2100|    437|    if (!cw.empty())
  ------------------
  |  Branch (2100:9): [True: 114, False: 323]
  ------------------
 2101|    114|      slst = analyze(cw);
 2102|    437|    if (slst.empty())
  ------------------
  |  Branch (2102:9): [True: 379, False: 58]
  ------------------
 2103|    379|      return slst;
 2104|       |    // convert the result to <code><a>ana1</a><a>ana2</a></code> format
 2105|     58|    std::string r;
 2106|     58|    r.append("<code>");
 2107|     58|    for (auto entry : slst) {
  ------------------
  |  Branch (2107:21): [True: 58, False: 58]
  ------------------
 2108|     58|      r.append("<a>");
 2109|       |
 2110|     58|      mystrrep(entry, "\t", " ");
 2111|     58|      mystrrep(entry, "&", "&amp;");
 2112|     58|      mystrrep(entry, "<", "&lt;");
 2113|     58|      r.append(entry);
 2114|       |
 2115|     58|      r.append("</a>");
 2116|     58|    }
 2117|     58|    r.append("</code>");
 2118|     58|    slst.clear();
 2119|     58|    slst.push_back(std::move(r));
 2120|     58|    return slst;
 2121|  21.1k|  } else if (check_xml_par(in_word, qpos, "type=", "stem")) {
  ------------------
  |  Branch (2121:14): [True: 1.25k, False: 19.9k]
  ------------------
 2122|  1.25k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2123|  1.25k|    if (!cw.empty())
  ------------------
  |  Branch (2123:9): [True: 873, False: 380]
  ------------------
 2124|    873|      return stem(cw);
 2125|  19.9k|  } else if (check_xml_par(in_word, qpos, "type=", "generate")) {
  ------------------
  |  Branch (2125:14): [True: 8.51k, False: 11.3k]
  ------------------
 2126|  8.51k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2127|  8.51k|    if (cw.empty())
  ------------------
  |  Branch (2127:9): [True: 152, False: 8.36k]
  ------------------
 2128|    152|      return slst;
 2129|  8.36k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 2130|  8.36k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (2130:9): [True: 703, False: 7.65k]
  ------------------
 2131|    703|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2132|    703|      if (!cw2.empty()) {
  ------------------
  |  Branch (2132:11): [True: 627, False: 76]
  ------------------
 2133|    627|        return generate(cw, cw2);
 2134|    627|      }
 2135|  7.65k|    } else {
 2136|  7.65k|      q2pos = in_word.find("<code", q2pos + 1);
 2137|  7.65k|      if (q2pos != std::string::npos) {
  ------------------
  |  Branch (2137:11): [True: 7.56k, False: 95]
  ------------------
 2138|  7.56k|        std::vector<std::string> slst2 = get_xml_list(in_word, in_word.find('>', q2pos), "<a>");
 2139|  7.56k|        if (!slst2.empty()) {
  ------------------
  |  Branch (2139:13): [True: 6.76k, False: 798]
  ------------------
 2140|  6.76k|          slst = generate(cw, slst2);
 2141|  6.76k|          uniqlist(slst);
 2142|  6.76k|          return slst;
 2143|  6.76k|        }
 2144|  7.56k|      }
 2145|  7.65k|    }
 2146|  11.3k|  } else if (check_xml_par(in_word, qpos, "type=", "add")) {
  ------------------
  |  Branch (2146:14): [True: 7.91k, False: 3.47k]
  ------------------
 2147|  7.91k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2148|  7.91k|    if (cw.empty())
  ------------------
  |  Branch (2148:9): [True: 76, False: 7.83k]
  ------------------
 2149|     76|      return slst;
 2150|  7.83k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 2151|  7.83k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (2151:9): [True: 2.58k, False: 5.25k]
  ------------------
 2152|  2.58k|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2153|  2.58k|      if (!cw2.empty()) {
  ------------------
  |  Branch (2153:11): [True: 2.12k, False: 456]
  ------------------
 2154|  2.12k|        add_with_affix(cw, cw2);
 2155|  2.12k|      } else {
 2156|    456|        add(cw);
 2157|    456|      }
 2158|  5.25k|    } else {
 2159|  5.25k|        add(cw);
 2160|  5.25k|    }
 2161|  7.83k|  }
 2162|  12.6k|  return slst;
 2163|  21.5k|}
_ZN8HunspellC2EPKcS1_S1_:
 2320|     38|  : m_Impl(new HunspellImpl(affpath, dpath, key)) {
 2321|     38|}
_ZN8Hunspell5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_:
 2332|  63.2k|bool Hunspell::spell(const std::string& word, int* info, std::string* root) {
 2333|  63.2k|  std::vector<std::string> candidate_stack;
 2334|  63.2k|  return m_Impl->spell(word, candidate_stack, info, root,
 2335|  63.2k|                       std::chrono::steady_clock::now());
 2336|  63.2k|}
_ZN8Hunspell7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 2338|  62.5k|std::vector<std::string> Hunspell::suggest(const std::string& word) {
 2339|  62.5k|  return m_Impl->suggest(word);
 2340|  62.5k|}
_ZNK12HunspellImpl12active_traceEv:
  143|  36.9M|  TraceCtx* active_trace() const {
  144|  36.9M|    return (m_trace && m_trace->on()) ? m_trace.get() : nullptr;
  ------------------
  |  Branch (144:13): [True: 0, False: 36.9M]
  |  Branch (144:24): [True: 0, False: 0]
  ------------------
  145|  36.9M|  }

_ZN10TraceScopeC2EP8TraceCtx:
  124|   554M|  explicit TraceScope(TraceCtx* context) : m_context(context) {
  125|   554M|    if (m_context)
  ------------------
  |  Branch (125:9): [True: 0, False: 554M]
  ------------------
  126|      0|      ++m_context->m_depth;
  127|   554M|  }
_ZN10TraceScopeD2Ev:
  128|   554M|  ~TraceScope() {
  129|   554M|    if (m_context)
  ------------------
  |  Branch (129:9): [True: 0, False: 554M]
  ------------------
  130|      0|      --m_context->m_depth;
  131|   554M|  }
_Z8trace_onP8TraceCtx:
  158|  1.21G|inline TraceCtx* trace_on(TraceCtx* context) {
  159|  1.21G|  return (context && context->on()) ? context : nullptr;
  ------------------
  |  Branch (159:11): [True: 0, False: 1.21G]
  |  Branch (159:22): [True: 0, False: 0]
  ------------------
  160|  1.21G|}
_ZN13TraceSuppressC2EP8TraceCtx:
  141|   113k|  explicit TraceSuppress(TraceCtx* context) : m_context(context) {
  142|   113k|    if (m_context)
  ------------------
  |  Branch (142:9): [True: 0, False: 113k]
  ------------------
  143|      0|      ++m_context->m_suppressed;
  144|   113k|  }
_ZN13TraceSuppressD2Ev:
  145|   113k|  ~TraceSuppress() {
  146|   113k|    if (m_context)
  ------------------
  |  Branch (146:9): [True: 0, False: 113k]
  ------------------
  147|      0|      --m_context->m_suppressed;
  148|   113k|  }

_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|  9.26k|std::string phonet(const std::string& inword, phonetable& parms) {
   70|       |
   71|  9.26k|  int i, k = 0, p, z, k0, n0, p0 = -333;
   72|  9.26k|  char c;
   73|  9.26k|  using uchar = unsigned char;
   74|       |
   75|  9.26k|  size_t len = inword.size();
   76|  9.26k|  if (len > MAXPHONETUTF8LEN)
  ------------------
  |  |   35|  9.26k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  9.26k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
  |  Branch (76:7): [True: 0, False: 9.26k]
  ------------------
   77|      0|    return {};
   78|  9.26k|  char word[MAXPHONETUTF8LEN + 1];
   79|  9.26k|  strncpy(word, inword.c_str(), MAXPHONETUTF8LEN);
  ------------------
  |  |   35|  9.26k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  9.26k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   80|  9.26k|  word[MAXPHONETUTF8LEN] = '\0';
  ------------------
  |  |   35|  9.26k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  9.26k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   81|       |
   82|  9.26k|  std::string target;
   83|       |  /**  check word  **/
   84|  9.26k|  i = z = 0;
   85|  87.1k|  while ((c = word[i]) != '\0') {
  ------------------
  |  Branch (85:10): [True: 77.9k, False: 9.26k]
  ------------------
   86|  77.9k|    int n = parms.hash[(uchar)c];
   87|  77.9k|    int z0 = 0;
   88|       |
   89|  77.9k|    if (n >= 0 && !parms.rules[n].empty()) {
  ------------------
  |  Branch (89:9): [True: 23.4k, False: 54.4k]
  |  Branch (89:19): [True: 23.4k, False: 0]
  ------------------
   90|       |      /**  check all rules for the same letter  **/
   91|  60.5k|      while (parms.rules[n][0] == c) {
  ------------------
  |  Branch (91:14): [True: 58.5k, False: 2.08k]
  ------------------
   92|       |        /**  check whole string  **/
   93|  58.5k|        k = 1; /** number of found letters  **/
   94|  58.5k|        p = 5; /** default priority  **/
   95|  58.5k|        const char*s = parms.rules[n].c_str();
   96|  58.5k|        s++; /**  important for (see below)  "*(s-1)"  **/
   97|       |
   98|  60.9k|        while (*s != '\0' && word[i + k] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (98:16): [True: 41.9k, False: 19.0k]
  |  Branch (98:30): [True: 2.54k, False: 39.3k]
  |  Branch (98:51): [True: 2.54k, False: 0]
  |  Branch (98:82): [True: 2.48k, False: 60]
  ------------------
   99|  2.48k|          k++;
  100|  2.48k|          s++;
  101|  2.48k|        }
  102|  58.5k|        if (*s == '(') {
  ------------------
  |  Branch (102:13): [True: 4.45k, False: 54.0k]
  ------------------
  103|       |          /**  check letters in "(..)"  **/
  104|  4.45k|          if (myisalpha(word[i + k])  // ...could be implied?
  ------------------
  |  Branch (104:15): [True: 3.25k, False: 1.19k]
  ------------------
  105|  3.25k|              && strchr(s + 1, word[i + k]) != nullptr) {
  ------------------
  |  Branch (105:18): [True: 362, False: 2.89k]
  ------------------
  106|    362|            k++;
  107|  1.84k|            while (*s && *s != ')')
  ------------------
  |  Branch (107:20): [True: 1.84k, False: 0]
  |  Branch (107:26): [True: 1.48k, False: 362]
  ------------------
  108|  1.48k|              s++;
  109|    362|            if (*s == ')')
  ------------------
  |  Branch (109:17): [True: 362, False: 0]
  ------------------
  110|    362|              s++;
  111|    362|          }
  112|  4.45k|        }
  113|  58.5k|        p0 = (int)*s;
  114|  58.5k|        k0 = k;
  115|  60.2k|        while (*s == '-' && k > 1) {
  ------------------
  |  Branch (115:16): [True: 1.78k, False: 58.5k]
  |  Branch (115:29): [True: 1.78k, False: 0]
  ------------------
  116|  1.78k|          k--;
  117|  1.78k|          s++;
  118|  1.78k|        }
  119|  58.5k|        if (*s == '<')
  ------------------
  |  Branch (119:13): [True: 61, False: 58.4k]
  ------------------
  120|     61|          s++;
  121|  58.5k|        if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (121:13): [True: 2, False: 58.5k]
  ------------------
  122|       |          /**  determine priority  **/
  123|      2|          p = *s - '0';
  124|      2|          s++;
  125|      2|        }
  126|  58.5k|        if (*s == '^' && *(s + 1) == '^')
  ------------------
  |  Branch (126:13): [True: 2.84k, False: 55.6k]
  |  Branch (126:26): [True: 0, False: 2.84k]
  ------------------
  127|      0|          s++;
  128|       |
  129|  58.5k|        if (*s == '\0' || (*s == '^' && (i == 0 || !myisalpha(word[i - 1])) &&
  ------------------
  |  Branch (129:13): [True: 20.9k, False: 37.5k]
  |  Branch (129:28): [True: 2.84k, False: 34.6k]
  |  Branch (129:42): [True: 114, False: 2.73k]
  |  Branch (129:52): [True: 708, False: 2.02k]
  ------------------
  130|    822|                           (*(s + 1) != '$' || (!myisalpha(word[i + k0])))) ||
  ------------------
  |  Branch (130:29): [True: 822, False: 0]
  |  Branch (130:48): [True: 0, False: 0]
  ------------------
  131|  36.6k|            (*s == '$' && i > 0 && myisalpha(word[i - 1]) &&
  ------------------
  |  Branch (131:14): [True: 0, False: 36.6k]
  |  Branch (131:27): [True: 0, False: 0]
  |  Branch (131:36): [True: 0, False: 0]
  ------------------
  132|  21.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|  21.8k|          char c0 = word[i + k - 1];
  136|  21.8k|          n0 = parms.hash[(uchar)c0];
  137|       |
  138|       |          //            if (parms.followup  &&  k > 1  &&  n0 >= 0
  139|  21.8k|          if (k > 1 && n0 >= 0 && p0 != (int)'-' && word[i + k] != '\0' && !parms.rules[n0].empty()) {
  ------------------
  |  Branch (139:15): [True: 680, False: 21.1k]
  |  Branch (139:24): [True: 680, False: 0]
  |  Branch (139:35): [True: 650, False: 30]
  |  Branch (139:53): [True: 594, False: 56]
  |  Branch (139:76): [True: 594, False: 0]
  ------------------
  140|       |            /**  test follow-up rule for "word[i+k]"  **/
  141|  1.56k|            while (parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (141:20): [True: 1.36k, False: 199]
  ------------------
  142|       |              /**  check whole string  **/
  143|  1.36k|              k0 = k;
  144|  1.36k|              p0 = 5;
  145|  1.36k|              s = parms.rules[n0].c_str();
  146|  1.36k|              s++;
  147|  1.76k|              while (*s != '\0' && word[i + k0] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (147:22): [True: 1.17k, False: 594]
  |  Branch (147:36): [True: 403, False: 770]
  |  Branch (147:58): [True: 403, False: 0]
  |  Branch (147:89): [True: 403, False: 0]
  ------------------
  148|    403|                k0++;
  149|    403|                s++;
  150|    403|              }
  151|  1.36k|              if (*s == '(') {
  ------------------
  |  Branch (151:19): [True: 0, False: 1.36k]
  ------------------
  152|       |                /**  check letters  **/
  153|      0|                if (myisalpha(word[i + k0]) && strchr(s + 1, word[i + k0]) != nullptr) {
  ------------------
  |  Branch (153:21): [True: 0, False: 0]
  |  Branch (153:48): [True: 0, False: 0]
  ------------------
  154|      0|                  k0++;
  155|      0|                  while (*s != ')' && *s != '\0')
  ------------------
  |  Branch (155:26): [True: 0, False: 0]
  |  Branch (155:39): [True: 0, False: 0]
  ------------------
  156|      0|                    s++;
  157|      0|                  if (*s == ')')
  ------------------
  |  Branch (157:23): [True: 0, False: 0]
  ------------------
  158|      0|                    s++;
  159|      0|                }
  160|      0|              }
  161|  1.36k|              while (*s == '-') {
  ------------------
  |  Branch (161:22): [True: 0, False: 1.36k]
  ------------------
  162|       |                /**  "k0" gets NOT reduced   **/
  163|       |                /**  because "if (k0 == k)"  **/
  164|      0|                s++;
  165|      0|              }
  166|  1.36k|              if (*s == '<')
  ------------------
  |  Branch (166:19): [True: 0, False: 1.36k]
  ------------------
  167|      0|                s++;
  168|  1.36k|              if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (168:19): [True: 0, False: 1.36k]
  ------------------
  169|      0|                p0 = *s - '0';
  170|      0|                s++;
  171|      0|              }
  172|       |
  173|  1.36k|              if (*s == '\0'
  ------------------
  |  Branch (173:19): [True: 594, False: 770]
  ------------------
  174|       |                  /**  *s == '^' cuts  **/
  175|    770|                  || (*s == '$' && !myisalpha(word[i + k0]))) {
  ------------------
  |  Branch (175:23): [True: 2, False: 768]
  |  Branch (175:36): [True: 2, False: 0]
  ------------------
  176|    596|                if (k0 == k) {
  ------------------
  |  Branch (176:21): [True: 199, False: 397]
  ------------------
  177|       |                  /**  this is just a piece of the string  **/
  178|    199|                  n0 += 2;
  179|    199|                  continue;
  180|    199|                }
  181|       |
  182|    397|                if (p0 < p) {
  ------------------
  |  Branch (182:21): [True: 2, False: 395]
  ------------------
  183|       |                  /**  priority too low  **/
  184|      2|                  n0 += 2;
  185|      2|                  continue;
  186|      2|                }
  187|       |                /**  rule fits; stop search  **/
  188|    395|                break;
  189|    397|              }
  190|    768|              n0 += 2;
  191|    768|            } /**  End of "while (parms.rules[n0][0] == c0)"  **/
  192|       |
  193|    594|            if (p0 >= p && parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (193:17): [True: 592, False: 2]
  |  Branch (193:28): [True: 395, False: 197]
  ------------------
  194|    395|              n += 2;
  195|    395|              continue;
  196|    395|            }
  197|    594|          } /** end of follow-up stuff **/
  198|       |
  199|       |          /**  replace string  **/
  200|  21.4k|          s = parms.rules[n + 1].c_str();
  201|  21.4k|          p0 = (!parms.rules[n].empty() && strchr(parms.rules[n].c_str() + 1, '<') != nullptr) ? 1 : 0;
  ------------------
  |  Branch (201:17): [True: 21.4k, False: 0]
  |  Branch (201:44): [True: 61, False: 21.3k]
  ------------------
  202|  21.4k|          if (p0 == 1 && z == 0) {
  ------------------
  |  Branch (202:15): [True: 61, False: 21.3k]
  |  Branch (202:26): [True: 61, False: 0]
  ------------------
  203|       |            /**  rule with '<' is used  **/
  204|     61|            if (!target.empty() && *s != '\0' &&
  ------------------
  |  Branch (204:17): [True: 46, False: 15]
  |  Branch (204:36): [True: 46, False: 0]
  ------------------
  205|     46|                (target[target.size()-1] == c || target[target.size()-1] == *s)) {
  ------------------
  |  Branch (205:18): [True: 0, False: 46]
  |  Branch (205:50): [True: 0, False: 46]
  ------------------
  206|      0|              target.erase(target.size() - 1);
  207|      0|            }
  208|     61|            z0 = 1;
  209|     61|            z = 1;
  210|     61|            k0 = 0;
  211|    122|            while (*s != '\0' && word[i + k0] != '\0') {
  ------------------
  |  Branch (211:20): [True: 61, False: 61]
  |  Branch (211:34): [True: 61, False: 0]
  ------------------
  212|     61|              word[i + k0] = *s;
  213|     61|              k0++;
  214|     61|              s++;
  215|     61|            }
  216|     61|            if (k > k0)
  ------------------
  |  Branch (216:17): [True: 0, False: 61]
  ------------------
  217|      0|              strmove(&word[0] + i + k0, &word[0] + i + k);
  218|       |
  219|       |            /**  new "actual letter"  **/
  220|     61|            c = word[i];
  221|  21.3k|          } else { /** no '<' rule used **/
  222|  21.3k|            i += k - 1;
  223|  21.3k|            z = 0;
  224|  21.7k|            while (*s != '\0' && *(s + 1) != '\0' && target.size() < len) {
  ------------------
  |  Branch (224:20): [True: 20.0k, False: 1.70k]
  |  Branch (224:34): [True: 432, False: 19.5k]
  |  Branch (224:54): [True: 356, False: 76]
  ------------------
  225|    356|              if (target.empty() || target[target.size()-1] != *s) {
  ------------------
  |  Branch (225:19): [True: 12, False: 344]
  |  Branch (225:37): [True: 117, False: 227]
  ------------------
  226|    129|                target.push_back(*s);
  227|    129|              }
  228|    356|              s++;
  229|    356|            }
  230|       |            /**  new "actual letter"  **/
  231|  21.3k|            c = *s;
  232|  21.3k|            if (!parms.rules[n].empty() && strstr(parms.rules[n].c_str() + 1, "^^") != nullptr) {
  ------------------
  |  Branch (232:17): [True: 21.3k, False: 0]
  |  Branch (232:44): [True: 0, False: 21.3k]
  ------------------
  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|  21.3k|          }
  241|  21.4k|          break;
  242|  21.8k|        } /** end of follow-up stuff **/
  243|  36.6k|        n += 2;
  244|  36.6k|      } /**  end of while (parms.rules[n][0] == c)  **/
  245|  23.4k|    }   /**  end of if (n >= 0)  **/
  246|  77.9k|    if (z0 == 0) {
  ------------------
  |  Branch (246:9): [True: 77.8k, False: 61]
  ------------------
  247|  77.8k|      if (k && !p0 && target.size() < len && c != '\0') {
  ------------------
  |  Branch (247:11): [True: 23.4k, False: 54.4k]
  |  Branch (247:16): [True: 21.3k, False: 2.08k]
  |  Branch (247:23): [True: 21.2k, False: 95]
  |  Branch (247:46): [True: 19.5k, False: 1.70k]
  ------------------
  248|       |        /**  condense only double letters  **/
  249|  19.5k|        target.push_back(c);
  250|       |        /// printf("\n setting \n");
  251|  19.5k|      }
  252|       |
  253|  77.8k|      i++;
  254|  77.8k|      z = 0;
  255|  77.8k|      k = 0;
  256|  77.8k|    }
  257|  77.9k|  } /**  end of   while ((c = word[i]) != '\0')  **/
  258|       |
  259|  9.26k|  return target;
  260|  9.26k|} /**  end of function "phonet"  **/
phonet.cxx:_ZL9myisalphac:
   59|  7.18k|static int myisalpha(char ch) {
   60|  7.18k|  if ((unsigned char)ch < 128)
  ------------------
  |  Branch (60:7): [True: 6.88k, False: 302]
  ------------------
   61|  6.88k|    return isalpha(ch);
   62|    302|  return 1;
   63|  7.18k|}

_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|   509k|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|   509k|  if (can_use_trie && trie.get_status())
  ------------------
  |  Branch (187:7): [True: 509k, False: 0]
  |  Branch (187:23): [True: 509k, False: 0]
  ------------------
  188|   509k|    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|   509k|}
_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|   509k|    bool get_status() const { return status_ok; }
_ZNK4TrieItLb1EE9transcodeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_:
  205|   509k|    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|   509k|        if (!status_ok || src.empty()) return TranscodeResult::None;
  ------------------
  |  Branch (207:13): [True: 0, False: 509k]
  |  Branch (207:27): [True: 1.76k, False: 507k]
  ------------------
  208|       |        
  209|   507k|        dst.clear();
  210|   507k|        dst.reserve(src.size()); 
  211|       |        
  212|       |        // State trackers for the 3-way outcome
  213|   507k|        bool any_substituted = false;
  214|   507k|        bool any_copied = false;
  215|       |        
  216|   507k|        size_t i = 0;
  217|       |        
  218|  5.46M|        while (i < src.size()) {
  ------------------
  |  Branch (218:16): [True: 4.95M, False: 507k]
  ------------------
  219|  4.95M|            size_t curr_idx = 0;
  220|  4.95M|            size_t match_len = 0;
  221|  4.95M|            uint32_t best_sub = 0xFFFFFFFF;
  222|       |
  223|  4.95M|            size_t j = i;
  224|       |            
  225|       |            // Greedily traverse the trie to find the longest matching sequence
  226|  4.95M|            while (j < src.size()) {
  ------------------
  |  Branch (226:20): [True: 4.95M, False: 135]
  ------------------
  227|  4.95M|                uint8_t byte = static_cast<uint8_t>(src[j]);
  228|       |                
  229|  4.95M|                if (UseNibbles) {
  ------------------
  |  Branch (229:21): [True: 4.95M, Folded]
  ------------------
  230|  4.95M|                    IndexType r1 = nodes[curr_idx].children[(byte >> 4) & 0x0F];
  231|  4.95M|                    if (r1 == 0) break;
  ------------------
  |  Branch (231:25): [True: 4.93M, False: 20.7k]
  ------------------
  232|  20.7k|                    curr_idx += r1;
  233|       |
  234|  20.7k|                    IndexType r2 = nodes[curr_idx].children[byte & 0x0F];
  235|  20.7k|                    if (r2 == 0) break;
  ------------------
  |  Branch (235:25): [True: 19.7k, False: 991]
  ------------------
  236|    991|                    curr_idx += r2;
  237|    991|                } 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|    991|                ++j;
  244|       |                
  245|       |                // Track the deepest valid match found during traversal
  246|    991|                if (sub_info_arena[curr_idx] != 0xFFFFFFFF) {
  ------------------
  |  Branch (246:21): [True: 380, False: 611]
  ------------------
  247|    380|                    best_sub = sub_info_arena[curr_idx];
  248|    380|                    match_len = j - i;
  249|    380|                }
  250|    991|            }
  251|       |
  252|  4.95M|            if (best_sub != 0xFFFFFFFF) {
  ------------------
  |  Branch (252:17): [True: 380, False: 4.95M]
  ------------------
  253|       |                // Decode the 24-bit offset and 8-bit size, append directly from arena
  254|    380|                dst.append(&char_arena[best_sub >> 8], best_sub & 0xFF);
  255|    380|                i += match_len;
  256|    380|                any_substituted = true; // State update: Substitution occurred
  257|  4.95M|            } else {
  258|       |                // Fallback: copy unmapped character directly to output
  259|  4.95M|                dst.push_back(src[i]);
  260|  4.95M|                ++i;
  261|  4.95M|                any_copied = true; // State update: Verbatim copy occurred
  262|  4.95M|            }
  263|  4.95M|        }
  264|       |        
  265|       |        // ALGORITHM: Outcome Evaluation
  266|   507k|        if (any_substituted && any_copied) {
  ------------------
  |  Branch (266:13): [True: 227, False: 507k]
  |  Branch (266:32): [True: 216, False: 11]
  ------------------
  267|    216|            return TranscodeResult::Partial;
  268|   507k|        } else if (any_substituted) {
  ------------------
  |  Branch (268:20): [True: 11, False: 507k]
  ------------------
  269|     11|            return TranscodeResult::All;
  270|     11|        }
  271|       |        
  272|   507k|        return TranscodeResult::None;
  273|   507k|    }

_ZN10SuggestMgrC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEjP8AffixMgr:
   87|     38|SuggestMgr::SuggestMgr(const std::string& tryme, unsigned int maxn, AffixMgr* aptr) {
   88|       |  // register affix manager and check in string of chars to
   89|       |  // try when building candidate suggestions
   90|     38|  pAMgr = aptr;
   91|       |
   92|     38|  csconv = nullptr;
   93|       |
   94|     38|  ckeyl = 0;
   95|       |
   96|     38|  ctryl = 0;
   97|       |
   98|     38|  utf8 = 0;
   99|     38|  langnum = 0;
  100|     38|  complexprefixes = 0;
  101|       |
  102|     38|  maxSug = maxn;
  103|     38|  nosplitsugs = 0;
  104|     38|  maxngramsugs = MAXNGRAMSUGS;
  ------------------
  |  |   77|     38|#define MAXNGRAMSUGS 4
  ------------------
  105|     38|  maxcpdsugs = MAXCOMPOUNDSUGS;
  ------------------
  |  |   79|     38|#define MAXCOMPOUNDSUGS 3
  ------------------
  106|       |
  107|     38|  if (pAMgr) {
  ------------------
  |  Branch (107:7): [True: 38, False: 0]
  ------------------
  108|     38|    langnum = pAMgr->get_langnum();
  109|     38|    ckey = pAMgr->get_key_string();
  110|     38|    nosplitsugs = pAMgr->get_nosplitsugs();
  111|     38|    if (pAMgr->get_maxngramsugs() >= 0)
  ------------------
  |  Branch (111:9): [True: 4, False: 34]
  ------------------
  112|      4|      maxngramsugs = pAMgr->get_maxngramsugs();
  113|     38|    utf8 = pAMgr->get_utf8();
  114|     38|    if (pAMgr->get_maxcpdsugs() >= 0)
  ------------------
  |  Branch (114:9): [True: 0, False: 38]
  ------------------
  115|      0|      maxcpdsugs = pAMgr->get_maxcpdsugs();
  116|     38|    if (!utf8) {
  ------------------
  |  Branch (116:9): [True: 20, False: 18]
  ------------------
  117|     20|      csconv = get_current_cs(pAMgr->get_encoding());
  118|     20|    }
  119|     38|    complexprefixes = pAMgr->get_complexprefixes();
  120|     38|  }
  121|       |
  122|     38|  if (!ckey.empty()) {
  ------------------
  |  Branch (122:7): [True: 38, False: 0]
  ------------------
  123|     38|    if (utf8) {
  ------------------
  |  Branch (123:9): [True: 18, False: 20]
  ------------------
  124|     18|      int len = u8_u16(ckey_utf, ckey);
  125|     18|      if (len != -1) {
  ------------------
  |  Branch (125:11): [True: 18, False: 0]
  ------------------
  126|     18|        ckeyl = len;
  127|     18|      }
  128|     20|    } else {
  129|     20|      ckeyl = ckey.size();
  130|     20|    }
  131|     38|  }
  132|       |
  133|     38|  ctry = tryme;
  134|     38|  if (!ctry.empty()) {
  ------------------
  |  Branch (134:7): [True: 2, False: 36]
  ------------------
  135|      2|    if (utf8) {
  ------------------
  |  Branch (135:9): [True: 2, False: 0]
  ------------------
  136|      2|      int len = u8_u16(ctry_utf, ctry);
  137|      2|      if (len != -1) {
  ------------------
  |  Branch (137:11): [True: 2, False: 0]
  ------------------
  138|      2|        ctryl = len;
  139|      2|      }
  140|      2|    } else {
  141|      0|      ctryl = ctry.size();
  142|      0|    }
  143|      2|  }
  144|       |
  145|       |  // language with possible dash usage
  146|       |  // (latin letters or dash in TRY characters)
  147|     38|  lang_with_dash_usage = ctry.find('-') != std::string::npos ||
  ------------------
  |  Branch (147:26): [True: 0, False: 38]
  ------------------
  148|     38|                         ctry.find('a') != std::string::npos;
  ------------------
  |  Branch (148:26): [True: 0, False: 38]
  ------------------
  149|     38|}
_ZN10SuggestMgr7testsugERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iPiPNS0_6chrono10time_pointINSE_12steady_clockENSE_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEERi:
  166|  80.9M|                        int& info) {
  167|  80.9M|  if (wlst.size() == maxSug)
  ------------------
  |  Branch (167:7): [True: 13, False: 80.9M]
  ------------------
  168|     13|    return;
  169|       |
  170|  80.9M|  const int cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (170:20): [True: 25.3k, False: 80.9M]
  ------------------
  171|       |
  172|  80.9M|  if (cwrd) {
  ------------------
  |  Branch (172:7): [True: 80.9M, False: 25.3k]
  ------------------
  173|  80.9M|    if (int result = checkword(candidate, cpdsuggest, timer, timelimit)) {
  ------------------
  |  Branch (173:13): [True: 1.92k, False: 80.9M]
  ------------------
  174|       |      // compound word in the dictionary
  175|  1.92k|      if (cpdsuggest == 0 && result >= 2)
  ------------------
  |  Branch (175:11): [True: 1.92k, False: 0]
  |  Branch (175:30): [True: 0, False: 1.92k]
  ------------------
  176|      0|          info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  177|  1.92k|      wlst.push_back(candidate);
  178|  1.92k|    }
  179|  80.9M|  }
  180|  80.9M|}
_ZN10SuggestMgr7suggestERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_Pib:
  190|   142k|                        int* onlycompoundsug, bool test_simplesug) {
  191|   142k|  int nocompoundtwowords = 0; // no second or third loops, see below
  192|   142k|  std::vector<w_char> word_utf;
  193|   142k|  size_t nsugorig = slst.size(), oldSug = 0;
  194|   142k|  std::string w2;
  195|   142k|  bool good_suggestion = false;
  196|       |
  197|       |  // word reversing wrapper for complex prefixes
  198|   142k|  if (complexprefixes) {
  ------------------
  |  Branch (198:7): [True: 8.16k, False: 134k]
  ------------------
  199|  8.16k|    w2.assign(w);
  200|  8.16k|    if (utf8)
  ------------------
  |  Branch (200:9): [True: 0, False: 8.16k]
  ------------------
  201|      0|      reverseword_utf(w2);
  202|  8.16k|    else
  203|  8.16k|      reverseword(w2);
  204|  8.16k|  }
  205|       |
  206|   142k|  const std::string& word = complexprefixes ? w2 : w;
  ------------------
  |  Branch (206:29): [True: 8.16k, False: 134k]
  ------------------
  207|       |
  208|   142k|  suggest_start = std::chrono::steady_clock::now();
  209|       |
  210|   142k|  if (utf8) {
  ------------------
  |  Branch (210:7): [True: 60.7k, False: 82.2k]
  ------------------
  211|  60.7k|    int wl = u8_u16(word_utf, word);
  212|  60.7k|    if (wl == -1) {
  ------------------
  |  Branch (212:9): [True: 9.74k, False: 51.0k]
  ------------------
  213|  9.74k|      return false;
  214|  9.74k|    }
  215|  60.7k|  }
  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|   133k|  int info = 0;
  225|   532k|  for (int cpdsuggest = 0; cpdsuggest < 3 && nocompoundtwowords == 0; cpdsuggest++) {
  ------------------
  |  Branch (225:28): [True: 399k, False: 132k]
  |  Branch (225:46): [True: 399k, False: 212]
  ------------------
  226|       |
  227|       |    // limit compound suggestion
  228|   399k|    if (cpdsuggest > 0)
  ------------------
  |  Branch (228:9): [True: 265k, False: 133k]
  ------------------
  229|   265k|      oldSug = slst.size();
  230|       |
  231|       |    // suggestions for an uppercase word (html -> HTML)
  232|   399k|    if (slst.size() < maxSug) {
  ------------------
  |  Branch (232:9): [True: 399k, False: 16]
  ------------------
  233|   399k|      size_t i = slst.size();
  234|   399k|      if (utf8)
  ------------------
  |  Branch (234:11): [True: 152k, False: 246k]
  ------------------
  235|   152k|        capchars_utf(slst, word_utf, cpdsuggest, info);
  236|   246k|      else
  237|   246k|        capchars(slst, word, cpdsuggest, info);
  238|   399k|      if (slst.size() > i)
  ------------------
  |  Branch (238:11): [True: 212, False: 398k]
  ------------------
  239|    212|        good_suggestion = true;
  240|   399k|    }
  241|       |
  242|       |    // perhaps we made a typical fault of spelling
  243|   399k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (243:9): [True: 399k, False: 16]
  |  Branch (243:36): [True: 133k, False: 265k]
  |  Branch (243:51): [True: 265k, False: 0]
  ------------------
  244|   399k|      size_t i = slst.size();
  245|   399k|      replchars(slst, word, cpdsuggest, info);
  246|   399k|      if (slst.size() > i) {
  ------------------
  |  Branch (246:11): [True: 0, False: 399k]
  ------------------
  247|      0|        good_suggestion = true;
  248|      0|        if (info & SPELL_BEST_SUG)
  ------------------
  |  |   89|      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|   399k|    }
  252|   399k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   399k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (252:9): [True: 0, False: 399k]
  ------------------
  253|      0|      return good_suggestion;
  254|   399k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (254:9): [True: 0, False: 399k]
  |  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|   399k|    if ((slst.size() < maxSug) &&
  ------------------
  |  Branch (258:9): [True: 399k, False: 16]
  ------------------
  259|   399k|        (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (259:10): [True: 133k, False: 265k]
  |  Branch (259:25): [True: 265k, False: 0]
  ------------------
  260|   399k|      mapchars(slst, word, cpdsuggest, info);
  261|   399k|    }
  262|   399k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   399k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (262:9): [True: 19, False: 399k]
  ------------------
  263|     19|      return good_suggestion;
  264|   399k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (264:9): [True: 0, False: 399k]
  |  Branch (264:27): [True: 0, False: 0]
  ------------------
  265|      0|      return true;
  266|       |
  267|       |    // only suggest compound words when no other ~good suggestion
  268|   399k|    if ((cpdsuggest == 0) && (slst.size() > nsugorig))
  ------------------
  |  Branch (268:9): [True: 133k, False: 265k]
  |  Branch (268:30): [True: 212, False: 133k]
  ------------------
  269|    212|      nocompoundtwowords = 1;
  270|       |
  271|       |    // did we swap the order of chars by mistake
  272|   399k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (272:9): [True: 399k, False: 16]
  |  Branch (272:36): [True: 133k, False: 265k]
  |  Branch (272:51): [True: 265k, False: 0]
  ------------------
  273|   399k|      if (utf8)
  ------------------
  |  Branch (273:11): [True: 152k, False: 246k]
  ------------------
  274|   152k|        swapchar_utf(slst, word_utf, cpdsuggest, info);
  275|   246k|      else
  276|   246k|        swapchar(slst, word, cpdsuggest, info);
  277|   399k|    }
  278|   399k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   399k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (278:9): [True: 0, False: 399k]
  ------------------
  279|      0|      return good_suggestion;
  280|   399k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (280:9): [True: 0, False: 399k]
  |  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|   399k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (284:9): [True: 399k, False: 17]
  |  Branch (284:36): [True: 133k, False: 265k]
  |  Branch (284:51): [True: 265k, False: 0]
  ------------------
  285|   399k|      if (utf8)
  ------------------
  |  Branch (285:11): [True: 152k, False: 246k]
  ------------------
  286|   152k|        longswapchar_utf(slst, word_utf, cpdsuggest, info);
  287|   246k|      else
  288|   246k|        longswapchar(slst, word, cpdsuggest, info);
  289|   399k|    }
  290|   399k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   399k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (290:9): [True: 0, False: 399k]
  ------------------
  291|      0|      return good_suggestion;
  292|   399k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (292:9): [True: 0, False: 399k]
  |  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|   399k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (296:9): [True: 399k, False: 17]
  |  Branch (296:36): [True: 133k, False: 265k]
  |  Branch (296:51): [True: 265k, False: 0]
  ------------------
  297|   399k|      if (utf8)
  ------------------
  |  Branch (297:11): [True: 152k, False: 246k]
  ------------------
  298|   152k|        badcharkey_utf(slst, word_utf, cpdsuggest, info);
  299|   246k|      else
  300|   246k|        badcharkey(slst, word, cpdsuggest, info);
  301|   399k|    }
  302|   399k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   399k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (302:9): [True: 0, False: 399k]
  ------------------
  303|      0|      return good_suggestion;
  304|   399k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (304:9): [True: 0, False: 399k]
  |  Branch (304:27): [True: 0, False: 0]
  ------------------
  305|      0|      return true;
  306|       |
  307|       |    // did we add a char that should not be there
  308|   399k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (308:9): [True: 399k, False: 17]
  |  Branch (308:36): [True: 133k, False: 265k]
  |  Branch (308:51): [True: 265k, False: 0]
  ------------------
  309|   399k|      if (utf8)
  ------------------
  |  Branch (309:11): [True: 152k, False: 246k]
  ------------------
  310|   152k|        extrachar_utf(slst, word_utf, cpdsuggest, info);
  311|   246k|      else
  312|   246k|        extrachar(slst, word, cpdsuggest, info);
  313|   399k|    }
  314|   399k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   399k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (314:9): [True: 0, False: 399k]
  ------------------
  315|      0|      return good_suggestion;
  316|   399k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (316:9): [True: 0, False: 399k]
  |  Branch (316:27): [True: 0, False: 0]
  ------------------
  317|      0|      return true;
  318|       |
  319|       |    // did we forgot a char
  320|   399k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (320:9): [True: 399k, False: 17]
  |  Branch (320:36): [True: 133k, False: 265k]
  |  Branch (320:51): [True: 265k, False: 0]
  ------------------
  321|   399k|      if (utf8)
  ------------------
  |  Branch (321:11): [True: 152k, False: 246k]
  ------------------
  322|   152k|        forgotchar_utf(slst, word_utf, cpdsuggest, info);
  323|   246k|      else
  324|   246k|        forgotchar(slst, word, cpdsuggest, info);
  325|   399k|    }
  326|   399k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   399k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (326:9): [True: 0, False: 399k]
  ------------------
  327|      0|      return good_suggestion;
  328|   399k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (328:9): [True: 0, False: 399k]
  |  Branch (328:27): [True: 0, False: 0]
  ------------------
  329|      0|      return true;
  330|       |
  331|       |    // did we move a char
  332|   399k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (332:9): [True: 399k, False: 17]
  |  Branch (332:36): [True: 133k, False: 265k]
  |  Branch (332:51): [True: 265k, False: 0]
  ------------------
  333|   399k|      if (utf8)
  ------------------
  |  Branch (333:11): [True: 152k, False: 246k]
  ------------------
  334|   152k|        movechar_utf(slst, word_utf, cpdsuggest, info);
  335|   246k|      else
  336|   246k|        movechar(slst, word, cpdsuggest, info);
  337|   399k|    }
  338|   399k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   399k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (338:9): [True: 0, False: 399k]
  ------------------
  339|      0|      return good_suggestion;
  340|   399k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (340:9): [True: 0, False: 399k]
  |  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|   399k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (344:9): [True: 399k, False: 17]
  |  Branch (344:36): [True: 133k, False: 265k]
  |  Branch (344:51): [True: 265k, False: 0]
  ------------------
  345|   399k|      if (utf8)
  ------------------
  |  Branch (345:11): [True: 152k, False: 246k]
  ------------------
  346|   152k|        badchar_utf(slst, word_utf, cpdsuggest, info);
  347|   246k|      else
  348|   246k|        badchar(slst, word, cpdsuggest, info);
  349|   399k|    }
  350|   399k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   399k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (350:9): [True: 0, False: 399k]
  ------------------
  351|      0|      return good_suggestion;
  352|   399k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (352:9): [True: 0, False: 399k]
  |  Branch (352:27): [True: 0, False: 0]
  ------------------
  353|      0|      return true;
  354|       |
  355|       |    // did we double two characters
  356|   399k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (356:9): [True: 399k, False: 17]
  |  Branch (356:36): [True: 133k, False: 265k]
  |  Branch (356:51): [True: 265k, False: 0]
  ------------------
  357|   399k|      if (utf8)
  ------------------
  |  Branch (357:11): [True: 152k, False: 246k]
  ------------------
  358|   152k|        doubletwochars_utf(slst, word_utf, cpdsuggest, info);
  359|   246k|      else
  360|   246k|        doubletwochars(slst, word, cpdsuggest, info);
  361|   399k|    }
  362|   399k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   399k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (362:9): [True: 0, False: 399k]
  ------------------
  363|      0|      return good_suggestion;
  364|   399k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (364:9): [True: 0, False: 399k]
  |  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|   399k|    if (!cpdsuggest || (!nosplitsugs && slst.size() < oldSug + maxcpdsugs)) {
  ------------------
  |  Branch (371:9): [True: 133k, False: 265k]
  |  Branch (371:25): [True: 265k, False: 0]
  |  Branch (371:41): [True: 265k, False: 0]
  ------------------
  372|   399k|      good_suggestion = twowords(slst, word, cpdsuggest, good_suggestion, info);
  373|       |
  374|   399k|      if (info & SPELL_BEST_SUG)
  ------------------
  |  |   89|   399k|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  |  Branch (374:11): [True: 121, False: 398k]
  ------------------
  375|    121|        return true;
  376|   399k|    }
  377|   398k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   398k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (377:9): [True: 0, False: 398k]
  ------------------
  378|      0|      return good_suggestion;
  379|       |
  380|       |    // testing returns after the first loop
  381|   398k|    if (test_simplesug)
  ------------------
  |  Branch (381:9): [True: 0, False: 398k]
  ------------------
  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|   398k|    if (cpdsuggest == 1 && (slst.size() > oldSug || (info & SPELL_COMPOUND)))
  ------------------
  |  |   81|   132k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  |  Branch (387:9): [True: 132k, False: 266k]
  |  Branch (387:29): [True: 0, False: 132k]
  |  Branch (387:53): [True: 0, False: 132k]
  ------------------
  388|      0|       nocompoundtwowords = 1;
  389|       |
  390|   398k|  }  // repeating ``for'' statement compounding support
  391|       |
  392|   133k|  if (!nocompoundtwowords && (!slst.empty()) && onlycompoundsug)
  ------------------
  |  Branch (392:7): [True: 132k, False: 212]
  |  Branch (392:30): [True: 15.6k, False: 117k]
  |  Branch (392:49): [True: 15.6k, False: 0]
  ------------------
  393|  15.6k|    *onlycompoundsug = 1;
  394|       |
  395|   133k|  return good_suggestion;
  396|   133k|}
_ZN10SuggestMgr12capchars_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  401|   152k|                              int cpdsuggest, int& info) {
  402|   152k|  std::vector<w_char> candidate_utf(word);
  403|   152k|  mkallcap_utf(candidate_utf, langnum);
  404|   152k|  std::string candidate;
  405|   152k|  u16_u8(candidate, candidate_utf);
  406|   152k|  testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  407|   152k|}
_ZN10SuggestMgr8capcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  412|   246k|                          int cpdsuggest, int& info) {
  413|   246k|  std::string candidate(word);
  414|   246k|  mkallcap(candidate, csconv);
  415|   246k|  testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  416|   246k|}
_ZN10SuggestMgr8mapcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  421|   399k|                         int cpdsuggest, int& info) {
  422|   399k|  std::string candidate;
  423|   399k|  std::chrono::steady_clock::time_point timelimit;
  424|   399k|  int timer;
  425|       |
  426|   399k|  if (word.size() < 2 || !pAMgr)
  ------------------
  |  Branch (426:7): [True: 34.3k, False: 364k]
  |  Branch (426:26): [True: 0, False: 364k]
  ------------------
  427|  34.3k|    return wlst.size();
  428|       |
  429|   364k|  const std::vector<mapentry>& maptable = pAMgr->get_maptable();
  430|   364k|  if (maptable.empty())
  ------------------
  |  Branch (430:7): [True: 349k, False: 15.0k]
  ------------------
  431|   349k|    return wlst.size();
  432|       |
  433|  15.0k|  timelimit = std::chrono::steady_clock::now();
  434|  15.0k|  timer = MINTIMER;
  ------------------
  |  |  110|  15.0k|#define MINTIMER 100
  ------------------
  435|  15.0k|  return map_related(word, candidate, 0, wlst, cpdsuggest,
  436|  15.0k|                     maptable, &timer, &timelimit, 0, info);
  437|   364k|}
_ZN10SuggestMgr11map_relatedERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERS6_mRNS0_6vectorIS6_NS4_IS6_EEEEiRKNSA_ISC_NS4_ISC_EEEEPiPNS0_6chrono10time_pointINSJ_12steady_clockENSJ_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEEiRi:
  447|  10.7M|                            int depth, int& info) {
  448|  10.7M|  if (word.size() == wn) {
  ------------------
  |  Branch (448:7): [True: 2.71M, False: 8.06M]
  ------------------
  449|  2.71M|    if (candidate == word)
  ------------------
  |  Branch (449:9): [True: 15.0k, False: 2.70M]
  ------------------
  450|  15.0k|      return wlst.size();
  451|  2.70M|    const int cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (451:22): [True: 0, False: 2.70M]
  ------------------
  452|  2.70M|    if ((cwrd) && checkword(candidate, cpdsuggest, timer, timelimit)) {
  ------------------
  |  Branch (452:9): [True: 2.70M, False: 0]
  |  Branch (452:19): [True: 0, False: 2.70M]
  ------------------
  453|      0|      if (wlst.size() < maxSug) {
  ------------------
  |  Branch (453:11): [True: 0, False: 0]
  ------------------
  454|      0|        wlst.push_back(candidate);
  455|      0|      }
  456|      0|    }
  457|  2.70M|    return wlst.size();
  458|  2.71M|  }
  459|       |
  460|  8.06M|  if (depth > 0x3F00) {
  ------------------
  |  Branch (460:7): [True: 0, False: 8.06M]
  ------------------
  461|      0|    *timer = 0;
  462|      0|    return wlst.size();
  463|      0|  }
  464|       |
  465|  8.06M|  int in_map = 0;
  466|  32.2M|  for (size_t j = 0; j < maptable.size(); ++j) {
  ------------------
  |  Branch (466:22): [True: 24.1M, False: 8.06M]
  ------------------
  467|  88.7M|    for (size_t k = 0; k < maptable[j].size(); ++k) {
  ------------------
  |  Branch (467:24): [True: 64.5M, False: 24.1M]
  ------------------
  468|  64.5M|      size_t len = maptable[j][k].size();
  469|  64.5M|      if (len && word.compare(wn, len, maptable[j][k]) == 0) {
  ------------------
  |  Branch (469:11): [True: 64.5M, False: 0]
  |  Branch (469:18): [True: 1.35M, False: 63.1M]
  ------------------
  470|  1.35M|        in_map = 1;
  471|  1.35M|        size_t cn = candidate.size();
  472|  5.40M|        for (size_t l = 0; l < maptable[j].size(); ++l) {
  ------------------
  |  Branch (472:28): [True: 4.05M, False: 1.35M]
  ------------------
  473|  4.05M|          candidate.resize(cn);
  474|  4.05M|          candidate.append(maptable[j][l]);
  475|  4.05M|          map_related(word, candidate, wn + len, wlst,
  476|  4.05M|                           cpdsuggest, maptable, timer, timelimit, depth + 1, info);
  477|  4.05M|          if (!(*timer))
  ------------------
  |  Branch (477:15): [True: 811, False: 4.05M]
  ------------------
  478|    811|            return wlst.size();
  479|  4.05M|          if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS) {
  ------------------
  |  |  108|  4.05M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (479:15): [True: 19, False: 4.05M]
  ------------------
  480|     19|            *timer = 0;
  481|     19|            return wlst.size();
  482|     19|          }
  483|  4.05M|        }
  484|  1.35M|      }
  485|  64.5M|    }
  486|  24.1M|  }
  487|  8.06M|  if (!in_map) {
  ------------------
  |  Branch (487:7): [True: 6.71M, False: 1.35M]
  ------------------
  488|  6.71M|    candidate.push_back(word[wn]);
  489|  6.71M|    map_related(word, candidate, wn + 1, wlst, cpdsuggest,
  490|  6.71M|                maptable, timer, timelimit, depth + 1, info);
  491|  6.71M|  }
  492|  8.06M|  return wlst.size();
  493|  8.06M|}
_ZN10SuggestMgr9replcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  499|   399k|                          int cpdsuggest, int& info) {
  500|   399k|  std::string candidate;
  501|   399k|  int wl = word.size();
  502|   399k|  if (wl < 2 || !pAMgr)
  ------------------
  |  Branch (502:7): [True: 34.3k, False: 364k]
  |  Branch (502:17): [True: 0, False: 364k]
  ------------------
  503|  34.3k|    return wlst.size();
  504|   364k|  const std::vector<replentry>& reptable = pAMgr->get_reptable();
  505|   364k|  auto replchars_start = std::chrono::steady_clock::now();
  506|   364k|  for (const auto& entry : reptable) {
  ------------------
  |  Branch (506:26): [True: 75.7k, False: 364k]
  ------------------
  507|  75.7k|    size_t r = 0;
  508|       |    // search every occurence of the pattern in the word
  509|  76.0k|    while ((r = word.find(entry.pattern, r)) != std::string::npos) {
  ------------------
  |  Branch (509:12): [True: 354, False: 75.7k]
  ------------------
  510|    354|      if (std::chrono::steady_clock::now() - replchars_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|    354|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (510:11): [True: 0, False: 354]
  ------------------
  511|      0|        return wlst.size();
  512|    354|      int type = (r == 0) ? 1 : 0;
  ------------------
  |  Branch (512:18): [True: 6, False: 348]
  ------------------
  513|    354|      if (r + entry.pattern.size() == word.size())
  ------------------
  |  Branch (513:11): [True: 0, False: 354]
  ------------------
  514|      0|        type += 2;
  515|    360|      while (type && entry.outstrings[type].empty())
  ------------------
  |  Branch (515:14): [True: 6, False: 354]
  |  Branch (515:22): [True: 6, False: 0]
  ------------------
  516|      6|        type = (type == 2 && r != 0) ? 0 : type - 1;
  ------------------
  |  Branch (516:17): [True: 0, False: 6]
  |  Branch (516:30): [True: 0, False: 0]
  ------------------
  517|    354|      const std::string&out = entry.outstrings[type];
  518|    354|      if (out.empty()) {
  ------------------
  |  Branch (518:11): [True: 0, False: 354]
  ------------------
  519|      0|        ++r;
  520|      0|        continue;
  521|      0|      }
  522|    354|      candidate.assign(word, 0, r);
  523|    354|      candidate.append(entry.outstrings[type]);
  524|    354|      candidate.append(word, r + entry.pattern.size(), std::string::npos);
  525|    354|      size_t sp = candidate.find(' ');
  526|    354|      size_t oldns = wlst.size();
  527|    354|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  528|    354|      if (oldns < wlst.size()) {
  ------------------
  |  Branch (528:11): [True: 0, False: 354]
  ------------------
  529|       |        // REP suggestions are the best, don't search other type of suggestions
  530|      0|        info |= SPELL_BEST_SUG;
  ------------------
  |  |   89|      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|    354|      if (sp != std::string::npos) {
  ------------------
  |  Branch (534:11): [True: 84, False: 270]
  ------------------
  535|     84|        size_t prev = 0;
  536|    672|        while (sp != std::string::npos) {
  ------------------
  |  Branch (536:16): [True: 588, False: 84]
  ------------------
  537|    588|          std::string prev_chunk = candidate.substr(prev, sp - prev);
  538|    588|          if (checkword(prev_chunk, 0, nullptr, nullptr)) {
  ------------------
  |  Branch (538:15): [True: 0, False: 588]
  ------------------
  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|    588|          prev = sp + 1;
  547|    588|          sp = candidate.find(' ', prev);
  548|    588|        }
  549|     84|      }
  550|    354|      r++;  // search for the next letter
  551|    354|    }
  552|  75.7k|  }
  553|   364k|  return wlst.size();
  554|   364k|}
_ZN10SuggestMgr14doubletwocharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  563|   246k|                               int cpdsuggest, int& info) {
  564|   246k|  size_t wl = word.size();
  565|   246k|  if (wl < 5 || !pAMgr)
  ------------------
  |  Branch (565:7): [True: 51.8k, False: 194k]
  |  Branch (565:17): [True: 0, False: 194k]
  ------------------
  566|  51.8k|    return wlst.size();
  567|       |
  568|   194k|  int state = 0;
  569|  4.82M|  for (size_t i = 2; i < wl; ++i) {
  ------------------
  |  Branch (569:22): [True: 4.62M, False: 194k]
  ------------------
  570|  4.62M|    if (word[i] == word[i - 2]) {
  ------------------
  |  Branch (570:9): [True: 1.25M, False: 3.37M]
  ------------------
  571|  1.25M|      state++;
  572|  1.25M|      if (state == 3 || (state == 2 && i >= 4)) {
  ------------------
  |  Branch (572:11): [True: 6.80k, False: 1.24M]
  |  Branch (572:26): [True: 458k, False: 789k]
  |  Branch (572:40): [True: 449k, False: 9.28k]
  ------------------
  573|   456k|        auto word_iter = word.begin();
  574|   456k|        std::string candidate(word_iter, word_iter + i - 1);
  575|   456k|        candidate.insert(candidate.end(), word_iter + i + 1, word.end());
  576|   456k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  577|   456k|        state = 0;
  578|   456k|      }
  579|  3.37M|    } else {
  580|  3.37M|      state = 0;
  581|  3.37M|    }
  582|  4.62M|  }
  583|   194k|  return wlst.size();
  584|   246k|}
_ZN10SuggestMgr18doubletwochars_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  593|   152k|                                   int cpdsuggest, int& info) {
  594|   152k|  size_t wl = word.size();
  595|   152k|  int state = 0;
  596|   152k|  if (wl < 5 || !pAMgr)
  ------------------
  |  Branch (596:7): [True: 55.0k, False: 97.7k]
  |  Branch (596:17): [True: 0, False: 97.7k]
  ------------------
  597|  55.0k|    return wlst.size();
  598|  1.65M|  for (size_t i = 2; i < wl; ++i) {
  ------------------
  |  Branch (598:22): [True: 1.56M, False: 97.7k]
  ------------------
  599|  1.56M|    if (word[i] == word[i - 2]) {
  ------------------
  |  Branch (599:9): [True: 483k, False: 1.07M]
  ------------------
  600|   483k|      state++;
  601|   483k|      if (state == 3 || (state == 2 && i >= 4)) {
  ------------------
  |  Branch (601:11): [True: 3.83k, False: 480k]
  |  Branch (601:26): [True: 171k, False: 308k]
  |  Branch (601:40): [True: 165k, False: 5.55k]
  ------------------
  602|   169k|        auto word_iter = word.begin();
  603|   169k|        std::vector<w_char> candidate_utf(word_iter, word_iter + i - 1);
  604|   169k|        candidate_utf.insert(candidate_utf.end(), word_iter + i + 1, word.end());
  605|   169k|        std::string candidate;
  606|   169k|        u16_u8(candidate, candidate_utf);
  607|   169k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  608|   169k|        state = 0;
  609|   169k|      }
  610|  1.07M|    } else {
  611|  1.07M|      state = 0;
  612|  1.07M|    }
  613|  1.56M|  }
  614|  97.7k|  return wlst.size();
  615|   152k|}
_ZN10SuggestMgr10badcharkeyERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  621|   246k|                           int cpdsuggest, int& info) {
  622|   246k|  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.38M|  for (size_t i = 0, wl = candidate.size(); i < wl; ++i) {
  ------------------
  |  Branch (626:45): [True: 5.13M, False: 246k]
  ------------------
  627|  5.13M|    char tmpc = candidate[i];
  628|       |    // check with uppercase letters
  629|  5.13M|    candidate[i] = csconv[((unsigned char)tmpc)].cupper;
  630|  5.13M|    if (tmpc != candidate[i]) {
  ------------------
  |  Branch (630:9): [True: 1.27M, False: 3.86M]
  ------------------
  631|  1.27M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  632|  1.27M|      candidate[i] = tmpc;
  633|  1.27M|    }
  634|       |    // check neighbor characters in keyboard string
  635|  5.13M|    if (ckey.empty())
  ------------------
  |  Branch (635:9): [True: 0, False: 5.13M]
  ------------------
  636|      0|      continue;
  637|  5.13M|    size_t loc = 0;
  638|   134M|    while ((loc < ckeyl) && ckey[loc] != tmpc)
  ------------------
  |  Branch (638:12): [True: 130M, False: 4.24M]
  |  Branch (638:29): [True: 129M, False: 892k]
  ------------------
  639|   129M|      ++loc;
  640|  6.07M|    while (loc < ckeyl) {
  ------------------
  |  Branch (640:12): [True: 938k, False: 5.13M]
  ------------------
  641|       |      // a long keyboard string can hold many neighbours for this
  642|       |      // character, so give up once the overall time budget is spent
  643|   938k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   938k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (643:11): [True: 0, False: 938k]
  ------------------
  644|      0|        return wlst.size();
  645|   938k|      if ((loc > 0) && ckey[loc - 1] != '|') {
  ------------------
  |  Branch (645:11): [True: 787k, False: 150k]
  |  Branch (645:24): [True: 761k, False: 26.6k]
  ------------------
  646|   761k|        candidate[i] = ckey[loc - 1];
  647|   761k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  648|   761k|      }
  649|   938k|      if (((loc + 1) < ckeyl) && (ckey[loc + 1] != '|')) {
  ------------------
  |  Branch (649:11): [True: 852k, False: 86.1k]
  |  Branch (649:34): [True: 784k, False: 67.6k]
  ------------------
  650|   784k|        candidate[i] = ckey[loc + 1];
  651|   784k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  652|   784k|      }
  653|  14.4M|      do {
  654|  14.4M|        loc++;
  655|  14.4M|      } while ((loc < ckeyl) && ckey[loc] != tmpc);
  ------------------
  |  Branch (655:16): [True: 13.5M, False: 892k]
  |  Branch (655:33): [True: 13.5M, False: 45.8k]
  ------------------
  656|   938k|    }
  657|  5.13M|    candidate[i] = tmpc;
  658|  5.13M|  }
  659|   246k|  return wlst.size();
  660|   246k|}
_ZN10SuggestMgr14badcharkey_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  666|   152k|                               int cpdsuggest, int& info) {
  667|   152k|  std::string candidate;
  668|   152k|  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.04M|  for (size_t i = 0, wl = word.size(); i < wl; ++i) {
  ------------------
  |  Branch (671:40): [True: 1.89M, False: 152k]
  ------------------
  672|  1.89M|    w_char tmpc = candidate_utf[i];
  673|       |    // check with uppercase letters
  674|  1.89M|    candidate_utf[i] = upper_utf(candidate_utf[i], 1);
  675|  1.89M|    if (tmpc != candidate_utf[i]) {
  ------------------
  |  Branch (675:9): [True: 449k, False: 1.44M]
  ------------------
  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.89M|    if (ckey_utf.empty())
  ------------------
  |  Branch (681:9): [True: 0, False: 1.89M]
  ------------------
  682|      0|      continue;
  683|  1.89M|    size_t loc = 0;
  684|  47.2M|    while ((loc < ckeyl) && ckey_utf[loc] != tmpc)
  ------------------
  |  Branch (684:12): [True: 45.8M, False: 1.43M]
  |  Branch (684:29): [True: 45.3M, False: 464k]
  ------------------
  685|  45.3M|      ++loc;
  686|  2.37M|    while (loc < ckeyl) {
  ------------------
  |  Branch (686:12): [True: 481k, False: 1.89M]
  ------------------
  687|       |      // a long keyboard string can hold many neighbours for this
  688|       |      // character, so give up once the overall time budget is spent
  689|   481k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   481k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (689:11): [True: 0, False: 481k]
  ------------------
  690|      0|        return wlst.size();
  691|   481k|      if ((loc > 0) && ckey_utf[loc - 1] != W_VLINE) {
  ------------------
  |  Branch (691:11): [True: 384k, False: 97.3k]
  |  Branch (691:24): [True: 384k, False: 0]
  ------------------
  692|   384k|        candidate_utf[i] = ckey_utf[loc - 1];
  693|   384k|        u16_u8(candidate, candidate_utf);
  694|   384k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  695|   384k|      }
  696|   481k|      if (((loc + 1) < ckeyl) && (ckey_utf[loc + 1] != W_VLINE)) {
  ------------------
  |  Branch (696:11): [True: 432k, False: 48.9k]
  |  Branch (696:34): [True: 432k, False: 0]
  ------------------
  697|   432k|        candidate_utf[i] = ckey_utf[loc + 1];
  698|   432k|        u16_u8(candidate, candidate_utf);
  699|   432k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  700|   432k|      }
  701|  7.70M|      do {
  702|  7.70M|        loc++;
  703|  7.70M|      } while ((loc < ckeyl) && ckey_utf[loc] != tmpc);
  ------------------
  |  Branch (703:16): [True: 7.23M, False: 464k]
  |  Branch (703:33): [True: 7.22M, False: 17.2k]
  ------------------
  704|   481k|    }
  705|  1.89M|    candidate_utf[i] = tmpc;
  706|  1.89M|  }
  707|   152k|  return wlst.size();
  708|   152k|}
_ZN10SuggestMgr7badcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  713|   246k|                               int cpdsuggest, int& info) {
  714|   246k|  std::string candidate(word);
  715|   246k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  716|   246k|  int timer = MINTIMER;
  ------------------
  |  |  110|   246k|#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|   246k|  for (size_t j = 0; j < ctryl; ++j) {
  ------------------
  |  Branch (719:22): [True: 0, False: 246k]
  ------------------
  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|   246k|  return wlst.size();
  732|   246k|}
_ZN10SuggestMgr11badchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  737|   152k|                            int cpdsuggest, int& info) {
  738|   152k|  std::vector<w_char> candidate_utf(word);
  739|   152k|  std::string candidate;
  740|   152k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  741|   152k|  int timer = MINTIMER;
  ------------------
  |  |  110|   152k|#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|   170k|  for (size_t j = 0; j < ctryl; ++j) {
  ------------------
  |  Branch (744:22): [True: 17.6k, False: 152k]
  ------------------
  745|   240k|    for (auto aI = candidate_utf.rbegin(), aEnd = candidate_utf.rend(); aI != aEnd; ++aI) {
  ------------------
  |  Branch (745:73): [True: 222k, False: 17.6k]
  ------------------
  746|   222k|      w_char tmpc = *aI;
  747|   222k|      if (tmpc == ctry_utf[j])
  ------------------
  |  Branch (747:11): [True: 0, False: 222k]
  ------------------
  748|      0|        continue;
  749|   222k|      *aI = ctry_utf[j];
  750|   222k|      u16_u8(candidate, candidate_utf);
  751|   222k|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  752|   222k|      if (!timer)
  ------------------
  |  Branch (752:11): [True: 0, False: 222k]
  ------------------
  753|      0|        return wlst.size();
  754|   222k|      *aI = tmpc;
  755|   222k|    }
  756|  17.6k|  }
  757|   152k|  return wlst.size();
  758|   152k|}
_ZN10SuggestMgr13extrachar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  763|   152k|                              int cpdsuggest, int& info) {
  764|   152k|  std::vector<w_char> candidate_utf(word);
  765|   152k|  if (candidate_utf.size() < 2)
  ------------------
  |  Branch (765:7): [True: 16.5k, False: 136k]
  ------------------
  766|  16.5k|    return wlst.size();
  767|       |  // try omitting one char of word at a time
  768|  2.01M|  for (size_t i = 0; i < candidate_utf.size(); ++i) {
  ------------------
  |  Branch (768:22): [True: 1.87M, False: 136k]
  ------------------
  769|  1.87M|    size_t index = candidate_utf.size() - 1 - i;
  770|  1.87M|    w_char tmpc = candidate_utf[index];
  771|  1.87M|    candidate_utf.erase(candidate_utf.begin() + index);
  772|  1.87M|    std::string candidate;
  773|  1.87M|    u16_u8(candidate, candidate_utf);
  774|  1.87M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  775|  1.87M|    candidate_utf.insert(candidate_utf.begin() + index, tmpc);
  776|  1.87M|  }
  777|   136k|  return wlst.size();
  778|   152k|}
_ZN10SuggestMgr9extracharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  783|   246k|                          int cpdsuggest, int& info) {
  784|   246k|  std::string candidate(word);
  785|   246k|  if (candidate.size() < 2)
  ------------------
  |  Branch (785:7): [True: 18.3k, False: 227k]
  ------------------
  786|  18.3k|    return wlst.size();
  787|       |  // try omitting one char of word at a time
  788|  5.34M|  for (size_t i = 0; i < candidate.size(); ++i) {
  ------------------
  |  Branch (788:22): [True: 5.11M, False: 227k]
  ------------------
  789|  5.11M|    size_t index = candidate.size() - 1 - i;
  790|  5.11M|    char tmpc = candidate[index];
  791|  5.11M|    candidate.erase(candidate.begin() + index);
  792|  5.11M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  793|  5.11M|    candidate.insert(candidate.begin() + index, tmpc);
  794|  5.11M|  }
  795|   227k|  return wlst.size();
  796|   246k|}
_ZN10SuggestMgr10forgotcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  801|   246k|                           int cpdsuggest, int& info) {
  802|   246k|  std::string candidate(word);
  803|   246k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  804|   246k|  int timer = MINTIMER;
  ------------------
  |  |  110|   246k|#define MINTIMER 100
  ------------------
  805|       |
  806|       |  // try inserting a tryme character before every letter (and the null
  807|       |  // terminator)
  808|   246k|  for (size_t k = 0; k < ctryl; ++k) {
  ------------------
  |  Branch (808:22): [True: 0, False: 246k]
  ------------------
  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|   246k|  return wlst.size();
  819|   246k|}
_ZN10SuggestMgr14forgotchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  824|   152k|                               int cpdsuggest, int& info) {
  825|   152k|  std::vector<w_char> candidate_utf(word);
  826|   152k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  827|   152k|  int timer = MINTIMER;
  ------------------
  |  |  110|   152k|#define MINTIMER 100
  ------------------
  828|       |
  829|       |  // try inserting a tryme character at the end of the word and before every
  830|       |  // letter
  831|   170k|  for (size_t k = 0; k < ctryl; ++k) {
  ------------------
  |  Branch (831:22): [True: 17.6k, False: 152k]
  ------------------
  832|   258k|    for (size_t i = 0; i <= candidate_utf.size(); ++i) {
  ------------------
  |  Branch (832:24): [True: 240k, False: 17.6k]
  ------------------
  833|   240k|      size_t index = candidate_utf.size() - i;
  834|   240k|      candidate_utf.insert(candidate_utf.begin() + index, ctry_utf[k]);
  835|   240k|      std::string candidate;
  836|   240k|      u16_u8(candidate, candidate_utf);
  837|   240k|      testsug(wlst, candidate, cpdsuggest, &timer, &timelimit, info);
  838|   240k|      if (!timer)
  ------------------
  |  Branch (838:11): [True: 0, False: 240k]
  ------------------
  839|      0|        return wlst.size();
  840|   240k|      candidate_utf.erase(candidate_utf.begin() + index);
  841|   240k|    }
  842|  17.6k|  }
  843|   152k|  return wlst.size();
  844|   152k|}
_ZN10SuggestMgr8twowordsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_ibRi:
  854|   399k|                         bool good, int& info) {
  855|   399k|  int c2, forbidden = 0, cwrd, wl = word.size();
  856|   399k|  if (wl < 3)
  ------------------
  |  Branch (856:7): [True: 54.8k, False: 344k]
  ------------------
  857|  54.8k|    return false;
  858|       |
  859|   344k|  if (langnum == LANG_hu)
  ------------------
  |  Branch (859:7): [True: 14.2k, False: 329k]
  ------------------
  860|  14.2k|    forbidden = check_forbidden(word);
  861|       |
  862|   344k|  char* candidate = new char[wl + 2];
  863|   344k|  memcpy(candidate + 1, word.data(), wl);
  864|   344k|  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.66M|  for (char* p = candidate + 1; p[1] != '\0'; p++) {
  ------------------
  |  Branch (868:33): [True: 4.35M, False: 308k]
  ------------------
  869|  4.35M|    p[-1] = *p;
  870|       |    // go to end of the UTF-8 character
  871|  4.59M|    while (utf8 && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (871:12): [True: 1.51M, False: 3.07M]
  |  Branch (871:20): [True: 236k, False: 1.27M]
  ------------------
  872|   236k|      *p = p[1];
  873|   236k|      p++;
  874|   236k|    }
  875|  4.35M|    if (utf8 && p[1] == '\0')
  ------------------
  |  Branch (875:9): [True: 1.27M, False: 3.07M]
  |  Branch (875:17): [True: 35.4k, False: 1.24M]
  ------------------
  876|  35.4k|      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.32M|    *p = ' ';
  886|  4.32M|    if (!cpdsuggest && checkword(candidate, cpdsuggest, nullptr, nullptr)) {
  ------------------
  |  Branch (886:9): [True: 1.44M, False: 2.87M]
  |  Branch (886:9): [True: 1.19k, False: 4.31M]
  |  Branch (886:24): [True: 1.19k, False: 1.44M]
  ------------------
  887|       |      // best solution
  888|  1.19k|      info |= SPELL_BEST_SUG;
  ------------------
  |  |   89|  1.19k|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  889|       |
  890|       |      // remove not word pair suggestions
  891|  1.19k|      if (!good) {
  ------------------
  |  Branch (891:11): [True: 121, False: 1.07k]
  ------------------
  892|    121|        good = true;
  893|    121|        wlst.clear();
  894|    121|      }
  895|       |
  896|  1.19k|      wlst.insert(wlst.begin(), candidate);
  897|  1.19k|    }
  898|       |
  899|       |    // word pairs with dash?
  900|  4.32M|    if (lang_with_dash_usage) {
  ------------------
  |  Branch (900:9): [True: 0, False: 4.32M]
  ------------------
  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;
  ------------------
  |  |   89|      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.32M|    if (wlst.size() < maxSug && !nosplitsugs && !good) {
  ------------------
  |  Branch (916:9): [True: 4.31M, False: 292]
  |  Branch (916:33): [True: 4.31M, False: 0]
  |  Branch (916:49): [True: 4.31M, False: 906]
  ------------------
  917|  4.31M|      *p = '\0';
  918|  4.31M|      int c1 = checkword(candidate, cpdsuggest, nullptr, nullptr);
  919|  4.31M|      if (c1) {
  ------------------
  |  Branch (919:11): [True: 22.7k, False: 4.29M]
  ------------------
  920|  22.7k|        c2 = checkword((p + 1), cpdsuggest, nullptr, nullptr);
  921|  22.7k|        if (c2) {
  ------------------
  |  Branch (921:13): [True: 789, False: 21.9k]
  ------------------
  922|       |          // spec. Hungarian code (TODO need a better compound word support)
  923|    789|          if ((langnum == LANG_hu) && !forbidden &&
  ------------------
  |  Branch (923:15): [True: 19, False: 770]
  |  Branch (923:39): [True: 19, False: 0]
  ------------------
  924|       |              // if 3 repeating letter, use - instead of space
  925|     19|              (((p[-1] == p[1]) &&
  ------------------
  |  Branch (925:17): [True: 4, False: 15]
  ------------------
  926|      4|              (((p > candidate + 1) && (p[-1] == p[-2])) || (p[-1] == p[2]))) ||
  ------------------
  |  Branch (926:17): [True: 0, False: 4]
  |  Branch (926:40): [True: 0, False: 0]
  |  Branch (926:61): [True: 0, False: 4]
  ------------------
  927|       |              // or multiple compounding, with more, than 6 syllables
  928|     19|              ((c1 == 3) && (c2 >= 2))))
  ------------------
  |  Branch (928:16): [True: 0, False: 19]
  |  Branch (928:29): [True: 0, False: 0]
  ------------------
  929|      0|            *p = '-';
  930|    789|          else
  931|    789|            *p = ' ';
  932|       |
  933|    789|          cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (933:18): [True: 53, False: 736]
  ------------------
  934|       |
  935|    789|          if (cwrd && (wlst.size() < maxSug))
  ------------------
  |  Branch (935:15): [True: 736, False: 53]
  |  Branch (935:23): [True: 736, False: 0]
  ------------------
  936|    736|              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|    789|          if ( !nosplitsugs && lang_with_dash_usage &&
  ------------------
  |  Branch (940:16): [True: 789, False: 0]
  |  Branch (940:32): [True: 0, False: 789]
  ------------------
  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|    789|        }
  954|  22.7k|      }
  955|  4.31M|    }
  956|  4.32M|  }
  957|   344k|  delete[] candidate;
  958|   344k|  return good;
  959|   399k|}
_ZN10SuggestMgr8swapcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  964|   246k|                         int cpdsuggest, int& info) {
  965|   246k|  if (word.size() < 2)
  ------------------
  |  Branch (965:7): [True: 18.3k, False: 227k]
  ------------------
  966|  18.3k|    return wlst.size();
  967|       |
  968|   227k|  std::string candidate(word);
  969|       |
  970|       |  // try swapping adjacent chars one by one
  971|  5.11M|  for (size_t i = 0; i < candidate.size() - 1; ++i) {
  ------------------
  |  Branch (971:22): [True: 4.89M, False: 227k]
  ------------------
  972|  4.89M|    std::swap(candidate[i], candidate[i+1]);
  973|  4.89M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  974|  4.89M|    std::swap(candidate[i], candidate[i+1]);
  975|  4.89M|  }
  976|       |
  977|       |  // try double swaps for short words
  978|       |  // ahev -> have, owudl -> would
  979|   227k|  if (candidate.size() == 4 || candidate.size() == 5) {
  ------------------
  |  Branch (979:7): [True: 13.6k, False: 214k]
  |  Branch (979:32): [True: 9.07k, False: 205k]
  ------------------
  980|  22.7k|    candidate[0] = word[1];
  981|  22.7k|    candidate[1] = word[0];
  982|  22.7k|    candidate[2] = word[2];
  983|  22.7k|    candidate[candidate.size() - 2] = word[candidate.size() - 1];
  984|  22.7k|    candidate[candidate.size() - 1] = word[candidate.size() - 2];
  985|  22.7k|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  986|  22.7k|    if (candidate.size() == 5) {
  ------------------
  |  Branch (986:9): [True: 9.07k, False: 13.6k]
  ------------------
  987|  9.07k|      candidate[0] = word[0];
  988|  9.07k|      candidate[1] = word[2];
  989|  9.07k|      candidate[2] = word[1];
  990|  9.07k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  991|  9.07k|    }
  992|  22.7k|  }
  993|       |
  994|   227k|  return wlst.size();
  995|   246k|}
_ZN10SuggestMgr12swapchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1000|   152k|                             int cpdsuggest, int& info) {
 1001|   152k|  if (word.size() < 2)
  ------------------
  |  Branch (1001:7): [True: 16.5k, False: 136k]
  ------------------
 1002|  16.5k|    return wlst.size();
 1003|       |
 1004|   136k|  std::vector<w_char> candidate_utf(word);
 1005|       |
 1006|   136k|  std::string candidate;
 1007|       |  // try swapping adjacent chars one by one
 1008|  1.87M|  for (size_t i = 0; i < candidate_utf.size() - 1; ++i) {
  ------------------
  |  Branch (1008:22): [True: 1.74M, False: 136k]
  ------------------
 1009|  1.74M|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|  1.74M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (1009:9): [True: 0, False: 1.74M]
  ------------------
 1010|      0|      return wlst.size();
 1011|  1.74M|    std::swap(candidate_utf[i], candidate_utf[i+1]);
 1012|  1.74M|    u16_u8(candidate, candidate_utf);
 1013|  1.74M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1014|  1.74M|    std::swap(candidate_utf[i], candidate_utf[i+1]);
 1015|  1.74M|  }
 1016|       |
 1017|       |  // try double swaps for short words
 1018|       |  // ahev -> have, owudl -> would, suodn -> sound
 1019|   136k|  if (candidate_utf.size() == 4 || candidate_utf.size() == 5) {
  ------------------
  |  Branch (1019:7): [True: 18.7k, False: 117k]
  |  Branch (1019:36): [True: 9.92k, False: 107k]
  ------------------
 1020|  28.6k|    candidate_utf[0] = word[1];
 1021|  28.6k|    candidate_utf[1] = word[0];
 1022|  28.6k|    candidate_utf[2] = word[2];
 1023|  28.6k|    candidate_utf[candidate_utf.size() - 2] = word[candidate_utf.size() - 1];
 1024|  28.6k|    candidate_utf[candidate_utf.size() - 1] = word[candidate_utf.size() - 2];
 1025|  28.6k|    u16_u8(candidate, candidate_utf);
 1026|  28.6k|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1027|  28.6k|    if (candidate_utf.size() == 5) {
  ------------------
  |  Branch (1027:9): [True: 9.92k, False: 18.7k]
  ------------------
 1028|  9.92k|      candidate_utf[0] = word[0];
 1029|  9.92k|      candidate_utf[1] = word[2];
 1030|  9.92k|      candidate_utf[2] = word[1];
 1031|  9.92k|      u16_u8(candidate, candidate_utf);
 1032|  9.92k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1033|  9.92k|    }
 1034|  28.6k|  }
 1035|   136k|  return wlst.size();
 1036|   136k|}
_ZN10SuggestMgr12longswapcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
 1041|   246k|                             int cpdsuggest, int& info) {
 1042|   246k|  std::string candidate(word);
 1043|       |  // try swapping not adjacent chars one by one
 1044|  5.38M|  for (auto p = candidate.begin(); p < candidate.end(); ++p) {
  ------------------
  |  Branch (1044:36): [True: 5.13M, False: 246k]
  ------------------
 1045|   193M|    for (auto q = candidate.begin(); q < candidate.end(); ++q) {
  ------------------
  |  Branch (1045:38): [True: 188M, False: 5.13M]
  ------------------
 1046|   188M|      const auto distance = std::abs(std::distance(q, p));
 1047|   188M|      if (distance > 1 && distance <= MAX_CHAR_DISTANCE && *p != *q) {
  ------------------
  |  |   84|   361M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1047:11): [True: 173M, False: 14.9M]
  |  Branch (1047:27): [True: 26.6M, False: 146M]
  |  Branch (1047:60): [True: 19.8M, False: 6.82M]
  ------------------
 1048|  19.8M|        std::swap(*p, *q);
 1049|  19.8M|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1050|  19.8M|        std::swap(*p, *q);
 1051|  19.8M|      }
 1052|   188M|    }
 1053|  5.13M|  }
 1054|   246k|  return wlst.size();
 1055|   246k|}
_ZN10SuggestMgr16longswapchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1060|   152k|                                 int cpdsuggest, int& info) {
 1061|   152k|  std::vector<w_char> candidate_utf(word);
 1062|       |  // try swapping not adjacent chars
 1063|  2.04M|  for (auto p = candidate_utf.begin(); p < candidate_utf.end(); ++p) {
  ------------------
  |  Branch (1063:40): [True: 1.89M, False: 152k]
  ------------------
 1064|  53.9M|    for (auto q = candidate_utf.begin(); q < candidate_utf.end(); ++q) {
  ------------------
  |  Branch (1064:42): [True: 52.0M, False: 1.89M]
  ------------------
 1065|  52.0M|      const auto distance = std::abs(std::distance(q, p));
 1066|  52.0M|      if (distance > 1 && distance <= MAX_CHAR_DISTANCE && *p != *q) {
  ------------------
  |  |   84|  98.7M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1066:11): [True: 46.6M, False: 5.38M]
  |  Branch (1066:27): [True: 8.90M, False: 37.7M]
  |  Branch (1066:60): [True: 6.24M, False: 2.65M]
  ------------------
 1067|  6.24M|        std::swap(*p, *q);
 1068|  6.24M|        std::string candidate;
 1069|  6.24M|        u16_u8(candidate, candidate_utf);
 1070|  6.24M|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1071|  6.24M|        std::swap(*p, *q);
 1072|  6.24M|      }
 1073|  52.0M|    }
 1074|  1.89M|  }
 1075|   152k|  return wlst.size();
 1076|   152k|}
_ZN10SuggestMgr8movecharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
 1081|   246k|                         int cpdsuggest, int& info) {
 1082|   246k|  if (word.size() < 2)
  ------------------
  |  Branch (1082:7): [True: 18.3k, False: 227k]
  ------------------
 1083|  18.3k|    return wlst.size();
 1084|       |
 1085|   227k|  std::string candidate(word);
 1086|       |
 1087|       |  // try moving a char
 1088|  5.34M|  for (auto p = candidate.begin(); p < candidate.end(); ++p) {
  ------------------
  |  Branch (1088:36): [True: 5.11M, False: 227k]
  ------------------
 1089|  23.3M|    for (auto q = p + 1; q < candidate.end() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  22.2M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1089:26): [True: 22.2M, False: 1.07M]
  |  Branch (1089:26): [True: 18.2M, False: 5.11M]
  |  Branch (1089:49): [True: 18.2M, False: 4.04M]
  ------------------
 1090|  18.2M|      std::swap(*q, *(q - 1));
 1091|  18.2M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1091:11): [True: 4.89M, False: 13.3M]
  ------------------
 1092|  4.89M|        continue;  // omit swap char
 1093|  13.3M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1094|  13.3M|    }
 1095|  5.11M|    const auto word_iter = word.begin();
 1096|  5.11M|    std::copy_n(word_iter, candidate.size(), candidate.begin());
 1097|  5.11M|  }
 1098|       |
 1099|  5.11M|  for (auto p = candidate.rbegin(), pEnd = candidate.rend() - 1; p != pEnd; ++p) {
  ------------------
  |  Branch (1099:66): [True: 4.89M, False: 227k]
  ------------------
 1100|  23.1M|    for (auto q = p + 1, qEnd = candidate.rend(); q != qEnd && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  22.2M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1100:51): [True: 22.2M, False: 846k]
  |  Branch (1100:64): [True: 18.2M, False: 4.04M]
  ------------------
 1101|  18.2M|      std::swap(*q, *(q - 1));
 1102|  18.2M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1102:11): [True: 4.89M, False: 13.3M]
  ------------------
 1103|  4.89M|        continue;  // omit swap char
 1104|  13.3M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1105|  13.3M|    }
 1106|  4.89M|    const auto word_iter = word.begin();
 1107|  4.89M|    std::copy_n(word_iter, candidate.size(), candidate.begin());
 1108|  4.89M|  }
 1109|       |
 1110|   227k|  return wlst.size();
 1111|   246k|}
_ZN10SuggestMgr12movechar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1116|   152k|                             int cpdsuggest, int& info) {
 1117|   152k|  if (word.size() < 2)
  ------------------
  |  Branch (1117:7): [True: 16.5k, False: 136k]
  ------------------
 1118|  16.5k|    return wlst.size();
 1119|       |
 1120|   136k|  std::vector<w_char> candidate_utf(word);
 1121|       |
 1122|       |  // try moving a char
 1123|  2.01M|  for (auto p = candidate_utf.begin(); p < candidate_utf.end(); ++p) {
  ------------------
  |  Branch (1123:40): [True: 1.87M, False: 136k]
  ------------------
 1124|  8.07M|    for (auto q = p + 1; q < candidate_utf.end() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  7.46M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1124:26): [True: 7.46M, False: 611k]
  |  Branch (1124:26): [True: 6.19M, False: 1.87M]
  |  Branch (1124:53): [True: 6.19M, False: 1.26M]
  ------------------
 1125|  6.19M|      std::swap(*q, *(q - 1));
 1126|  6.19M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1126:11): [True: 1.74M, False: 4.45M]
  ------------------
 1127|  1.74M|        continue;  // omit swap char
 1128|  4.45M|      std::string candidate;
 1129|  4.45M|      u16_u8(candidate, candidate_utf);
 1130|  4.45M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1131|  4.45M|    }
 1132|  1.87M|    const auto word_iter = word.begin();
 1133|  1.87M|    std::copy_n(word_iter, candidate_utf.size(), candidate_utf.begin());
 1134|  1.87M|  }
 1135|       |
 1136|  2.01M|  for (auto p = candidate_utf.rbegin(); p < candidate_utf.rend(); ++p) {
  ------------------
  |  Branch (1136:41): [True: 1.87M, False: 136k]
  ------------------
 1137|  8.07M|    for (auto q = p + 1; q < candidate_utf.rend() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  7.46M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1137:26): [True: 7.46M, False: 611k]
  |  Branch (1137:26): [True: 6.19M, False: 1.87M]
  |  Branch (1137:54): [True: 6.19M, False: 1.26M]
  ------------------
 1138|  6.19M|      std::swap(*q, *(q - 1));
 1139|  6.19M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1139:11): [True: 1.74M, False: 4.45M]
  ------------------
 1140|  1.74M|        continue;  // omit swap char
 1141|  4.45M|      std::string candidate;
 1142|  4.45M|      u16_u8(candidate, candidate_utf);
 1143|  4.45M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1144|  4.45M|    }
 1145|  1.87M|    const auto word_iter = word.begin();
 1146|  1.87M|    std::copy_n(word_iter, candidate_utf.size(), candidate_utf.begin());
 1147|  1.87M|  }
 1148|       |
 1149|   136k|  return wlst.size();
 1150|   152k|}
_ZN10SuggestMgr9ngsuggestERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEEPKcRKNS1_INS0_10unique_ptrI7HashMgrNS0_14default_deleteISE_EEEENS5_ISH_EEEEi:
 1185|  59.5k|                          int captype) {
 1186|  59.5k|  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|  59.5k|  struct hentry* roots[MAX_ROOTS];
 1191|  59.5k|  char* rootsphon[MAX_ROOTS];
 1192|  59.5k|  int scores[MAX_ROOTS];
 1193|  59.5k|  int scoresphon[MAX_ROOTS];
 1194|  6.01M|  for (int i = 0; i < MAX_ROOTS; i++) {
  ------------------
  |  |   74|  6.01M|#define MAX_ROOTS 100
  ------------------
  |  Branch (1194:19): [True: 5.95M, False: 59.5k]
  ------------------
 1195|  5.95M|    roots[i] = nullptr;
 1196|  5.95M|    scores[i] = -100 * i;
 1197|  5.95M|    rootsphon[i] = nullptr;
 1198|  5.95M|    scoresphon[i] = -100 * i;
 1199|  5.95M|  }
 1200|  59.5k|  bool has_roots = false;
 1201|  59.5k|  bool has_rootsphon = false;
 1202|  59.5k|  lp = MAX_ROOTS - 1;
  ------------------
  |  |   74|  59.5k|#define MAX_ROOTS 100
  ------------------
 1203|  59.5k|  lpphon = MAX_ROOTS - 1;
  ------------------
  |  |   74|  59.5k|#define MAX_ROOTS 100
  ------------------
 1204|  59.5k|  int low = NGRAM_LOWERING;
  ------------------
  |  |   83|  59.5k|#define NGRAM_LOWERING (1 << 2)
  ------------------
 1205|       |
 1206|  59.5k|  std::string w2;
 1207|  59.5k|  const char* word = w;
 1208|       |
 1209|  59.5k|  int nc;
 1210|       |  // word reversing wrapper for complex prefixes
 1211|  59.5k|  if (complexprefixes) {
  ------------------
  |  Branch (1211:7): [True: 3.35k, False: 56.2k]
  ------------------
 1212|  3.35k|    w2.assign(w);
 1213|  3.35k|    if (utf8)
  ------------------
  |  Branch (1213:9): [True: 0, False: 3.35k]
  ------------------
 1214|      0|      reverseword_utf(w2);
 1215|  3.35k|    else
 1216|  3.35k|      reverseword(w2);
 1217|  3.35k|    word = w2.c_str();
 1218|  3.35k|    nc = (int)w2.size();
 1219|  56.2k|  } else {
 1220|  56.2k|    nc = (int)strlen(word);
 1221|  56.2k|  }
 1222|       |
 1223|  59.5k|  std::vector<w_char> u8;
 1224|  59.5k|  int n = (utf8) ? u8_u16(u8, word) : nc;
  ------------------
  |  Branch (1224:11): [True: 25.2k, False: 34.3k]
  ------------------
 1225|       |
 1226|       |  // set character based ngram suggestion for words with non-BMP Unicode
 1227|       |  // characters
 1228|  59.5k|  const struct cs_info* origconv = csconv;
 1229|  59.5k|  if (n == -1) {
  ------------------
  |  Branch (1229:7): [True: 1.72k, False: 57.8k]
  ------------------
 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|  59.5k|  ngsuggest_guard restore_state(nonbmp, origconv, &utf8, &csconv);
 1238|  59.5k|  int max_word_len = (utf8) ? MAXWORDUTF8LEN : MAXWORDLEN;
  ------------------
  |  |   85|  23.5k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  23.5k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                int max_word_len = (utf8) ? MAXWORDUTF8LEN : MAXWORDLEN;
  ------------------
  |  |   90|  36.0k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1238:22): [True: 23.5k, False: 36.0k]
  ------------------
 1239|       |  // ofz#59067 a replist entry can generate a very long word, abandon
 1240|       |  // ngram if that odd-edge case arises
 1241|  59.5k|  if (n > max_word_len * 4)
  ------------------
  |  Branch (1241:7): [True: 0, False: 59.5k]
  ------------------
 1242|      0|      return;
 1243|       |
 1244|  59.5k|  struct hentry* hp = nullptr;
 1245|  59.5k|  int col = -1;
 1246|  59.5k|  phonetable* ph = (pAMgr) ? pAMgr->get_phonetable() : nullptr;
  ------------------
  |  Branch (1246:20): [True: 59.5k, False: 0]
  ------------------
 1247|  59.5k|  std::string target;
 1248|  59.5k|  std::string candidate;
 1249|  59.5k|  std::vector<w_char> w_candidate;
 1250|  59.5k|  if (ph) {
  ------------------
  |  Branch (1250:7): [True: 3.38k, False: 56.1k]
  ------------------
 1251|  3.38k|    if (utf8) {
  ------------------
  |  Branch (1251:9): [True: 0, False: 3.38k]
  ------------------
 1252|      0|      u8_u16(w_candidate, word);
 1253|      0|      mkallcap_utf(w_candidate, langnum);
 1254|      0|      u16_u8(candidate, w_candidate);
 1255|  3.38k|    } else {
 1256|  3.38k|      candidate.assign(word);
 1257|  3.38k|      if (!nonbmp)
  ------------------
  |  Branch (1257:11): [True: 3.38k, False: 0]
  ------------------
 1258|  3.38k|        mkallcap(candidate, csconv);
 1259|  3.38k|    }
 1260|  3.38k|    target = phonet(candidate, *ph);  // XXX phonet() is 8-bit (nc, not n)
 1261|  3.38k|  }
 1262|       |
 1263|  59.5k|  FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL;
  ------------------
  |  |   98|  59.5k|#define FLAG unsigned short
  ------------------
                FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL;
  ------------------
  |  |   99|  59.5k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1263:24): [True: 59.5k, False: 0]
  ------------------
 1264|  59.5k|  FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL;
  ------------------
  |  |   98|  59.5k|#define FLAG unsigned short
  ------------------
                FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL;
  ------------------
  |  |   99|  59.5k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1264:20): [True: 59.5k, False: 0]
  ------------------
 1265|  59.5k|  FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL;
  ------------------
  |  |   98|  59.5k|#define FLAG unsigned short
  ------------------
                FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL;
  ------------------
  |  |   99|  59.5k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1265:25): [True: 59.5k, False: 0]
  ------------------
 1266|  59.5k|  FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL;
  ------------------
  |  |   98|  59.5k|#define FLAG unsigned short
  ------------------
                FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL;
  ------------------
  |  |   99|  59.5k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1266:25): [True: 59.5k, False: 0]
  ------------------
 1267|       |
 1268|  59.5k|  std::vector<w_char> w_word, w_target;
 1269|  59.5k|  if (utf8) {
  ------------------
  |  Branch (1269:7): [True: 23.5k, False: 36.0k]
  ------------------
 1270|  23.5k|    u8_u16(w_word, word);
 1271|  23.5k|    u8_u16(w_target, target);
 1272|  23.5k|  }
 1273|       |
 1274|  59.5k|  std::string f;
 1275|  59.5k|  std::vector<w_char> w_f;
 1276|       |
 1277|  59.5k|  for (const auto& i : rHMgr) {
  ------------------
  |  Branch (1277:22): [True: 59.5k, False: 59.5k]
  ------------------
 1278|  1.80M|    while (nullptr != (hp = i->walk_hashtable(col, hp))) {
  ------------------
  |  Branch (1278:12): [True: 1.74M, False: 59.5k]
  ------------------
 1279|       |      // skip exceptions
 1280|  1.74M|      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.74M|           (((abs(n - hp->clen) > 4) && !nonbmp)) ||
  ------------------
  |  Branch (1284:12): [True: 1.21M, False: 527k]
  |  Branch (1284:14): [True: 1.13M, False: 611k]
  |  Branch (1284:41): [True: 1.08M, False: 46.6k]
  ------------------
 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|   658k|           ((captype == NOCAP) && (hp->var & H_OPT_INITCAP) &&
  ------------------
  |  |   92|   658k|#define NOCAP 0
  ------------------
                         ((captype == NOCAP) && (hp->var & H_OPT_INITCAP) &&
  ------------------
  |  |   50|   162k|#define H_OPT_INITCAP (1 << 3)  // is dictionary word capitalized?
  ------------------
  |  Branch (1291:13): [True: 162k, False: 495k]
  |  Branch (1291:35): [True: 67.3k, False: 95.3k]
  ------------------
 1292|  67.3k|              !ph && (langnum != LANG_de) && !(hp->var & H_OPT_PHON)) ||
  ------------------
  |  |   49|  65.6k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  |  Branch (1292:15): [True: 65.6k, False: 1.66k]
  |  Branch (1292:22): [True: 65.6k, False: 0]
  |  Branch (1292:46): [True: 65.6k, False: 0]
  ------------------
 1293|       |           // or it has one of the following special flags
 1294|   592k|           ((hp->astr) && (pAMgr) &&
  ------------------
  |  Branch (1294:13): [True: 156k, False: 436k]
  |  Branch (1294:27): [True: 156k, False: 0]
  ------------------
 1295|   156k|             (TESTAFF(hp->astr, forbiddenword, hp->alen) ||
  ------------------
  |  |  102|   312k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 2.00k, False: 154k]
  |  |  ------------------
  ------------------
 1296|   154k|             TESTAFF(hp->astr, ONLYUPCASEFLAG, hp->alen) ||
  ------------------
  |  |  102|   310k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 62.6k, False: 91.7k]
  |  |  ------------------
  ------------------
 1297|  91.7k|             TESTAFF(hp->astr, nosuggest, hp->alen) ||
  ------------------
  |  |  102|   248k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 91.7k]
  |  |  ------------------
  ------------------
 1298|  91.7k|             TESTAFF(hp->astr, nongramsuggest, hp->alen) ||
  ------------------
  |  |  102|   248k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 91.7k]
  |  |  ------------------
  ------------------
 1299|  91.7k|             TESTAFF(hp->astr, onlyincompound, hp->alen)))
  ------------------
  |  |  102|  91.7k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 91.7k]
  |  |  ------------------
  ------------------
 1300|  1.74M|         )
 1301|  1.21M|        continue;
 1302|       |
 1303|   527k|      if (utf8) {
  ------------------
  |  Branch (1303:11): [True: 252k, False: 275k]
  ------------------
 1304|   252k|        u8_u16(w_f, HENTRY_WORD(hp));
  ------------------
  |  |   54|   252k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1305|       |
 1306|   252k|        int leftcommon = leftcommonsubstring(w_word, w_f);
 1307|   252k|        if (low) {
  ------------------
  |  Branch (1307:13): [True: 252k, False: 0]
  ------------------
 1308|       |          // lowering dictionary word
 1309|   252k|          mkallsmall_utf(w_f, langnum);
 1310|   252k|        }
 1311|   252k|        sc = ngram(3, w_word, w_f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|   252k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1312|   275k|      } else {
 1313|   275k|        f.assign(HENTRY_WORD(hp));
  ------------------
  |  |   54|   275k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1314|       |
 1315|   275k|        int leftcommon = leftcommonsubstring(word, f.c_str());
 1316|   275k|        if (low) {
  ------------------
  |  Branch (1316:13): [True: 252k, False: 23.2k]
  ------------------
 1317|       |          // lowering dictionary word
 1318|   252k|          mkallsmall(f, csconv);
 1319|   252k|        }
 1320|   275k|        sc = ngram(3, word, f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|   275k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1321|   275k|      }
 1322|       |
 1323|       |      // check special pronunciation
 1324|   527k|      f.clear();
 1325|   527k|      if ((hp->var & H_OPT_PHON) &&
  ------------------
  |  |   49|   527k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  |  Branch (1325:11): [True: 830, False: 527k]
  |  Branch (1325:11): [True: 830, False: 527k]
  ------------------
 1326|    830|          copy_field(f, HENTRY_DATA(hp), MORPH_PHON)) {
  ------------------
  |  |  114|    830|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (1326:11): [True: 830, False: 0]
  ------------------
 1327|    830|        int sc2;
 1328|    830|        if (utf8) {
  ------------------
  |  Branch (1328:13): [True: 0, False: 830]
  ------------------
 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|    830|        } else {
 1338|    830|          int leftcommon = leftcommonsubstring(word, f.c_str());
 1339|    830|          if (low) {
  ------------------
  |  Branch (1339:15): [True: 830, False: 0]
  ------------------
 1340|       |            // lowering dictionary word
 1341|    830|            mkallsmall(f, csconv);
 1342|    830|          }
 1343|    830|          sc2 = ngram(3, word, f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|    830|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1344|    830|        }
 1345|    830|        if (sc2 > sc)
  ------------------
  |  Branch (1345:13): [True: 444, False: 386]
  ------------------
 1346|    444|          sc = sc2;
 1347|    830|      }
 1348|       |
 1349|   527k|      int scphon = -20000;
 1350|   527k|      if (ph && (sc > 2) && (abs(n - (int)hp->clen) <= 3)) {
  ------------------
  |  Branch (1350:11): [True: 30.9k, False: 496k]
  |  Branch (1350:17): [True: 6.95k, False: 24.0k]
  |  Branch (1350:29): [True: 5.87k, False: 1.07k]
  ------------------
 1351|  5.87k|        if (utf8) {
  ------------------
  |  Branch (1351:13): [True: 0, False: 5.87k]
  ------------------
 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|  5.87k|        } else {
 1356|  5.87k|          candidate = HENTRY_WORD(hp);
  ------------------
  |  |   54|  5.87k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1357|  5.87k|          mkallcap(candidate, csconv);
 1358|  5.87k|        }
 1359|  5.87k|        f = phonet(candidate, *ph);
 1360|  5.87k|        if (utf8) {
  ------------------
  |  Branch (1360:13): [True: 0, False: 5.87k]
  ------------------
 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|  5.87k|        } else {
 1365|  5.87k|          scphon = 2 * ngram(3, target, f,
 1366|  5.87k|                             NGRAM_LONGER_WORSE);
  ------------------
  |  |   81|  5.87k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1367|  5.87k|        }
 1368|  5.87k|      }
 1369|       |
 1370|   527k|      if (sc > scores[lp]) {
  ------------------
  |  Branch (1370:11): [True: 527k, False: 0]
  ------------------
 1371|   527k|        scores[lp] = sc;
 1372|   527k|        roots[lp] = hp;
 1373|   527k|        has_roots = true;
 1374|   527k|        lval = sc;
 1375|  53.3M|        for (int j = 0; j < MAX_ROOTS; j++)
  ------------------
  |  |   74|  53.3M|#define MAX_ROOTS 100
  ------------------
  |  Branch (1375:25): [True: 52.7M, False: 527k]
  ------------------
 1376|  52.7M|          if (scores[j] < lval) {
  ------------------
  |  Branch (1376:15): [True: 44.3M, False: 8.42M]
  ------------------
 1377|  44.3M|            lp = j;
 1378|  44.3M|            lval = scores[j];
 1379|  44.3M|          }
 1380|   527k|      }
 1381|       |
 1382|   527k|      if (scphon > scoresphon[lpphon]) {
  ------------------
  |  Branch (1382:11): [True: 5.87k, False: 522k]
  ------------------
 1383|  5.87k|        scoresphon[lpphon] = scphon;
 1384|  5.87k|        rootsphon[lpphon] = HENTRY_WORD(hp);
  ------------------
  |  |   54|  5.87k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1385|  5.87k|        has_rootsphon = true;
 1386|  5.87k|        lval = scphon;
 1387|   593k|        for (int j = 0; j < MAX_ROOTS; j++)
  ------------------
  |  |   74|   593k|#define MAX_ROOTS 100
  ------------------
  |  Branch (1387:25): [True: 587k, False: 5.87k]
  ------------------
 1388|   587k|          if (scoresphon[j] < lval) {
  ------------------
  |  Branch (1388:15): [True: 530k, False: 57.1k]
  ------------------
 1389|   530k|            lpphon = j;
 1390|   530k|            lval = scoresphon[j];
 1391|   530k|          }
 1392|  5.87k|      }
 1393|   527k|    }
 1394|  59.5k|  }
 1395|       |
 1396|  59.5k|  if (!has_roots && !has_rootsphon) {
  ------------------
  |  Branch (1396:7): [True: 14.2k, False: 45.3k]
  |  Branch (1396:21): [True: 14.2k, False: 0]
  ------------------
 1397|       |    // with no roots there will be no guesses and no point running
 1398|       |    // ngram
 1399|  14.2k|    return;
 1400|  14.2k|  }
 1401|       |
 1402|       |  // find minimum threshold for a passable suggestion
 1403|       |  // mangle original word three differnt ways
 1404|       |  // and score them to generate a minimum acceptable score
 1405|  45.3k|  std::vector<w_char> w_mw;
 1406|  45.3k|  int thresh = 0;
 1407|   181k|  for (int sp = 1; sp < 4; sp++) {
  ------------------
  |  Branch (1407:20): [True: 135k, False: 45.3k]
  ------------------
 1408|   135k|    if (utf8) {
  ------------------
  |  Branch (1408:9): [True: 56.9k, False: 78.9k]
  ------------------
 1409|  56.9k|      w_mw = w_word;
 1410|   107k|      for (int k = sp; k < n; k += 4) {
  ------------------
  |  Branch (1410:24): [True: 50.4k, False: 56.9k]
  ------------------
 1411|  50.4k|        w_mw[k].l = '*';
 1412|  50.4k|        w_mw[k].h = 0;
 1413|  50.4k|      }
 1414|       |
 1415|  56.9k|      if (low) {
  ------------------
  |  Branch (1415:11): [True: 56.9k, False: 0]
  ------------------
 1416|       |        // lowering dictionary word
 1417|  56.9k|        mkallsmall_utf(w_mw, langnum);
 1418|  56.9k|      }
 1419|       |
 1420|  56.9k|      thresh += ngram(n, w_word, w_mw, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  56.9k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1421|  78.9k|    } else {
 1422|  78.9k|      std::string mw = word;
 1423|   191k|      for (int k = sp; k < n; k += 4)
  ------------------
  |  Branch (1423:24): [True: 112k, False: 78.9k]
  ------------------
 1424|   112k|        mw[k] = '*';
 1425|       |
 1426|  78.9k|      if (low) {
  ------------------
  |  Branch (1426:11): [True: 73.8k, False: 5.16k]
  ------------------
 1427|       |        // lowering dictionary word
 1428|  73.8k|        mkallsmall(mw, csconv);
 1429|  73.8k|      }
 1430|       |
 1431|  78.9k|      thresh += ngram(n, word, mw, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  78.9k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1432|  78.9k|    }
 1433|   135k|  }
 1434|  45.3k|  thresh = thresh / 3;
 1435|  45.3k|  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|  45.3k|  char* guess[MAX_GUESS];
 1441|  45.3k|  char* guessorig[MAX_GUESS];
 1442|  45.3k|  int gscore[MAX_GUESS];
 1443|  9.10M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.10M|#define MAX_GUESS 200
  ------------------
  |  Branch (1443:19): [True: 9.06M, False: 45.3k]
  ------------------
 1444|  9.06M|    guess[i] = nullptr;
 1445|  9.06M|    guessorig[i] = nullptr;
 1446|  9.06M|    gscore[i] = -100 * i;
 1447|  9.06M|  }
 1448|       |
 1449|  45.3k|  lp = MAX_GUESS - 1;
  ------------------
  |  |   76|  45.3k|#define MAX_GUESS 200
  ------------------
 1450|       |
 1451|  45.3k|  std::vector<guessword> glst(MAX_WORDS);
  ------------------
  |  |   75|  45.3k|#define MAX_WORDS 100
  ------------------
 1452|       |
 1453|  4.53M|  for (auto& root : roots) {
  ------------------
  |  Branch (1453:19): [True: 4.53M, False: 45.3k]
  ------------------
 1454|  4.53M|    if (root) {
  ------------------
  |  Branch (1454:9): [True: 527k, False: 4.00M]
  ------------------
 1455|   527k|      struct hentry* rp = root;
 1456|       |
 1457|   527k|      f.clear();
 1458|   527k|      const char* field = nullptr;
 1459|   527k|      if ((rp->var & H_OPT_PHON) && copy_field(f, HENTRY_DATA(rp), MORPH_PHON))
  ------------------
  |  |   49|   527k|#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|    830|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (1459:11): [True: 830, False: 527k]
  |  Branch (1459:11): [True: 830, False: 527k]
  |  Branch (1459:37): [True: 830, False: 0]
  ------------------
 1460|    830|          field = f.c_str();
 1461|   527k|      int nw = pAMgr->expand_rootword(
 1462|   527k|          glst.data(), MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word,
  ------------------
  |  |   75|   527k|#define MAX_WORDS 100
  ------------------
                        glst.data(), MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word,
  ------------------
  |  |   54|   527k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1463|   527k|          nc, field);
 1464|       |
 1465|  1.05M|      for (int k = 0; k < nw; k++) {
  ------------------
  |  Branch (1465:23): [True: 526k, False: 527k]
  ------------------
 1466|   526k|        if (utf8) {
  ------------------
  |  Branch (1466:13): [True: 252k, False: 274k]
  ------------------
 1467|   252k|          u8_u16(w_f, glst[k].word);
 1468|       |
 1469|   252k|          int leftcommon = leftcommonsubstring(w_word, w_f);
 1470|   252k|          if (low) {
  ------------------
  |  Branch (1470:15): [True: 252k, False: 0]
  ------------------
 1471|       |            // lowering dictionary word
 1472|   252k|            mkallsmall_utf(w_f, langnum);
 1473|   252k|          }
 1474|       |
 1475|   252k|          sc = ngram(n, w_word, w_f, NGRAM_ANY_MISMATCH) + leftcommon;
  ------------------
  |  |   82|   252k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1476|   274k|        } else {
 1477|   274k|          f = glst[k].word;
 1478|       |
 1479|   274k|          int leftcommon = leftcommonsubstring(word, f.c_str());
 1480|   274k|          if (low) {
  ------------------
  |  Branch (1480:15): [True: 251k, False: 23.2k]
  ------------------
 1481|       |            // lowering dictionary word
 1482|   251k|            mkallsmall(f, csconv);
 1483|   251k|          }
 1484|       |
 1485|   274k|          sc = ngram(n, word, f, NGRAM_ANY_MISMATCH) + leftcommon;
  ------------------
  |  |   82|   274k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1486|   274k|        }
 1487|       |
 1488|   526k|        if (sc > thresh) {
  ------------------
  |  Branch (1488:13): [True: 95.5k, False: 431k]
  ------------------
 1489|  95.5k|          if (sc > gscore[lp]) {
  ------------------
  |  Branch (1489:15): [True: 95.5k, False: 0]
  ------------------
 1490|  95.5k|            if (guess[lp]) {
  ------------------
  |  Branch (1490:17): [True: 0, False: 95.5k]
  ------------------
 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|  95.5k|            gscore[lp] = sc;
 1498|  95.5k|            guess[lp] = glst[k].word;
 1499|  95.5k|            guessorig[lp] = glst[k].orig;
 1500|  95.5k|            lval = sc;
 1501|  19.2M|            for (int j = 0; j < MAX_GUESS; j++)
  ------------------
  |  |   76|  19.2M|#define MAX_GUESS 200
  ------------------
  |  Branch (1501:29): [True: 19.1M, False: 95.5k]
  ------------------
 1502|  19.1M|              if (gscore[j] < lval) {
  ------------------
  |  Branch (1502:19): [True: 18.3M, False: 762k]
  ------------------
 1503|  18.3M|                lp = j;
 1504|  18.3M|                lval = gscore[j];
 1505|  18.3M|              }
 1506|  95.5k|          } else {
 1507|      0|            delete[] glst[k].word;
 1508|      0|            delete[] glst[k].orig;
 1509|      0|          }
 1510|   431k|        } else {
 1511|   431k|          delete[] glst[k].word;
 1512|   431k|          delete[] glst[k].orig;
 1513|   431k|        }
 1514|   526k|      }
 1515|   527k|    }
 1516|  4.53M|  }
 1517|  45.3k|  glst.clear();
 1518|       |
 1519|       |  // now we are done generating guesses
 1520|       |  // sort in order of decreasing score
 1521|       |
 1522|  45.3k|  bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS);
  ------------------
  |  |   76|  45.3k|#define MAX_GUESS 200
  ------------------
 1523|  45.3k|  if (ph)
  ------------------
  |  Branch (1523:7): [True: 2.67k, False: 42.6k]
  ------------------
 1524|  2.67k|    bubblesort(&rootsphon[0], nullptr, &scoresphon[0], MAX_ROOTS);
  ------------------
  |  |   74|  2.67k|#define MAX_ROOTS 100
  ------------------
 1525|       |
 1526|       |  // weight suggestions with a similarity index, based on
 1527|       |  // the longest common subsequent algorithm and resort
 1528|       |
 1529|  45.3k|  int is_swap = 0;
 1530|  45.3k|  int re = 0;
 1531|  45.3k|  double fact = 1.0;
 1532|  45.3k|  if (pAMgr) {
  ------------------
  |  Branch (1532:7): [True: 45.3k, False: 0]
  ------------------
 1533|  45.3k|    int maxd = pAMgr->get_maxdiff();
 1534|  45.3k|    if (maxd >= 0)
  ------------------
  |  Branch (1534:9): [True: 0, False: 45.3k]
  ------------------
 1535|      0|      fact = (10.0 - maxd) / 5.0;
 1536|  45.3k|  }
 1537|       |
 1538|  45.3k|  std::vector<w_char> w_gl;
 1539|  8.60M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  8.60M|#define MAX_GUESS 200
  ------------------
  |  Branch (1539:19): [True: 8.56M, False: 42.7k]
  ------------------
 1540|  8.56M|    if (guess[i]) {
  ------------------
  |  Branch (1540:9): [True: 69.4k, False: 8.49M]
  ------------------
 1541|       |      // lowering guess[i]
 1542|  69.4k|      std::string gl;
 1543|  69.4k|      int len;
 1544|  69.4k|      if (utf8) {
  ------------------
  |  Branch (1544:11): [True: 21.1k, False: 48.3k]
  ------------------
 1545|  21.1k|        len = u8_u16(w_gl, guess[i]);
 1546|  21.1k|        mkallsmall_utf(w_gl, langnum);
 1547|  21.1k|        u16_u8(gl, w_gl);
 1548|  48.3k|      } else {
 1549|  48.3k|        gl.assign(guess[i]);
 1550|  48.3k|        if (!nonbmp)
  ------------------
  |  Branch (1550:13): [True: 48.2k, False: 78]
  ------------------
 1551|  48.2k|          mkallsmall(gl, csconv);
 1552|  48.3k|        len = strlen(guess[i]);
 1553|  48.3k|      }
 1554|       |
 1555|  69.4k|      int _lcs = lcslen(word, gl.c_str());
 1556|       |
 1557|       |      // same characters with different casing
 1558|  69.4k|      if ((n == len) && (n == _lcs)) {
  ------------------
  |  Branch (1558:11): [True: 18.8k, False: 50.5k]
  |  Branch (1558:25): [True: 2.52k, False: 16.3k]
  ------------------
 1559|  2.52k|        gscore[i] += 2000;
 1560|  2.52k|        break;
 1561|  2.52k|      }
 1562|       |      // using 2-gram instead of 3, and other weightening
 1563|       |
 1564|  66.9k|      if (utf8) {
  ------------------
  |  Branch (1564:11): [True: 18.9k, False: 47.9k]
  ------------------
 1565|  18.9k|        u8_u16(w_gl, gl);
 1566|       |        //w_gl is lowercase already at this point
 1567|  18.9k|        re = ngram(2, w_word, w_gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  18.9k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                      re = ngram(2, w_word, w_gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  18.9k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1568|  18.9k|        if (low) {
  ------------------
  |  Branch (1568:13): [True: 18.9k, False: 0]
  ------------------
 1569|  18.9k|          w_f = w_word;
 1570|       |          // lowering dictionary word
 1571|  18.9k|          mkallsmall_utf(w_f, langnum);
 1572|  18.9k|          re += ngram(2, w_gl, w_f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  18.9k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, w_gl, w_f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  18.9k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1573|  18.9k|        } 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|  47.9k|      } else {
 1577|       |        //gl is lowercase already at this point
 1578|  47.9k|        re = ngram(2, word, gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  47.9k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                      re = ngram(2, word, gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  47.9k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1579|  47.9k|        if (low) {
  ------------------
  |  Branch (1579:13): [True: 47.8k, False: 78]
  ------------------
 1580|  47.8k|          f = word;
 1581|       |          // lowering dictionary word
 1582|  47.8k|          mkallsmall(f, csconv);
 1583|  47.8k|          re += ngram(2, gl, f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  47.8k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, gl, f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  47.8k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1584|  47.8k|        } else {
 1585|     78|          re += ngram(2, gl, word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|     78|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, gl, word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|     78|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1586|     78|        }
 1587|  47.9k|      }
 1588|       |
 1589|  66.9k|      int ngram_score, leftcommon_score;
 1590|  66.9k|      if (utf8) {
  ------------------
  |  Branch (1590:11): [True: 18.9k, False: 47.9k]
  ------------------
 1591|       |        //w_gl is lowercase already at this point
 1592|  18.9k|        ngram_score = ngram(4, w_word, w_gl, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  18.9k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1593|  18.9k|        leftcommon_score = leftcommonsubstring(w_word, w_gl);
 1594|  47.9k|      } else {
 1595|       |        //gl is lowercase already at this point
 1596|  47.9k|        ngram_score = ngram(4, word, gl, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  47.9k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1597|  47.9k|        leftcommon_score = leftcommonsubstring(word, gl.c_str());
 1598|  47.9k|      }
 1599|  66.9k|      gscore[i] =
 1600|       |          // length of longest common subsequent minus length difference
 1601|  66.9k|          2 * _lcs - abs((int)(n - len)) +
 1602|       |          // weight length of the left common substring
 1603|  66.9k|          leftcommon_score +
 1604|       |          // weight equal character positions
 1605|  66.9k|          (!nonbmp && commoncharacterpositions(word, gl.c_str(), &is_swap)
  ------------------
  |  Branch (1605:12): [True: 66.8k, False: 78]
  |  Branch (1605:23): [True: 53.7k, False: 13.1k]
  ------------------
 1606|  66.9k|               ? 1
 1607|  66.9k|               : 0) +
 1608|       |          // swap character (not neighboring)
 1609|  66.9k|          ((is_swap) ? 10 : 0) +
  ------------------
  |  Branch (1609:12): [True: 221, False: 66.7k]
  ------------------
 1610|       |          // ngram
 1611|  66.9k|          ngram_score +
 1612|       |          // weighted ngrams
 1613|  66.9k|          re +
 1614|       |          // different limit for dictionaries with PHONE rules
 1615|  66.9k|          (ph ? (re < len * fact ? -1000 : 0)
  ------------------
  |  Branch (1615:12): [True: 4.80k, False: 62.1k]
  |  Branch (1615:18): [True: 3.68k, False: 1.11k]
  ------------------
 1616|  66.9k|              : (re < (n + len) * fact ? -1000 : 0));
  ------------------
  |  Branch (1616:18): [True: 56.5k, False: 5.58k]
  ------------------
 1617|  66.9k|    }
 1618|  8.56M|  }
 1619|       |
 1620|  45.3k|  bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS);
  ------------------
  |  |   76|  45.3k|#define MAX_GUESS 200
  ------------------
 1621|       |
 1622|       |  // phonetic version
 1623|  45.3k|  if (ph)
  ------------------
  |  Branch (1623:7): [True: 2.67k, False: 42.6k]
  ------------------
 1624|   269k|    for (int i = 0; i < MAX_ROOTS; i++) {
  ------------------
  |  |   74|   269k|#define MAX_ROOTS 100
  ------------------
  |  Branch (1624:21): [True: 267k, False: 2.67k]
  ------------------
 1625|   267k|      if (rootsphon[i]) {
  ------------------
  |  Branch (1625:11): [True: 5.87k, False: 261k]
  ------------------
 1626|       |        // lowering rootphon[i]
 1627|  5.87k|        std::string gl;
 1628|  5.87k|        int len;
 1629|  5.87k|        if (utf8) {
  ------------------
  |  Branch (1629:13): [True: 0, False: 5.87k]
  ------------------
 1630|      0|          len = u8_u16(w_gl, rootsphon[i]);
 1631|      0|          mkallsmall_utf(w_gl, langnum);
 1632|      0|          u16_u8(gl, w_gl);
 1633|  5.87k|        } else {
 1634|  5.87k|          gl.assign(rootsphon[i]);
 1635|  5.87k|          if (!nonbmp)
  ------------------
  |  Branch (1635:15): [True: 5.87k, False: 0]
  ------------------
 1636|  5.87k|            mkallsmall(gl, csconv);
 1637|  5.87k|          len = strlen(rootsphon[i]);
 1638|  5.87k|        }
 1639|       |
 1640|       |        // weight length of the left common substring
 1641|  5.87k|        int leftcommon_score;
 1642|  5.87k|        if (utf8)
  ------------------
  |  Branch (1642:13): [True: 0, False: 5.87k]
  ------------------
 1643|      0|          leftcommon_score = leftcommonsubstring(w_word, w_gl);
 1644|  5.87k|        else
 1645|  5.87k|          leftcommon_score = leftcommonsubstring(word, gl.c_str());
 1646|       |        // heuristic weigthing of ngram scores
 1647|  5.87k|        scoresphon[i] += 2 * lcslen(word, gl) - abs((int)(n - len)) +
 1648|  5.87k|                         leftcommon_score;
 1649|  5.87k|      }
 1650|   267k|    }
 1651|       |
 1652|  45.3k|  if (ph)
  ------------------
  |  Branch (1652:7): [True: 2.67k, False: 42.6k]
  ------------------
 1653|  2.67k|    bubblesort(&rootsphon[0], nullptr, &scoresphon[0], MAX_ROOTS);
  ------------------
  |  |   74|  2.67k|#define MAX_ROOTS 100
  ------------------
 1654|       |
 1655|       |  // copy over
 1656|  45.3k|  size_t oldns = wlst.size();
 1657|       |
 1658|  45.3k|  int same = 0;
 1659|  9.10M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.10M|#define MAX_GUESS 200
  ------------------
  |  Branch (1659:19): [True: 9.06M, False: 45.3k]
  ------------------
 1660|  9.06M|    if (guess[i]) {
  ------------------
  |  Branch (1660:9): [True: 95.5k, False: 8.96M]
  ------------------
 1661|  95.5k|      if ((wlst.size() < oldns + maxngramsugs) && (wlst.size() < maxSug) &&
  ------------------
  |  Branch (1661:11): [True: 90.3k, False: 5.24k]
  |  Branch (1661:51): [True: 90.3k, False: 0]
  ------------------
 1662|  90.3k|          (!same || (gscore[i] > 1000))) {
  ------------------
  |  Branch (1662:12): [True: 16.4k, False: 73.9k]
  |  Branch (1662:21): [True: 0, False: 73.9k]
  ------------------
 1663|  16.4k|        int unique = 1;
 1664|       |        // leave only excellent suggestions, if exists
 1665|  16.4k|        if (gscore[i] > 1000)
  ------------------
  |  Branch (1665:13): [True: 2.52k, False: 13.8k]
  ------------------
 1666|  2.52k|          same = 1;
 1667|  13.8k|        else if (gscore[i] < -100) {
  ------------------
  |  Branch (1667:18): [True: 8.22k, False: 5.66k]
  ------------------
 1668|  8.22k|          same = 1;
 1669|       |          // keep the best ngram suggestions, unless in ONLYMAXDIFF mode
 1670|  8.22k|          if (wlst.size() > oldns || (pAMgr && pAMgr->get_onlymaxdiff())) {
  ------------------
  |  Branch (1670:15): [True: 896, False: 7.32k]
  |  Branch (1670:39): [True: 7.32k, False: 0]
  |  Branch (1670:48): [True: 0, False: 7.32k]
  ------------------
 1671|    896|            delete[] guess[i];
 1672|    896|            delete[] guessorig[i];
 1673|    896|            continue;
 1674|    896|          }
 1675|  8.22k|        }
 1676|  15.5k|        for (auto& j : wlst) {
  ------------------
  |  Branch (1676:22): [True: 8.92k, False: 12.5k]
  ------------------
 1677|       |          // don't suggest previous suggestions or a previous suggestion with
 1678|       |          // prefixes or affixes
 1679|  8.92k|          if ((!guessorig[i] && strstr(guess[i], j.c_str())) || (guessorig[i] && strstr(guessorig[i], j.c_str())) ||
  ------------------
  |  Branch (1679:15): [True: 2.92k, False: 6.00k]
  |  Branch (1679:16): [True: 8.92k, False: 0]
  |  Branch (1679:33): [True: 2.92k, False: 6.00k]
  |  Branch (1679:66): [True: 0, False: 6.00k]
  |  Branch (1679:82): [True: 0, False: 0]
  ------------------
 1680|       |              // check forbidden words
 1681|  6.00k|              !checkword(guess[i], 0, nullptr, nullptr)) {
  ------------------
  |  Branch (1681:15): [True: 0, False: 6.00k]
  ------------------
 1682|  2.92k|            unique = 0;
 1683|  2.92k|            break;
 1684|  2.92k|          }
 1685|  8.92k|        }
 1686|  15.5k|        if (unique) {
  ------------------
  |  Branch (1686:13): [True: 12.5k, False: 2.92k]
  ------------------
 1687|  12.5k|          if (guessorig[i]) {
  ------------------
  |  Branch (1687:15): [True: 0, False: 12.5k]
  ------------------
 1688|      0|            wlst.emplace_back(guessorig[i]);
 1689|  12.5k|          } else {
 1690|  12.5k|            wlst.emplace_back(guess[i]);
 1691|  12.5k|          }
 1692|  12.5k|        }
 1693|  15.5k|        delete[] guess[i];
 1694|  15.5k|        delete[] guessorig[i];
 1695|  79.1k|      } else {
 1696|  79.1k|        delete[] guess[i];
 1697|  79.1k|        delete[] guessorig[i];
 1698|  79.1k|      }
 1699|  95.5k|    }
 1700|  9.06M|  }
 1701|       |
 1702|  45.3k|  oldns = wlst.size();
 1703|  45.3k|  if (ph)
  ------------------
  |  Branch (1703:7): [True: 2.67k, False: 42.6k]
  ------------------
 1704|   267k|    for (auto& i : rootsphon) {
  ------------------
  |  Branch (1704:18): [True: 267k, False: 2.67k]
  ------------------
 1705|   267k|      if (i) {
  ------------------
  |  Branch (1705:11): [True: 5.87k, False: 261k]
  ------------------
 1706|  5.87k|        if ((wlst.size() < oldns + MAXPHONSUGS) && (wlst.size() < maxSug)) {
  ------------------
  |  |   78|  5.87k|#define MAXPHONSUGS 2
  ------------------
  |  Branch (1706:13): [True: 2.65k, False: 3.22k]
  |  Branch (1706:52): [True: 2.65k, False: 0]
  ------------------
 1707|  2.65k|          int unique = 1;
 1708|  4.62k|          for (auto& j : wlst) {
  ------------------
  |  Branch (1708:24): [True: 4.62k, False: 942]
  ------------------
 1709|       |            // don't suggest previous suggestions or a previous suggestion with
 1710|       |            // prefixes or affixes
 1711|  4.62k|            if (strstr(i, j.c_str()) ||
  ------------------
  |  Branch (1711:17): [True: 1.71k, False: 2.91k]
  |  Branch (1711:17): [True: 1.71k, False: 2.91k]
  ------------------
 1712|       |                // check forbidden words
 1713|  2.91k|                !checkword(i, 0, nullptr, nullptr)) {
  ------------------
  |  Branch (1713:17): [True: 0, False: 2.91k]
  ------------------
 1714|  1.71k|              unique = 0;
 1715|  1.71k|              break;
 1716|  1.71k|            }
 1717|  4.62k|          }
 1718|  2.65k|          if (unique) {
  ------------------
  |  Branch (1718:15): [True: 942, False: 1.71k]
  ------------------
 1719|    942|            wlst.emplace_back(i);
 1720|    942|          }
 1721|  2.65k|        }
 1722|  5.87k|      }
 1723|   267k|    }
 1724|  45.3k|}
_ZN10SuggestMgr9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPiPNS0_6chrono10time_pointINSA_12steady_clockENSA_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1735|  89.4M|                          std::chrono::steady_clock::time_point* timelimit) {
 1736|       |  // check overall suggestion time limit
 1737|  89.4M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|  89.4M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (1737:7): [True: 11, False: 89.4M]
  ------------------
 1738|     11|    return 0;
 1739|       |
 1740|       |  // check time limit
 1741|  89.4M|  if (timer) {
  ------------------
  |  Branch (1741:7): [True: 3.16M, False: 86.2M]
  ------------------
 1742|  3.16M|    (*timer)--;
 1743|  3.16M|    if (!(*timer) && timelimit) {
  ------------------
  |  Branch (1743:9): [True: 26.9k, False: 3.14M]
  |  Branch (1743:22): [True: 26.9k, False: 0]
  ------------------
 1744|  26.9k|      if (std::chrono::steady_clock::now() - *timelimit > TIMELIMIT_MS)
  ------------------
  |  |  109|  26.9k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1744:11): [True: 19, False: 26.9k]
  ------------------
 1745|     19|        return 0;
 1746|  26.9k|      *timer = MAXPLUSTIMER;
  ------------------
  |  |  111|  26.9k|#define MAXPLUSTIMER 100
  ------------------
 1747|  26.9k|    }
 1748|  3.16M|  }
 1749|       |
 1750|  89.4M|  if (pAMgr) {
  ------------------
  |  Branch (1750:7): [True: 89.4M, False: 0]
  ------------------
 1751|  89.4M|    struct hentry* rv = nullptr;
 1752|  89.4M|    int nosuffix = 0;
 1753|       |
 1754|  89.4M|    if (cpdsuggest >= 1) {
  ------------------
  |  Branch (1754:9): [True: 58.4M, False: 31.0M]
  ------------------
 1755|  58.4M|      if (pAMgr->get_compound()) {
  ------------------
  |  Branch (1755:11): [True: 14.3M, False: 44.1M]
  ------------------
 1756|  14.3M|        struct hentry* rv2 = nullptr;
 1757|  14.3M|        struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
 1758|  14.3M|        int info = (cpdsuggest == 1) ? SPELL_COMPOUND_2 : 0;
  ------------------
  |  |   88|  7.15M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (1758:20): [True: 7.15M, False: 7.15M]
  ------------------
 1759|  14.3M|        AffixScratch scratch;
 1760|  14.3M|        rv = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 1, &info, scratch);  // EXT
 1761|       |        // TODO filter 3-word or more compound words, as in spell()
 1762|       |        // (it's too slow to call suggest() here for all possible compound words)
 1763|  14.3M|        if (rv &&
  ------------------
  |  Branch (1763:13): [True: 0, False: 14.3M]
  |  Branch (1763:13): [True: 0, False: 14.3M]
  ------------------
 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) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1766|      0|               TESTAFF(rv2->astr, pAMgr->get_nosuggest(), rv2->alen))))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1767|      0|          return 3;  // XXX obsolote categorisation + only ICONV needs affix
 1768|       |                     // flag check?
 1769|  14.3M|      }
 1770|  58.4M|      return 0;
 1771|  58.4M|    }
 1772|       |
 1773|  31.0M|    rv = pAMgr->lookup(word.c_str(), word.size());
 1774|       |
 1775|  31.0M|    if (rv) {
  ------------------
  |  Branch (1775:9): [True: 35.7k, False: 31.0M]
  ------------------
 1776|  35.7k|      if ((rv->astr) &&
  ------------------
  |  Branch (1776:11): [True: 152, False: 35.5k]
  |  Branch (1776:11): [True: 0, False: 35.7k]
  ------------------
 1777|    152|          (TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |  102|    304|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 152]
  |  |  ------------------
  ------------------
 1778|    152|           TESTAFF(rv->astr, pAMgr->get_nosuggest(), rv->alen) ||
  ------------------
  |  |  102|    304|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 152]
  |  |  ------------------
  ------------------
 1779|    152|           TESTAFF(rv->astr, pAMgr->get_substandard(), rv->alen)))
  ------------------
  |  |  102|    152|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 152]
  |  |  ------------------
  ------------------
 1780|      0|        return 0;
 1781|  35.8k|      while (rv) {
  ------------------
  |  Branch (1781:14): [True: 35.7k, False: 142]
  ------------------
 1782|  35.7k|        if (rv->astr &&
  ------------------
  |  Branch (1782:13): [True: 152, False: 35.5k]
  |  Branch (1782:13): [True: 142, False: 35.5k]
  ------------------
 1783|    152|            (TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |  102|    304|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 152]
  |  |  ------------------
  ------------------
 1784|    152|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|    304|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 142, False: 10]
  |  |  ------------------
  ------------------
 1785|    142|             TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen))) {
  ------------------
  |  |  102|     10|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
 1786|    142|          rv = rv->next_homonym;
 1787|    142|        } else
 1788|  35.5k|          break;
 1789|  35.7k|      }
 1790|  31.0M|    } else {
 1791|  31.0M|      AffixScratch scratch;
 1792|  31.0M|      rv = pAMgr->prefix_check(word, 0, word.size(),
 1793|  31.0M|                               0, scratch);  // only prefix, and prefix + suffix XXX
 1794|  31.0M|    }
 1795|       |
 1796|  31.0M|    if (rv) {
  ------------------
  |  Branch (1796:9): [True: 35.5k, False: 31.0M]
  ------------------
 1797|  35.5k|      nosuffix = 1;
 1798|  31.0M|    } else {
 1799|  31.0M|      AffixScratch scratch;
 1800|  31.0M|      rv = pAMgr->suffix_check(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // only suffix
  ------------------
  |  |   99|  31.0M|#define FLAG_NULL 0x00
  ------------------
                    rv = pAMgr->suffix_check(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // only suffix
  ------------------
  |  |   99|  31.0M|#define FLAG_NULL 0x00
  ------------------
                    rv = pAMgr->suffix_check(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // only suffix
  ------------------
  |  |   75|  31.0M|#define IN_CPD_NOT 0
  ------------------
 1801|  31.0M|    }
 1802|       |
 1803|  31.0M|    if (!rv && pAMgr->have_contclass()) {
  ------------------
  |  Branch (1803:9): [True: 31.0M, False: 35.5k]
  |  Branch (1803:16): [True: 10.7M, False: 20.2M]
  ------------------
 1804|  10.7M|      AffixScratch scratch;
 1805|  10.7M|      rv = pAMgr->suffix_check_twosfx(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL);
  ------------------
  |  |   99|  10.7M|#define FLAG_NULL 0x00
  ------------------
 1806|  10.7M|      if (!rv)
  ------------------
  |  Branch (1806:11): [True: 10.7M, False: 0]
  ------------------
 1807|  10.7M|        rv = pAMgr->prefix_check_twosfx(word, 0, word.size(), 0, scratch, FLAG_NULL);
  ------------------
  |  |   99|  10.7M|#define FLAG_NULL 0x00
  ------------------
 1808|  10.7M|    }
 1809|       |
 1810|       |    // check forbidden words
 1811|  31.0M|    if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1811:9): [True: 35.5k, False: 31.0M]
  |  Branch (1811:9): [True: 0, False: 31.0M]
  |  Branch (1811:17): [True: 10, False: 35.5k]
  ------------------
 1812|     10|        (TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |  102|     20|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
 1813|     10|         TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|     20|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
 1814|     10|         TESTAFF(rv->astr, pAMgr->get_nosuggest(), rv->alen) ||
  ------------------
  |  |  102|     20|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
 1815|     10|         TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen)))
  ------------------
  |  |  102|     10|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 10]
  |  |  ------------------
  ------------------
 1816|      0|      return 0;
 1817|       |
 1818|  31.0M|    if (rv) {  // XXX obsolote
  ------------------
  |  Branch (1818:9): [True: 35.5k, False: 31.0M]
  ------------------
 1819|  35.5k|      if ((pAMgr->get_compoundflag()) &&
  ------------------
  |  Branch (1819:11): [True: 8.47k, False: 27.1k]
  |  Branch (1819:11): [True: 6, False: 35.5k]
  ------------------
 1820|  8.47k|          TESTAFF(rv->astr, pAMgr->get_compoundflag(), rv->alen))
  ------------------
  |  |  102|  8.47k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 6, False: 8.46k]
  |  |  ------------------
  ------------------
 1821|      6|        return 2 + nosuffix;
 1822|  35.5k|      return 1;
 1823|  35.5k|    }
 1824|  31.0M|  }
 1825|  31.0M|  return 0;
 1826|  89.4M|}
_ZN10SuggestMgr15check_forbiddenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1828|  14.2k|int SuggestMgr::check_forbidden(const std::string& word) {
 1829|  14.2k|  if (pAMgr) {
  ------------------
  |  Branch (1829:7): [True: 14.2k, False: 0]
  ------------------
 1830|  14.2k|    struct hentry* rv = pAMgr->lookup(word.c_str(), word.size());
 1831|  14.2k|    if (rv && rv->astr &&
  ------------------
  |  Branch (1831:9): [True: 0, False: 14.2k]
  |  Branch (1831:9): [True: 0, False: 14.2k]
  |  Branch (1831:15): [True: 0, False: 0]
  ------------------
 1832|      0|        (TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1833|      0|         TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen)))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1834|      0|      rv = nullptr;
 1835|  14.2k|    size_t len = word.size();
 1836|  14.2k|    AffixScratch scratch;
 1837|  14.2k|    if (!(pAMgr->prefix_check(word, 0, len, 1, scratch)))
  ------------------
  |  Branch (1837:9): [True: 14.2k, False: 0]
  ------------------
 1838|  14.2k|      rv = pAMgr->suffix_check(word, 0, len, 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // prefix+suffix, suffix
  ------------------
  |  |   99|  14.2k|#define FLAG_NULL 0x00
  ------------------
                    rv = pAMgr->suffix_check(word, 0, len, 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // prefix+suffix, suffix
  ------------------
  |  |   99|  14.2k|#define FLAG_NULL 0x00
  ------------------
                    rv = pAMgr->suffix_check(word, 0, len, 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // prefix+suffix, suffix
  ------------------
  |  |   75|  14.2k|#define IN_CPD_NOT 0
  ------------------
 1839|       |    // check forbidden words
 1840|  14.2k|    if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1840:9): [True: 0, False: 14.2k]
  |  Branch (1840:9): [True: 0, False: 14.2k]
  |  Branch (1840:17): [True: 0, False: 0]
  ------------------
 1841|      0|        TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen))
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1842|      0|      return 1;
 1843|  14.2k|  }
 1844|  14.2k|  return 0;
 1845|  14.2k|}
_ZN10SuggestMgr13suggest_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1847|  13.1k|std::string SuggestMgr::suggest_morph(const std::string& in_w) {
 1848|  13.1k|  std::string result;
 1849|       |
 1850|  13.1k|  struct hentry* rv = nullptr;
 1851|       |
 1852|  13.1k|  if (!pAMgr)
  ------------------
  |  Branch (1852:7): [True: 0, False: 13.1k]
  ------------------
 1853|      0|    return {};
 1854|       |
 1855|  13.1k|  std::string w(in_w);
 1856|       |
 1857|       |  // word reversing wrapper for complex prefixes
 1858|  13.1k|  if (complexprefixes) {
  ------------------
  |  Branch (1858:7): [True: 689, False: 12.4k]
  ------------------
 1859|    689|    if (utf8)
  ------------------
  |  Branch (1859:9): [True: 0, False: 689]
  ------------------
 1860|      0|      reverseword_utf(w);
 1861|    689|    else
 1862|    689|      reverseword(w);
 1863|    689|  }
 1864|       |
 1865|  13.1k|  rv = pAMgr->lookup(w.c_str(), w.size());
 1866|       |
 1867|  15.0k|  while (rv) {
  ------------------
  |  Branch (1867:10): [True: 1.98k, False: 13.1k]
  ------------------
 1868|  1.98k|    if ((!rv->astr) ||
  ------------------
  |  Branch (1868:9): [True: 1.63k, False: 356]
  |  Branch (1868:9): [True: 1.98k, False: 0]
  ------------------
 1869|    356|        !(TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |  102|    712|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 356]
  |  |  ------------------
  ------------------
 1870|    356|          TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |  102|    712|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 356]
  |  |  ------------------
  ------------------
 1871|  1.98k|          TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen))) {
  ------------------
  |  |  102|    356|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 356]
  |  |  ------------------
  ------------------
 1872|  1.98k|      if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|  1.98k|#define MORPH_STEM "st:"
  ------------------
  |  Branch (1872:11): [True: 1.98k, False: 0]
  ------------------
 1873|  1.98k|        result.push_back(MSEP_FLD);
  ------------------
  |  |  121|  1.98k|#define MSEP_FLD ' '
  ------------------
 1874|  1.98k|        result.append(MORPH_STEM);
  ------------------
  |  |  103|  1.98k|#define MORPH_STEM "st:"
  ------------------
 1875|  1.98k|        result.append(w);
 1876|  1.98k|      }
 1877|  1.98k|      if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (1877:11): [True: 0, False: 1.98k]
  ------------------
 1878|      0|        result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 1879|      0|        result.append(HENTRY_DATA2(rv));
 1880|      0|      }
 1881|  1.98k|      result.push_back(MSEP_REC);
  ------------------
  |  |  122|  1.98k|#define MSEP_REC '\n'
  ------------------
 1882|  1.98k|    }
 1883|  1.98k|    rv = rv->next_homonym;
 1884|  1.98k|  }
 1885|       |
 1886|  13.1k|  AffixScratch scratch;
 1887|  13.1k|  std::string st = pAMgr->affix_check_morph(w, 0, w.size(), scratch);
 1888|  13.1k|  if (!st.empty()) {
  ------------------
  |  Branch (1888:7): [True: 0, False: 13.1k]
  ------------------
 1889|      0|    result.append(st);
 1890|      0|  }
 1891|       |
 1892|  13.1k|  if (pAMgr->get_compound() && result.empty()) {
  ------------------
  |  Branch (1892:7): [True: 2.76k, False: 10.3k]
  |  Branch (1892:32): [True: 2.32k, False: 441]
  ------------------
 1893|  2.32k|    struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
 1894|  2.32k|    pAMgr->compound_check_morph(w, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, result, nullptr, scratch);
 1895|  2.32k|  }
 1896|       |
 1897|  13.1k|  line_uniq(result, MSEP_REC);
  ------------------
  |  |  122|  13.1k|#define MSEP_REC '\n'
  ------------------
 1898|       |
 1899|  13.1k|  return result;
 1900|  13.1k|}
_ZN10SuggestMgr18suggest_hentry_genEP6hentryPKc:
 1925|   506k|std::string SuggestMgr::suggest_hentry_gen(hentry* rv, const char* pattern) {
 1926|   506k|  std::string result;
 1927|   506k|  int sfxcount = get_sfxcount(pattern);
 1928|       |
 1929|   506k|  if (get_sfxcount(HENTRY_DATA(rv)) > sfxcount)
  ------------------
  |  Branch (1929:7): [True: 0, False: 506k]
  ------------------
 1930|      0|    return result;
 1931|       |
 1932|   506k|  if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (1932:7): [True: 0, False: 506k]
  ------------------
 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|   506k|  char* p = nullptr;
 1943|   506k|  if (HENTRY_DATA(rv))
  ------------------
  |  Branch (1943:7): [True: 0, False: 506k]
  ------------------
 1944|      0|    p = (char*)strstr(HENTRY_DATA2(rv), MORPH_ALLOMORPH);
  ------------------
  |  |  104|      0|#define MORPH_ALLOMORPH "al:"
  ------------------
 1945|   506k|  while (p) {
  ------------------
  |  Branch (1945:10): [True: 0, False: 506k]
  ------------------
 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|   506k|  return result;
 1971|   506k|}
_ZN10SuggestMgr11suggest_genERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_NS0_6chrono10time_pointINSE_12steady_clockENSE_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1974|   509k|                                    std::chrono::steady_clock::time_point start_time) {
 1975|   509k|  if (desc.empty() || !pAMgr)
  ------------------
  |  Branch (1975:7): [True: 275k, False: 233k]
  |  Branch (1975:23): [True: 0, False: 233k]
  ------------------
 1976|   275k|    return {};
 1977|       |
 1978|   233k|  const char* pattern = in_pattern.c_str();
 1979|   233k|  std::string result2;
 1980|   233k|  std::string newpattern;
 1981|   233k|  struct hentry* rv = nullptr;
 1982|       |
 1983|       |  // search affixed forms with and without derivational suffixes
 1984|   274k|  while (true) {
  ------------------
  |  Branch (1984:10): [True: 274k, Folded]
  ------------------
 1985|   274k|    for (const auto& k : desc) {
  ------------------
  |  Branch (1985:24): [True: 274k, False: 274k]
  ------------------
 1986|   274k|      if (std::chrono::steady_clock::now() - start_time > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|   274k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1986:11): [True: 0, False: 274k]
  ------------------
 1987|      0|        return result2;
 1988|   274k|      std::string result;
 1989|       |
 1990|       |      // add compound word parts (except the last one)
 1991|   274k|      const size_t lastpart = append_compound_parts(k, result);
 1992|   274k|      const char* s = k.c_str() + lastpart;
 1993|   274k|      std::string tok(k, lastpart);
 1994|   274k|      size_t pos = tok.find(" | ");
 1995|   274k|      while (pos != std::string::npos) {
  ------------------
  |  Branch (1995:14): [True: 0, False: 274k]
  ------------------
 1996|      0|        tok[pos + 1] = MSEP_ALT;
  ------------------
  |  |  123|      0|#define MSEP_ALT '\v'
  ------------------
 1997|      0|        pos = tok.find(" | ", pos);
 1998|      0|      }
 1999|   274k|      std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  123|   274k|#define MSEP_ALT '\v'
  ------------------
 2000|   274k|      for (auto& i : pl) {
  ------------------
  |  Branch (2000:20): [True: 274k, False: 274k]
  ------------------
 2001|       |        // remove inflectional and terminal suffixes
 2002|   274k|        size_t is = i.find(MORPH_INFL_SFX);
  ------------------
  |  |  110|   274k|#define MORPH_INFL_SFX "is:"
  ------------------
 2003|   274k|        if (is != std::string::npos)
  ------------------
  |  Branch (2003:13): [True: 0, False: 274k]
  ------------------
 2004|      0|          i.resize(is);
 2005|   274k|        size_t ts = i.find(MORPH_TERM_SFX);
  ------------------
  |  |  111|   274k|#define MORPH_TERM_SFX "ts:"
  ------------------
 2006|   274k|        while (ts != std::string::npos) {
  ------------------
  |  Branch (2006:16): [True: 0, False: 274k]
  ------------------
 2007|      0|          i[ts] = '_';
 2008|      0|          ts = i.find(MORPH_TERM_SFX);
  ------------------
  |  |  111|      0|#define MORPH_TERM_SFX "ts:"
  ------------------
 2009|      0|        }
 2010|   274k|        const char* st = strstr(s, MORPH_STEM);
  ------------------
  |  |  103|   274k|#define MORPH_STEM "st:"
  ------------------
 2011|   274k|        if (st) {
  ------------------
  |  Branch (2011:13): [True: 253k, False: 21.3k]
  ------------------
 2012|   253k|          copy_field(tok, st, MORPH_STEM);
  ------------------
  |  |  103|   253k|#define MORPH_STEM "st:"
  ------------------
 2013|   253k|          rv = pAMgr->lookup(tok.c_str(), tok.size());
 2014|   506k|          while (rv) {
  ------------------
  |  Branch (2014:18): [True: 253k, False: 253k]
  ------------------
 2015|   253k|            if (std::chrono::steady_clock::now() - start_time > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|   253k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (2015:17): [True: 0, False: 253k]
  ------------------
 2016|      0|              return result2;
 2017|   253k|            std::string newpat(i);
 2018|   253k|            newpat.append(pattern);
 2019|   253k|            std::string sg = suggest_hentry_gen(rv, newpat.c_str());
 2020|   253k|            if (sg.empty())
  ------------------
  |  Branch (2020:17): [True: 253k, False: 0]
  ------------------
 2021|   253k|              sg = suggest_hentry_gen(rv, pattern);
 2022|   253k|            if (!sg.empty()) {
  ------------------
  |  Branch (2022:17): [True: 0, False: 253k]
  ------------------
 2023|      0|              std::vector<std::string> gen = line_tok(sg, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2024|      0|              for (auto& j : gen) {
  ------------------
  |  Branch (2024:28): [True: 0, False: 0]
  ------------------
 2025|      0|                result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2026|      0|                result2.append(result);
 2027|      0|                if (i.find(MORPH_SURF_PFX) != std::string::npos) {
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
  |  Branch (2027:21): [True: 0, False: 0]
  ------------------
 2028|      0|                  std::string field;
 2029|      0|                  copy_field(field, i, MORPH_SURF_PFX);
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
 2030|      0|                  result2.append(field);
 2031|      0|                }
 2032|      0|                result2.append(j);
 2033|      0|              }
 2034|      0|            }
 2035|   253k|            rv = rv->next_homonym;
 2036|   253k|          }
 2037|   253k|        }
 2038|   274k|      }
 2039|   274k|    }
 2040|       |
 2041|   274k|    if (!result2.empty() || !strstr(pattern, MORPH_DERI_SFX))
  ------------------
  |  |  109|   274k|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (2041:9): [True: 0, False: 274k]
  |  Branch (2041:29): [True: 233k, False: 40.6k]
  ------------------
 2042|   233k|      break;
 2043|       |
 2044|  40.6k|    newpattern.assign(pattern);
 2045|  40.6k|    mystrrep(newpattern, MORPH_DERI_SFX, MORPH_TERM_SFX);
  ------------------
  |  |  109|  40.6k|#define MORPH_DERI_SFX "ds:"
  ------------------
                  mystrrep(newpattern, MORPH_DERI_SFX, MORPH_TERM_SFX);
  ------------------
  |  |  111|  40.6k|#define MORPH_TERM_SFX "ts:"
  ------------------
 2046|  40.6k|    pattern = newpattern.c_str();
 2047|  40.6k|  }
 2048|   233k|  return result2;
 2049|   233k|}
_ZN10SuggestMgr5ngramEiRKNSt3__16vectorI6w_charNS0_9allocatorIS2_EEEES7_i:
 2055|   618k|                      int opt) {
 2056|   618k|  int nscore = 0, ns, l1 = su1.size(), l2 = su2.size();
 2057|       |
 2058|   618k|  if (l2 == 0)
  ------------------
  |  Branch (2058:7): [True: 6.75k, False: 611k]
  ------------------
 2059|  6.75k|    return 0;
 2060|   925k|  for (int j = 1; j <= n; j++) {
  ------------------
  |  Branch (2060:19): [True: 878k, False: 47.0k]
  ------------------
 2061|   878k|    ns = 0;
 2062|  4.13M|    for (int i = 0; i <= (l1 - j); i++) {
  ------------------
  |  Branch (2062:21): [True: 3.25M, False: 878k]
  ------------------
 2063|  3.25M|      int k = 0;
 2064|  14.8M|      for (int l = 0; l <= (l2 - j); l++) {
  ------------------
  |  Branch (2064:23): [True: 12.7M, False: 2.12M]
  ------------------
 2065|  16.6M|        for (k = 0; k < j; k++) {
  ------------------
  |  Branch (2065:21): [True: 15.4M, False: 1.12M]
  ------------------
 2066|  15.4M|          if (su1[i + k] != su2[l + k])
  ------------------
  |  Branch (2066:15): [True: 11.6M, False: 3.86M]
  ------------------
 2067|  11.6M|            break;
 2068|  15.4M|        }
 2069|  12.7M|        if (k == j) {
  ------------------
  |  Branch (2069:13): [True: 1.12M, False: 11.6M]
  ------------------
 2070|  1.12M|          ns++;
 2071|  1.12M|          break;
 2072|  1.12M|        }
 2073|  12.7M|      }
 2074|  3.25M|      if (k != j && opt & NGRAM_WEIGHTED) {
  ------------------
  |  |   84|  2.12M|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2074:11): [True: 2.12M, False: 1.12M]
  |  Branch (2074:21): [True: 71.4k, False: 2.05M]
  ------------------
 2075|  71.4k|        ns--;
 2076|  71.4k|        if (i == 0 || i == l1 - j)
  ------------------
  |  Branch (2076:13): [True: 19.2k, False: 52.2k]
  |  Branch (2076:23): [True: 28.2k, False: 23.9k]
  ------------------
 2077|  47.5k|          ns--;  // side weight
 2078|  71.4k|      }
 2079|  3.25M|    }
 2080|   878k|    nscore = nscore + ns;
 2081|   878k|    if (ns < 2 && !(opt & NGRAM_WEIGHTED))
  ------------------
  |  |   84|   618k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2081:9): [True: 618k, False: 259k]
  |  Branch (2081:19): [True: 564k, False: 53.8k]
  ------------------
 2082|   564k|      break;
 2083|   878k|  }
 2084|       |
 2085|   611k|  ns = 0;
 2086|   611k|  if (opt & NGRAM_LONGER_WORSE)
  ------------------
  |  |   81|   611k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
  |  Branch (2086:7): [True: 252k, False: 359k]
  ------------------
 2087|   252k|    ns = (l2 - l1) - 2;
 2088|   611k|  if (opt & NGRAM_ANY_MISMATCH)
  ------------------
  |  |   82|   611k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
  |  Branch (2088:7): [True: 359k, False: 252k]
  ------------------
 2089|   359k|    ns = abs(l2 - l1) - 2;
 2090|   611k|  ns = (nscore - ((ns > 0) ? ns : 0));
  ------------------
  |  Branch (2090:19): [True: 101k, False: 509k]
  ------------------
 2091|   611k|  return ns;
 2092|   618k|}
_ZN10SuggestMgr5ngramEiRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 2098|   780k|                      int opt) {
 2099|   780k|  int nscore = 0, ns, l1, l2 = s2.size();
 2100|       |
 2101|   780k|  if (l2 == 0)
  ------------------
  |  Branch (2101:7): [True: 12.0k, False: 767k]
  ------------------
 2102|  12.0k|    return 0;
 2103|   767k|  l1 = s1.size();
 2104|  1.43M|  for (int j = 1; j <= n; j++) {
  ------------------
  |  Branch (2104:19): [True: 1.31M, False: 122k]
  ------------------
 2105|  1.31M|    ns = 0;
 2106|  10.3M|    for (int i = 0; i <= (l1 - j); i++) {
  ------------------
  |  Branch (2106:21): [True: 9.06M, False: 1.31M]
  ------------------
 2107|       |      //s2 is haystack, s1[i..i+j) is needle
 2108|  9.06M|      if (s2.find(s1.c_str()+i, 0, j) != std::string::npos) {
  ------------------
  |  Branch (2108:11): [True: 3.47M, False: 5.59M]
  ------------------
 2109|  3.47M|        ns++;
 2110|  5.59M|      } else if (opt & NGRAM_WEIGHTED) {
  ------------------
  |  |   84|  5.59M|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2110:18): [True: 335k, False: 5.26M]
  ------------------
 2111|   335k|        ns--;
 2112|   335k|        if (i == 0 || i == l1 - j)
  ------------------
  |  Branch (2112:13): [True: 36.1k, False: 299k]
  |  Branch (2112:23): [True: 98.8k, False: 200k]
  ------------------
 2113|   135k|          ns--;  // side weight
 2114|   335k|      }
 2115|  9.06M|    }
 2116|  1.31M|    nscore = nscore + ns;
 2117|  1.31M|    if (ns < 2 && !(opt & NGRAM_WEIGHTED))
  ------------------
  |  |   84|   772k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2117:9): [True: 772k, False: 544k]
  |  Branch (2117:19): [True: 645k, False: 126k]
  ------------------
 2118|   645k|      break;
 2119|  1.31M|  }
 2120|       |
 2121|   767k|  ns = 0;
 2122|   767k|  if (opt & NGRAM_LONGER_WORSE)
  ------------------
  |  |   81|   767k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
  |  Branch (2122:7): [True: 280k, False: 487k]
  ------------------
 2123|   280k|    ns = (l2 - l1) - 2;
 2124|   767k|  if (opt & NGRAM_ANY_MISMATCH)
  ------------------
  |  |   82|   767k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
  |  Branch (2124:7): [True: 487k, False: 280k]
  ------------------
 2125|   487k|    ns = abs(l2 - l1) - 2;
 2126|   767k|  ns = (nscore - ((ns > 0) ? ns : 0));
  ------------------
  |  Branch (2126:19): [True: 161k, False: 606k]
  ------------------
 2127|   767k|  return ns;
 2128|   780k|}
_ZN10SuggestMgr19leftcommonsubstringERKNSt3__16vectorI6w_charNS0_9allocatorIS2_EEEES7_:
 2133|   523k|    const std::vector<w_char>& su2) {
 2134|   523k|  int l1 = su1.size(), l2 = su2.size();
 2135|       |  // decapitalize dictionary word
 2136|   523k|  if (complexprefixes) {
  ------------------
  |  Branch (2136:7): [True: 0, False: 523k]
  ------------------
 2137|      0|    if (l1 && l2 && su1[l1 - 1] == su2[l2 - 1])
  ------------------
  |  Branch (2137:9): [True: 0, False: 0]
  |  Branch (2137:15): [True: 0, False: 0]
  |  Branch (2137:21): [True: 0, False: 0]
  ------------------
 2138|      0|      return 1;
 2139|   523k|  } else {
 2140|   523k|    unsigned short idx = su2.empty() ? 0 : (unsigned short)(su2[0]),
  ------------------
  |  Branch (2140:26): [True: 0, False: 523k]
  ------------------
 2141|   523k|                   otheridx = su1.empty() ? 0 : (unsigned short)(su1[0]);
  ------------------
  |  Branch (2141:31): [True: 17.6k, False: 505k]
  ------------------
 2142|   523k|    if (otheridx != idx && (otheridx != unicodetolower(idx, langnum)))
  ------------------
  |  Branch (2142:9): [True: 498k, False: 24.4k]
  |  Branch (2142:28): [True: 376k, False: 122k]
  ------------------
 2143|   376k|      return 0;
 2144|   146k|    int i;
 2145|   243k|    for (i = 1; (i < l1) && (i < l2) && (su1[i] == su2[i]);
  ------------------
  |  Branch (2145:17): [True: 228k, False: 14.3k]
  |  Branch (2145:29): [True: 214k, False: 14.4k]
  |  Branch (2145:41): [True: 96.3k, False: 118k]
  ------------------
 2146|   146k|         i++)
 2147|  96.3k|      ;
 2148|   146k|    return i;
 2149|   523k|  }
 2150|      0|  return 0;
 2151|   523k|}
_ZN10SuggestMgr19leftcommonsubstringEPKcS1_:
 2156|   605k|    const char* s2) {
 2157|   605k|  if (complexprefixes) {
  ------------------
  |  Branch (2157:7): [True: 48.8k, False: 556k]
  ------------------
 2158|  48.8k|    int l1 = strlen(s1), l2 = strlen(s2);
 2159|  48.8k|    if (l1 && l1 <= l2 && s1[l1 - 1] == s2[l2 - 1])
  ------------------
  |  Branch (2159:9): [True: 47.2k, False: 1.67k]
  |  Branch (2159:15): [True: 21.5k, False: 25.6k]
  |  Branch (2159:27): [True: 1.90k, False: 19.6k]
  ------------------
 2160|  1.90k|      return 1;
 2161|   556k|  } else if (csconv) {
  ------------------
  |  Branch (2161:14): [True: 556k, False: 0]
  ------------------
 2162|   556k|    const char* olds = s1;
 2163|       |    // decapitalise dictionary word
 2164|   556k|    if ((*s1 != *s2) && (((unsigned char)*s1) != csconv[((unsigned char)*s2)].clower))
  ------------------
  |  Branch (2164:9): [True: 505k, False: 50.7k]
  |  Branch (2164:25): [True: 374k, False: 131k]
  ------------------
 2165|   374k|      return 0;
 2166|   395k|    do {
 2167|   395k|      s1++;
 2168|   395k|      s2++;
 2169|   395k|    } while ((*s1 == *s2) && (*s1 != '\0'));
  ------------------
  |  Branch (2169:14): [True: 213k, False: 181k]
  |  Branch (2169:30): [True: 212k, False: 386]
  ------------------
 2170|   182k|    return (int)(s1 - olds);
 2171|   556k|  }
 2172|  46.9k|  return 0;
 2173|   605k|}
_ZN10SuggestMgr24commoncharacterpositionsEPKcS1_Pi:
 2177|  66.8k|                                         int* is_swap) {
 2178|  66.8k|  int num = 0, diff = 0, diffpos[2];
 2179|  66.8k|  *is_swap = 0;
 2180|  66.8k|  if (utf8) {
  ------------------
  |  Branch (2180:7): [True: 18.9k, False: 47.8k]
  ------------------
 2181|  18.9k|    std::vector<w_char> su1;
 2182|  18.9k|    std::vector<w_char> su2;
 2183|  18.9k|    int l1 = u8_u16(su1, s1), l2 = u8_u16(su2, s2);
 2184|       |
 2185|  18.9k|    if (l1 <= 0 || l2 <= 0)
  ------------------
  |  Branch (2185:9): [True: 4.01k, False: 14.9k]
  |  Branch (2185:20): [True: 0, False: 14.9k]
  ------------------
 2186|  4.01k|      return 0;
 2187|       |
 2188|       |    // decapitalize dictionary word
 2189|  14.9k|    if (complexprefixes) {
  ------------------
  |  Branch (2189:9): [True: 0, False: 14.9k]
  ------------------
 2190|      0|      su2[l2 - 1] = lower_utf(su2[l2 - 1], langnum);
 2191|  14.9k|    } else {
 2192|  14.9k|      su2[0] = lower_utf(su2[0], langnum);
 2193|  14.9k|    }
 2194|  53.9k|    for (int i = 0; (i < l1) && (i < l2); i++) {
  ------------------
  |  Branch (2194:21): [True: 43.4k, False: 10.5k]
  |  Branch (2194:33): [True: 38.9k, False: 4.42k]
  ------------------
 2195|  38.9k|      if (su1[i] == su2[i]) {
  ------------------
  |  Branch (2195:11): [True: 21.5k, False: 17.3k]
  ------------------
 2196|  21.5k|        num++;
 2197|  21.5k|      } else {
 2198|  17.3k|        if (diff < 2)
  ------------------
  |  Branch (2198:13): [True: 15.5k, False: 1.85k]
  ------------------
 2199|  15.5k|          diffpos[diff] = i;
 2200|  17.3k|        diff++;
 2201|  17.3k|      }
 2202|  38.9k|    }
 2203|  14.9k|    if ((diff == 2) && (l1 == l2) &&
  ------------------
  |  Branch (2203:9): [True: 2.64k, False: 12.3k]
  |  Branch (2203:24): [True: 606, False: 2.03k]
  ------------------
 2204|    606|        (su1[diffpos[0]] == su2[diffpos[1]]) &&
  ------------------
  |  Branch (2204:9): [True: 252, False: 354]
  ------------------
 2205|    252|        (su1[diffpos[1]] == su2[diffpos[0]]))
  ------------------
  |  Branch (2205:9): [True: 91, False: 161]
  ------------------
 2206|     91|      *is_swap = 1;
 2207|  47.8k|  } else {
 2208|  47.8k|    size_t i;
 2209|  47.8k|    std::string t(s2);
 2210|       |    // decapitalize dictionary word
 2211|  47.8k|    if (complexprefixes) {
  ------------------
  |  Branch (2211:9): [True: 2.76k, False: 45.1k]
  ------------------
 2212|  2.76k|      size_t l2 = t.size();
 2213|  2.76k|      t[l2 - 1] = csconv[(unsigned char)t[l2 - 1]].clower;
 2214|  45.1k|    } else {
 2215|  45.1k|      mkallsmall(t, csconv);
 2216|  45.1k|    }
 2217|   254k|    for (i = 0; i < t.size() && (*(s1 + i) != 0); ++i) {
  ------------------
  |  Branch (2217:17): [True: 229k, False: 24.9k]
  |  Branch (2217:33): [True: 206k, False: 22.9k]
  ------------------
 2218|   206k|      if (*(s1 + i) == t[i]) {
  ------------------
  |  Branch (2218:11): [True: 108k, False: 98.2k]
  ------------------
 2219|   108k|        num++;
 2220|   108k|      } else {
 2221|  98.2k|        if (diff < 2)
  ------------------
  |  Branch (2221:13): [True: 53.7k, False: 44.4k]
  ------------------
 2222|  53.7k|          diffpos[diff] = i;
 2223|  98.2k|        diff++;
 2224|  98.2k|      }
 2225|   206k|    }
 2226|  47.8k|    if ((diff == 2) && (*(s1 + i) == 0) && i == t.size() &&
  ------------------
  |  Branch (2226:9): [True: 11.1k, False: 36.7k]
  |  Branch (2226:24): [True: 8.32k, False: 2.79k]
  |  Branch (2226:44): [True: 3.46k, False: 4.86k]
  ------------------
 2227|  3.46k|        (*(s1 + diffpos[0]) == t[diffpos[1]]) &&
  ------------------
  |  Branch (2227:9): [True: 724, False: 2.73k]
  ------------------
 2228|    724|        (*(s1 + diffpos[1]) == t[diffpos[0]]))
  ------------------
  |  Branch (2228:9): [True: 130, False: 594]
  ------------------
 2229|    130|      *is_swap = 1;
 2230|  47.8k|  }
 2231|  62.8k|  return num;
 2232|  66.8k|}
_ZN10SuggestMgr10bubblesortEPPcS1_Pii:
 2243|  95.9k|void SuggestMgr::bubblesort(char** rword, char** rword2, int* rsc, int n) {
 2244|  95.9k|  int m = 1;
 2245|  18.6M|  while (m < n) {
  ------------------
  |  Branch (2245:10): [True: 18.5M, False: 95.9k]
  ------------------
 2246|  18.5M|    int j = m;
 2247|  37.6M|    while (j > 0) {
  ------------------
  |  Branch (2247:12): [True: 37.5M, False: 26.2k]
  ------------------
 2248|  37.5M|      if (rsc[j - 1] < rsc[j]) {
  ------------------
  |  Branch (2248:11): [True: 19.0M, False: 18.5M]
  ------------------
 2249|  19.0M|        int sctmp = rsc[j - 1];
 2250|  19.0M|        char* wdtmp = rword[j - 1];
 2251|  19.0M|        rsc[j - 1] = rsc[j];
 2252|  19.0M|        rword[j - 1] = rword[j];
 2253|  19.0M|        rsc[j] = sctmp;
 2254|  19.0M|        rword[j] = wdtmp;
 2255|  19.0M|        if (rword2) {
  ------------------
  |  Branch (2255:13): [True: 18.5M, False: 504k]
  ------------------
 2256|  18.5M|          wdtmp = rword2[j - 1];
 2257|  18.5M|          rword2[j - 1] = rword2[j];
 2258|  18.5M|          rword2[j] = wdtmp;
 2259|  18.5M|        }
 2260|  19.0M|        j--;
 2261|  19.0M|      } else
 2262|  18.5M|        break;
 2263|  37.5M|    }
 2264|  18.5M|    m++;
 2265|  18.5M|  }
 2266|  95.9k|}
_ZN10SuggestMgr3lcsEPKcS1_PiS2_:
 2272|  75.3k|                      int* l2) {
 2273|  75.3k|  int n, m, i, j;
 2274|  75.3k|  std::vector<w_char> su;
 2275|  75.3k|  std::vector<w_char> su2;
 2276|  75.3k|  if (utf8) {
  ------------------
  |  Branch (2276:7): [True: 21.1k, False: 54.2k]
  ------------------
 2277|  21.1k|    m = u8_u16(su, s);
 2278|  21.1k|    n = u8_u16(su2, s2);
 2279|  54.2k|  } else {
 2280|  54.2k|    m = strlen(s);
 2281|  54.2k|    n = strlen(s2);
 2282|  54.2k|  }
 2283|  75.3k|  if (m <= 0 || n <= 0) {
  ------------------
  |  Branch (2283:7): [True: 9.48k, False: 65.8k]
  |  Branch (2283:17): [True: 0, False: 65.8k]
  ------------------
 2284|  9.48k|    *l1 = 0;
 2285|  9.48k|    *l2 = 0;
 2286|  9.48k|    return nullptr;
 2287|  9.48k|  }
 2288|  65.8k|  char* c = new char[(m + 1) * (n + 1)]();
 2289|  65.8k|  char* b = new char[(m + 1) * (n + 1)]();
 2290|   396k|  for (i = 1; i <= m; i++) {
  ------------------
  |  Branch (2290:15): [True: 330k, False: 65.8k]
  ------------------
 2291|  4.01M|    for (j = 1; j <= n; j++) {
  ------------------
  |  Branch (2291:17): [True: 3.68M, False: 330k]
  ------------------
 2292|  3.68M|      if (((utf8) && (su[i - 1] == su2[j - 1])) ||
  ------------------
  |  Branch (2292:12): [True: 207k, False: 3.47M]
  |  Branch (2292:22): [True: 49.4k, False: 157k]
  ------------------
 2293|  3.63M|          ((!utf8) && (s[i - 1] == s2[j - 1]))) {
  ------------------
  |  Branch (2293:12): [True: 3.47M, False: 157k]
  |  Branch (2293:23): [True: 571k, False: 2.90M]
  ------------------
 2294|   620k|        c[i * (n + 1) + j] = c[(i - 1) * (n + 1) + j - 1] + 1;
 2295|   620k|        b[i * (n + 1) + j] = LCS_UPLEFT;
 2296|  3.06M|      } else if (c[(i - 1) * (n + 1) + j] >= c[i * (n + 1) + j - 1]) {
  ------------------
  |  Branch (2296:18): [True: 2.21M, False: 852k]
  ------------------
 2297|  2.21M|        c[i * (n + 1) + j] = c[(i - 1) * (n + 1) + j];
 2298|  2.21M|        b[i * (n + 1) + j] = LCS_UP;
 2299|  2.21M|      } else {
 2300|   852k|        c[i * (n + 1) + j] = c[i * (n + 1) + j - 1];
 2301|   852k|        b[i * (n + 1) + j] = LCS_LEFT;
 2302|   852k|      }
 2303|  3.68M|    }
 2304|   330k|  }
 2305|  65.8k|  delete[] c;
 2306|  65.8k|  *l1 = m;
 2307|  65.8k|  *l2 = n;
 2308|  65.8k|  return b;
 2309|  75.3k|}
_ZN10SuggestMgr6lcslenEPKcS1_:
 2311|  75.3k|int SuggestMgr::lcslen(const char* s, const char* s2) {
 2312|  75.3k|  int m, n, len = 0;
 2313|  75.3k|  char* result = lcs(s, s2, &m, &n);
 2314|  75.3k|  if (!result)
  ------------------
  |  Branch (2314:7): [True: 9.48k, False: 65.8k]
  ------------------
 2315|  9.48k|    return 0;
 2316|  65.8k|  int i = m, j = n;
 2317|   526k|  while ((i != 0) && (j != 0)) {
  ------------------
  |  Branch (2317:10): [True: 465k, False: 61.3k]
  |  Branch (2317:22): [True: 460k, False: 4.46k]
  ------------------
 2318|   460k|    if (result[i * (n + 1) + j] == LCS_UPLEFT) {
  ------------------
  |  Branch (2318:9): [True: 186k, False: 274k]
  ------------------
 2319|   186k|      len++;
 2320|   186k|      i--;
 2321|   186k|      j--;
 2322|   274k|    } else if (result[i * (n + 1) + j] == LCS_UP) {
  ------------------
  |  Branch (2322:16): [True: 133k, False: 140k]
  ------------------
 2323|   133k|      i--;
 2324|   133k|    } else
 2325|   140k|      j--;
 2326|   460k|  }
 2327|  65.8k|  delete[] result;
 2328|  65.8k|  return len;
 2329|  75.3k|}
_ZN10SuggestMgr6lcslenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 2331|  5.87k|int SuggestMgr::lcslen(const std::string& s, const std::string& s2) {
 2332|  5.87k|  return lcslen(s.c_str(), s2.c_str());
 2333|  5.87k|}
suggestmgr.cxx:_ZN12_GLOBAL__N_115ngsuggest_guardC2EbPK7cs_infoPiPS3_:
 1164|  59.5k|      : m_nonbmp(nonbmp)
 1165|  59.5k|      , m_origconv(origconv)
 1166|  59.5k|      , m_utf8(utf8)
 1167|  59.5k|      , m_csconv(csconv)
 1168|  59.5k|    {
 1169|  59.5k|    }
suggestmgr.cxx:_ZN12_GLOBAL__N_115ngsuggest_guardD2Ev:
 1172|  59.5k|    {
 1173|  59.5k|      if (m_nonbmp) {
  ------------------
  |  Branch (1173:11): [True: 1.72k, False: 57.8k]
  ------------------
 1174|  1.72k|        *m_csconv = m_origconv;
 1175|  1.72k|        *m_utf8 = 1;
 1176|  1.72k|      }
 1177|  59.5k|    }
suggestmgr.cxx:_ZL12get_sfxcountPKc:
 1902|  1.01M|static int get_sfxcount(const char* morph) {
 1903|  1.01M|  if (!morph || !*morph)
  ------------------
  |  Branch (1903:7): [True: 506k, False: 506k]
  |  Branch (1903:17): [True: 0, False: 506k]
  ------------------
 1904|   506k|    return 0;
 1905|   506k|  int n = 0;
 1906|   506k|  const char* old = morph;
 1907|   506k|  morph = strstr(morph, MORPH_DERI_SFX);
  ------------------
  |  |  109|   506k|#define MORPH_DERI_SFX "ds:"
  ------------------
 1908|   506k|  if (!morph)
  ------------------
  |  Branch (1908:7): [True: 429k, False: 76.9k]
  ------------------
 1909|   429k|    morph = strstr(old, MORPH_INFL_SFX);
  ------------------
  |  |  110|   429k|#define MORPH_INFL_SFX "is:"
  ------------------
 1910|   506k|  if (!morph)
  ------------------
  |  Branch (1910:7): [True: 429k, False: 76.9k]
  ------------------
 1911|   429k|    morph = strstr(old, MORPH_TERM_SFX);
  ------------------
  |  |  111|   429k|#define MORPH_TERM_SFX "ts:"
  ------------------
 1912|   747k|  while (morph) {
  ------------------
  |  Branch (1912:10): [True: 241k, False: 506k]
  ------------------
 1913|   241k|    n++;
 1914|   241k|    old = morph;
 1915|   241k|    morph = strstr(morph + 1, MORPH_DERI_SFX);
  ------------------
  |  |  109|   241k|#define MORPH_DERI_SFX "ds:"
  ------------------
 1916|   241k|    if (!morph)
  ------------------
  |  Branch (1916:9): [True: 197k, False: 43.6k]
  ------------------
 1917|   197k|      morph = strstr(old + 1, MORPH_INFL_SFX);
  ------------------
  |  |  110|   197k|#define MORPH_INFL_SFX "is:"
  ------------------
 1918|   241k|    if (!morph)
  ------------------
  |  Branch (1918:9): [True: 197k, False: 43.6k]
  ------------------
 1919|   197k|      morph = strstr(old + 1, MORPH_TERM_SFX);
  ------------------
  |  |  111|   197k|#define MORPH_TERM_SFX "ts:"
  ------------------
 1920|   241k|  }
 1921|   506k|  return n;
 1922|  1.01M|}

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

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

