_ZN8PfxEntryC2EP8AffixMgr:
   99|      8|    : pmyMgr(pmgr)
  100|      8|    , next(nullptr)
  101|      8|    , nexteq(nullptr)
  102|      8|    , nextne(nullptr)
  103|      8|    , flgnxt(nullptr) {}
_ZN8PfxEntry3addEPKcm:
  106|      2|std::string PfxEntry::add(const char* word, size_t len) {
  107|      2|  std::string result;
  108|      2|  if ((len > strip.size() || (len == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (108:7): [True: 2, False: 0]
  |  Branch (108:8): [True: 2, False: 0]
  |  Branch (108:31): [True: 0, False: 0]
  |  Branch (108:43): [True: 0, False: 0]
  ------------------
  109|      2|      (len >= numconds) && test_condition(word) &&
  ------------------
  |  Branch (109:7): [True: 2, False: 0]
  |  Branch (109:28): [True: 2, False: 0]
  ------------------
  110|      2|      (strip.empty() ||
  ------------------
  |  Branch (110:8): [True: 2, False: 0]
  ------------------
  111|      2|      (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|      2|    result.assign(appnd);
  114|      2|    result.append(word + strip.size());
  115|      2|  }
  116|      2|  return result;
  117|      2|}
_ZN8PfxEntry9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  275|  1.40M|                                   AffixScratch& scratch) {
  276|  1.40M|  struct hentry* he;  // hash entry of root word or NULL
  277|       |
  278|  1.40M|  TraceCtx* t = trace_on(scratch.trace);
  279|  1.40M|  if (t)
  ------------------
  |  Branch (279:7): [True: 0, False: 1.40M]
  ------------------
  280|      0|    trace_affix(*t, "pfx", pmyMgr, *this);
  281|  1.40M|  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.40M|  int tmpl = len - appnd.size(); // length of tmpword
  289|       |
  290|  1.40M|  if (tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) {
  ------------------
  |  Branch (290:7): [True: 1.40M, False: 3.43k]
  |  Branch (290:20): [True: 3.43k, False: 0]
  |  Branch (290:33): [True: 0, False: 3.43k]
  ------------------
  291|       |    // generate new root word by removing prefix and adding
  292|       |    // back any characters that would have been stripped
  293|       |
  294|  1.40M|    std::string& tmpword = scratch.pfx_check_word;
  295|  1.40M|    tmpword.assign(strip);
  296|  1.40M|    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.40M|    if (t)
  ------------------
  |  Branch (306:9): [True: 0, False: 1.40M]
  ------------------
  307|      0|      trace(*t, "stem \"%s\"", tmpword.c_str());
  308|       |
  309|  1.40M|    bool passes = test_condition(tmpword);
  310|  1.40M|    if (t)
  ------------------
  |  Branch (310:9): [True: 0, False: 1.40M]
  ------------------
  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.40M|    if (passes) {
  ------------------
  |  Branch (315:9): [True: 16.0k, False: 1.38M]
  ------------------
  316|  16.0k|      tmpl += strip.size();
  317|  16.0k|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (317:11): [True: 0, False: 16.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|  16.0k|      } else if (t) {
  ------------------
  |  Branch (337:18): [True: 0, False: 16.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|  16.0k|      if ((opts & aeXPRODUCT)) {
  ------------------
  |  |   65|  16.0k|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (346:11): [True: 16.0k, False: 0]
  ------------------
  347|  16.0k|        he = pmyMgr->suffix_check(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|  16.0k|#define aeXPRODUCT (1 << 0)
  ------------------
  348|  16.0k|                                  scratch, FLAG_NULL, needflag, in_compound);
  ------------------
  |  |   99|  16.0k|#define FLAG_NULL 0x00
  ------------------
  349|  16.0k|        if (he)
  ------------------
  |  Branch (349:13): [True: 0, False: 16.0k]
  ------------------
  350|      0|          return he;
  351|  16.0k|      }
  352|  16.0k|    }
  353|  1.40M|  } else if (t) {
  ------------------
  |  Branch (353:14): [True: 0, False: 3.43k]
  ------------------
  354|      0|    trace(*t, "test length have=%d -> fail, nothing would be left of the word",
  355|      0|          tmpl);
  356|      0|  }
  357|  1.40M|  return nullptr;
  358|  1.40M|}
_ZN8PfxEntry12check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  366|  1.40M|                                      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.40M|  int tmpl = len - appnd.size(); // length of tmpword
  373|       |
  374|  1.40M|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (374:8): [True: 1.40M, False: 3.33k]
  |  Branch (374:21): [True: 3.33k, False: 0]
  |  Branch (374:34): [True: 0, False: 3.33k]
  ------------------
  375|  1.40M|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (375:7): [True: 1.35M, False: 46.0k]
  ------------------
  376|       |    // generate new root word by removing prefix and adding
  377|       |    // back any characters that would have been stripped
  378|       |
  379|  1.35M|    std::string& tmpword = scratch.pfx_check_twosfx;
  380|  1.35M|    tmpword.assign(strip);
  381|  1.35M|    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.35M|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (391:9): [True: 12.1k, False: 1.34M]
  ------------------
  392|  12.1k|      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|  12.1k|      if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   65|  12.1k|#define aeXPRODUCT (1 << 0)
  ------------------
                    if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   76|  12.1k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (398:11): [True: 12.1k, False: 0]
  |  Branch (398:34): [True: 12.1k, False: 0]
  ------------------
  399|       |        // hash entry of root word or NULL
  400|  12.1k|        struct hentry* he = pmyMgr->suffix_check_twosfx(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|  12.1k|#define aeXPRODUCT (1 << 0)
  ------------------
  401|  12.1k|                                                        scratch, needflag);
  402|  12.1k|        if (he)
  ------------------
  |  Branch (402:13): [True: 0, False: 12.1k]
  ------------------
  403|      0|          return he;
  404|  12.1k|      }
  405|  12.1k|    }
  406|  1.35M|  }
  407|  1.40M|  return nullptr;
  408|  1.40M|}
_ZN8PfxEntry18check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  416|    702|                                         AffixScratch& scratch) {
  417|    702|  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|    702|  int tmpl = len - appnd.size(); // length of tmpword
  423|       |
  424|    702|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (424:8): [True: 702, False: 0]
  |  Branch (424:21): [True: 0, False: 0]
  |  Branch (424:34): [True: 0, False: 0]
  ------------------
  425|    702|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (425:7): [True: 618, False: 84]
  ------------------
  426|       |    // generate new root word by removing prefix and adding
  427|       |    // back any characters that would have been stripped
  428|       |
  429|    618|    std::string& tmpword = scratch.pfx_check_twosfx;
  430|    618|    tmpword.assign(strip);
  431|    618|    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|    618|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (441:9): [True: 0, False: 618]
  ------------------
  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|    618|  }
  455|    702|  return result;
  456|    702|}
_ZN8PfxEntry11check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiictR12AffixScratch:
  464|    704|                                  AffixScratch& scratch) {
  465|    704|  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|    704|  int tmpl = len - appnd.size(); // length of tmpword
  473|       |
  474|    704|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (474:8): [True: 704, False: 0]
  |  Branch (474:21): [True: 0, False: 0]
  |  Branch (474:34): [True: 0, False: 0]
  ------------------
  475|    704|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (475:7): [True: 620, False: 84]
  ------------------
  476|       |    // generate new root word by removing prefix and adding
  477|       |    // back any characters that would have been stripped
  478|       |
  479|    620|    std::string& tmpword = scratch.pfx_check_word;
  480|    620|    tmpword.assign(strip);
  481|    620|    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|    620|    if (test_condition(tmpword)) {
  ------------------
  |  Branch (491:9): [True: 2, False: 618]
  ------------------
  492|      2|      tmpl += strip.size();
  493|      2|      struct hentry* he;  // hash entry of root word or NULL
  494|      2|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (494:11): [True: 0, False: 2]
  ------------------
  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|      2|      if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   65|      2|#define aeXPRODUCT (1 << 0)
  ------------------
                    if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) {
  ------------------
  |  |   76|      2|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (528:11): [True: 2, False: 0]
  |  Branch (528:34): [True: 2, False: 0]
  ------------------
  529|      2|        std::string st = pmyMgr->suffix_check_morph(tmpword, 0, tmpl, aeXPRODUCT, this,
  ------------------
  |  |   65|      2|#define aeXPRODUCT (1 << 0)
  ------------------
  530|      2|                                                    scratch, FLAG_NULL, needflag);
  ------------------
  |  |   99|      2|#define FLAG_NULL 0x00
  ------------------
  531|      2|        if (!st.empty()) {
  ------------------
  |  Branch (531:13): [True: 0, False: 2]
  ------------------
  532|      0|          result.append(st);
  533|      0|        }
  534|      2|      }
  535|      2|    }
  536|    620|  }
  537|       |
  538|    704|  return result;
  539|    704|}
_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|     27|std::string SfxEntry::add(const char* word, size_t len) {
  580|     27|  std::string result;
  581|       |  /* make sure all conditions match */
  582|     27|  if ((len > strip.size() || (len == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (582:8): [True: 27, False: 0]
  |  Branch (582:31): [True: 0, False: 0]
  |  Branch (582:43): [True: 0, False: 0]
  ------------------
  583|     27|      (len >= numconds) && test_condition(word + len, word) &&
  ------------------
  |  Branch (583:7): [True: 27, False: 0]
  |  Branch (583:28): [True: 27, False: 0]
  ------------------
  584|     27|      (strip.empty() ||
  ------------------
  |  Branch (584:8): [True: 27, False: 0]
  ------------------
  585|     27|       (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|     27|    result.assign(word, len);
  587|       |    /* we have a match so add suffix */
  588|     27|    result.replace(len - strip.size(), std::string::npos, appnd);
  589|     27|  }
  590|     27|  return result;
  591|     27|}
_ZNK8SfxEntry10applies_toEPK6hentryiP8PfxEntrytttPK8TraceCtx:
  731|     25|                          const TraceCtx* t) const {
  732|       |  // the suffix flag is either on the entry itself, or on a prefix that enables
  733|       |  // this suffix
  734|     25|  bool in_dic = TESTAFF(he->astr, aflag, he->alen);
  ------------------
  |  |  102|     25|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  735|     25|  bool in_prefix = ep && ep->getCont() &&
  ------------------
  |  Branch (735:20): [True: 0, False: 25]
  |  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|     25|  if (t) {
  ------------------
  |  Branch (737:7): [True: 0, False: 25]
  ------------------
  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|     25|  if (!in_dic && !in_prefix)
  ------------------
  |  Branch (745:7): [True: 25, False: 0]
  |  Branch (745:18): [True: 25, False: 0]
  ------------------
  746|     25|    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|  49.1k|                                   AffixScratch& scratch) {
  817|  49.1k|  struct hentry* he;  // hash entry pointer
  818|  49.1k|  PfxEntry* ep = ppfx;
  819|       |
  820|  49.1k|  TraceCtx* t = trace_on(scratch.trace);
  821|  49.1k|  if (t)
  ------------------
  |  Branch (821:7): [True: 0, False: 49.1k]
  ------------------
  822|      0|    trace_affix(*t, "sfx", pmyMgr, *this);
  823|  49.1k|  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|  49.1k|  if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0)) {
  ------------------
  |  |   65|  49.1k|#define aeXPRODUCT (1 << 0)
  ------------------
                if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0)) {
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (828:7): [True: 0, False: 49.1k]
  |  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|  49.1k|  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|  49.1k|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (844:8): [True: 47.7k, False: 1.40k]
  |  Branch (844:21): [True: 1.40k, False: 0]
  |  Branch (844:34): [True: 0, False: 1.40k]
  ------------------
  845|  47.7k|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (845:7): [True: 47.7k, 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|  47.7k|    std::string& tmpword = scratch.sfx_check_word;
  851|  47.7k|    tmpword.assign(word, start, tmpl);
  852|  47.7k|    if (!strip.empty()) {
  ------------------
  |  Branch (852:9): [True: 0, False: 47.7k]
  ------------------
  853|      0|      tmpword.append(strip);
  854|      0|    }
  855|       |
  856|  47.7k|    const char* beg = tmpword.c_str();
  857|  47.7k|    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|  47.7k|    if (t)
  ------------------
  |  Branch (867:9): [True: 0, False: 47.7k]
  ------------------
  868|      0|      trace(*t, "stem \"%s\"", tmpword.c_str());
  869|       |
  870|  47.7k|    bool passes = test_condition(end, beg);
  871|  47.7k|    if (t)
  ------------------
  |  Branch (871:9): [True: 0, False: 47.7k]
  ------------------
  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|  47.7k|    if (passes) {
  ------------------
  |  Branch (876:9): [True: 47.7k, False: 0]
  ------------------
  877|       |#ifdef SZOSZABLYA_POSSIBLE_ROOTS
  878|       |      fprintf(stdout, "%s %s %c\n", word.c_str() + start, beg, aflag);
  879|       |#endif
  880|  47.7k|      if ((he = pmyMgr->lookup(tmpword.c_str(), tmpword.size())) != nullptr) {
  ------------------
  |  Branch (880:11): [True: 25, False: 47.7k]
  ------------------
  881|     25|        if (t)
  ------------------
  |  Branch (881:13): [True: 0, False: 25]
  ------------------
  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|     25|        do {
  885|     25|          if (applies_to(he, optflags, ep, cclass, needflag, badflag, t)) {
  ------------------
  |  Branch (885:15): [True: 0, False: 25]
  ------------------
  886|      0|            if (t)
  ------------------
  |  Branch (886:17): [True: 0, False: 0]
  ------------------
  887|      0|              trace(*t, "accept");
  888|      0|            return he;
  889|      0|          }
  890|     25|          he = he->next_homonym;  // check homonyms
  891|     25|          if (t) {
  ------------------
  |  Branch (891:15): [True: 0, False: 25]
  ------------------
  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|     25|        } while (he);
  ------------------
  |  Branch (899:18): [True: 0, False: 25]
  ------------------
  900|  47.7k|      } else if (t) {
  ------------------
  |  Branch (900:18): [True: 0, False: 47.7k]
  ------------------
  901|      0|        trace(*t, "lookup \"%s\" -> miss", tmpword.c_str());
  902|      0|      }
  903|  47.7k|    }
  904|  47.7k|  } else if (t) {
  ------------------
  |  Branch (904:14): [True: 0, False: 1.40k]
  ------------------
  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|  49.1k|  return nullptr;
  909|  49.1k|}
_ZN8SfxEntry12check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntrytR12AffixScratch:
  918|  26.0k|                                      AffixScratch& scratch) {
  919|  26.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|  26.0k|  if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0)
  ------------------
  |  |   65|  26.0k|#define aeXPRODUCT (1 << 0)
  ------------------
                if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0)
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (924:7): [True: 0, False: 26.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|  26.0k|  int tmpl = len - appnd.size(); // length of tmpword
  933|       |
  934|  26.0k|  if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) &&
  ------------------
  |  Branch (934:8): [True: 25.8k, False: 165]
  |  Branch (934:21): [True: 165, False: 0]
  |  Branch (934:34): [True: 0, False: 165]
  ------------------
  935|  25.8k|      (tmpl + strip.size() >= numconds)) {
  ------------------
  |  Branch (935:7): [True: 25.8k, 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|  25.8k|    std::string& tmpword = scratch.sfx_check_twosfx;
  941|  25.8k|    tmpword.assign(word, start);
  942|  25.8k|    tmpword.resize(tmpl);
  943|  25.8k|    tmpword.append(strip);
  944|  25.8k|    tmpl += strip.size();
  945|       |
  946|  25.8k|    const char* beg = tmpword.c_str();
  947|  25.8k|    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|  25.8k|    if (test_condition(end, beg)) {
  ------------------
  |  Branch (956:9): [True: 25.8k, False: 0]
  ------------------
  957|  25.8k|      struct hentry* he;  // hash entry pointer
  958|  25.8k|      if (ppfx) {
  ------------------
  |  Branch (958:11): [True: 0, False: 25.8k]
  ------------------
  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|  25.8k|      } else {
  966|  25.8k|        he = pmyMgr->suffix_check(tmpword, 0, tmpl, 0, nullptr, scratch, (FLAG)aflag, needflag, IN_CPD_NOT);
  ------------------
  |  |   75|  25.8k|#define IN_CPD_NOT 0
  ------------------
  967|  25.8k|      }
  968|  25.8k|      if (he)
  ------------------
  |  Branch (968:11): [True: 0, False: 25.8k]
  ------------------
  969|      0|        return he;
  970|  25.8k|    }
  971|  25.8k|  }
  972|  26.0k|  return nullptr;
  973|  26.0k|}
_ZN8SfxEntry15initReverseWordEv:
 1083|     34|void SfxEntry::initReverseWord() {
 1084|     34|  rappnd = appnd;
 1085|     34|  reverseword(rappnd);
 1086|     34|}
_ZN8PfxEntry14test_conditionERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  134|  2.76M|inline int PfxEntry::test_condition(const std::string& s) {
  135|  2.76M|  size_t st = 0;
  136|  2.76M|  size_t pos = std::string::npos;  // group with pos input position
  137|  2.76M|  bool neg = false;        // complementer
  138|  2.76M|  bool ingroup = false;    // character in the group
  139|  2.76M|  if (numconds == 0)
  ------------------
  |  Branch (139:7): [True: 3.87k, False: 2.75M]
  ------------------
  140|  3.87k|    return 1;
  141|  2.75M|  char* p = c.conds;
  142|  2.87M|  while (true) {
  ------------------
  |  Branch (142:10): [True: 2.87M, Folded]
  ------------------
  143|  2.87M|    switch (*p) {
  144|      0|      case '\0':
  ------------------
  |  Branch (144:7): [True: 0, False: 2.87M]
  ------------------
  145|      0|        return 1;
  146|  24.3k|      case '[': {
  ------------------
  |  Branch (146:7): [True: 24.3k, False: 2.85M]
  ------------------
  147|  24.3k|        neg = false;
  148|  24.3k|        ingroup = false;
  149|  24.3k|        p = nextchar(p);
  150|  24.3k|        pos = st;
  151|  24.3k|        break;
  152|      0|      }
  153|  24.3k|      case '^': {
  ------------------
  |  Branch (153:7): [True: 24.3k, False: 2.85M]
  ------------------
  154|  24.3k|        p = nextchar(p);
  155|  24.3k|        neg = true;
  156|  24.3k|        break;
  157|      0|      }
  158|  24.3k|      case ']': {
  ------------------
  |  Branch (158:7): [True: 24.3k, False: 2.85M]
  ------------------
  159|  24.3k|        if (bool(neg) == bool(ingroup))
  ------------------
  |  Branch (159:13): [True: 0, False: 24.3k]
  ------------------
  160|      0|          return 0;
  161|  24.3k|        pos = std::string::npos;
  162|  24.3k|        p = nextchar(p);
  163|       |        // skip the next character
  164|  24.3k|        if (!ingroup && st < s.size())
  ------------------
  |  Branch (164:13): [True: 24.3k, False: 0]
  |  Branch (164:25): [True: 23.0k, False: 1.30k]
  ------------------
  165|  23.0k|          st = (opts & aeUTF8) ? utf8_next(s, st) : st + 1;
  ------------------
  |  |   66|  23.0k|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (165:16): [True: 23.0k, False: 0]
  ------------------
  166|  24.3k|        if (st == s.size() && p)
  ------------------
  |  Branch (166:13): [True: 3.49k, False: 20.8k]
  |  Branch (166:31): [True: 0, False: 3.49k]
  ------------------
  167|      0|          return 0;  // word <= condition
  168|  24.3k|        break;
  169|  24.3k|      }
  170|  24.3k|      case '.':
  ------------------
  |  Branch (170:7): [True: 0, False: 2.87M]
  ------------------
  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|  2.80M|      default: {
  ------------------
  |  Branch (180:7): [True: 2.80M, False: 72.9k]
  ------------------
  181|  2.80M|        if (st < s.size() && s[st] == *p) {
  ------------------
  |  Branch (181:13): [True: 2.80M, False: 2.61k]
  |  Branch (181:30): [True: 24.6k, False: 2.77M]
  ------------------
  182|  24.6k|          ++st;
  183|  24.6k|          p = nextchar(p);
  184|  24.6k|          if ((opts & aeUTF8) && (s[st - 1] & 0x80)) {  // multibyte
  ------------------
  |  |   66|  24.6k|#define aeUTF8 (1 << 1)
  ------------------
  |  Branch (184:15): [True: 24.6k, False: 0]
  |  Branch (184:34): [True: 24.6k, False: 0]
  ------------------
  185|  49.0k|            while (p && is_utf8_cont(*p)) {             // character
  ------------------
  |  Branch (185:20): [True: 49.0k, False: 0]
  |  Branch (185:25): [True: 24.6k, False: 24.3k]
  ------------------
  186|  24.6k|              if (st >= s.size() || *p != s[st]) {
  ------------------
  |  Branch (186:19): [True: 0, False: 24.6k]
  |  Branch (186:37): [True: 390, False: 24.3k]
  ------------------
  187|    390|                if (pos == std::string::npos)
  ------------------
  |  Branch (187:21): [True: 390, False: 0]
  ------------------
  188|    390|                  return 0;
  189|      0|                st = pos;
  190|      0|                break;
  191|    390|              }
  192|  24.3k|              p = nextchar(p);
  193|  24.3k|              ++st;
  194|  24.3k|            }
  195|  24.3k|            if (pos != std::string::npos && st != pos) {
  ------------------
  |  Branch (195:17): [True: 0, False: 24.3k]
  |  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|  24.3k|          } 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|  2.78M|        } else if (pos != std::string::npos) {  // group
  ------------------
  |  Branch (205:20): [True: 48.6k, False: 2.73M]
  ------------------
  206|  48.6k|          p = nextchar(p);
  207|  48.6k|        } else
  208|  2.73M|          return 0;
  209|  2.80M|      }
  210|  2.87M|    }
  211|   145k|    if (!p)
  ------------------
  |  Branch (211:9): [True: 24.3k, False: 121k]
  ------------------
  212|  24.3k|      return 1;
  213|   145k|  }
  214|  2.75M|}
_ZN8PfxEntry8nextcharEPc:
  119|   170k|inline char* PfxEntry::nextchar(char* p) {
  120|   170k|  if (p) {
  ------------------
  |  Branch (120:7): [True: 170k, False: 0]
  ------------------
  121|   170k|    p++;
  122|   170k|    if (opts & aeLONGCOND) {
  ------------------
  |  |   69|   170k|#define aeLONGCOND (1 << 4)
  ------------------
  |  Branch (122:9): [True: 0, False: 170k]
  ------------------
  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|   170k|    } else if (p == c.conds + MAXCONDLEN)
  ------------------
  |  |   93|   170k|#define MAXCONDLEN 20
  ------------------
  |  Branch (127:16): [True: 0, False: 170k]
  ------------------
  128|      0|      return nullptr;
  129|   170k|    return *p ? p : nullptr;
  ------------------
  |  Branch (129:12): [True: 146k, False: 24.3k]
  ------------------
  130|   170k|  }
  131|      0|  return nullptr;
  132|   170k|}
_ZN8SfxEntry14test_conditionEPKcS1_:
  608|  73.6k|inline int SfxEntry::test_condition(const char* st, const char* beg) {
  609|  73.6k|  const char* pos = nullptr;  // group with pos input position
  610|  73.6k|  bool neg = false;        // complementer
  611|  73.6k|  bool ingroup = false;    // character in the group
  612|  73.6k|  if (numconds == 0)
  ------------------
  |  Branch (612:7): [True: 73.6k, False: 0]
  ------------------
  613|  73.6k|    return 1;
  614|      0|  char* p = c.conds;
  615|      0|  st--;
  616|      0|  int i = 1;
  617|      0|  while (true) {
  ------------------
  |  Branch (617:10): [True: 0, Folded]
  ------------------
  618|      0|    switch (*p) {
  619|      0|      case '\0':
  ------------------
  |  Branch (619:7): [True: 0, False: 0]
  ------------------
  620|      0|        return 1;
  621|      0|      case '[':
  ------------------
  |  Branch (621:7): [True: 0, False: 0]
  ------------------
  622|      0|        p = nextchar(p);
  623|      0|        pos = st;
  624|      0|        break;
  625|      0|      case '^':
  ------------------
  |  Branch (625:7): [True: 0, False: 0]
  ------------------
  626|      0|        p = nextchar(p);
  627|      0|        neg = true;
  628|      0|        break;
  629|      0|      case ']':
  ------------------
  |  Branch (629:7): [True: 0, False: 0]
  ------------------
  630|      0|        if (!neg && !ingroup)
  ------------------
  |  Branch (630:13): [True: 0, False: 0]
  |  Branch (630:21): [True: 0, False: 0]
  ------------------
  631|      0|          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: 0]
  ------------------
  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|      0|      default: {
  ------------------
  |  Branch (666:7): [True: 0, False: 0]
  ------------------
  667|      0|        if (*st == *p) {
  ------------------
  |  Branch (667:13): [True: 0, False: 0]
  ------------------
  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|      0|        } else if (pos) {  // group
  ------------------
  |  Branch (713:20): [True: 0, False: 0]
  ------------------
  714|      0|          p = nextchar(p);
  715|      0|        } else
  716|      0|          return 0;
  717|      0|      }
  718|      0|    }
  719|      0|    if (!p)
  ------------------
  |  Branch (719:9): [True: 0, False: 0]
  ------------------
  720|      0|      return 1;
  721|      0|  }
  722|      0|}

_ZN8PfxEntry7getContEv:
  136|  4.21M|  inline const unsigned short* getCont() { return contclass; }
_ZN8PfxEntry10getContLenEv:
  137|  1.40M|  inline unsigned short getContLen() { return contclasslen; }
_ZN8SfxEntry7getContEv:
  226|   367k|  inline const unsigned short* getCont() { return contclass; }
_ZN8SfxEntry10getContLenEv:
  227|  39.1k|  inline unsigned short getContLen() { return contclasslen; }
_ZN8PfxEntry7getFlagEv:
  128|    916|  FLAG getFlag() { return aflag; }
_ZN8PfxEntry6getKeyEv:
  129|   133k|  const char* getKey() { return appnd.c_str(); }
_ZN8SfxEntry7getFlagEv:
  220|   109k|  FLAG getFlag() { return aflag; }
_ZN8SfxEntry8getAffixEv:
  228|  36.6k|  inline const char* getAffix() { return appnd.c_str(); }
_ZNK8PfxEntry10allowCrossEv:
   94|      2|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|      2|#define aeXPRODUCT (1 << 0)
  ------------------
_ZN8PfxEntry9getKeyLenEv:
  132|  2.72k|  inline int getKeyLen() { return appnd.size(); }
_ZN8PfxEntry7getNextEv:
  139|  2.73M|  inline PfxEntry* getNext() { return next; }
_ZN8PfxEntry9getNextNEEv:
  140|  57.4k|  inline PfxEntry* getNextNE() { return nextne; }
_ZN8PfxEntry9getNextEQEv:
  141|  75.1k|  inline PfxEntry* getNextEQ() { return nexteq; }
_ZN8PfxEntry9getFlgNxtEv:
  142|    908|  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|     27|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|     27|#define aeXPRODUCT (1 << 0)
  ------------------
_ZN8SfxEntry6getKeyEv:
  221|   327k|  const char* getKey() { return rappnd.c_str(); }
_ZN8SfxEntry9getKeyLenEv:
  230|   165k|  inline int getKeyLen() { return appnd.size(); }
_ZN8SfxEntry7getNextEv:
  232|    228|  inline SfxEntry* getNext() { return next; }
_ZN8SfxEntry9getNextNEEv:
  233|  40.5k|  inline SfxEntry* getNextNE() { return nextne; }
_ZN8SfxEntry9getNextEQEv:
  234|   287k|  inline SfxEntry* getNextEQ() { return nexteq; }
_ZN8SfxEntry9getFlgNxtEv:
  239|  64.2k|  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|    int n = condlen(cs);
 1090|      8|    if (n > std::numeric_limits<unsigned char>::max()) {
  ------------------
  |  Branch (1090:9): [True: 0, False: 8]
  ------------------
 1091|      0|      HUNSPELL_WARNING(stderr, "error: condition length %d is over max limit\n", n);
 1092|      0|      return 1;
 1093|      0|    }
 1094|      8|    entry.numconds = (unsigned char)n;
 1095|      8|    const size_t cslen = cs.size();
 1096|      8|    const size_t short_part = std::min<size_t>(MAXCONDLEN, cslen);
  ------------------
  |  |   93|      8|#define MAXCONDLEN 20
  ------------------
 1097|      8|    memcpy(entry.c.conds, cs.data(), short_part);
 1098|      8|    if (short_part < MAXCONDLEN) {
  ------------------
  |  |   93|      8|#define MAXCONDLEN 20
  ------------------
  |  Branch (1098:9): [True: 8, False: 0]
  ------------------
 1099|       |      //blank out the remaining space
 1100|      8|      memset(entry.c.conds + short_part, 0, MAXCONDLEN - short_part);
  ------------------
  |  |   93|      8|#define MAXCONDLEN 20
  ------------------
 1101|      8|    } else if (cs[MAXCONDLEN]) {
  ------------------
  |  |   93|      0|#define MAXCONDLEN 20
  ------------------
  |  Branch (1101:16): [True: 0, False: 0]
  ------------------
 1102|       |      //there is more conditions than fit in fixed space, so its
 1103|       |      //a long condition
 1104|      0|      entry.opts |= aeLONGCOND;
  ------------------
  |  |   69|      0|#define aeLONGCOND (1 << 4)
  ------------------
 1105|      0|      size_t remaining = cs.size() - MAXCONDLEN_1;
  ------------------
  |  |   94|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   93|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
 1106|      0|      entry.c.l.conds2 = new char[1 + remaining];
 1107|      0|      memcpy(entry.c.l.conds2, cs.data() + MAXCONDLEN_1, remaining);
  ------------------
  |  |   94|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   93|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
 1108|      0|      entry.c.l.conds2[remaining] = 0;
 1109|      0|    }
 1110|     34|  } else {
 1111|     34|    entry.numconds = 0;
 1112|     34|    entry.c.conds[0] = '\0';
 1113|     34|  }
 1114|     42|  return 0;
 1115|     42|}
_ZN8AffixMgr12prefix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratchtt:
 1133|   539M|                                      const FLAG avoidflag) {
 1134|   539M|  struct hentry* rv = nullptr;
 1135|       |
 1136|   539M|  pfx = nullptr;
 1137|   539M|  pfxappnd = nullptr;
 1138|   539M|  sfxappnd = nullptr;
 1139|   539M|  sfxextra = 0;
 1140|       |
 1141|   539M|  TraceCtx* t = trace_on(scratch.trace);
 1142|   539M|  int candidates = 0;
 1143|       |
 1144|       |  // first handle the special case of 0 length prefixes
 1145|   539M|  PfxEntry* pe = pStart[0];
 1146|   540M|  while (pe) {
  ------------------
  |  Branch (1146:10): [True: 1.36M, False: 539M]
  ------------------
 1147|  1.36M|    if (
 1148|       |        // fogemorpheme
 1149|  1.36M|        ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   75|  1.36M|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1149:10): [True: 0, False: 1.36M]
  ------------------
 1150|  1.36M|         !(pe->getCont() &&
  ------------------
  |  Branch (1150:12): [True: 1.36M, False: 0]
  ------------------
 1151|  1.36M|           (TESTAFF(pe->getCont(), onlyincompound, pe->getContLen())))) &&
  ------------------
  |  |  102|  1.36M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1151:12): [True: 0, False: 1.36M]
  ------------------
 1152|       |        // permit prefixes in compounds
 1153|  1.36M|        ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   77|  1.36M|#define IN_CPD_END 2
  ------------------
  |  Branch (1153:10): [True: 1.36M, False: 0]
  ------------------
 1154|      0|         (pe->getCont() &&
  ------------------
  |  Branch (1154:11): [True: 0, False: 0]
  ------------------
 1155|  1.36M|          (TESTAFF(pe->getCont(), compoundpermitflag, pe->getContLen()))))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1155:11): [True: 0, False: 0]
  ------------------
 1156|       |      // check prefix
 1157|  1.36M|      ++candidates;
 1158|  1.36M|      rv = pe->checkword(word, start, len, in_compound, needflag, scratch);
 1159|       |      // Skip a stem with the avoid flag and keep scanning the other prefixes.
 1160|  1.36M|      if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |   99|  1.36M|#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 (1160:11): [True: 0, False: 1.36M]
  |  Branch (1160:17): [True: 0, False: 0]
  ------------------
 1161|      0|        trace_avoidflag(t, avoidflag, rv);
 1162|      0|        rv = nullptr;
 1163|      0|      }
 1164|  1.36M|      if (rv) {
  ------------------
  |  Branch (1164:11): [True: 0, False: 1.36M]
  ------------------
 1165|      0|        pfx = pe;  // BUG: pfx not stateless
 1166|      0|        return rv;
 1167|      0|      }
 1168|  1.36M|    }
 1169|  1.36M|    pe = pe->getNext();
 1170|  1.36M|  }
 1171|       |
 1172|       |  // now handle the general case
 1173|   539M|  unsigned char sp = word[start];
 1174|   539M|  PfxEntry* pptr = pStart[sp];
 1175|       |
 1176|   539M|  while (pptr) {
  ------------------
  |  Branch (1176:10): [True: 68.3k, False: 539M]
  ------------------
 1177|  68.3k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1177:9): [True: 39.5k, False: 28.7k]
  ------------------
 1178|  39.5k|      if (
 1179|       |          // fogemorpheme
 1180|  39.5k|          ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   75|  39.5k|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1180:12): [True: 0, False: 39.5k]
  ------------------
 1181|  39.5k|           !(pptr->getCont() &&
  ------------------
  |  Branch (1181:14): [True: 35.5k, False: 3.97k]
  ------------------
 1182|  35.5k|             (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen())))) &&
  ------------------
  |  |  102|  35.5k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1182:14): [True: 0, False: 35.5k]
  ------------------
 1183|       |          // permit prefixes in compounds
 1184|  39.5k|          ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   77|  39.5k|#define IN_CPD_END 2
  ------------------
  |  Branch (1184:12): [True: 39.5k, False: 0]
  ------------------
 1185|      0|           (pptr->getCont() && (TESTAFF(pptr->getCont(), compoundpermitflag,
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1185:13): [True: 0, False: 0]
  |  Branch (1185:32): [True: 0, False: 0]
  ------------------
 1186|  39.5k|                                        pptr->getContLen()))))) {
 1187|       |        // check prefix
 1188|  39.5k|        ++candidates;
 1189|  39.5k|        rv = pptr->checkword(word, start, len, in_compound, needflag, scratch);
 1190|  39.5k|        if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |   99|  39.5k|#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 (1190:13): [True: 0, False: 39.5k]
  |  Branch (1190:19): [True: 0, False: 0]
  ------------------
 1191|      0|          trace_avoidflag(t, avoidflag, rv);
 1192|      0|          rv = nullptr;
 1193|      0|        }
 1194|  39.5k|        if (rv) {
  ------------------
  |  Branch (1194:13): [True: 0, False: 39.5k]
  ------------------
 1195|      0|          pfx = pptr;  // BUG: pfx not stateless
 1196|      0|          return rv;
 1197|      0|        }
 1198|  39.5k|      }
 1199|  39.5k|      pptr = pptr->getNextEQ();
 1200|  39.5k|    } else {
 1201|  28.7k|      pptr = pptr->getNextNE();
 1202|  28.7k|    }
 1203|  68.3k|  }
 1204|       |
 1205|       |  // a pass that had nothing to try says so, which is different from a pass that
 1206|       |  // did not run
 1207|   539M|  if (t && candidates == 0)
  ------------------
  |  Branch (1207:7): [True: 0, False: 539M]
  |  Branch (1207:12): [True: 0, False: 0]
  ------------------
 1208|      0|    trace(*t, "pfx \"%s\" candidates=0", word.substr(start, len).c_str());
 1209|       |
 1210|   539M|  return nullptr;
 1211|   539M|}
_ZN8AffixMgr19prefix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1219|  16.6M|                                             const FLAG needflag) {
 1220|  16.6M|  struct hentry* rv = nullptr;
 1221|       |
 1222|  16.6M|  pfx = nullptr;
 1223|  16.6M|  sfxappnd = nullptr;
 1224|  16.6M|  sfxextra = 0;
 1225|       |
 1226|       |  // first handle the special case of 0 length prefixes
 1227|  16.6M|  PfxEntry* pe = pStart[0];
 1228|       |
 1229|  17.9M|  while (pe) {
  ------------------
  |  Branch (1229:10): [True: 1.36M, False: 16.6M]
  ------------------
 1230|  1.36M|    rv = pe->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1231|  1.36M|    if (rv)
  ------------------
  |  Branch (1231:9): [True: 0, False: 1.36M]
  ------------------
 1232|      0|      return rv;
 1233|  1.36M|    pe = pe->getNext();
 1234|  1.36M|  }
 1235|       |
 1236|       |  // now handle the general case
 1237|  16.6M|  unsigned char sp = word[start];
 1238|  16.6M|  PfxEntry* pptr = pStart[sp];
 1239|       |
 1240|  16.6M|  while (pptr) {
  ------------------
  |  Branch (1240:10): [True: 64.3k, False: 16.6M]
  ------------------
 1241|  64.3k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1241:9): [True: 35.5k, False: 28.7k]
  ------------------
 1242|  35.5k|      rv = pptr->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1243|  35.5k|      if (rv) {
  ------------------
  |  Branch (1243:11): [True: 0, False: 35.5k]
  ------------------
 1244|      0|        pfx = pptr;
 1245|      0|        return rv;
 1246|      0|      }
 1247|  35.5k|      pptr = pptr->getNextEQ();
 1248|  35.5k|    } else {
 1249|  28.7k|      pptr = pptr->getNextNE();
 1250|  28.7k|    }
 1251|  64.3k|  }
 1252|       |
 1253|  16.6M|  return nullptr;
 1254|  16.6M|}
_ZN8AffixMgr18prefix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1262|  12.7k|                                         const FLAG needflag) {
 1263|       |
 1264|       |  // many prefixes can analyse a word the same way
 1265|  12.7k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  122|  12.7k|#define MSEP_REC '\n'
  ------------------
 1266|       |
 1267|  12.7k|  pfx = nullptr;
 1268|  12.7k|  sfxappnd = nullptr;
 1269|  12.7k|  sfxextra = 0;
 1270|       |
 1271|       |  // first handle the special case of 0 length prefixes
 1272|  12.7k|  PfxEntry* pe = pStart[0];
 1273|  13.4k|  while (pe) {
  ------------------
  |  Branch (1273:10): [True: 702, False: 12.7k]
  ------------------
 1274|    702|    std::string st = pe->check_morph(word, start, len, in_compound, needflag, scratch);
 1275|    702|    if (!st.empty()) {
  ------------------
  |  Branch (1275:9): [True: 0, False: 702]
  ------------------
 1276|      0|      result.append(st);
 1277|      0|    }
 1278|    702|    pe = pe->getNext();
 1279|    702|  }
 1280|       |
 1281|       |  // now handle the general case
 1282|  12.7k|  unsigned char sp = word[start];
 1283|  12.7k|  PfxEntry* pptr = pStart[sp];
 1284|       |
 1285|  12.7k|  while (pptr) {
  ------------------
  |  Branch (1285:10): [True: 2, False: 12.7k]
  ------------------
 1286|      2|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1286:9): [True: 2, False: 0]
  ------------------
 1287|      2|      std::string st = pptr->check_morph(word, start, len, in_compound, needflag, scratch);
 1288|      2|      if (!st.empty()) {
  ------------------
  |  Branch (1288:11): [True: 0, False: 2]
  ------------------
 1289|       |        // fogemorpheme
 1290|      0|        if ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   75|      0|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1290:13): [True: 0, False: 0]
  ------------------
 1291|      0|            !((pptr->getCont() && (TESTAFF(pptr->getCont(), onlyincompound,
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1291:16): [True: 0, False: 0]
  |  Branch (1291:35): [True: 0, False: 0]
  ------------------
 1292|      0|                                           pptr->getContLen()))))) {
 1293|      0|          result.append(st);
 1294|      0|          pfx = pptr;
 1295|      0|        }
 1296|      0|      }
 1297|      2|      pptr = pptr->getNextEQ();
 1298|      2|    } else {
 1299|      0|      pptr = pptr->getNextNE();
 1300|      0|    }
 1301|      2|  }
 1302|       |
 1303|  12.7k|  return result.join();
 1304|  12.7k|}
_ZN8AffixMgr25prefix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiicR12AffixScratcht:
 1312|  3.97k|                                                const FLAG needflag) {
 1313|       |  // every prefix crosses with every pair of suffixes
 1314|  3.97k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  122|  3.97k|#define MSEP_REC '\n'
  ------------------
 1315|       |
 1316|  3.97k|  pfx = nullptr;
 1317|  3.97k|  sfxappnd = nullptr;
 1318|  3.97k|  sfxextra = 0;
 1319|       |
 1320|       |  // first handle the special case of 0 length prefixes
 1321|  3.97k|  PfxEntry* pe = pStart[0];
 1322|  4.67k|  while (pe) {
  ------------------
  |  Branch (1322:10): [True: 702, False: 3.97k]
  ------------------
 1323|    702|    std::string st = pe->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1324|    702|    if (!st.empty()) {
  ------------------
  |  Branch (1324:9): [True: 0, False: 702]
  ------------------
 1325|      0|      result.append(st);
 1326|      0|    }
 1327|    702|    pe = pe->getNext();
 1328|    702|  }
 1329|       |
 1330|       |  // now handle the general case
 1331|  3.97k|  unsigned char sp = word[start];
 1332|  3.97k|  PfxEntry* pptr = pStart[sp];
 1333|       |
 1334|  3.97k|  while (pptr) {
  ------------------
  |  Branch (1334:10): [True: 0, False: 3.97k]
  ------------------
 1335|      0|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1335:9): [True: 0, False: 0]
  ------------------
 1336|      0|      std::string st = pptr->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1337|      0|      if (!st.empty()) {
  ------------------
  |  Branch (1337:11): [True: 0, False: 0]
  ------------------
 1338|      0|        result.append(st);
 1339|      0|        pfx = pptr;
 1340|      0|      }
 1341|      0|      pptr = pptr->getNextEQ();
 1342|      0|    } else {
 1343|      0|      pptr = pptr->getNextNE();
 1344|      0|    }
 1345|      0|  }
 1346|       |
 1347|  3.97k|  return result.join();
 1348|  3.97k|}
_ZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1694|    670|short AffixMgr::get_syllable(const std::string& word) {
 1695|    670|  if (cpdmaxsyllable == 0)
  ------------------
  |  Branch (1695:7): [True: 0, False: 670]
  ------------------
 1696|      0|    return 0;
 1697|       |
 1698|    670|  short num = 0;
 1699|       |
 1700|    670|  if (!utf8) {
  ------------------
  |  Branch (1700:7): [True: 0, False: 670]
  ------------------
 1701|      0|    num = (short)std::count_if(word.begin(), word.end(),
 1702|      0|          [&](char c) {
 1703|      0|            return std::binary_search(cpdvowels.begin(), cpdvowels.end(), c);
 1704|      0|          });
 1705|    670|  } else if (!cpdvowels_utf16.empty()) {
  ------------------
  |  Branch (1705:14): [True: 670, False: 0]
  ------------------
 1706|    670|    std::vector<w_char> w;
 1707|    670|    u8_u16(w, word);
 1708|    670|    num = (short)std::count_if(w.begin(), w.end(),
 1709|    670|          [&](w_char wc) {
 1710|    670|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1711|    670|          });
 1712|    670|  }
 1713|       |
 1714|    670|  return num;
 1715|    670|}
_ZN8AffixMgr10setcminmaxEPmS0_PKcm:
 1717|  23.3M|void AffixMgr::setcminmax(size_t* cmin, size_t* cmax, const char* word, size_t len) {
 1718|  23.3M|  if (utf8) {
  ------------------
  |  Branch (1718:7): [True: 1.71M, False: 21.6M]
  ------------------
 1719|  1.71M|    int i;
 1720|  5.11M|    for (*cmin = 0, i = 0; (i < cpdmin) && *cmin < len; i++) {
  ------------------
  |  Branch (1720:28): [True: 3.42M, False: 1.68M]
  |  Branch (1720:44): [True: 3.39M, False: 25.1k]
  ------------------
 1721|  3.87M|      for ((*cmin)++; *cmin < len && is_utf8_cont(word[*cmin]); (*cmin)++)
  ------------------
  |  Branch (1721:23): [True: 3.83M, False: 42.4k]
  |  Branch (1721:38): [True: 481k, False: 3.35M]
  ------------------
 1722|   481k|        ;
 1723|  3.39M|    }
 1724|  3.42M|    for (*cmax = len, i = 0; (i < (cpdmin - 1)) && *cmax > 0; i++) {
  ------------------
  |  Branch (1724:30): [True: 1.71M, False: 1.70M]
  |  Branch (1724:52): [True: 1.70M, False: 3.50k]
  ------------------
 1725|  2.64M|      for ((*cmax)--; *cmax > 0 && is_utf8_cont(word[*cmax]); (*cmax)--)
  ------------------
  |  Branch (1725:23): [True: 2.62M, False: 21.6k]
  |  Branch (1725:36): [True: 938k, False: 1.68M]
  ------------------
 1726|   938k|        ;
 1727|  1.70M|    }
 1728|  21.6M|  } else {
 1729|  21.6M|    *cmin = cpdmin;
 1730|  21.6M|    *cmax = len - cpdmin + 1;
 1731|  21.6M|  }
 1732|  23.3M|}
_ZN8AffixMgr14compound_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEssssPP6hentrySB_ccPiR12AffixScratch:
 1746|  23.3M|                                        AffixScratch& scratch) {
 1747|  23.3M|  short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2;
 1748|  23.3M|  hentry *rv = nullptr, *rv_first;
 1749|  23.3M|  std::string st;
 1750|  23.3M|  char ch = '\0', affixed;
 1751|  23.3M|  size_t cmin, cmax;
 1752|  23.3M|  int striple = 0, soldi = 0, oldcmin = 0, oldcmax = 0, oldlen = 0, checkedstriple = 0;
 1753|  23.3M|  hentry** oldwords = words;
 1754|  23.3M|  size_t scpd = 0, len = word.size();
 1755|       |
 1756|  23.3M|  TraceCtx* t = trace_on(scratch.trace);
 1757|       |
 1758|       |  // protect subsequent words[wnum + 1] reads and any recursion
 1759|  23.3M|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (1759:7): [True: 0, False: 23.3M]
  ------------------
 1760|      0|    return nullptr;
 1761|       |
 1762|  23.3M|  int checked_prefix;
 1763|       |
 1764|       |  // add a time limit to handle possible
 1765|       |  // combinatorical explosion of the overlapping words
 1766|       |
 1767|  23.3M|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  23.3M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1768|  23.3M|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  23.3M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1769|       |
 1770|       |  // get the current time
 1771|  23.3M|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 1772|       |
 1773|  23.3M|  if (wnum == 0) {
  ------------------
  |  Branch (1773:7): [True: 23.3M, False: 289]
  ------------------
 1774|       |      // set the start time
 1775|  23.3M|      clock_time_start = clock_now;
 1776|  23.3M|      timelimit_exceeded = false;
 1777|  23.3M|  }
 1778|    289|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  109|    289|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1778:12): [True: 0, False: 289]
  ------------------
 1779|      0|      timelimit_exceeded = true;
 1780|       |
 1781|  23.3M|  setcminmax(&cmin, &cmax, word.c_str(), len);
 1782|       |
 1783|       |  // with SIMPLIFIEDTRIPLE a second part that starts at a doubled letter is one letter longer
 1784|       |  // than the surface shows, so the split can go one letter past cmax
 1785|  23.3M|  size_t cmaxtriple = simplifiedtriple ? (utf8 ? utf8_next(word, cmax) : cmax + 1) : cmax;
  ------------------
  |  Branch (1785:23): [True: 0, False: 23.3M]
  |  Branch (1785:43): [True: 0, False: 0]
  ------------------
 1786|       |
 1787|  23.3M|  st.assign(word);
 1788|       |
 1789|   514M|  for (size_t i = cmin; i < cmaxtriple; ++i) {
  ------------------
  |  Branch (1789:25): [True: 491M, False: 22.2M]
  ------------------
 1790|       |    // go to end of the UTF-8 character
 1791|   491M|    if (utf8) {
  ------------------
  |  Branch (1791:9): [True: 40.3M, False: 451M]
  ------------------
 1792|  50.1M|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (1792:14): [True: 9.75M, False: 40.3M]
  ------------------
 1793|  9.75M|        ;
 1794|  40.3M|      if (i >= cmaxtriple)
  ------------------
  |  Branch (1794:11): [True: 164k, False: 40.2M]
  ------------------
 1795|   164k|        return nullptr;
 1796|  40.3M|    }
 1797|   491M|    if (i >= cmax && !(i > 2 && word[i - 1] == word[i - 2]))
  ------------------
  |  Branch (1797:9): [True: 0, False: 491M]
  |  Branch (1797:24): [True: 0, False: 0]
  |  Branch (1797:33): [True: 0, False: 0]
  ------------------
 1798|      0|      break;
 1799|       |
 1800|   491M|    words = oldwords;
 1801|   491M|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (1801:23): [True: 0, False: 491M]
  ------------------
 1802|       |
 1803|   491M|    do {  // onlycpdrule loop
 1804|       |
 1805|   491M|      oldnumsyllable = numsyllable;
 1806|   491M|      oldwordnum = wordnum;
 1807|   491M|      checked_prefix = 0;
 1808|       |
 1809|   491M|      do {  // simplified checkcompoundpattern loop
 1810|       |
 1811|   491M|        if (timelimit_exceeded ||
  ------------------
  |  Branch (1811:13): [True: 0, False: 491M]
  |  Branch (1811:13): [True: 0, False: 491M]
  ------------------
 1812|   491M|            std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  109|   491M|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1812:13): [True: 0, False: 491M]
  ------------------
 1813|      0|          if (t && !timelimit_exceeded)
  ------------------
  |  Branch (1813:15): [True: 0, False: 0]
  |  Branch (1813:20): [True: 0, False: 0]
  ------------------
 1814|      0|            trace(*t, "test timelimit -> fail, the compound search stops here and gives up");
 1815|      0|          timelimit_exceeded = true;
 1816|      0|          return nullptr;
 1817|      0|        }
 1818|       |
 1819|   491M|        if (scpd > 0) {
  ------------------
  |  Branch (1819:13): [True: 0, False: 491M]
  ------------------
 1820|      0|          for (; scpd <= checkcpdtable.size() &&
  ------------------
  |  Branch (1820:18): [True: 0, False: 0]
  ------------------
 1821|      0|                 (checkcpdtable[scpd - 1].pattern3.empty() ||
  ------------------
  |  Branch (1821:19): [True: 0, False: 0]
  ------------------
 1822|      0|                  i > word.size() ||
  ------------------
  |  Branch (1822:19): [True: 0, False: 0]
  ------------------
 1823|      0|                  word.compare(i, checkcpdtable[scpd - 1].pattern3.size(), checkcpdtable[scpd - 1].pattern3) != 0);
  ------------------
  |  Branch (1823:19): [True: 0, False: 0]
  ------------------
 1824|      0|               scpd++)
 1825|      0|            ;
 1826|       |
 1827|      0|          if (scpd > checkcpdtable.size())
  ------------------
  |  Branch (1827:15): [True: 0, False: 0]
  ------------------
 1828|      0|            break;  // break simplified checkcompoundpattern loop
 1829|      0|          st.replace(i, std::string::npos, checkcpdtable[scpd - 1].pattern);
 1830|      0|          soldi = i;
 1831|      0|          i += checkcpdtable[scpd - 1].pattern.size();
 1832|      0|          st.replace(i, std::string::npos, checkcpdtable[scpd - 1].pattern2);
 1833|      0|          st.replace(i + checkcpdtable[scpd - 1].pattern2.size(), std::string::npos,
 1834|      0|                 word.substr(soldi + checkcpdtable[scpd - 1].pattern3.size()));
 1835|       |
 1836|      0|          oldlen = len;
 1837|      0|          len += checkcpdtable[scpd - 1].pattern.size() +
 1838|      0|                 checkcpdtable[scpd - 1].pattern2.size() -
 1839|      0|                 checkcpdtable[scpd - 1].pattern3.size();
 1840|      0|          oldcmin = cmin;
 1841|      0|          oldcmax = cmax;
 1842|      0|          setcminmax(&cmin, &cmax, st.c_str(), len);
 1843|       |
 1844|      0|          cmax = len - cpdmin + 1;
 1845|      0|        }
 1846|       |
 1847|   491M|        if (i >= st.size())
  ------------------
  |  Branch (1847:13): [True: 914k, False: 490M]
  ------------------
 1848|   914k|          return nullptr;
 1849|       |
 1850|   490M|        ch = st[i];
 1851|   490M|        if (t) {
  ------------------
  |  Branch (1851:13): [True: 0, False: 490M]
  ------------------
 1852|       |          // a non-zero scpd means this split is the retry that one CHECKCOMPOUNDPATTERN entry asks
 1853|       |          // for, with the text at the join replaced by the two sides of that entry
 1854|      0|          if (scpd != 0)
  ------------------
  |  Branch (1854:15): [True: 0, False: 0]
  ------------------
 1855|      0|            trace(*t, "split at=%d left=\"%s\" right=\"%s\" cpdpattern=%d", (int)i,
 1856|      0|                  st.substr(0, i).c_str(), st.substr(i).c_str(), (int)scpd);
 1857|      0|          else
 1858|      0|            trace(*t, "split at=%d left=\"%s\" right=\"%s\"", (int)i,
 1859|      0|                  st.substr(0, i).c_str(), st.substr(i).c_str());
 1860|      0|        }
 1861|       |        // everything this split point tries belongs to the split
 1862|   490M|        TraceScope split_depth(t);
 1863|   490M|        st[i] = '\0';
 1864|       |
 1865|   490M|        sfx = nullptr;
 1866|   490M|        pfx = nullptr;
 1867|       |
 1868|       |        // FIRST WORD
 1869|       |
 1870|   490M|        affixed = 1;
 1871|   490M|        rv = lookup(st.c_str(), i);  // perhaps without prefix
 1872|   490M|        if (t) {
  ------------------
  |  Branch (1872:13): [True: 0, False: 490M]
  ------------------
 1873|      0|          if (rv)
  ------------------
  |  Branch (1873:15): [True: 0, False: 0]
  ------------------
 1874|      0|            trace(*t, "first \"%s\" -> entry \"%s\" flags=%s", st.c_str(),
 1875|      0|                  rv->word, trace_flags(this, rv->astr, rv->alen).c_str());
 1876|      0|          else
 1877|      0|            trace(*t, "first \"%s\" -> miss", st.c_str());
 1878|      0|        }
 1879|       |
 1880|       |        // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 1881|       |        // compound words, overriding the effect of COMPOUNDPERMITFLAG
 1882|   490M|        if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (1882:13): [True: 2.94M, False: 487M]
  |  Branch (1882:21): [True: 49.5k, False: 2.89M]
  ------------------
 1883|  49.5k|                TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule) {
  ------------------
  |  |  102|   490M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 49.5k]
  |  |  ------------------
  ------------------
  |  Branch (1883:68): [True: 0, False: 0]
  ------------------
 1884|      0|            bool would_continue = !onlycpdrule && simplifiedcpd;
  ------------------
  |  Branch (1884:35): [True: 0, False: 0]
  |  Branch (1884:51): [True: 0, False: 0]
  ------------------
 1885|      0|            if (!scpd && would_continue) {
  ------------------
  |  Branch (1885:17): [True: 0, False: 0]
  |  Branch (1885:26): [True: 0, False: 0]
  ------------------
 1886|       |                // given the while conditions that continue jumps to, this situation
 1887|       |                // never ends
 1888|      0|                HUNSPELL_WARNING(stderr, "break infinite loop\n");
 1889|      0|                break;
 1890|      0|            }
 1891|       |
 1892|      0|            if (scpd > 0 && would_continue) {
  ------------------
  |  Branch (1892:17): [True: 0, False: 0]
  |  Branch (1892:29): [True: 0, False: 0]
  ------------------
 1893|       |                // under these conditions we loop again, but the assumption above
 1894|       |                // appears to be that cmin and cmax are the original values they
 1895|       |                // had in the outside loop
 1896|      0|                cmin = oldcmin;
 1897|      0|                cmax = oldcmax;
 1898|      0|            }
 1899|      0|            continue;
 1900|      0|        }
 1901|       |
 1902|       |        // search homonym with compound flag
 1903|   493M|        while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1903:16): [True: 2.94M, False: 490M]
  |  Branch (1903:24): [True: 2.94M, False: 268]
  ------------------
 1904|  2.94M|               ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |  102|   965k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 965k]
  |  |  ------------------
  ------------------
  |  Branch (1904:18): [True: 965k, False: 1.97M]
  ------------------
 1905|  2.94M|                !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (1905:20): [True: 2.94M, False: 0]
  |  Branch (1905:36): [True: 2.94M, False: 0]
  |  Branch (1905:46): [True: 2.94M, False: 0]
  ------------------
 1906|  2.94M|                   TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|  2.94M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 472, False: 2.94M]
  |  |  ------------------
  ------------------
 1907|  2.94M|                  (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (1907:20): [True: 0, False: 2.94M]
  |  Branch (1907:37): [True: 0, False: 0]
  |  Branch (1907:49): [True: 0, False: 0]
  ------------------
 1908|      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]
  |  |  ------------------
  ------------------
 1909|  2.94M|                  (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (1909:20): [True: 0, False: 2.94M]
  |  Branch (1909:38): [True: 0, False: 0]
  |  Branch (1909:49): [True: 0, False: 0]
  |  Branch (1909:59): [True: 0, False: 0]
  ------------------
 1910|      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]
  |  |  ------------------
  ------------------
 1911|  2.94M|                  (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (1911:20): [True: 0, False: 2.94M]
  |  Branch (1911:44): [True: 0, False: 0]
  ------------------
 1912|      0|                   ((!words && !wordnum &&
  ------------------
  |  Branch (1912:22): [True: 0, False: 0]
  |  Branch (1912:32): [True: 0, False: 0]
  ------------------
 1913|      0|                     defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (1913:22): [True: 0, False: 0]
  ------------------
 1914|      0|                    (words &&
  ------------------
  |  Branch (1914:22): [True: 0, False: 0]
  ------------------
 1915|      0|                     defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))) ||
  ------------------
  |  Branch (1915:22): [True: 0, False: 0]
  ------------------
 1916|    472|                (scpd != 0 && checkcpdtable[scpd - 1].cond != FLAG_NULL &&
  ------------------
  |  |   99|    472|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1916:18): [True: 0, False: 472]
  |  Branch (1916:31): [True: 0, False: 0]
  ------------------
 1917|  2.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 (1917:18): [True: 0, False: 0]
  ------------------
 1918|  2.94M|          rv = rv->next_homonym;
 1919|  2.94M|        }
 1920|       |
 1921|   490M|        if (rv)
  ------------------
  |  Branch (1921:13): [True: 740, False: 490M]
  ------------------
 1922|    740|          affixed = 0;
 1923|       |
 1924|   490M|        if (!rv) {
  ------------------
  |  Branch (1924:13): [True: 490M, False: 740]
  ------------------
 1925|   490M|          if (onlycpdrule)
  ------------------
  |  Branch (1925:15): [True: 0, False: 490M]
  ------------------
 1926|      0|            break;
 1927|   490M|          if (compoundflag &&
  ------------------
  |  Branch (1927:15): [True: 490M, False: 0]
  ------------------
 1928|   490M|              !(rv = prefix_check(st, 0, i,
  ------------------
  |  Branch (1928:15): [True: 490M, False: 0]
  ------------------
 1929|   490M|                                  hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   78|   116k|#define IN_CPD_OTHER 3
  ------------------
                                                hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   76|   981M|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1929:35): [True: 116k, False: 490M]
  ------------------
 1930|   490M|                                  scratch, compoundflag))) {
 1931|   490M|            if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   99|   490M|#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|   116k|#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|   981M|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1931:18): [True: 0, False: 490M]
  |  Branch (1931:93): [True: 116k, False: 490M]
  ------------------
 1932|   490M|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (1932:19): [True: 0, False: 490M]
  |  Branch (1932:43): [True: 0, False: 0]
  ------------------
 1933|      0|                !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (1933:17): [True: 0, False: 0]
  |  Branch (1933:33): [True: 0, False: 0]
  ------------------
 1934|      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 (1934:19): [True: 0, False: 0]
  ------------------
 1935|      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 (1935:19): [True: 0, False: 0]
  ------------------
 1936|      0|              rv = nullptr;
 1937|       |              // the suffix is dropped with the word it built
 1938|      0|              sfx = nullptr;
 1939|      0|            }
 1940|   490M|          }
 1941|       |
 1942|   490M|          if (rv ||
  ------------------
  |  Branch (1942:15): [True: 0, False: 490M]
  ------------------
 1943|   490M|              (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (1943:17): [True: 490M, False: 117k]
  |  Branch (1943:35): [True: 0, False: 490M]
  ------------------
 1944|      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 (1944:18): [True: 0, False: 0]
  |  Branch (1944:94): [True: 0, False: 0]
  ------------------
 1945|      0|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (1945:19): [True: 0, False: 0]
  |  Branch (1945:43): [True: 0, False: 0]
  ------------------
 1946|      0|                                                                    compoundbegin))) ||  // twofold suffixes + compound
 1947|      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 (1947:18): [True: 0, False: 0]
  |  Branch (1947:47): [True: 0, False: 0]
  ------------------
 1948|   490M|               ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (1948:17): [True: 960, False: 490M]
  |  Branch (1948:34): [True: 0, False: 960]
  ------------------
 1949|      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 (1949:18): [True: 0, False: 0]
  |  Branch (1949:95): [True: 0, False: 0]
  ------------------
 1950|      0|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (1950:19): [True: 0, False: 0]
  |  Branch (1950:43): [True: 0, False: 0]
  ------------------
 1951|      0|                                                                    compoundmiddle))) ||  // twofold suffixes + compound
 1952|      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 (1952:18): [True: 0, False: 0]
  |  Branch (1952:47): [True: 0, False: 0]
  ------------------
 1953|      0|            checked_prefix = 1;
 1954|       |          // else check forbiddenwords and needaffix
 1955|   490M|        } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|  1.05k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 525]
  |  |  ------------------
  ------------------
  |  Branch (1955:20): [True: 525, False: 215]
  |  Branch (1955:20): [True: 0, False: 740]
  ------------------
 1956|    525|                                TESTAFF(rv->astr, needaffix, rv->alen) ||
  ------------------
  |  |  102|  1.05k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 525]
  |  |  ------------------
  ------------------
 1957|    525|                                TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|  1.05k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 525]
  |  |  ------------------
  ------------------
 1958|    525|                                (is_sug && nosuggest &&
  ------------------
  |  Branch (1958:34): [True: 6, False: 519]
  |  Branch (1958:44): [True: 0, False: 6]
  ------------------
 1959|      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]
  |  |  ------------------
  ------------------
 1960|      0|          st[i] = ch;
 1961|       |          // continue;
 1962|      0|          break;
 1963|      0|        }
 1964|       |
 1965|       |        // check non_compound flag in suffix and prefix
 1966|   490M|        if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1966:13): [True: 740, False: 490M]
  |  Branch (1966:21): [True: 472, False: 268]
  ------------------
 1967|    472|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1967:15): [True: 0, False: 472]
  |  Branch (1967:22): [True: 0, False: 0]
  ------------------
 1968|      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]
  |  |  ------------------
  ------------------
 1969|    472|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1969:15): [True: 0, False: 472]
  |  Branch (1969:22): [True: 0, False: 0]
  ------------------
 1970|      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]
  |  |  ------------------
  ------------------
 1971|    472|                      sfx->getContLen())))) {
 1972|      0|          rv = nullptr;
 1973|      0|        }
 1974|       |
 1975|       |        // check compoundend flag in suffix and prefix
 1976|   490M|        if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (1976:13): [True: 740, False: 490M]
  |  Branch (1976:21): [True: 740, False: 0]
  |  Branch (1976:40): [True: 0, False: 740]
  |  Branch (1976:55): [True: 0, False: 0]
  ------------------
 1977|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1977:15): [True: 0, False: 0]
  |  Branch (1977:22): [True: 0, False: 0]
  ------------------
 1978|      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]
  |  |  ------------------
  ------------------
 1979|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1979:15): [True: 0, False: 0]
  |  Branch (1979:22): [True: 0, False: 0]
  ------------------
 1980|      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]
  |  |  ------------------
  ------------------
 1981|      0|          rv = nullptr;
 1982|      0|        }
 1983|       |
 1984|       |        // check compoundmiddle flag in suffix and prefix
 1985|   490M|        if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (1985:13): [True: 740, False: 490M]
  |  Branch (1985:21): [True: 740, False: 0]
  |  Branch (1985:40): [True: 472, False: 268]
  |  Branch (1985:58): [True: 0, False: 472]
  ------------------
 1986|      0|            !hu_mov_rule &&
  ------------------
  |  Branch (1986:13): [True: 0, False: 0]
  ------------------
 1987|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1987:15): [True: 0, False: 0]
  |  Branch (1987:22): [True: 0, False: 0]
  ------------------
 1988|      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]
  |  |  ------------------
  ------------------
 1989|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1989:15): [True: 0, False: 0]
  |  Branch (1989:22): [True: 0, False: 0]
  ------------------
 1990|      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]
  |  |  ------------------
  ------------------
 1991|      0|          rv = nullptr;
 1992|      0|        }
 1993|       |
 1994|       |        // check forbiddenwords
 1995|   490M|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1995:13): [True: 740, False: 490M]
  |  Branch (1995:13): [True: 0, False: 490M]
  |  Branch (1995:21): [True: 525, False: 215]
  ------------------
 1996|    525|            (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|  1.05k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 525]
  |  |  ------------------
  ------------------
 1997|    525|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|  1.05k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 525]
  |  |  ------------------
  ------------------
 1998|    525|             (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 (1998:15): [True: 6, False: 519]
  |  Branch (1998:25): [True: 0, False: 6]
  ------------------
 1999|      0|          return nullptr;
 2000|      0|        }
 2001|       |
 2002|       |        // increment word number, if the second root has a compoundroot flag
 2003|   490M|        if ((rv) && compoundroot &&
  ------------------
  |  Branch (2003:13): [True: 740, False: 490M]
  |  Branch (2003:21): [True: 0, False: 740]
  ------------------
 2004|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2004:13): [True: 0, False: 0]
  ------------------
 2005|      0|          wordnum++;
 2006|      0|        }
 2007|       |
 2008|       |        // first word is acceptable in compound words?
 2009|   490M|        if (((rv) &&
  ------------------
  |  Branch (2009:13): [True: 525, False: 490M]
  |  Branch (2009:14): [True: 740, False: 490M]
  ------------------
 2010|    740|             (checked_prefix || (words && words[wnum]) ||
  ------------------
  |  Branch (2010:15): [True: 0, False: 740]
  |  Branch (2010:34): [True: 0, False: 740]
  |  Branch (2010:43): [True: 0, False: 0]
  ------------------
 2011|    740|              (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|    740|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 525, False: 215]
  |  |  ------------------
  ------------------
  |  Branch (2011:16): [True: 740, False: 0]
  ------------------
 2012|    215|              ((oldwordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (2012:16): [True: 0, False: 215]
  |  Branch (2012:37): [True: 0, False: 0]
  ------------------
 2013|      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]
  |  |  ------------------
  ------------------
 2014|    215|              ((oldwordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (2014:16): [True: 0, False: 215]
  |  Branch (2014:36): [True: 0, False: 0]
  ------------------
 2015|      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]
  |  |  ------------------
  ------------------
 2016|       |
 2017|       |              // LANG_hu section: spec. Hungarian rule
 2018|    215|              || ((langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (2018:19): [True: 215, False: 0]
  |  Branch (2018:43): [True: 215, False: 0]
  ------------------
 2019|    215|                  (TESTAFF(
  ------------------
  |  |  102|    430|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 215]
  |  |  ------------------
  ------------------
 2020|    215|                       rv->astr, 'F',
 2021|    215|                       rv->alen) ||  // XXX hardwired Hungarian dictionary codes
 2022|    215|                   TESTAFF(rv->astr, 'G', rv->alen) ||
  ------------------
  |  |  102|    430|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 215]
  |  |  ------------------
  ------------------
 2023|    215|                   TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |  102|    215|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 215]
  |  |  ------------------
  ------------------
 2024|       |              // END of LANG_hu section
 2025|    740|              ) &&
 2026|    525|             (
 2027|       |                 // test CHECKCOMPOUNDPATTERN conditions
 2028|    525|                 scpd == 0 || checkcpdtable[scpd - 1].cond == FLAG_NULL ||
  ------------------
  |  |   99|    525|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2028:18): [True: 525, False: 0]
  |  Branch (2028:31): [True: 0, False: 0]
  ------------------
 2029|      0|                 join_side_has_flag(rv, checkcpdtable[scpd - 1].cond, pfx, sfx)) &&
  ------------------
  |  Branch (2029:18): [True: 0, False: 0]
  ------------------
 2030|    525|             !((checkcompoundtriple && scpd == 0 &&
  ------------------
  |  Branch (2030:17): [True: 0, False: 525]
  |  Branch (2030:40): [True: 0, False: 0]
  ------------------
 2031|      0|                !words && i < word.size() && // test triple letters
  ------------------
  |  Branch (2031:17): [True: 0, False: 0]
  |  Branch (2031:27): [True: 0, False: 0]
  ------------------
 2032|      0|                (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (2032:17): [True: 0, False: 0]
  ------------------
 2033|      0|                (((i > 1) && (word[i - 1] == word[i - 2])) ||
  ------------------
  |  Branch (2033:19): [True: 0, False: 0]
  |  Branch (2033:30): [True: 0, False: 0]
  ------------------
 2034|      0|                 ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (2034:18): [True: 0, False: 0]
  ------------------
 2035|      0|                 )) ||
 2036|    525|               (checkcompoundcase && scpd == 0 && !words && i < word.size() &&
  ------------------
  |  Branch (2036:17): [True: 0, False: 525]
  |  Branch (2036:38): [True: 0, False: 0]
  |  Branch (2036:51): [True: 0, False: 0]
  |  Branch (2036:61): [True: 0, False: 0]
  ------------------
 2037|      0|                cpdcase_check(word, i))))
  ------------------
  |  Branch (2037:17): [True: 0, False: 0]
  ------------------
 2038|       |            // LANG_hu section: spec. Hungarian rule
 2039|   490M|            || ((!rv) && (langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (2039:17): [True: 490M, False: 215]
  |  Branch (2039:26): [True: 40.2M, False: 450M]
  |  Branch (2039:50): [True: 116k, False: 40.0M]
  ------------------
 2040|   116k|                (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (2040:17): [True: 0, False: 116k]
  ------------------
 2041|      0|                (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2041:18): [True: 0, False: 0]
  |  Branch (2041:25): [True: 0, False: 0]
  ------------------
 2042|      0|                 (  // XXX hardwired Hungarian dic. codes
 2043|      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]
  |  |  ------------------
  ------------------
 2044|      0|                             sfx->getContLen()) ||
 2045|      0|                     TESTAFF(
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2046|      0|                         sfx->getCont(), (unsigned short)'%',
 2047|    525|                         sfx->getContLen()))))) {  // first word is ok condition
 2048|       |
 2049|       |          // LANG_hu section: spec. Hungarian rule
 2050|    525|          if (langnum == LANG_hu) {
  ------------------
  |  Branch (2050:15): [True: 335, False: 190]
  ------------------
 2051|       |            // calculate syllable number of the word
 2052|    335|            numsyllable += get_syllable(st.substr(0, i));
 2053|       |            // + 1 word, if syllable number of the prefix > 1 (hungarian
 2054|       |            // convention)
 2055|    335|            if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2055:17): [True: 0, False: 335]
  |  Branch (2055:17): [True: 0, False: 335]
  |  Branch (2055:24): [True: 0, False: 0]
  ------------------
 2056|      0|              wordnum++;
 2057|    335|          }
 2058|       |          // END of LANG_hu section
 2059|       |
 2060|       |          // NEXT WORD(S)
 2061|    525|          rv_first = rv;
 2062|       |          // the affixes that built the first word, so its continuation classes stay reachable once
 2063|       |          // the second word has overwritten pfx and sfx
 2064|    525|          PfxEntry* rv_first_pfx = pfx;
 2065|    525|          SfxEntry* rv_first_sfx = sfx;
 2066|    525|          st[i] = ch;
 2067|       |
 2068|    525|          do {  // striple loop
 2069|       |
 2070|       |            // check simplifiedtriple
 2071|    525|            if (simplifiedtriple) {
  ------------------
  |  Branch (2071:17): [True: 0, False: 525]
  ------------------
 2072|      0|              if (striple) {
  ------------------
  |  Branch (2072:19): [True: 0, False: 0]
  ------------------
 2073|      0|                checkedstriple = 1;
 2074|      0|                i--;  // check "fahrt" instead of "ahrt" in "Schiffahrt"
 2075|      0|              } else if (i > 2 && i <= word.size() && word[i - 1] == word[i - 2]) {
  ------------------
  |  Branch (2075:26): [True: 0, False: 0]
  |  Branch (2075:35): [True: 0, False: 0]
  |  Branch (2075:55): [True: 0, False: 0]
  ------------------
 2076|      0|                striple = 1;
 2077|       |                // past cmax the surface split is too short, so only the form with the letter
 2078|       |                // put back is tried
 2079|      0|                if (i >= cmax) {
  ------------------
  |  Branch (2079:21): [True: 0, False: 0]
  ------------------
 2080|      0|                  checkedstriple = 1;
 2081|      0|                  i--;
 2082|      0|                }
 2083|      0|              }
 2084|      0|            }
 2085|       |
 2086|    525|            rv = lookup(st.c_str() + i, st.size() - i);  // perhaps without prefix
 2087|    525|            if (t) {
  ------------------
  |  Branch (2087:17): [True: 0, False: 525]
  ------------------
 2088|      0|              if (rv)
  ------------------
  |  Branch (2088:19): [True: 0, False: 0]
  ------------------
 2089|      0|                trace(*t, "second \"%s\" -> entry \"%s\" flags=%s", st.c_str() + i,
 2090|      0|                      rv->word, trace_flags(this, rv->astr, rv->alen).c_str());
 2091|      0|              else
 2092|      0|                trace(*t, "second \"%s\" -> miss", st.c_str() + i);
 2093|      0|            }
 2094|       |
 2095|       |            // search homonym with compound flag
 2096|    525|            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 (2096:20): [True: 0, False: 525]
  |  Branch (2096:30): [True: 0, False: 0]
  ------------------
 2097|      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 (2097:32): [True: 0, False: 0]
  |  Branch (2097:48): [True: 0, False: 0]
  ------------------
 2098|      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 (2098:32): [True: 0, False: 0]
  |  Branch (2098:47): [True: 0, False: 0]
  ------------------
 2099|      0|                              (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))) ||
  ------------------
  |  Branch (2099:32): [True: 0, False: 0]
  |  Branch (2099:56): [True: 0, False: 0]
  |  Branch (2099:65): [True: 0, False: 0]
  ------------------
 2100|      0|                            (scpd != 0 && checkcpdtable[scpd - 1].cond2 != FLAG_NULL &&
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2100:30): [True: 0, False: 0]
  |  Branch (2100:43): [True: 0, False: 0]
  ------------------
 2101|      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 (2101:30): [True: 0, False: 0]
  ------------------
 2102|      0|              rv = rv->next_homonym;
 2103|      0|            }
 2104|       |
 2105|       |            // check FORCEUCASE
 2106|    525|            if (rv && forceucase &&
  ------------------
  |  Branch (2106:17): [True: 0, False: 525]
  |  Branch (2106:23): [True: 0, False: 0]
  ------------------
 2107|      0|                (TESTAFF(rv->astr, forceucase, rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2107:17): [True: 0, False: 0]
  ------------------
 2108|      0|                !(info && *info & SPELL_ORIGCAP))
  ------------------
  |  |   86|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  |  Branch (2108:19): [True: 0, False: 0]
  |  Branch (2108:27): [True: 0, False: 0]
  ------------------
 2109|      0|              rv = nullptr;
 2110|       |
 2111|    525|            if (rv && words && words[wnum + 1])
  ------------------
  |  Branch (2111:17): [True: 0, False: 525]
  |  Branch (2111:23): [True: 0, False: 0]
  |  Branch (2111:32): [True: 0, False: 0]
  ------------------
 2112|      0|              return rv_first;
 2113|       |
 2114|    525|            oldnumsyllable2 = numsyllable;
 2115|    525|            oldwordnum2 = wordnum;
 2116|       |
 2117|       |            // LANG_hu section: spec. Hungarian rule, XXX hardwired dictionary
 2118|       |            // code
 2119|    525|            if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (2119:17): [True: 0, False: 525]
  |  Branch (2119:17): [True: 0, False: 525]
  |  Branch (2119:25): [True: 0, False: 0]
  ------------------
 2120|      0|                (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2120:17): [True: 0, False: 0]
  ------------------
 2121|      0|                !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2121:17): [True: 0, False: 0]
  ------------------
 2122|      0|              numsyllable--;
 2123|      0|            }
 2124|       |            // END of LANG_hu section
 2125|       |
 2126|       |            // increment word number, if the second root has a compoundroot flag
 2127|    525|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2127:17): [True: 0, False: 525]
  |  Branch (2127:25): [True: 0, False: 0]
  ------------------
 2128|      0|                (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2128:17): [True: 0, False: 0]
  ------------------
 2129|      0|              wordnum++;
 2130|      0|            }
 2131|       |
 2132|       |            // check forbiddenwords
 2133|    525|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2133:17): [True: 0, False: 525]
  |  Branch (2133:17): [True: 0, False: 525]
  |  Branch (2133:25): [True: 0, False: 0]
  ------------------
 2134|      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]
  |  |  ------------------
  ------------------
 2135|      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]
  |  |  ------------------
  ------------------
 2136|      0|                 (is_sug && nosuggest &&
  ------------------
  |  Branch (2136:19): [True: 0, False: 0]
  |  Branch (2136:29): [True: 0, False: 0]
  ------------------
 2137|      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]
  |  |  ------------------
  ------------------
 2138|      0|              return nullptr;
 2139|       |
 2140|       |            // second word is acceptable, as a root?
 2141|       |            // hungarian conventions: compounding is acceptable,
 2142|       |            // when compound forms consist of 2 words, or if more,
 2143|       |            // then the syllable number of root words must be 6, or lesser.
 2144|       |
 2145|    525|            if ((rv) &&
  ------------------
  |  Branch (2145:17): [True: 0, False: 525]
  |  Branch (2145:17): [True: 0, False: 525]
  ------------------
 2146|      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 (2146:19): [True: 0, False: 0]
  ------------------
 2147|      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 (2147:19): [True: 0, False: 0]
  ------------------
 2148|      0|                (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2148:19): [True: 0, False: 0]
  |  Branch (2148:41): [True: 0, False: 0]
  ------------------
 2149|      0|                 ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (2149:19): [True: 0, False: 0]
  ------------------
 2150|      0|                  (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (2150:19): [True: 0, False: 0]
  ------------------
 2151|      0|                   cpdmaxsyllable))) &&
 2152|      0|                (
 2153|       |                    // test CHECKCOMPOUNDPATTERN
 2154|      0|                    checkcpdtable.empty() || scpd != 0 ||
  ------------------
  |  Branch (2154:21): [True: 0, False: 0]
  |  Branch (2154:46): [True: 0, False: 0]
  ------------------
 2155|      0|                    (i < word.size() && !cpdpat_check(word, i, rv_first, rv, 0, t, rv_first_pfx, rv_first_sfx, nullptr, nullptr))) &&
  ------------------
  |  Branch (2155:22): [True: 0, False: 0]
  |  Branch (2155:41): [True: 0, False: 0]
  ------------------
 2156|      0|                ((!checkcompounddup || (rv != rv_first)))
  ------------------
  |  Branch (2156:19): [True: 0, False: 0]
  |  Branch (2156:40): [True: 0, False: 0]
  ------------------
 2157|       |                // test CHECKCOMPOUNDPATTERN conditions
 2158|      0|                &&
 2159|      0|                (scpd == 0 || checkcpdtable[scpd - 1].cond2 == FLAG_NULL ||
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2159:18): [True: 0, False: 0]
  |  Branch (2159:31): [True: 0, False: 0]
  ------------------
 2160|      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]
  |  |  ------------------
  ------------------
 2161|       |              // forbid compound word, if it is a non-compound word with typical
 2162|       |              // fault
 2163|      0|              if ((checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2163:20): [True: 0, False: 0]
  |  Branch (2163:40): [True: 0, False: 0]
  ------------------
 2164|      0|                  cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2164:19): [True: 0, False: 0]
  ------------------
 2165|      0|                return nullptr;
 2166|      0|              return rv_first;
 2167|      0|            }
 2168|       |
 2169|    525|            numsyllable = oldnumsyllable2;
 2170|    525|            wordnum = oldwordnum2;
 2171|       |
 2172|       |            // perhaps second word has prefix or/and suffix
 2173|    525|            sfx = nullptr;
 2174|    525|            sfxflag = FLAG_NULL;
  ------------------
  |  |   99|    525|#define FLAG_NULL 0x00
  ------------------
 2175|       |            // the affixes that built the second word, kept because affix_check clears the members
 2176|    525|            PfxEntry* rv_second_pfx = nullptr;
 2177|    525|            SfxEntry* rv_second_sfx = nullptr;
 2178|    525|            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|    525|#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|    525|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2178:19): [True: 525, False: 0]
  |  Branch (2178:35): [True: 525, False: 0]
  |  Branch (2178:51): [True: 525, False: 0]
  ------------------
 2179|    525|                                                                   : nullptr;
 2180|    525|            if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (2180:17): [True: 525, False: 0]
  |  Branch (2180:24): [True: 0, False: 525]
  |  Branch (2180:39): [True: 0, False: 0]
  ------------------
 2181|      0|              sfx = nullptr;
 2182|      0|              pfx = nullptr;
 2183|      0|              if (i < word.size())
  ------------------
  |  Branch (2183:19): [True: 0, False: 0]
  ------------------
 2184|      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
  ------------------
 2185|      0|            }
 2186|       |
 2187|    525|            if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (2187:17): [True: 525, False: 0]
  |  Branch (2187:24): [True: 0, False: 525]
  |  Branch (2187:48): [True: 0, False: 0]
  ------------------
 2188|      0|              if (i < word.size())
  ------------------
  |  Branch (2188:19): [True: 0, False: 0]
  ------------------
 2189|      0|                rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2190|      0|              if (rv && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))
  ------------------
  |  Branch (2190:19): [True: 0, False: 0]
  |  Branch (2190:25): [True: 0, False: 0]
  ------------------
 2191|      0|                return rv_first;
 2192|      0|              rv = nullptr;
 2193|      0|            }
 2194|       |
 2195|       |            // test CHECKCOMPOUNDPATTERN conditions (allowed forms)
 2196|    525|            if (rv &&
  ------------------
  |  Branch (2196:17): [True: 0, False: 525]
  ------------------
 2197|      0|                !(scpd == 0 || checkcpdtable[scpd - 1].cond2 == FLAG_NULL ||
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2197:19): [True: 0, False: 0]
  |  Branch (2197:32): [True: 0, False: 0]
  ------------------
 2198|      0|                  join_side_has_flag(rv, checkcpdtable[scpd - 1].cond2, rv_second_pfx,
  ------------------
  |  Branch (2198:19): [True: 0, False: 0]
  ------------------
 2199|      0|                                     rv_second_sfx)))
 2200|      0|              rv = nullptr;
 2201|       |
 2202|       |            // test CHECKCOMPOUNDPATTERN conditions (forbidden compounds)
 2203|    525|            if (rv && !checkcpdtable.empty() && scpd == 0 &&
  ------------------
  |  Branch (2203:17): [True: 0, False: 525]
  |  Branch (2203:23): [True: 0, False: 0]
  |  Branch (2203:49): [True: 0, False: 0]
  ------------------
 2204|      0|                cpdpat_check(word, i, rv_first, rv, affixed, t, rv_first_pfx, rv_first_sfx, rv_second_pfx, rv_second_sfx))
  ------------------
  |  Branch (2204:17): [True: 0, False: 0]
  ------------------
 2205|      0|              rv = nullptr;
 2206|       |
 2207|       |            // check non_compound flag in suffix and prefix
 2208|    525|            if ((rv) && ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2208:17): [True: 0, False: 525]
  |  Branch (2208:27): [True: 0, False: 0]
  |  Branch (2208:34): [True: 0, False: 0]
  ------------------
 2209|      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]
  |  |  ------------------
  ------------------
 2210|      0|                                  pfx->getContLen())) ||
 2211|      0|                         (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2211:27): [True: 0, False: 0]
  |  Branch (2211:34): [True: 0, False: 0]
  ------------------
 2212|      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]
  |  |  ------------------
  ------------------
 2213|      0|                                  sfx->getContLen())))) {
 2214|      0|              rv = nullptr;
 2215|      0|            }
 2216|       |
 2217|       |            // check FORCEUCASE
 2218|    525|            if (rv && forceucase &&
  ------------------
  |  Branch (2218:17): [True: 0, False: 525]
  |  Branch (2218:23): [True: 0, False: 0]
  ------------------
 2219|      0|                (TESTAFF(rv->astr, forceucase, rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2219:17): [True: 0, False: 0]
  ------------------
 2220|      0|                !(info && *info & SPELL_ORIGCAP))
  ------------------
  |  |   86|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  |  Branch (2220:19): [True: 0, False: 0]
  |  Branch (2220:27): [True: 0, False: 0]
  ------------------
 2221|      0|              rv = nullptr;
 2222|       |
 2223|       |            // check forbiddenwords
 2224|    525|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2224:17): [True: 0, False: 525]
  |  Branch (2224:17): [True: 0, False: 525]
  |  Branch (2224:25): [True: 0, False: 0]
  ------------------
 2225|      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]
  |  |  ------------------
  ------------------
 2226|      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]
  |  |  ------------------
  ------------------
 2227|      0|                 (is_sug && nosuggest &&
  ------------------
  |  Branch (2227:19): [True: 0, False: 0]
  |  Branch (2227:29): [True: 0, False: 0]
  ------------------
 2228|      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]
  |  |  ------------------
  ------------------
 2229|      0|              return nullptr;
 2230|       |
 2231|       |            // pfxappnd = prefix of word+i, or NULL
 2232|       |            // calculate syllable number of prefix.
 2233|       |            // hungarian convention: when syllable number of prefix is more,
 2234|       |            // than 1, the prefix+word counts as two words.
 2235|       |
 2236|    525|            if (langnum == LANG_hu) {
  ------------------
  |  Branch (2236:17): [True: 335, False: 190]
  ------------------
 2237|    335|              if (i < word.size()) {
  ------------------
  |  Branch (2237:19): [True: 335, False: 0]
  ------------------
 2238|       |                // calculate syllable number of the word
 2239|    335|                numsyllable += get_syllable(word.substr(i));
 2240|    335|              }
 2241|       |
 2242|       |              // - affix syllable num.
 2243|       |              // XXX only second suffix (inflections, not derivations)
 2244|    335|              if (sfxappnd) {
  ------------------
  |  Branch (2244:19): [True: 0, False: 335]
  ------------------
 2245|      0|                std::string tmp(sfxappnd);
 2246|      0|                reverseword(tmp);
 2247|      0|                numsyllable -= short(get_syllable(tmp) + sfxextra);
 2248|    335|              } else {
 2249|    335|                numsyllable -= short(sfxextra);
 2250|    335|              }
 2251|       |
 2252|       |              // + 1 word, if syllable number of the prefix > 1 (hungarian
 2253|       |              // convention)
 2254|    335|              if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2254:19): [True: 0, False: 335]
  |  Branch (2254:19): [True: 0, False: 335]
  |  Branch (2254:26): [True: 0, False: 0]
  ------------------
 2255|      0|                wordnum++;
 2256|       |
 2257|       |              // increment syllable num, if last word has a SYLLABLENUM flag
 2258|       |              // and the suffix is beginning `s'
 2259|       |
 2260|    335|              if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2260:19): [True: 0, False: 335]
  ------------------
 2261|      0|                switch (sfxflag) {
  ------------------
  |  Branch (2261:25): [True: 0, False: 0]
  ------------------
 2262|      0|                  case 'c': {
  ------------------
  |  Branch (2262:19): [True: 0, False: 0]
  ------------------
 2263|      0|                    numsyllable += 2;
 2264|      0|                    break;
 2265|      0|                  }
 2266|      0|                  case 'J': {
  ------------------
  |  Branch (2266:19): [True: 0, False: 0]
  ------------------
 2267|      0|                    numsyllable += 1;
 2268|      0|                    break;
 2269|      0|                  }
 2270|      0|                  case 'I': {
  ------------------
  |  Branch (2270:19): [True: 0, False: 0]
  ------------------
 2271|      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 (2271:25): [True: 0, False: 0]
  |  Branch (2271:25): [True: 0, False: 0]
  ------------------
 2272|      0|                      numsyllable += 1;
 2273|      0|                    break;
 2274|      0|                  }
 2275|      0|                }
 2276|      0|              }
 2277|    335|            }
 2278|       |
 2279|       |            // increment word number, if the second word has a compoundroot flag
 2280|    525|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2280:17): [True: 0, False: 525]
  |  Branch (2280:25): [True: 0, False: 0]
  ------------------
 2281|      0|                (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2281:17): [True: 0, False: 0]
  ------------------
 2282|      0|              wordnum++;
 2283|      0|            }
 2284|       |            // second word is acceptable, as a word with prefix or/and suffix?
 2285|       |            // hungarian conventions: compounding is acceptable,
 2286|       |            // when compound forms consist 2 word, otherwise
 2287|       |            // the syllable number of root words is 6, or lesser.
 2288|    525|            if ((rv) &&
  ------------------
  |  Branch (2288:17): [True: 0, False: 525]
  ------------------
 2289|      0|                (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2289:19): [True: 0, False: 0]
  |  Branch (2289:41): [True: 0, False: 0]
  ------------------
 2290|      0|                 ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2290:19): [True: 0, False: 0]
  |  Branch (2290:44): [True: 0, False: 0]
  ------------------
 2291|      0|                ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2291:19): [True: 0, False: 0]
  |  Branch (2291:40): [True: 0, False: 0]
  ------------------
 2292|       |              // forbid compound word, if it is a non-compound word with typical
 2293|       |              // fault
 2294|      0|              if ((checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2294:20): [True: 0, False: 0]
  |  Branch (2294:40): [True: 0, False: 0]
  ------------------
 2295|      0|                  cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2295:19): [True: 0, False: 0]
  ------------------
 2296|      0|                return nullptr;
 2297|      0|              return rv_first;
 2298|      0|            }
 2299|       |
 2300|    525|            numsyllable = oldnumsyllable2;
 2301|    525|            wordnum = oldwordnum2;
 2302|       |
 2303|       |            // perhaps second word is a compound word (recursive call)
 2304|       |            // (only if SPELL_COMPOUND_2 is not set and maxwordnum is not exceeded)
 2305|    525|            if ((!info || !(*info & SPELL_COMPOUND_2)) && wordnum + 2 < maxwordnum && wnum + 1 < maxwordnum) {
  ------------------
  |  |   88|    525|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (2305:18): [True: 0, False: 525]
  |  Branch (2305:27): [True: 289, False: 236]
  |  Branch (2305:59): [True: 289, False: 0]
  |  Branch (2305:87): [True: 289, False: 0]
  ------------------
 2306|    289|              rv = compound_check(st.substr(i), wordnum + 1,
 2307|    289|                                  numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2308|    289|                                  is_sug, info, scratch);
 2309|       |
 2310|    289|              if (rv && !checkcpdtable.empty() && i < word.size() &&
  ------------------
  |  Branch (2310:19): [True: 0, False: 289]
  |  Branch (2310:25): [True: 0, False: 0]
  |  Branch (2310:51): [True: 0, False: 0]
  ------------------
 2311|      0|                  ((scpd == 0 &&
  ------------------
  |  Branch (2311:21): [True: 0, False: 0]
  ------------------
 2312|      0|                    cpdpat_check(word, i, rv_first, rv, affixed, t, rv_first_pfx, rv_first_sfx, nullptr, nullptr)) ||
  ------------------
  |  Branch (2312:21): [True: 0, False: 0]
  ------------------
 2313|      0|                   (scpd != 0 &&
  ------------------
  |  Branch (2313:21): [True: 0, False: 0]
  ------------------
 2314|      0|                    !cpdpat_check(word, i, rv_first, rv, affixed, t, rv_first_pfx, rv_first_sfx, nullptr, nullptr))))
  ------------------
  |  Branch (2314:21): [True: 0, False: 0]
  ------------------
 2315|      0|                rv = nullptr;
 2316|    289|            } else {
 2317|    236|              rv = nullptr;
 2318|    236|            }
 2319|    525|            if (rv) {
  ------------------
  |  Branch (2319:17): [True: 0, False: 525]
  ------------------
 2320|       |              // forbid compound word, if it is a non-compound word with typical
 2321|       |              // fault, or a dictionary word pair
 2322|       |
 2323|      0|              if (cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2323:19): [True: 0, False: 0]
  ------------------
 2324|      0|                return nullptr;
 2325|       |
 2326|      0|              if (checkcompoundrep || forbiddenword) {
  ------------------
  |  Branch (2326:19): [True: 0, False: 0]
  |  Branch (2326:39): [True: 0, False: 0]
  ------------------
 2327|      0|                if (checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2327:21): [True: 0, False: 0]
  |  Branch (2327:41): [True: 0, False: 0]
  ------------------
 2328|      0|                  return nullptr;
 2329|       |
 2330|       |                // check first part
 2331|      0|                if (i < word.size() && word.compare(i, rv->blen, rv->word, rv->blen) == 0) {
  ------------------
  |  Branch (2331:21): [True: 0, False: 0]
  |  Branch (2331:40): [True: 0, False: 0]
  ------------------
 2332|      0|                  char r = st[i + rv->blen];
 2333|      0|                  st[i + rv->blen] = '\0';
 2334|       |
 2335|      0|                  if ((checkcompoundrep && cpdrep_check(st, i + rv->blen, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2335:24): [True: 0, False: 0]
  |  Branch (2335:44): [True: 0, False: 0]
  ------------------
 2336|      0|                      cpdwordpair_check(st, i + rv->blen, scratch, timelimit_exceeded, clock_time_start)) {
  ------------------
  |  Branch (2336:23): [True: 0, False: 0]
  ------------------
 2337|      0|                    st[ + i + rv->blen] = r;
 2338|      0|                    continue;
 2339|      0|                  }
 2340|       |
 2341|      0|                  if (forbiddenword) {
  ------------------
  |  Branch (2341:23): [True: 0, False: 0]
  ------------------
 2342|      0|                    struct hentry* rv2 = lookup(word.c_str(), word.size());
 2343|      0|                    if (!rv2 && len <= word.size())
  ------------------
  |  Branch (2343:25): [True: 0, False: 0]
  |  Branch (2343:33): [True: 0, False: 0]
  ------------------
 2344|      0|                      rv2 = affix_check(word, 0, len, scratch);
 2345|      0|                    if (rv2 && rv2->astr &&
  ------------------
  |  Branch (2345:25): [True: 0, False: 0]
  |  Branch (2345:32): [True: 0, False: 0]
  ------------------
 2346|      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]
  |  |  ------------------
  ------------------
 2347|      0|                        (strncmp(rv2->word, st.c_str(), i + rv->blen) == 0)) {
  ------------------
  |  Branch (2347:25): [True: 0, False: 0]
  ------------------
 2348|      0|                      return nullptr;
 2349|      0|                    }
 2350|      0|                  }
 2351|      0|                  st[i + rv->blen] = r;
 2352|      0|                }
 2353|      0|              }
 2354|      0|              return rv_first;
 2355|      0|            }
 2356|    525|          } while (striple && !checkedstriple);  // end of striple loop
  ------------------
  |  Branch (2356:20): [True: 0, False: 525]
  |  Branch (2356:31): [True: 0, False: 0]
  ------------------
 2357|       |
 2358|    525|          if (checkedstriple) {
  ------------------
  |  Branch (2358:15): [True: 0, False: 525]
  ------------------
 2359|      0|            i++;
 2360|      0|            checkedstriple = 0;
 2361|      0|            striple = 0;
 2362|      0|          }
 2363|       |
 2364|    525|        }  // first word is ok condition
 2365|       |
 2366|   490M|        if (soldi != 0) {
  ------------------
  |  Branch (2366:13): [True: 0, False: 490M]
  ------------------
 2367|      0|          i = soldi;
 2368|      0|          len = oldlen;
 2369|      0|          cmin = oldcmin;
 2370|      0|          cmax = oldcmax;
 2371|      0|        }
 2372|   490M|        scpd++;
 2373|       |
 2374|   490M|      } while (!onlycpdrule && simplifiedcpd &&
  ------------------
  |  Branch (2374:16): [True: 490M, False: 0]
  |  Branch (2374:32): [True: 0, False: 490M]
  ------------------
 2375|      0|               scpd <= checkcpdtable.size());  // end of simplifiedcpd loop
  ------------------
  |  Branch (2375:16): [True: 0, False: 0]
  ------------------
 2376|       |
 2377|   490M|      scpd = 0;
 2378|   490M|      wordnum = oldwordnum;
 2379|   490M|      numsyllable = oldnumsyllable;
 2380|       |
 2381|   490M|      if (soldi != 0) {
  ------------------
  |  Branch (2381:11): [True: 0, False: 490M]
  ------------------
 2382|      0|        i = soldi;
 2383|      0|        st.assign(word);  // XXX add more optim.
 2384|      0|        soldi = 0;
 2385|      0|        len = oldlen;
 2386|      0|        cmin = oldcmin;
 2387|      0|        cmax = oldcmax;
 2388|      0|      } else
 2389|   490M|        st[i] = ch;
 2390|       |
 2391|   490M|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2391:14): [True: 0, False: 490M]
  |  Branch (2391:38): [True: 0, False: 0]
  ------------------
 2392|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2392:14): [True: 0, False: 0]
  ------------------
 2393|   491M|  }
 2394|       |
 2395|  22.2M|  return nullptr;
 2396|  23.3M|}
_ZN8AffixMgr20compound_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEssssPP6hentrySB_cRS6_PS7_R12AffixScratch:
 2410|  2.30k|                                   AffixScratch& scratch) {
 2411|  2.30k|  short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2;
 2412|  2.30k|  hentry *rv = nullptr, *rv_first;
 2413|  2.30k|  std::string st, presult;
 2414|  2.30k|  char ch, affixed = 0;
 2415|  2.30k|  int checked_prefix, ok = 0;
 2416|  2.30k|  size_t cmin, cmax;
 2417|  2.30k|  hentry** oldwords = words;
 2418|  2.30k|  size_t len = word.size();
 2419|       |
 2420|       |  // protect subsequent words[wnum + 1] reads and any recursion
 2421|  2.30k|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (2421:7): [True: 0, False: 2.30k]
  ------------------
 2422|      0|    return 0;
 2423|       |
 2424|       |  // add a time limit to handle possible
 2425|       |  // combinatorical explosion of the overlapping words
 2426|       |
 2427|  2.30k|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  2.30k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2428|  2.30k|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  2.30k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2429|       |
 2430|       |  // get the current time
 2431|  2.30k|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 2432|       |
 2433|  2.30k|  if (wnum == 0) {
  ------------------
  |  Branch (2433:7): [True: 2.30k, False: 0]
  ------------------
 2434|       |      // set the start time
 2435|  2.30k|      clock_time_start = clock_now;
 2436|  2.30k|      timelimit_exceeded = false;
 2437|  2.30k|  }
 2438|      0|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  109|      0|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2438:12): [True: 0, False: 0]
  ------------------
 2439|      0|      timelimit_exceeded = true;
 2440|       |
 2441|  2.30k|  setcminmax(&cmin, &cmax, word.c_str(), len);
 2442|       |
 2443|  2.30k|  st.assign(word);
 2444|       |
 2445|  32.2k|  for (size_t i = cmin; i < cmax; ++i) {
  ------------------
  |  Branch (2445:25): [True: 30.2k, False: 2.00k]
  ------------------
 2446|       |    // go to end of the UTF-8 character
 2447|  30.2k|    if (utf8) {
  ------------------
  |  Branch (2447:9): [True: 10.2k, False: 19.9k]
  ------------------
 2448|  12.9k|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (2448:14): [True: 2.70k, False: 10.2k]
  ------------------
 2449|  2.70k|        ;
 2450|  10.2k|      if (i >= cmax)
  ------------------
  |  Branch (2450:11): [True: 76, False: 10.1k]
  ------------------
 2451|     76|        return 0;
 2452|  10.2k|    }
 2453|       |
 2454|  30.1k|    words = oldwords;
 2455|  30.1k|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (2455:23): [True: 0, False: 30.1k]
  ------------------
 2456|       |
 2457|  30.1k|    do {  // onlycpdrule loop
 2458|       |
 2459|  30.1k|      if (timelimit_exceeded ||
  ------------------
  |  Branch (2459:11): [True: 0, False: 30.1k]
  |  Branch (2459:11): [True: 0, False: 30.1k]
  ------------------
 2460|  30.1k|          std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  109|  30.1k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2460:11): [True: 0, False: 30.1k]
  ------------------
 2461|      0|        timelimit_exceeded = true;
 2462|      0|        return 0;
 2463|      0|      }
 2464|       |
 2465|  30.1k|      if (result.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|  30.1k|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (2465:11): [True: 0, False: 30.1k]
  ------------------
 2466|      0|        return 0;
 2467|       |
 2468|  30.1k|      oldnumsyllable = numsyllable;
 2469|  30.1k|      oldwordnum = wordnum;
 2470|  30.1k|      checked_prefix = 0;
 2471|       |
 2472|  30.1k|      if (i >= st.size())
  ------------------
  |  Branch (2472:11): [True: 219, False: 29.9k]
  ------------------
 2473|    219|        return 0;
 2474|       |
 2475|  29.9k|      ch = st[i];
 2476|  29.9k|      st[i] = '\0';
 2477|  29.9k|      sfx = nullptr;
 2478|       |
 2479|       |      // FIRST WORD
 2480|       |
 2481|  29.9k|      affixed = 1;
 2482|       |
 2483|  29.9k|      presult.clear();
 2484|  29.9k|      if (partresult)
  ------------------
  |  Branch (2484:11): [True: 0, False: 29.9k]
  ------------------
 2485|      0|        presult.append(*partresult);
 2486|       |
 2487|  29.9k|      rv = lookup(st.c_str(), i);  // perhaps without prefix
 2488|       |
 2489|       |      // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 2490|       |      // compound words, overriding the effect of COMPOUNDPERMITFLAG
 2491|  29.9k|      if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (2491:11): [True: 493, False: 29.4k]
  |  Branch (2491:19): [True: 82, False: 411]
  ------------------
 2492|     82|              TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule)
  ------------------
  |  |  102|  29.9k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 82]
  |  |  ------------------
  ------------------
  |  Branch (2492:66): [True: 0, False: 0]
  ------------------
 2493|      0|          continue;
 2494|       |
 2495|       |      // search homonym with compound flag
 2496|  30.4k|      while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2496:14): [True: 493, False: 29.9k]
  |  Branch (2496:22): [True: 493, False: 0]
  ------------------
 2497|    493|             ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |  102|    137|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 137]
  |  |  ------------------
  ------------------
  |  Branch (2497:16): [True: 137, False: 356]
  ------------------
 2498|    493|              !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (2498:18): [True: 493, False: 0]
  |  Branch (2498:34): [True: 493, False: 0]
  |  Branch (2498:44): [True: 493, False: 0]
  ------------------
 2499|    493|                 TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|    493|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 493]
  |  |  ------------------
  ------------------
 2500|    493|                (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (2500:18): [True: 0, False: 493]
  |  Branch (2500:35): [True: 0, False: 0]
  |  Branch (2500:47): [True: 0, False: 0]
  ------------------
 2501|      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]
  |  |  ------------------
  ------------------
 2502|    493|                (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (2502:18): [True: 0, False: 493]
  |  Branch (2502:36): [True: 0, False: 0]
  |  Branch (2502:47): [True: 0, False: 0]
  |  Branch (2502:57): [True: 0, False: 0]
  ------------------
 2503|      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]
  |  |  ------------------
  ------------------
 2504|    493|                (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (2504:18): [True: 0, False: 493]
  |  Branch (2504:42): [True: 0, False: 0]
  ------------------
 2505|      0|                 ((!words && !wordnum &&
  ------------------
  |  Branch (2505:20): [True: 0, False: 0]
  |  Branch (2505:30): [True: 0, False: 0]
  ------------------
 2506|      0|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (2506:20): [True: 0, False: 0]
  ------------------
 2507|      0|                  (words &&
  ------------------
  |  Branch (2507:20): [True: 0, False: 0]
  ------------------
 2508|    493|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))))) {
  ------------------
  |  Branch (2508:20): [True: 0, False: 0]
  ------------------
 2509|    493|        rv = rv->next_homonym;
 2510|    493|      }
 2511|       |
 2512|       |
 2513|  29.9k|      if (rv)
  ------------------
  |  Branch (2513:11): [True: 0, False: 29.9k]
  ------------------
 2514|      0|        affixed = 0;
 2515|       |
 2516|  29.9k|      if (rv) {
  ------------------
  |  Branch (2516:11): [True: 0, False: 29.9k]
  ------------------
 2517|      0|        presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2518|      0|        presult.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2519|      0|        presult.append(st, 0, i);
 2520|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2520:13): [True: 0, False: 0]
  ------------------
 2521|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2522|      0|          presult.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2523|      0|          presult.append(st, 0, i);
 2524|      0|        }
 2525|      0|        if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2525:13): [True: 0, False: 0]
  ------------------
 2526|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2527|      0|          presult.append(HENTRY_DATA2(rv));
 2528|      0|        }
 2529|      0|      }
 2530|       |
 2531|  29.9k|      if (!rv) {
  ------------------
  |  Branch (2531:11): [True: 29.9k, False: 0]
  ------------------
 2532|  29.9k|        if (compoundflag &&
  ------------------
  |  Branch (2532:13): [True: 29.9k, False: 0]
  ------------------
 2533|  29.9k|            !(rv =
  ------------------
  |  Branch (2533:13): [True: 29.9k, False: 0]
  ------------------
 2534|  29.9k|                  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|  59.8k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2534:42): [True: 0, False: 29.9k]
  ------------------
 2535|  29.9k|                               scratch, compoundflag))) {
 2536|  29.9k|          if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   99|  29.9k|#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|  59.8k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2536:16): [True: 0, False: 29.9k]
  |  Branch (2536:91): [True: 0, False: 29.9k]
  ------------------
 2537|  29.9k|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (2537:17): [True: 0, False: 29.9k]
  |  Branch (2537:41): [True: 0, False: 0]
  ------------------
 2538|      0|              !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (2538:15): [True: 0, False: 0]
  |  Branch (2538:31): [True: 0, False: 0]
  ------------------
 2539|      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 (2539:17): [True: 0, False: 0]
  ------------------
 2540|      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 (2540:17): [True: 0, False: 0]
  ------------------
 2541|      0|            rv = nullptr;
 2542|      0|          }
 2543|  29.9k|        }
 2544|       |
 2545|  29.9k|        if (rv ||
  ------------------
  |  Branch (2545:13): [True: 0, False: 29.9k]
  ------------------
 2546|  29.9k|            (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (2546:15): [True: 29.9k, False: 0]
  |  Branch (2546:33): [True: 0, False: 29.9k]
  ------------------
 2547|      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 (2547:16): [True: 0, False: 0]
  |  Branch (2547:92): [True: 0, False: 0]
  ------------------
 2548|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2548:17): [True: 0, False: 0]
  |  Branch (2548:41): [True: 0, False: 0]
  ------------------
 2549|      0|                                                                  compoundbegin))) ||  // twofold suffix+compound
 2550|      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 (2550:16): [True: 0, False: 0]
  |  Branch (2550:45): [True: 0, False: 0]
  ------------------
 2551|  29.9k|             ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (2551:15): [True: 0, False: 29.9k]
  |  Branch (2551:32): [True: 0, False: 0]
  ------------------
 2552|      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 (2552:16): [True: 0, False: 0]
  |  Branch (2552:93): [True: 0, False: 0]
  ------------------
 2553|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2553:17): [True: 0, False: 0]
  |  Branch (2553:41): [True: 0, False: 0]
  ------------------
 2554|      0|                                                                  compoundmiddle))) ||  // twofold suffix+compound
 2555|      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 (2555:16): [True: 0, False: 0]
  |  Branch (2555:45): [True: 0, False: 0]
  ------------------
 2556|      0|          std::string p;
 2557|      0|          if (compoundflag)
  ------------------
  |  Branch (2557:15): [True: 0, False: 0]
  ------------------
 2558|      0|            p = affix_check_morph(st, 0, i, scratch, compoundflag);
 2559|      0|          if (p.empty()) {
  ------------------
  |  Branch (2559:15): [True: 0, False: 0]
  ------------------
 2560|      0|            if ((wordnum == 0) && compoundbegin) {
  ------------------
  |  Branch (2560:17): [True: 0, False: 0]
  |  Branch (2560:35): [True: 0, False: 0]
  ------------------
 2561|      0|              p = affix_check_morph(st, 0, i, scratch, compoundbegin);
 2562|      0|            } else if ((wordnum > 0) && compoundmiddle) {
  ------------------
  |  Branch (2562:24): [True: 0, False: 0]
  |  Branch (2562:41): [True: 0, False: 0]
  ------------------
 2563|      0|              p = affix_check_morph(st, 0, i, scratch, compoundmiddle);
 2564|      0|            }
 2565|      0|          }
 2566|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2567|      0|          presult.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2568|      0|          presult.append(st, 0, i);
 2569|      0|          if (!p.empty()) {
  ------------------
  |  Branch (2569:15): [True: 0, False: 0]
  ------------------
 2570|      0|            line_uniq_app(p, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2571|      0|            if (!p.empty() && p[0] != MSEP_FLD)
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
  |  Branch (2571:17): [True: 0, False: 0]
  |  Branch (2571:31): [True: 0, False: 0]
  ------------------
 2572|      0|              presult.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2573|      0|            presult.append(p);
 2574|      0|          }
 2575|      0|          checked_prefix = 1;
 2576|      0|        }
 2577|       |        // else check forbiddenwords
 2578|  29.9k|      } 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 (2578:18): [True: 0, False: 0]
  |  Branch (2578:18): [True: 0, False: 0]
  ------------------
 2579|      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]
  |  |  ------------------
  ------------------
 2580|      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]
  |  |  ------------------
  ------------------
 2581|      0|        st[i] = ch;
 2582|      0|        continue;
 2583|      0|      }
 2584|       |
 2585|       |      // check non_compound flag in suffix and prefix
 2586|  29.9k|      if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2586:11): [True: 0, False: 29.9k]
  |  Branch (2586:19): [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(), compoundforbidflag, 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(), compoundforbidflag, 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|        continue;
 2592|      0|      }
 2593|       |
 2594|       |      // check compoundend flag in suffix and prefix
 2595|  29.9k|      if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (2595:11): [True: 0, False: 29.9k]
  |  Branch (2595:19): [True: 0, False: 0]
  |  Branch (2595:38): [True: 0, False: 0]
  |  Branch (2595:53): [True: 0, False: 0]
  ------------------
 2596|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2596:13): [True: 0, False: 0]
  |  Branch (2596:20): [True: 0, False: 0]
  ------------------
 2597|      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]
  |  |  ------------------
  ------------------
 2598|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2598:13): [True: 0, False: 0]
  |  Branch (2598:20): [True: 0, False: 0]
  ------------------
 2599|      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]
  |  |  ------------------
  ------------------
 2600|      0|        continue;
 2601|      0|      }
 2602|       |
 2603|       |      // check compoundmiddle flag in suffix and prefix
 2604|  29.9k|      if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (2604:11): [True: 0, False: 29.9k]
  |  Branch (2604:19): [True: 0, False: 0]
  |  Branch (2604:38): [True: 0, False: 0]
  |  Branch (2604:56): [True: 0, False: 0]
  ------------------
 2605|      0|          !hu_mov_rule &&
  ------------------
  |  Branch (2605:11): [True: 0, False: 0]
  ------------------
 2606|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2606:13): [True: 0, False: 0]
  |  Branch (2606:20): [True: 0, False: 0]
  ------------------
 2607|      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]
  |  |  ------------------
  ------------------
 2608|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2608:13): [True: 0, False: 0]
  |  Branch (2608:20): [True: 0, False: 0]
  ------------------
 2609|      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]
  |  |  ------------------
  ------------------
 2610|      0|        rv = nullptr;
 2611|      0|      }
 2612|       |
 2613|       |      // check forbiddenwords
 2614|  29.9k|      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 (2614:11): [True: 0, False: 29.9k]
  |  Branch (2614:11): [True: 0, False: 29.9k]
  |  Branch (2614:19): [True: 0, False: 0]
  ------------------
 2615|      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]
  |  |  ------------------
  ------------------
 2616|      0|        continue;
 2617|       |
 2618|       |      // increment word number, if the second root has a compoundroot flag
 2619|  29.9k|      if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2619:11): [True: 0, False: 29.9k]
  |  Branch (2619:19): [True: 0, False: 0]
  ------------------
 2620|      0|          (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2620:11): [True: 0, False: 0]
  ------------------
 2621|      0|        wordnum++;
 2622|      0|      }
 2623|       |
 2624|       |      // first word is acceptable in compound words?
 2625|  29.9k|      if (((rv) &&
  ------------------
  |  Branch (2625:11): [True: 0, False: 29.9k]
  |  Branch (2625:12): [True: 0, False: 29.9k]
  ------------------
 2626|      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 (2626:13): [True: 0, False: 0]
  |  Branch (2626:32): [True: 0, False: 0]
  |  Branch (2626:41): [True: 0, False: 0]
  |  Branch (2626:58): [True: 0, False: 0]
  ------------------
 2627|      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 (2627:14): [True: 0, False: 0]
  |  Branch (2627:35): [True: 0, False: 0]
  ------------------
 2628|      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 (2628:14): [True: 0, False: 0]
  |  Branch (2628:34): [True: 0, False: 0]
  ------------------
 2629|       |            // LANG_hu section: spec. Hungarian rule
 2630|      0|            || ((langnum == LANG_hu) &&  // hu_mov_rule
  ------------------
  |  Branch (2630:17): [True: 0, False: 0]
  ------------------
 2631|      0|                hu_mov_rule &&
  ------------------
  |  Branch (2631:17): [True: 0, False: 0]
  ------------------
 2632|      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]
  |  |  ------------------
  ------------------
 2633|       |            // END of LANG_hu section
 2634|      0|            ) &&
 2635|      0|           !((checkcompoundtriple && !words &&  // test triple letters
  ------------------
  |  Branch (2635:15): [True: 0, False: 0]
  |  Branch (2635:38): [True: 0, False: 0]
  ------------------
 2636|      0|              (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (2636:15): [True: 0, False: 0]
  ------------------
 2637|      0|              (((i > 1) && (word[i - 1] == word[i - 2])) || ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (2637:17): [True: 0, False: 0]
  |  Branch (2637:28): [True: 0, False: 0]
  |  Branch (2637:61): [True: 0, False: 0]
  ------------------
 2638|      0|               )) ||
 2639|      0|             (
 2640|       |                 // test CHECKCOMPOUNDPATTERN
 2641|      0|                 !checkcpdtable.empty() && !words && cpdpat_check(word, i, rv, nullptr, affixed, nullptr, nullptr, nullptr, nullptr, nullptr)) ||
  ------------------
  |  Branch (2641:18): [True: 0, False: 0]
  |  Branch (2641:44): [True: 0, False: 0]
  |  Branch (2641:54): [True: 0, False: 0]
  ------------------
 2642|      0|             (checkcompoundcase && !words && cpdcase_check(word, i))))
  ------------------
  |  Branch (2642:15): [True: 0, False: 0]
  |  Branch (2642:36): [True: 0, False: 0]
  |  Branch (2642:46): [True: 0, False: 0]
  ------------------
 2643|       |          // LANG_hu section: spec. Hungarian rule
 2644|  29.9k|          || ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (2644:15): [True: 29.9k, False: 0]
  |  Branch (2644:24): [True: 10.1k, False: 19.7k]
  |  Branch (2644:48): [True: 0, False: 10.1k]
  |  Branch (2644:63): [True: 0, False: 0]
  ------------------
 2645|      0|              (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2645:16): [True: 0, False: 0]
  |  Branch (2645:23): [True: 0, False: 0]
  ------------------
 2646|      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]
  |  |  ------------------
  ------------------
 2647|      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]
  |  |  ------------------
  ------------------
 2648|       |          // END of LANG_hu section
 2649|  29.9k|      ) {
 2650|       |        // LANG_hu section: spec. Hungarian rule
 2651|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2651:13): [True: 0, False: 0]
  ------------------
 2652|       |          // calculate syllable number of the word
 2653|      0|          numsyllable += get_syllable(st.substr(0, i));
 2654|       |
 2655|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2656|       |          // convention)
 2657|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2657:15): [True: 0, False: 0]
  |  Branch (2657:15): [True: 0, False: 0]
  |  Branch (2657:22): [True: 0, False: 0]
  ------------------
 2658|      0|            wordnum++;
 2659|      0|        }
 2660|       |        // END of LANG_hu section
 2661|       |
 2662|       |        // NEXT WORD(S)
 2663|      0|        rv_first = rv;
 2664|      0|        rv = lookup(word.c_str() + i, word.size() - i);  // perhaps without prefix
 2665|       |
 2666|       |        // search homonym with compound flag
 2667|      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 (2667:16): [True: 0, False: 0]
  |  Branch (2667:26): [True: 0, False: 0]
  ------------------
 2668|      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 (2668:28): [True: 0, False: 0]
  |  Branch (2668:44): [True: 0, False: 0]
  ------------------
 2669|      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 (2669:28): [True: 0, False: 0]
  |  Branch (2669:43): [True: 0, False: 0]
  ------------------
 2670|      0|                          (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))))) {
  ------------------
  |  Branch (2670:28): [True: 0, False: 0]
  |  Branch (2670:52): [True: 0, False: 0]
  |  Branch (2670:61): [True: 0, False: 0]
  ------------------
 2671|      0|          rv = rv->next_homonym;
 2672|      0|        }
 2673|       |
 2674|      0|        if (rv && words && words[wnum + 1]) {
  ------------------
  |  Branch (2674:13): [True: 0, False: 0]
  |  Branch (2674:19): [True: 0, False: 0]
  |  Branch (2674:28): [True: 0, False: 0]
  ------------------
 2675|      0|          result.append(presult);
 2676|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2677|      0|          result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2678|      0|          result.append(word, i, word.size());
 2679|      0|          if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (2679:15): [True: 0, False: 0]
  |  Branch (2679:34): [True: 0, False: 0]
  ------------------
 2680|      0|            result.append(HENTRY_DATA2(rv));
 2681|      0|          if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2681:15): [True: 0, False: 0]
  ------------------
 2682|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2683|      0|            result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2684|      0|            result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2685|      0|          }
 2686|       |          // store the pointer of the hash entry
 2687|      0|          if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2687:15): [True: 0, False: 0]
  |  Branch (2687:35): [True: 0, False: 0]
  ------------------
 2688|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2689|      0|            result.append(HENTRY_DATA2(rv));
 2690|      0|          }
 2691|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2692|      0|          return 0;
 2693|      0|        }
 2694|       |
 2695|      0|        oldnumsyllable2 = numsyllable;
 2696|      0|        oldwordnum2 = wordnum;
 2697|       |
 2698|       |        // LANG_hu section: spec. Hungarian rule
 2699|      0|        if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (2699:13): [True: 0, False: 0]
  |  Branch (2699:13): [True: 0, False: 0]
  |  Branch (2699:21): [True: 0, False: 0]
  ------------------
 2700|      0|            (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2700:13): [True: 0, False: 0]
  ------------------
 2701|      0|            !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2701:13): [True: 0, False: 0]
  ------------------
 2702|      0|          numsyllable--;
 2703|      0|        }
 2704|       |        // END of LANG_hu section
 2705|       |        // increment word number, if the second root has a compoundroot flag
 2706|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2706:13): [True: 0, False: 0]
  |  Branch (2706:21): [True: 0, False: 0]
  ------------------
 2707|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2707:13): [True: 0, False: 0]
  ------------------
 2708|      0|          wordnum++;
 2709|      0|        }
 2710|       |
 2711|       |        // check forbiddenwords
 2712|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2712:13): [True: 0, False: 0]
  |  Branch (2712:13): [True: 0, False: 0]
  |  Branch (2712:21): [True: 0, False: 0]
  ------------------
 2713|      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]
  |  |  ------------------
  ------------------
 2714|      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]
  |  |  ------------------
  ------------------
 2715|      0|          st[i] = ch;
 2716|      0|          continue;
 2717|      0|        }
 2718|       |
 2719|       |        // second word is acceptable, as a root?
 2720|       |        // hungarian conventions: compounding is acceptable,
 2721|       |        // when compound forms consist of 2 words, or if more,
 2722|       |        // then the syllable number of root words must be 6, or lesser.
 2723|      0|        if ((rv) &&
  ------------------
  |  Branch (2723:13): [True: 0, False: 0]
  |  Branch (2723:13): [True: 0, False: 0]
  ------------------
 2724|      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 (2724:15): [True: 0, False: 0]
  ------------------
 2725|      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 (2725:15): [True: 0, False: 0]
  ------------------
 2726|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2726:15): [True: 0, False: 0]
  |  Branch (2726:37): [True: 0, False: 0]
  ------------------
 2727|      0|             ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (2727:15): [True: 0, False: 0]
  ------------------
 2728|      0|              (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (2728:15): [True: 0, False: 0]
  ------------------
 2729|      0|               cpdmaxsyllable))) &&
 2730|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2730:15): [True: 0, False: 0]
  |  Branch (2730:36): [True: 0, False: 0]
  ------------------
 2731|       |          // bad compound word
 2732|      0|          result.append(presult);
 2733|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2734|      0|          result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2735|      0|          result.append(word, i, word.size());
 2736|       |
 2737|      0|          if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2737:15): [True: 0, False: 0]
  ------------------
 2738|      0|            if (complexprefixes)
  ------------------
  |  Branch (2738:17): [True: 0, False: 0]
  ------------------
 2739|      0|              result.append(HENTRY_DATA2(rv));
 2740|      0|            if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2740:17): [True: 0, False: 0]
  ------------------
 2741|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2742|      0|              result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 2743|      0|              result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2744|      0|            }
 2745|       |            // store the pointer of the hash entry
 2746|      0|            if (!complexprefixes) {
  ------------------
  |  Branch (2746:17): [True: 0, False: 0]
  ------------------
 2747|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2748|      0|              result.append(HENTRY_DATA2(rv));
 2749|      0|            }
 2750|      0|          }
 2751|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2752|      0|          ok = 1;
 2753|      0|        }
 2754|       |
 2755|      0|        numsyllable = oldnumsyllable2;
 2756|      0|        wordnum = oldwordnum2;
 2757|       |
 2758|       |        // perhaps second word has prefix or/and suffix
 2759|      0|        sfx = nullptr;
 2760|      0|        sfxflag = FLAG_NULL;
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
 2761|       |
 2762|      0|        if (compoundflag && !onlycpdrule)
  ------------------
  |  Branch (2762:13): [True: 0, False: 0]
  |  Branch (2762:29): [True: 0, False: 0]
  ------------------
 2763|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundflag);
 2764|      0|        else
 2765|      0|          rv = nullptr;
 2766|       |
 2767|      0|        if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (2767:13): [True: 0, False: 0]
  |  Branch (2767:20): [True: 0, False: 0]
  |  Branch (2767:35): [True: 0, False: 0]
  ------------------
 2768|      0|          sfx = nullptr;
 2769|      0|          pfx = nullptr;
 2770|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundend, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2771|      0|        }
 2772|       |
 2773|      0|        if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (2773:13): [True: 0, False: 0]
  |  Branch (2773:20): [True: 0, False: 0]
  |  Branch (2773:44): [True: 0, False: 0]
  ------------------
 2774|      0|          rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2775|      0|          if (rv && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1)) {
  ------------------
  |  Branch (2775:15): [True: 0, False: 0]
  |  Branch (2775:21): [True: 0, False: 0]
  |  Branch (2775:30): [True: 0, False: 0]
  ------------------
 2776|      0|            std::string m;
 2777|      0|            if (compoundflag)
  ------------------
  |  Branch (2777:17): [True: 0, False: 0]
  ------------------
 2778|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag);
 2779|      0|            if (m.empty() && compoundend) {
  ------------------
  |  Branch (2779:17): [True: 0, False: 0]
  |  Branch (2779:30): [True: 0, False: 0]
  ------------------
 2780|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundend);
 2781|      0|            }
 2782|      0|            result.append(presult);
 2783|      0|            if (!m.empty()) {
  ------------------
  |  Branch (2783:17): [True: 0, False: 0]
  ------------------
 2784|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2785|      0|              result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2786|      0|              result.append(word, i, word.size());
 2787|      0|              line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2788|      0|              result.append(m);
 2789|      0|            }
 2790|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2791|      0|            ok = 1;
 2792|      0|          }
 2793|      0|        }
 2794|       |
 2795|       |        // check non_compound flag in suffix and prefix
 2796|      0|        if ((rv) &&
  ------------------
  |  Branch (2796:13): [True: 0, False: 0]
  ------------------
 2797|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2797:15): [True: 0, False: 0]
  |  Branch (2797:22): [True: 0, False: 0]
  ------------------
 2798|      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]
  |  |  ------------------
  ------------------
 2799|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2799:15): [True: 0, False: 0]
  |  Branch (2799:22): [True: 0, False: 0]
  ------------------
 2800|      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]
  |  |  ------------------
  ------------------
 2801|      0|                      sfx->getContLen())))) {
 2802|      0|          rv = nullptr;
 2803|      0|        }
 2804|       |
 2805|       |        // check forbiddenwords
 2806|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2806:13): [True: 0, False: 0]
  |  Branch (2806:13): [True: 0, False: 0]
  |  Branch (2806:21): [True: 0, False: 0]
  ------------------
 2807|      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]
  |  |  ------------------
  ------------------
 2808|      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]
  |  |  ------------------
  ------------------
 2809|      0|            (!TESTAFF(rv->astr, needaffix, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2809:13): [True: 0, False: 0]
  ------------------
 2810|      0|          st[i] = ch;
 2811|      0|          continue;
 2812|      0|        }
 2813|       |
 2814|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2814:13): [True: 0, False: 0]
  ------------------
 2815|       |          // calculate syllable number of the word
 2816|      0|          numsyllable += get_syllable(word.c_str() + i);
 2817|       |
 2818|       |          // - affix syllable num.
 2819|       |          // XXX only second suffix (inflections, not derivations)
 2820|      0|          if (sfxappnd) {
  ------------------
  |  Branch (2820:15): [True: 0, False: 0]
  ------------------
 2821|      0|            std::string tmp(sfxappnd);
 2822|      0|            reverseword(tmp);
 2823|      0|            numsyllable -= short(get_syllable(tmp) + sfxextra);
 2824|      0|          } else {
 2825|      0|            numsyllable -= short(sfxextra);
 2826|      0|          }
 2827|       |
 2828|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2829|       |          // convention)
 2830|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2830:15): [True: 0, False: 0]
  |  Branch (2830:15): [True: 0, False: 0]
  |  Branch (2830:22): [True: 0, False: 0]
  ------------------
 2831|      0|            wordnum++;
 2832|       |
 2833|       |          // increment syllable num, if last word has a SYLLABLENUM flag
 2834|       |          // and the suffix is beginning `s'
 2835|       |
 2836|      0|          if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2836:15): [True: 0, False: 0]
  ------------------
 2837|      0|            switch (sfxflag) {
  ------------------
  |  Branch (2837:21): [True: 0, False: 0]
  ------------------
 2838|      0|              case 'c': {
  ------------------
  |  Branch (2838:15): [True: 0, False: 0]
  ------------------
 2839|      0|                numsyllable += 2;
 2840|      0|                break;
 2841|      0|              }
 2842|      0|              case 'J': {
  ------------------
  |  Branch (2842:15): [True: 0, False: 0]
  ------------------
 2843|      0|                numsyllable += 1;
 2844|      0|                break;
 2845|      0|              }
 2846|      0|              case 'I': {
  ------------------
  |  Branch (2846:15): [True: 0, False: 0]
  ------------------
 2847|      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 (2847:21): [True: 0, False: 0]
  |  Branch (2847:21): [True: 0, False: 0]
  ------------------
 2848|      0|                  numsyllable += 1;
 2849|      0|                break;
 2850|      0|              }
 2851|      0|            }
 2852|      0|          }
 2853|      0|        }
 2854|       |
 2855|       |        // increment word number, if the second word has a compoundroot flag
 2856|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2856:13): [True: 0, False: 0]
  |  Branch (2856:21): [True: 0, False: 0]
  ------------------
 2857|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2857:13): [True: 0, False: 0]
  ------------------
 2858|      0|          wordnum++;
 2859|      0|        }
 2860|       |        // second word is acceptable, as a word with prefix or/and suffix?
 2861|       |        // hungarian conventions: compounding is acceptable,
 2862|       |        // when compound forms consist 2 word, otherwise
 2863|       |        // the syllable number of root words is 6, or lesser.
 2864|      0|        if ((rv) &&
  ------------------
  |  Branch (2864:13): [True: 0, False: 0]
  ------------------
 2865|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2865:15): [True: 0, False: 0]
  |  Branch (2865:37): [True: 0, False: 0]
  ------------------
 2866|      0|             ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2866:15): [True: 0, False: 0]
  |  Branch (2866:40): [True: 0, False: 0]
  ------------------
 2867|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2867:15): [True: 0, False: 0]
  |  Branch (2867:36): [True: 0, False: 0]
  ------------------
 2868|      0|          std::string m;
 2869|      0|          if (compoundflag)
  ------------------
  |  Branch (2869:15): [True: 0, False: 0]
  ------------------
 2870|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2871|      0|          if (m.empty() && compoundend) {
  ------------------
  |  Branch (2871:15): [True: 0, False: 0]
  |  Branch (2871:28): [True: 0, False: 0]
  ------------------
 2872|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundend, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2873|      0|          }
 2874|      0|          result.append(presult);
 2875|      0|          if (!m.empty()) {
  ------------------
  |  Branch (2875:15): [True: 0, False: 0]
  ------------------
 2876|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2877|      0|            result.append(MORPH_PART);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
 2878|      0|            result.append(word, i, word.size());
 2879|      0|            line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2880|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 2881|      0|            result.append(m);
 2882|      0|          }
 2883|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 2884|      0|          ok = 1;
 2885|      0|        }
 2886|       |
 2887|      0|        numsyllable = oldnumsyllable2;
 2888|      0|        wordnum = oldwordnum2;
 2889|       |
 2890|       |        // perhaps second word is a compound word (recursive call)
 2891|      0|        if ((wordnum + 2 < maxwordnum) && (wnum + 1 < maxwordnum) && (ok == 0)) {
  ------------------
  |  Branch (2891:13): [True: 0, False: 0]
  |  Branch (2891:43): [True: 0, False: 0]
  |  Branch (2891:70): [True: 0, False: 0]
  ------------------
 2892|      0|          compound_check_morph(word.substr(i), wordnum + 1,
 2893|      0|                               numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2894|      0|                               result, &presult, scratch);
 2895|      0|        } else {
 2896|      0|          rv = nullptr;
 2897|      0|        }
 2898|      0|      }
 2899|  29.9k|      st[i] = ch;
 2900|  29.9k|      wordnum = oldwordnum;
 2901|  29.9k|      numsyllable = oldnumsyllable;
 2902|       |
 2903|  29.9k|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2903:14): [True: 0, False: 29.9k]
  |  Branch (2903:38): [True: 0, False: 0]
  ------------------
 2904|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2904:14): [True: 0, False: 0]
  ------------------
 2905|  30.1k|  }
 2906|  2.00k|  return 0;
 2907|  2.30k|}
_ZNK8AffixMgr12circumfix_okEP8PfxEntryP8SfxEntryPK8TraceCtx:
 2923|  49.1k|bool AffixMgr::circumfix_ok(PfxEntry* pfx, SfxEntry* sfx, const TraceCtx* t) const {
 2924|  49.1k|  if (!circumfix)
  ------------------
  |  Branch (2924:7): [True: 49.1k, False: 0]
  ------------------
 2925|  49.1k|    return true;
 2926|      0|  bool in_prefix = pfx && pfx->getCont() &&
  ------------------
  |  Branch (2926:20): [True: 0, False: 0]
  |  Branch (2926:27): [True: 0, False: 0]
  ------------------
 2927|      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]
  |  |  ------------------
  ------------------
 2928|      0|  bool in_suffix = sfx->getCont() &&
  ------------------
  |  Branch (2928:20): [True: 0, False: 0]
  ------------------
 2929|      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]
  |  |  ------------------
  ------------------
 2930|      0|  if (t)
  ------------------
  |  Branch (2930:7): [True: 0, False: 0]
  ------------------
 2931|      0|    trace_circumfix(*t, this, circumfix, pfx, sfx, in_prefix, in_suffix);
 2932|      0|  return in_prefix == in_suffix;
 2933|  49.1k|}
_ZNK8AffixMgr17suffix_applicableEP8PfxEntryP8SfxEntrytcPK8TraceCtx:
 2953|   241k|                                 const TraceCtx* t) const {
 2954|       |  // suffixes are only allowed at the beginning of a compound when they are signed with the
 2955|       |  // compoundpermitflag flag
 2956|   241k|  if (in_compound == IN_CPD_BEGIN &&
  ------------------
  |  |   76|   483k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2956:7): [True: 192k, False: 49.1k]
  ------------------
 2957|   192k|      !(sfx->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2957:9): [True: 192k, False: 0]
  |  Branch (2957:27): [True: 0, False: 192k]
  ------------------
 2958|   192k|        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]
  |  |  ------------------
  ------------------
 2959|   192k|    if (t)
  ------------------
  |  Branch (2959:9): [True: 0, False: 192k]
  ------------------
 2960|      0|      trace_test(*t, "compoundpermit", this, compoundpermitflag, "sfx-cont",
 2961|      0|                 sfx->getCont(), sfx->getContLen(),
 2962|      0|                 "fail, a suffix at the start of a compound needs this flag");
 2963|   192k|    return false;
 2964|   192k|  }
 2965|       |
 2966|  49.1k|  if (!circumfix_ok(pfx, sfx, t))
  ------------------
  |  Branch (2966:7): [True: 0, False: 49.1k]
  ------------------
 2967|      0|    return false;
 2968|       |
 2969|       |  // a fogemorpheme is only allowed inside a compound
 2970|  49.1k|  if (!in_compound && sfx->getCont() &&
  ------------------
  |  Branch (2970:7): [True: 49.1k, False: 6]
  |  Branch (2970:23): [True: 19.5k, False: 29.6k]
  ------------------
 2971|  19.5k|      TESTAFF(sfx->getCont(), onlyincompound, sfx->getContLen())) {
  ------------------
  |  |  102|  19.5k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 19.5k]
  |  |  ------------------
  ------------------
 2972|      0|    if (t)
  ------------------
  |  Branch (2972:9): [True: 0, False: 0]
  ------------------
 2973|      0|      trace_test(*t, "onlyincompound", this, onlyincompound, "sfx-cont",
 2974|      0|                 sfx->getCont(), sfx->getContLen(),
 2975|      0|                 "fail, this suffix is only allowed inside a compound");
 2976|      0|    return false;
 2977|      0|  }
 2978|       |
 2979|       |  // a needaffix suffix needs a further affix, so it is allowed either as a second suffix or
 2980|       |  // when a prefix is present that does not itself need one
 2981|  49.1k|  if (!cclass && sfx->getCont() &&
  ------------------
  |  Branch (2981:7): [True: 47.9k, False: 1.25k]
  |  Branch (2981:18): [True: 19.5k, False: 28.3k]
  ------------------
 2982|  19.5k|      TESTAFF(sfx->getCont(), needaffix, sfx->getContLen()) &&
  ------------------
  |  |  102|  68.7k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 19.5k]
  |  |  ------------------
  ------------------
 2983|      0|      !(pfx && !(pfx->getCont() &&
  ------------------
  |  Branch (2983:9): [True: 0, False: 0]
  |  Branch (2983:18): [True: 0, False: 0]
  ------------------
 2984|      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]
  |  |  ------------------
  ------------------
 2985|      0|    if (t)
  ------------------
  |  Branch (2985:9): [True: 0, False: 0]
  ------------------
 2986|      0|      trace_test(*t, "needaffix", this, needaffix, "sfx-cont", sfx->getCont(),
 2987|      0|                 sfx->getContLen(),
 2988|      0|                 "fail, this suffix needs a further affix and has none");
 2989|      0|    return false;
 2990|      0|  }
 2991|       |
 2992|  49.1k|  return true;
 2993|  49.1k|}
_ZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttct:
 3005|   539M|                                      const FLAG avoidflag) {
 3006|   539M|  struct hentry* rv = nullptr;
 3007|       |
 3008|   539M|  TraceCtx* t = trace_on(scratch.trace);
 3009|   539M|  int candidates = 0;
 3010|       |  // a pass that had nothing to try says so, which is different from a pass that
 3011|       |  // did not run
 3012|   539M|  auto report_empty_pass = [t, &word, start, len, sfxopts, &candidates]() {
 3013|   539M|    if (t && candidates == 0)
 3014|   539M|      trace(*t, "sfx \"%s\" candidates=0%s", word.substr(start, len).c_str(),
 3015|   539M|            (sfxopts & aeXPRODUCT) != 0 ? " xprod=Y" : "");
 3016|   539M|  };
 3017|       |  // a rule the suffix conditions turned away never reaches checkword, so name
 3018|       |  // the rule here and run the conditions again to say which of them refused it
 3019|   539M|  auto report_refused = [this, t, ppfx, cclass, in_compound,
 3020|   539M|                         &candidates](SfxEntry* se) {
 3021|   539M|    if (!t)
 3022|   539M|      return;
 3023|   539M|    ++candidates;
 3024|   539M|    trace_affix(*t, "sfx", this, *se);
 3025|   539M|    TraceScope trace_depth(t);
 3026|   539M|    suffix_applicable(ppfx, se, cclass, in_compound, t);
 3027|   539M|  };
 3028|       |
 3029|       |  // first handle the special case of 0 length suffixes
 3030|   539M|  SfxEntry* se = sStart[0];
 3031|       |
 3032|   539M|  while (se) {
  ------------------
  |  Branch (3032:10): [True: 0, False: 539M]
  ------------------
 3033|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (3033:9): [True: 0, False: 0]
  |  Branch (3033:20): [True: 0, False: 0]
  ------------------
 3034|      0|      if (suffix_applicable(ppfx, se, cclass, in_compound, nullptr)) {
  ------------------
  |  Branch (3034:11): [True: 0, False: 0]
  ------------------
 3035|      0|        ++candidates;
 3036|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx,
 3037|      0|                           (FLAG)cclass, needflag,
 3038|      0|                           (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (3038:29): [True: 0, False: 0]
  ------------------
 3039|      0|                           scratch);
 3040|       |        // Skip a stem with the avoid flag and keep scanning the other suffixes.
 3041|      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 (3041:13): [True: 0, False: 0]
  |  Branch (3041:19): [True: 0, False: 0]
  ------------------
 3042|      0|          trace_avoidflag(t, avoidflag, rv);
 3043|      0|          rv = nullptr;
 3044|      0|        }
 3045|      0|        if (rv) {
  ------------------
  |  Branch (3045:13): [True: 0, False: 0]
  ------------------
 3046|      0|          sfx = se;  // BUG: sfx not stateless
 3047|      0|          return rv;
 3048|      0|        }
 3049|      0|      } else {
 3050|      0|        report_refused(se);
 3051|      0|      }
 3052|      0|    }
 3053|      0|    se = se->getNext();
 3054|      0|  }
 3055|       |
 3056|       |  // now handle the general case
 3057|   539M|  if (len == 0) {
  ------------------
  |  Branch (3057:7): [True: 44.8k, False: 539M]
  ------------------
 3058|  44.8k|    report_empty_pass();
 3059|  44.8k|    return nullptr;  // FULLSTRIP
 3060|  44.8k|  }
 3061|   539M|  unsigned char sp = word[start + len - 1];
 3062|   539M|  SfxEntry* sptr = sStart[sp];
 3063|       |
 3064|   539M|  while (sptr) {
  ------------------
  |  Branch (3064:10): [True: 264k, False: 539M]
  ------------------
 3065|   264k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3065:9): [True: 241k, False: 23.0k]
  ------------------
 3066|   241k|      if (!suffix_applicable(ppfx, sptr, cclass, in_compound, nullptr))
  ------------------
  |  Branch (3066:11): [True: 192k, False: 49.1k]
  ------------------
 3067|   192k|        report_refused(sptr);
 3068|  49.1k|      else if (in_compound != IN_CPD_END || ppfx ||
  ------------------
  |  |   77|  98.3k|#define IN_CPD_END 2
  ------------------
  |  Branch (3068:16): [True: 49.1k, False: 6]
  |  Branch (3068:45): [True: 0, False: 6]
  ------------------
 3069|      6|               !(sptr->getCont() &&
  ------------------
  |  Branch (3069:18): [True: 6, False: 0]
  ------------------
 3070|  49.1k|                 TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))) {
  ------------------
  |  |  102|      6|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 6]
  |  |  ------------------
  ------------------
 3071|  49.1k|        ++candidates;
 3072|  49.1k|        rv = sptr->checkword(word, start, len, sfxopts, ppfx,
 3073|  49.1k|                             cclass, needflag,
 3074|  49.1k|                             (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (3074:31): [True: 6, False: 49.1k]
  ------------------
 3075|  49.1k|                             scratch);
 3076|  49.1k|        if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |   99|  49.1k|#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 (3076:13): [True: 0, False: 49.1k]
  |  Branch (3076:19): [True: 0, False: 0]
  ------------------
 3077|      0|          trace_avoidflag(t, avoidflag, rv);
 3078|      0|          rv = nullptr;
 3079|      0|        }
 3080|  49.1k|        if (rv) {
  ------------------
  |  Branch (3080:13): [True: 0, False: 49.1k]
  ------------------
 3081|      0|          sfx = sptr;                 // BUG: sfx not stateless
 3082|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 3083|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (3083:15): [True: 0, False: 0]
  ------------------
 3084|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 3085|       |          // LANG_hu section: spec. Hungarian rule
 3086|      0|          else if (langnum == LANG_hu && sptr->getKeyLen() &&
  ------------------
  |  Branch (3086:20): [True: 0, False: 0]
  |  Branch (3086:42): [True: 0, False: 0]
  ------------------
 3087|      0|                   sptr->getKey()[0] == 'i' && sptr->getKey()[1] != 'y' &&
  ------------------
  |  Branch (3087:20): [True: 0, False: 0]
  |  Branch (3087:48): [True: 0, False: 0]
  ------------------
 3088|      0|                   sptr->getKey()[1] != 't') {
  ------------------
  |  Branch (3088:20): [True: 0, False: 0]
  ------------------
 3089|      0|            sfxextra = 1;
 3090|      0|          }
 3091|       |          // END of LANG_hu section
 3092|      0|          return rv;
 3093|      0|        }
 3094|  49.1k|      }
 3095|   241k|      sptr = sptr->getNextEQ();
 3096|   241k|    } else {
 3097|  23.0k|      sptr = sptr->getNextNE();
 3098|  23.0k|    }
 3099|   264k|  }
 3100|       |
 3101|   539M|  report_empty_pass();
 3102|       |
 3103|   539M|  return nullptr;
 3104|   539M|}
_ZN8AffixMgr19suffix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratcht:
 3113|  16.6M|                                             const FLAG needflag) {
 3114|  16.6M|  struct hentry* rv = nullptr;
 3115|       |
 3116|       |  // first handle the special case of 0 length suffixes
 3117|  16.6M|  SfxEntry* se = sStart[0];
 3118|  16.6M|  while (se) {
  ------------------
  |  Branch (3118:10): [True: 0, False: 16.6M]
  ------------------
 3119|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (3119:9): [True: 0, False: 0]
  ------------------
 3120|      0|      rv = se->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 3121|      0|      if (rv)
  ------------------
  |  Branch (3121:11): [True: 0, False: 0]
  ------------------
 3122|      0|        return rv;
 3123|      0|    }
 3124|      0|    se = se->getNext();
 3125|      0|  }
 3126|       |
 3127|       |  // now handle the general case
 3128|  16.6M|  if (len == 0)
  ------------------
  |  Branch (3128:7): [True: 13.6k, False: 16.6M]
  ------------------
 3129|  13.6k|    return nullptr;  // FULLSTRIP
 3130|  16.6M|  unsigned char sp = word[start + len - 1];
 3131|  16.6M|  SfxEntry* sptr = sStart[sp];
 3132|       |
 3133|  16.6M|  while (sptr) {
  ------------------
  |  Branch (3133:10): [True: 63.0k, False: 16.6M]
  ------------------
 3134|  63.0k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3134:9): [True: 45.5k, False: 17.4k]
  ------------------
 3135|  45.5k|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (3135:11): [True: 26.0k, False: 19.5k]
  ------------------
 3136|  26.0k|        rv = sptr->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 3137|  26.0k|        if (rv) {
  ------------------
  |  Branch (3137:13): [True: 0, False: 26.0k]
  ------------------
 3138|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 3139|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (3139:15): [True: 0, False: 0]
  ------------------
 3140|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 3141|      0|          return rv;
 3142|      0|        }
 3143|  26.0k|      }
 3144|  45.5k|      sptr = sptr->getNextEQ();
 3145|  45.5k|    } else {
 3146|  17.4k|      sptr = sptr->getNextNE();
 3147|  17.4k|    }
 3148|  63.0k|  }
 3149|       |
 3150|  16.6M|  return nullptr;
 3151|  16.6M|}
_ZN8AffixMgr25suffix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratcht:
 3160|  3.97k|                                                const FLAG needflag) {
 3161|  3.97k|  std::string result2;
 3162|  3.97k|  std::string result3;
 3163|       |  // the second suffix runs the whole suffix table again for every first suffix
 3164|  3.97k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  122|  3.97k|#define MSEP_REC '\n'
  ------------------
 3165|       |
 3166|       |  // first handle the special case of 0 length suffixes
 3167|  3.97k|  SfxEntry* se = sStart[0];
 3168|  3.97k|  while (se) {
  ------------------
  |  Branch (3168:10): [True: 0, False: 3.97k]
  ------------------
 3169|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (3169:9): [True: 0, False: 0]
  ------------------
 3170|      0|      std::string st = se->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 3171|      0|      if (!st.empty()) {
  ------------------
  |  Branch (3171:11): [True: 0, False: 0]
  ------------------
 3172|      0|        std::string analysis;
 3173|      0|        if (ppfx) {
  ------------------
  |  Branch (3173:13): [True: 0, False: 0]
  ------------------
 3174|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3174:15): [True: 0, False: 0]
  ------------------
 3175|      0|            analysis.append(ppfx->getMorph());
 3176|      0|            analysis.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3177|      0|          } else
 3178|      0|            debugflag(analysis, ppfx->getFlag());
 3179|      0|        }
 3180|      0|        analysis.append(st);
 3181|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (3181:13): [True: 0, False: 0]
  ------------------
 3182|      0|          analysis.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3183|      0|          analysis.append(se->getMorph());
 3184|      0|        } else
 3185|      0|          debugflag(analysis, se->getFlag());
 3186|      0|        result.append(analysis);
 3187|      0|      }
 3188|      0|    }
 3189|      0|    se = se->getNext();
 3190|      0|  }
 3191|       |
 3192|       |  // now handle the general case
 3193|  3.97k|  if (len == 0)
  ------------------
  |  Branch (3193:7): [True: 0, False: 3.97k]
  ------------------
 3194|      0|    return { };  // FULLSTRIP
 3195|  3.97k|  unsigned char sp = word[start + len - 1];
 3196|  3.97k|  SfxEntry* sptr = sStart[sp];
 3197|       |
 3198|  3.97k|  while (sptr) {
  ------------------
  |  Branch (3198:10): [True: 0, False: 3.97k]
  ------------------
 3199|      0|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3199:9): [True: 0, False: 0]
  ------------------
 3200|      0|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (3200:11): [True: 0, False: 0]
  ------------------
 3201|      0|        std::string st = sptr->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 3202|      0|        if (!st.empty()) {
  ------------------
  |  Branch (3202:13): [True: 0, False: 0]
  ------------------
 3203|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 3204|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (3204:15): [True: 0, False: 0]
  ------------------
 3205|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 3206|      0|          result2.assign(st);
 3207|       |
 3208|      0|          result3.clear();
 3209|       |
 3210|      0|          if (sptr->getMorph()) {
  ------------------
  |  Branch (3210:15): [True: 0, False: 0]
  ------------------
 3211|      0|            result3.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3212|      0|            result3.append(sptr->getMorph());
 3213|      0|          } else
 3214|      0|            debugflag(result3, sptr->getFlag());
 3215|      0|          strlinecat(result2, result3);
 3216|      0|          result.append(result2);
 3217|      0|        }
 3218|      0|      }
 3219|      0|      sptr = sptr->getNextEQ();
 3220|      0|    } else {
 3221|      0|      sptr = sptr->getNextNE();
 3222|      0|    }
 3223|      0|  }
 3224|       |
 3225|  3.97k|  return result.join();
 3226|  3.97k|}
_ZN8AffixMgr18suffix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttc:
 3236|  12.7k|                                         char in_compound) {
 3237|  12.7k|  std::string result;
 3238|       |
 3239|  12.7k|  struct hentry* rv = nullptr;
 3240|       |
 3241|       |  // first handle the special case of 0 length suffixes
 3242|  12.7k|  SfxEntry* se = sStart[0];
 3243|  12.7k|  while (se) {
  ------------------
  |  Branch (3243:10): [True: 0, False: 12.7k]
  ------------------
 3244|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (3244:9): [True: 0, False: 0]
  |  Branch (3244:20): [True: 0, False: 0]
  ------------------
 3245|      0|      if (suffix_applicable(ppfx, se, cclass, in_compound, nullptr))
  ------------------
  |  Branch (3245:11): [True: 0, False: 0]
  ------------------
 3246|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx, cclass,
 3247|      0|                           needflag, FLAG_NULL, scratch);
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
 3248|      0|      while (rv) {
  ------------------
  |  Branch (3248:14): [True: 0, False: 0]
  ------------------
 3249|      0|        if (ppfx) {
  ------------------
  |  Branch (3249:13): [True: 0, False: 0]
  ------------------
 3250|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3250:15): [True: 0, False: 0]
  ------------------
 3251|      0|            result.append(ppfx->getMorph());
 3252|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3253|      0|          } else
 3254|      0|            debugflag(result, ppfx->getFlag());
 3255|      0|        }
 3256|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3256:13): [True: 0, False: 0]
  |  Branch (3256:32): [True: 0, False: 0]
  ------------------
 3257|      0|          result.append(HENTRY_DATA2(rv));
 3258|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (3258:13): [True: 0, False: 0]
  ------------------
 3259|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3260|      0|          result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 3261|      0|          result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 3262|      0|        }
 3263|       |
 3264|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3264:13): [True: 0, False: 0]
  |  Branch (3264:33): [True: 0, False: 0]
  ------------------
 3265|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3266|      0|          result.append(HENTRY_DATA2(rv));
 3267|      0|        }
 3268|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (3268:13): [True: 0, False: 0]
  ------------------
 3269|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3270|      0|          result.append(se->getMorph());
 3271|      0|        } else
 3272|      0|          debugflag(result, se->getFlag());
 3273|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 3274|      0|        rv = se->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3275|      0|      }
 3276|      0|    }
 3277|      0|    se = se->getNext();
 3278|      0|  }
 3279|       |
 3280|       |  // now handle the general case
 3281|  12.7k|  if (len == 0)
  ------------------
  |  Branch (3281:7): [True: 0, False: 12.7k]
  ------------------
 3282|      0|    return { };  // FULLSTRIP
 3283|  12.7k|  unsigned char sp = word[start + len - 1];
 3284|  12.7k|  SfxEntry* sptr = sStart[sp];
 3285|       |
 3286|  12.7k|  while (sptr) {
  ------------------
  |  Branch (3286:10): [True: 0, False: 12.7k]
  ------------------
 3287|      0|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3287:9): [True: 0, False: 0]
  ------------------
 3288|      0|      if (suffix_applicable(ppfx, sptr, cclass, in_compound, nullptr))
  ------------------
  |  Branch (3288:11): [True: 0, False: 0]
  ------------------
 3289|      0|        rv = sptr->checkword(word, start, len, sfxopts, ppfx, cclass,
 3290|      0|                             needflag, FLAG_NULL, scratch);
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
 3291|      0|      while (rv) {
  ------------------
  |  Branch (3291:14): [True: 0, False: 0]
  ------------------
 3292|      0|        if (ppfx) {
  ------------------
  |  Branch (3292:13): [True: 0, False: 0]
  ------------------
 3293|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3293:15): [True: 0, False: 0]
  ------------------
 3294|      0|            result.append(ppfx->getMorph());
 3295|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3296|      0|          } else
 3297|      0|            debugflag(result, ppfx->getFlag());
 3298|      0|        }
 3299|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3299:13): [True: 0, False: 0]
  |  Branch (3299:32): [True: 0, False: 0]
  ------------------
 3300|      0|          result.append(HENTRY_DATA2(rv));
 3301|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (3301:13): [True: 0, False: 0]
  ------------------
 3302|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3303|      0|          result.append(MORPH_STEM);
  ------------------
  |  |  103|      0|#define MORPH_STEM "st:"
  ------------------
 3304|      0|          result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 3305|      0|        }
 3306|       |
 3307|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3307:13): [True: 0, False: 0]
  |  Branch (3307:33): [True: 0, False: 0]
  ------------------
 3308|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3309|      0|          result.append(HENTRY_DATA2(rv));
 3310|      0|        }
 3311|       |
 3312|      0|        if (sptr->getMorph()) {
  ------------------
  |  Branch (3312:13): [True: 0, False: 0]
  ------------------
 3313|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 3314|      0|          result.append(sptr->getMorph());
 3315|      0|        } else
 3316|      0|          debugflag(result, sptr->getFlag());
 3317|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 3318|      0|        rv = sptr->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3319|      0|      }
 3320|      0|      sptr = sptr->getNextEQ();
 3321|      0|    } else {
 3322|      0|      sptr = sptr->getNextNE();
 3323|      0|    }
 3324|      0|  }
 3325|       |
 3326|  12.7k|  return result;
 3327|  12.7k|}
_ZN8AffixMgr11affix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtctPP8PfxEntryPP8SfxEntry:
 3362|  17.4M|                                     SfxEntry** found_sfx) {
 3363|       |
 3364|  17.4M|  TraceCtx* t = trace_on(scratch.trace);
 3365|       |  // the affixes that built the word are reported before the members holding them are cleared
 3366|  17.4M|  auto report_form = [this, t, &word, start, len, found_pfx, found_sfx](const struct hentry* rv) {
 3367|  17.4M|    if (!rv)
 3368|  17.4M|      return;
 3369|  17.4M|    if (t)
 3370|  17.4M|      trace_form(*t, this, word.substr(start, len), rv->word, pfx, sfx);
 3371|  17.4M|    if (found_pfx)
 3372|  17.4M|      *found_pfx = pfx;
 3373|  17.4M|    if (found_sfx)
 3374|  17.4M|      *found_sfx = sfx;
 3375|  17.4M|  };
 3376|       |
 3377|       |  // check all prefixes (also crossed with suffixes if allowed)
 3378|  17.4M|  struct hentry* rv = prefix_check(word, start, len, in_compound, scratch, needflag, avoidflag);
 3379|  17.4M|  if (rv) {
  ------------------
  |  Branch (3379:7): [True: 0, False: 17.4M]
  ------------------
 3380|      0|    report_form(rv);
 3381|      0|    return rv;
 3382|      0|  }
 3383|       |
 3384|       |  // if still not found check all suffixes
 3385|  17.4M|  rv = suffix_check(word, start, len, 0, nullptr, scratch, FLAG_NULL, needflag, in_compound, avoidflag);
  ------------------
  |  |   99|  17.4M|#define FLAG_NULL 0x00
  ------------------
 3386|       |
 3387|  17.4M|  if (havecontclass) {
  ------------------
  |  Branch (3387:7): [True: 5.82M, False: 11.6M]
  ------------------
 3388|  5.82M|    if (rv)
  ------------------
  |  Branch (3388:9): [True: 0, False: 5.82M]
  ------------------
 3389|      0|      report_form(rv);
 3390|       |
 3391|  5.82M|    sfx = nullptr;
 3392|  5.82M|    pfx = nullptr;
 3393|       |
 3394|  5.82M|    if (rv)
  ------------------
  |  Branch (3394:9): [True: 0, False: 5.82M]
  ------------------
 3395|      0|      return rv;
 3396|       |    // if still not found check all two-level suffixes
 3397|  5.82M|    rv = suffix_check_twosfx(word, start, len, 0, nullptr, scratch, needflag);
 3398|       |
 3399|  5.82M|    if (rv) {
  ------------------
  |  Branch (3399:9): [True: 0, False: 5.82M]
  ------------------
 3400|      0|      report_form(rv);
 3401|      0|      return rv;
 3402|      0|    }
 3403|       |    // if still not found check all two-level suffixes
 3404|  5.82M|    rv = prefix_check_twosfx(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   75|  5.82M|#define IN_CPD_NOT 0
  ------------------
 3405|  5.82M|  }
 3406|       |
 3407|  17.4M|  report_form(rv);
 3408|       |
 3409|  17.4M|  return rv;
 3410|  17.4M|}
_ZN8AffixMgr17affix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtc:
 3418|  12.7k|                                  char in_compound) {
 3419|       |  // the four checks below overlap
 3420|  12.7k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  122|  12.7k|#define MSEP_REC '\n'
  ------------------
 3421|       |
 3422|       |  // check all prefixes (also crossed with suffixes if allowed)
 3423|  12.7k|  std::string st = prefix_check_morph(word, start, len, in_compound, scratch);
 3424|  12.7k|  if (!st.empty()) {
  ------------------
  |  Branch (3424:7): [True: 0, False: 12.7k]
  ------------------
 3425|      0|    result.append(st);
 3426|      0|  }
 3427|       |
 3428|       |  // if still not found check all suffixes
 3429|  12.7k|  st = suffix_check_morph(word, start, len, 0, nullptr, scratch, '\0', needflag, in_compound);
 3430|  12.7k|  if (!st.empty()) {
  ------------------
  |  Branch (3430:7): [True: 0, False: 12.7k]
  ------------------
 3431|      0|    result.append(st);
 3432|      0|  }
 3433|       |
 3434|  12.7k|  if (havecontclass) {
  ------------------
  |  Branch (3434:7): [True: 3.97k, False: 8.74k]
  ------------------
 3435|  3.97k|    sfx = nullptr;
 3436|  3.97k|    pfx = nullptr;
 3437|       |    // if still not found check all two-level suffixes
 3438|  3.97k|    st = suffix_check_twosfx_morph(word, start, len, 0, nullptr, scratch, needflag);
 3439|  3.97k|    if (!st.empty()) {
  ------------------
  |  Branch (3439:9): [True: 0, False: 3.97k]
  ------------------
 3440|      0|      result.append(st);
 3441|      0|    }
 3442|       |
 3443|       |    // if still not found check all two-level suffixes
 3444|  3.97k|    st = prefix_check_twosfx_morph(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   75|  3.97k|#define IN_CPD_NOT 0
  ------------------
 3445|  3.97k|    if (!st.empty()) {
  ------------------
  |  Branch (3445:9): [True: 0, False: 3.97k]
  ------------------
 3446|      0|      result.append(st);
 3447|      0|    }
 3448|  3.97k|  }
 3449|       |
 3450|  12.7k|  return result.join();
 3451|  12.7k|}
_ZN8AffixMgr15expand_rootwordEP9guesswordiPKciPKttS3_iS3_:
 3647|   545k|                              const char* phon) {
 3648|   545k|  int nh = 0;
 3649|       |  // first add root word to list
 3650|   545k|  if ((nh < maxn) &&
  ------------------
  |  Branch (3650:7): [True: 545k, False: 0]
  ------------------
 3651|   545k|      !(al && ((needaffix && TESTAFF(ap, needaffix, al)) ||
  ------------------
  |  |  102|  4.37k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 2.18k, False: 2.18k]
  |  |  ------------------
  ------------------
  |  Branch (3651:9): [True: 96.0k, False: 449k]
  |  Branch (3651:17): [True: 4.37k, False: 91.6k]
  ------------------
 3652|   543k|               (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 (3652:17): [True: 0, False: 93.8k]
  ------------------
 3653|   543k|    wlst[nh].word = mystrdup(ts);
 3654|   543k|    wlst[nh].allow = false;
 3655|   543k|    wlst[nh].orig = nullptr;
 3656|   543k|    nh++;
 3657|       |    // add special phonetic version
 3658|   543k|    if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3658:9): [True: 887, False: 542k]
  |  Branch (3658:17): [True: 887, False: 0]
  ------------------
 3659|    887|      wlst[nh].word = mystrdup(phon);
 3660|    887|      wlst[nh].allow = false;
 3661|    887|      wlst[nh].orig = mystrdup(ts);
 3662|    887|      nh++;
 3663|    887|    }
 3664|   543k|  }
 3665|       |
 3666|       |  // handle suffixes
 3667|   653k|  for (int i = 0; i < al; i++) {
  ------------------
  |  Branch (3667:19): [True: 107k, False: 545k]
  ------------------
 3668|   107k|    const auto c = (unsigned char)(ap[i] & 0x00FF);
 3669|   107k|    SfxEntry* sptr = sFlag[c];
 3670|   172k|    while (sptr) {
  ------------------
  |  Branch (3670:12): [True: 64.2k, False: 107k]
  ------------------
 3671|  64.2k|      if ((sptr->getFlag() == ap[i]) &&
  ------------------
  |  Branch (3671:11): [True: 64.2k, False: 0]
  ------------------
 3672|  64.2k|          (!sptr->getKeyLen() ||
  ------------------
  |  Branch (3672:12): [True: 0, False: 64.2k]
  ------------------
 3673|  64.2k|           ((badl > sptr->getKeyLen()) &&
  ------------------
  |  Branch (3673:13): [True: 36.6k, False: 27.5k]
  ------------------
 3674|  36.6k|            (strcmp(sptr->getAffix(), bad + badl - sptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3674:13): [True: 27, False: 36.6k]
  ------------------
 3675|       |          // check needaffix flag
 3676|     27|          !(sptr->getCont() &&
  ------------------
  |  Branch (3676:13): [True: 14, False: 13]
  ------------------
 3677|     14|            ((needaffix &&
  ------------------
  |  Branch (3677:15): [True: 7, False: 7]
  ------------------
 3678|      7|              TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) ||
  ------------------
  |  |  102|      7|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 7]
  |  |  ------------------
  ------------------
 3679|     14|             (circumfix &&
  ------------------
  |  Branch (3679:15): [True: 0, False: 14]
  ------------------
 3680|      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]
  |  |  ------------------
  ------------------
 3681|     14|             (onlyincompound &&
  ------------------
  |  Branch (3681:15): [True: 0, False: 14]
  ------------------
 3682|     27|              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]
  |  |  ------------------
  ------------------
 3683|     27|        std::string newword = sptr->add(ts, wl);
 3684|     27|        if (!newword.empty()) {
  ------------------
  |  Branch (3684:13): [True: 27, False: 0]
  ------------------
 3685|     27|          if (nh < maxn) {
  ------------------
  |  Branch (3685:15): [True: 27, False: 0]
  ------------------
 3686|     27|            wlst[nh].word = mystrdup(newword.c_str());
 3687|     27|            wlst[nh].allow = sptr->allowCross();
 3688|     27|            wlst[nh].orig = nullptr;
 3689|     27|            nh++;
 3690|       |            // add special phonetic version
 3691|     27|            if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3691:17): [True: 0, False: 27]
  |  Branch (3691:25): [True: 0, False: 0]
  ------------------
 3692|      0|              std::string prefix(phon);
 3693|      0|              std::string key(sptr->getKey());
 3694|      0|              reverseword(key);
 3695|      0|              prefix.append(key);
 3696|      0|              wlst[nh].word = mystrdup(prefix.c_str());
 3697|      0|              wlst[nh].allow = false;
 3698|      0|              wlst[nh].orig = mystrdup(newword.c_str());
 3699|      0|              nh++;
 3700|      0|            }
 3701|     27|          }
 3702|     27|        }
 3703|     27|      }
 3704|  64.2k|      sptr = sptr->getFlgNxt();
 3705|  64.2k|    }
 3706|   107k|  }
 3707|       |
 3708|   545k|  int n = nh;
 3709|       |
 3710|       |  // handle cross products of prefixes and suffixes
 3711|   546k|  for (int j = 1; j < n; j++)
  ------------------
  |  Branch (3711:19): [True: 907, False: 545k]
  ------------------
 3712|    907|    if (wlst[j].allow) {
  ------------------
  |  Branch (3712:9): [True: 20, False: 887]
  ------------------
 3713|     60|      for (int k = 0; k < al; k++) {
  ------------------
  |  Branch (3713:23): [True: 40, False: 20]
  ------------------
 3714|     40|        const auto c = (unsigned char)(ap[k] & 0x00FF);
 3715|     40|        PfxEntry* cptr = pFlag[c];
 3716|     40|        while (cptr) {
  ------------------
  |  Branch (3716:16): [True: 0, False: 40]
  ------------------
 3717|      0|          if ((cptr->getFlag() == ap[k]) && cptr->allowCross() &&
  ------------------
  |  Branch (3717:15): [True: 0, False: 0]
  |  Branch (3717:45): [True: 0, False: 0]
  ------------------
 3718|      0|              (!cptr->getKeyLen() ||
  ------------------
  |  Branch (3718:16): [True: 0, False: 0]
  ------------------
 3719|      0|               ((badl > cptr->getKeyLen()) &&
  ------------------
  |  Branch (3719:17): [True: 0, False: 0]
  ------------------
 3720|      0|                (strncmp(cptr->getKey(), bad, cptr->getKeyLen()) == 0)))) {
  ------------------
  |  Branch (3720:17): [True: 0, False: 0]
  ------------------
 3721|      0|            int l1 = strlen(wlst[j].word);
 3722|      0|            std::string newword = cptr->add(wlst[j].word, l1);
 3723|      0|            if (!newword.empty()) {
  ------------------
  |  Branch (3723:17): [True: 0, False: 0]
  ------------------
 3724|      0|              if (nh < maxn) {
  ------------------
  |  Branch (3724:19): [True: 0, False: 0]
  ------------------
 3725|      0|                wlst[nh].word = mystrdup(newword.c_str());
 3726|      0|                wlst[nh].allow = cptr->allowCross();
 3727|      0|                wlst[nh].orig = nullptr;
 3728|      0|                nh++;
 3729|      0|              }
 3730|      0|            }
 3731|      0|          }
 3732|      0|          cptr = cptr->getFlgNxt();
 3733|      0|        }
 3734|     40|      }
 3735|     20|    }
 3736|       |
 3737|       |  // now handle pure prefixes
 3738|   653k|  for (int m = 0; m < al; m++) {
  ------------------
  |  Branch (3738:19): [True: 107k, False: 545k]
  ------------------
 3739|   107k|    const auto c = (unsigned char)(ap[m] & 0x00FF);
 3740|   107k|    PfxEntry* ptr = pFlag[c];
 3741|   108k|    while (ptr) {
  ------------------
  |  Branch (3741:12): [True: 908, False: 107k]
  ------------------
 3742|    908|      if ((ptr->getFlag() == ap[m]) &&
  ------------------
  |  Branch (3742:11): [True: 908, False: 0]
  ------------------
 3743|    908|          (!ptr->getKeyLen() ||
  ------------------
  |  Branch (3743:12): [True: 0, False: 908]
  ------------------
 3744|    908|           ((badl > ptr->getKeyLen()) &&
  ------------------
  |  Branch (3744:13): [True: 908, False: 0]
  ------------------
 3745|    908|            (strncmp(ptr->getKey(), bad, ptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3745:13): [True: 2, False: 906]
  ------------------
 3746|       |          // check needaffix flag
 3747|      2|          !(ptr->getCont() &&
  ------------------
  |  Branch (3747:13): [True: 0, False: 2]
  ------------------
 3748|      0|            ((needaffix &&
  ------------------
  |  Branch (3748:15): [True: 0, False: 0]
  ------------------
 3749|      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]
  |  |  ------------------
  ------------------
 3750|      0|             (circumfix &&
  ------------------
  |  Branch (3750:15): [True: 0, False: 0]
  ------------------
 3751|      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]
  |  |  ------------------
  ------------------
 3752|      0|             (onlyincompound &&
  ------------------
  |  Branch (3752:15): [True: 0, False: 0]
  ------------------
 3753|      2|              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]
  |  |  ------------------
  ------------------
 3754|      2|        std::string newword = ptr->add(ts, wl);
 3755|      2|        if (!newword.empty()) {
  ------------------
  |  Branch (3755:13): [True: 2, False: 0]
  ------------------
 3756|      2|          if (nh < maxn) {
  ------------------
  |  Branch (3756:15): [True: 2, False: 0]
  ------------------
 3757|      2|            wlst[nh].word = mystrdup(newword.c_str());
 3758|      2|            wlst[nh].allow = ptr->allowCross();
 3759|      2|            wlst[nh].orig = nullptr;
 3760|      2|            nh++;
 3761|      2|          }
 3762|      2|        }
 3763|      2|      }
 3764|    908|      ptr = ptr->getFlgNxt();
 3765|    908|    }
 3766|   107k|  }
 3767|       |
 3768|   545k|  return nh;
 3769|   545k|}
_ZNK8AffixMgr12get_reptableEv:
 3772|   380k|const std::vector<replentry>& AffixMgr::get_reptable() const {
 3773|   380k|  return pHMgr->get_reptable();
 3774|   380k|}
_ZNK8AffixMgr14get_iconvtableEv:
 3777|  14.5M|RepList* AffixMgr::get_iconvtable() const {
 3778|  14.5M|  if (!iconvtable)
  ------------------
  |  Branch (3778:7): [True: 14.1M, False: 355k]
  ------------------
 3779|  14.1M|    return nullptr;
 3780|   355k|  return iconvtable;
 3781|  14.5M|}
_ZNK8AffixMgr14get_oconvtableEv:
 3784|   101k|RepList* AffixMgr::get_oconvtable() const {
 3785|   101k|  if (!oconvtable)
  ------------------
  |  Branch (3785:7): [True: 95.7k, False: 5.47k]
  ------------------
 3786|  95.7k|    return nullptr;
 3787|  5.47k|  return oconvtable;
 3788|   101k|}
_ZNK8AffixMgr14get_phonetableEv:
 3791|  61.4k|struct phonetable* AffixMgr::get_phonetable() const {
 3792|  61.4k|  if (!phone)
  ------------------
  |  Branch (3792:7): [True: 57.9k, False: 3.49k]
  ------------------
 3793|  57.9k|    return nullptr;
 3794|  3.49k|  return phone;
 3795|  61.4k|}
_ZNK8AffixMgr12get_maptableEv:
 3798|   380k|const std::vector<mapentry>& AffixMgr::get_maptable() const {
 3799|   380k|  return maptable;
 3800|   380k|}
_ZNK8AffixMgr14get_breaktableEv:
 3803|     38|const std::vector<std::string>& AffixMgr::get_breaktable() const {
 3804|     38|  return breaktable;
 3805|     38|}
_ZN8AffixMgr12get_encodingEv:
 3808|     78|const std::string& AffixMgr::get_encoding() {
 3809|     78|  if (encoding.empty())
  ------------------
  |  Branch (3809:7): [True: 20, False: 58]
  ------------------
 3810|     20|    encoding = SPELL_ENCODING;
  ------------------
  |  |   99|     20|#define SPELL_ENCODING "ISO8859-1"
  ------------------
 3811|     78|  return encoding;
 3812|     78|}
_ZNK8AffixMgr11get_langnumEv:
 3815|     76|int AffixMgr::get_langnum() const {
 3816|     76|  return langnum;
 3817|     76|}
_ZNK8AffixMgr19get_complexprefixesEv:
 3820|     76|int AffixMgr::get_complexprefixes() const {
 3821|     76|  return complexprefixes;
 3822|     76|}
_ZNK8AffixMgr13get_fullstripEv:
 3825|  8.33k|int AffixMgr::get_fullstrip() const {
 3826|  8.33k|  return fullstrip;
 3827|  8.33k|}
_ZNK8AffixMgr12get_keepcaseEv:
 3829|   102k|FLAG AffixMgr::get_keepcase() const {
 3830|   102k|  return keepcase;
 3831|   102k|}
_ZNK8AffixMgr14get_forceucaseEv:
 3833|  20.2k|FLAG AffixMgr::get_forceucase() const {
 3834|  20.2k|  return forceucase;
 3835|  20.2k|}
_ZNK8AffixMgr8get_warnEv:
 3837|  34.0k|FLAG AffixMgr::get_warn() const {
 3838|  34.0k|  return warn;
 3839|  34.0k|}
_ZNK8AffixMgr14get_forbidwarnEv:
 3841|      4|int AffixMgr::get_forbidwarn() const {
 3842|      4|  return forbidwarn;
 3843|      4|}
_ZNK8AffixMgr15get_checksharpsEv:
 3845|   655k|int AffixMgr::get_checksharps() const {
 3846|   655k|  return checksharps;
 3847|   655k|}
_ZNK8AffixMgr10get_ignoreEv:
 3854|  31.8M|const char* AffixMgr::get_ignore() const {
 3855|  31.8M|  if (ignorechars.empty())
  ------------------
  |  Branch (3855:7): [True: 28.7M, False: 3.12M]
  ------------------
 3856|  28.7M|    return nullptr;
 3857|  3.12M|  return ignorechars.c_str();
 3858|  31.8M|}
_ZNK8AffixMgr16get_ignore_utf16Ev:
 3861|   607k|const std::vector<w_char>& AffixMgr::get_ignore_utf16() const {
 3862|   607k|  return ignorechars_utf16;
 3863|   607k|}
_ZN8AffixMgr14get_key_stringEv:
 3866|     38|const std::string& AffixMgr::get_key_string() {
 3867|     38|  if (keystring.empty())
  ------------------
  |  Branch (3867:7): [True: 38, False: 0]
  ------------------
 3868|     38|    keystring = SPELL_KEYSTRING;
  ------------------
  |  |  100|     38|#define SPELL_KEYSTRING "qwertyuiop|asdfghjkl|zxcvbnm"
  ------------------
 3869|     38|  return keystring;
 3870|     38|}
_ZNK8AffixMgr14get_try_stringEv:
 3873|     38|const std::string& AffixMgr::get_try_string() const {
 3874|     38|  return trystring;
 3875|     38|}
_ZNK8AffixMgr12get_compoundEv:
 3887|  76.1M|int AffixMgr::get_compound() const {
 3888|  76.1M|  return compoundflag || compoundbegin || !defcpdtable.empty();
  ------------------
  |  Branch (3888:10): [True: 18.8M, False: 57.2M]
  |  Branch (3888:26): [True: 0, False: 57.2M]
  |  Branch (3888:43): [True: 0, False: 57.2M]
  ------------------
 3889|  76.1M|}
_ZNK8AffixMgr16get_compoundflagEv:
 3892|  56.0k|FLAG AffixMgr::get_compoundflag() const {
 3893|  56.0k|  return compoundflag;
 3894|  56.0k|}
_ZNK8AffixMgr17get_forbiddenwordEv:
 3897|   165k|FLAG AffixMgr::get_forbiddenword() const {
 3898|   165k|  return forbiddenword;
 3899|   165k|}
_ZNK8AffixMgr13get_nosuggestEv:
 3902|  61.5k|FLAG AffixMgr::get_nosuggest() const {
 3903|  61.5k|  return nosuggest;
 3904|  61.5k|}
_ZNK8AffixMgr18get_nongramsuggestEv:
 3907|  61.4k|FLAG AffixMgr::get_nongramsuggest() const {
 3908|  61.4k|  return nongramsuggest;
 3909|  61.4k|}
_ZNK8AffixMgr15get_substandardEv:
 3912|    143|FLAG AffixMgr::get_substandard() const {
 3913|    143|  return substandard;
 3914|    143|}
_ZNK8AffixMgr13get_needaffixEv:
 3917|  5.96k|FLAG AffixMgr::get_needaffix() const {
 3918|  5.96k|  return needaffix;
 3919|  5.96k|}
_ZNK8AffixMgr18get_onlyincompoundEv:
 3927|  66.8k|FLAG AffixMgr::get_onlyincompound() const {
 3928|  66.8k|  return onlyincompound;
 3929|  66.8k|}
_ZN8AffixMgr6lookupEPKcm:
 3937|   522M|struct hentry* AffixMgr::lookup(const char* word, size_t len) {
 3938|   522M|  struct hentry* he = nullptr;
 3939|  1.04G|  for (size_t i = 0; i < alldic.size() && !he; ++i) {
  ------------------
  |  Branch (3939:22): [True: 522M, False: 522M]
  |  Branch (3939:43): [True: 522M, False: 0]
  ------------------
 3940|   522M|    he = alldic[i]->lookup(word, len);
 3941|   522M|  }
 3942|   522M|  return he;
 3943|   522M|}
_ZNK8AffixMgr14have_contclassEv:
 3946|  31.1M|int AffixMgr::have_contclass() const {
 3947|  31.1M|  return havecontclass;
 3948|  31.1M|}
_ZNK8AffixMgr8get_utf8Ev:
 3951|     76|int AffixMgr::get_utf8() const {
 3952|     76|  return utf8;
 3953|     76|}
_ZNK8AffixMgr16get_maxngramsugsEv:
 3955|  69.0k|int AffixMgr::get_maxngramsugs() const {
 3956|  69.0k|  return maxngramsugs;
 3957|  69.0k|}
_ZNK8AffixMgr14get_maxcpdsugsEv:
 3959|     38|int AffixMgr::get_maxcpdsugs() const {
 3960|     38|  return maxcpdsugs;
 3961|     38|}
_ZNK8AffixMgr11get_maxdiffEv:
 3963|  47.0k|int AffixMgr::get_maxdiff() const {
 3964|  47.0k|  return maxdiff;
 3965|  47.0k|}
_ZNK8AffixMgr15get_onlymaxdiffEv:
 3967|  7.44k|int AffixMgr::get_onlymaxdiff() const {
 3968|  7.44k|  return onlymaxdiff;
 3969|  7.44k|}
_ZNK8AffixMgr15get_nosplitsugsEv:
 3972|     38|int AffixMgr::get_nosplitsugs() const {
 3973|     38|  return nosplitsugs;
 3974|     38|}
_ZNK8AffixMgr16get_sugswithdotsEv:
 3977|  3.51k|int AffixMgr::get_sugswithdots() const {
 3978|  3.51k|  return sugswithdots;
 3979|  3.51k|}
_ZN8AffixMgr10parse_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPtP7FileMgr:
 3982|     22|bool AffixMgr::parse_flag(const std::string& line, unsigned short* out, FileMgr* af) {
 3983|     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 (3983:7): [True: 2, False: 20]
  |  Branch (3983:28): [True: 0, False: 2]
  ------------------
 3984|      0|    HUNSPELL_WARNING(
 3985|      0|        stderr,
 3986|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 3987|      0|        af->getlinenum());
 3988|      0|    return false;
 3989|      0|  }
 3990|     22|  std::string s;
 3991|     22|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (3991:7): [True: 0, False: 22]
  ------------------
 3992|      0|    return false;
 3993|     22|  *out = pHMgr->decode_flag(s);
 3994|     22|  return true;
 3995|     22|}
_ZN8AffixMgr9parse_numERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiP7FileMgr:
 3998|     10|bool AffixMgr::parse_num(const std::string& line, int* out, FileMgr* af) {
 3999|     10|  if (*out != -1) {
  ------------------
  |  Branch (3999:7): [True: 0, False: 10]
  ------------------
 4000|      0|    HUNSPELL_WARNING(
 4001|      0|        stderr,
 4002|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 4003|      0|        af->getlinenum());
 4004|      0|    return false;
 4005|      0|  }
 4006|     10|  std::string s;
 4007|     10|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (4007:7): [True: 0, False: 10]
  ------------------
 4008|      0|    return false;
 4009|     10|  *out = atoi(s.c_str());
 4010|     10|  return true;
 4011|     10|}
_ZN8AffixMgr17parse_cpdsyllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4014|      2|bool AffixMgr::parse_cpdsyllable(const std::string& line, FileMgr* af) {
 4015|      2|  int i = 0;
 4016|      2|  int np = 0;
 4017|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4018|      8|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4018:10): [True: 6, False: 2]
  ------------------
 4019|      6|    switch (i) {
 4020|      2|      case 0: {
  ------------------
  |  Branch (4020:7): [True: 2, False: 4]
  ------------------
 4021|      2|        np++;
 4022|      2|        break;
 4023|      0|      }
 4024|      2|      case 1: {
  ------------------
  |  Branch (4024:7): [True: 2, False: 4]
  ------------------
 4025|      2|        cpdmaxsyllable = atoi(std::string(start_piece, iter).c_str());
 4026|      2|        np++;
 4027|      2|        break;
 4028|      0|      }
 4029|      2|      case 2: {
  ------------------
  |  Branch (4029:7): [True: 2, False: 4]
  ------------------
 4030|      2|        if (!utf8) {
  ------------------
  |  Branch (4030:13): [True: 0, False: 2]
  ------------------
 4031|      0|          cpdvowels.assign(start_piece, iter);
 4032|      0|          std::sort(cpdvowels.begin(), cpdvowels.end());
 4033|      2|        } else {
 4034|      2|          std::string piece(start_piece, iter);
 4035|      2|          u8_u16(cpdvowels_utf16, piece);
 4036|      2|          std::sort(cpdvowels_utf16.begin(), cpdvowels_utf16.end());
 4037|      2|        }
 4038|      2|        np++;
 4039|      2|        break;
 4040|      0|      }
 4041|      0|      default:
  ------------------
  |  Branch (4041:7): [True: 0, False: 6]
  ------------------
 4042|      0|        break;
 4043|      6|    }
 4044|      6|    ++i;
 4045|      6|    start_piece = mystrsep(line, iter);
 4046|      6|  }
 4047|      2|  if (np < 2) {
  ------------------
  |  Branch (4047:7): [True: 0, False: 2]
  ------------------
 4048|      0|    HUNSPELL_WARNING(stderr,
 4049|      0|                     "error: line %d: missing compoundsyllable information\n",
 4050|      0|                     af->getlinenum());
 4051|      0|    return false;
 4052|      0|  }
 4053|      2|  if (np == 2)
  ------------------
  |  Branch (4053:7): [True: 0, False: 2]
  ------------------
 4054|      0|    cpdvowels = "AEIOUaeiou";
 4055|      2|  return true;
 4056|      2|}
_ZN8AffixMgr15parse_convtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgrPP7RepListS8_:
 4061|      4|                              const std::string& keyword) {
 4062|      4|  if (*rl) {
  ------------------
  |  Branch (4062:7): [True: 0, False: 4]
  ------------------
 4063|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4064|      0|                     af->getlinenum());
 4065|      0|    return false;
 4066|      0|  }
 4067|      4|  int i = 0;
 4068|      4|  int np = 0;
 4069|      4|  int numrl = 0;
 4070|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4071|     18|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4071:10): [True: 14, False: 4]
  ------------------
 4072|     14|    switch (i) {
 4073|      4|      case 0: {
  ------------------
  |  Branch (4073:7): [True: 4, False: 10]
  ------------------
 4074|      4|        np++;
 4075|      4|        break;
 4076|      0|      }
 4077|      4|      case 1: {
  ------------------
  |  Branch (4077:7): [True: 4, False: 10]
  ------------------
 4078|      4|        numrl = atoi(std::string(start_piece, iter).c_str());
 4079|      4|        if (numrl < 1) {
  ------------------
  |  Branch (4079:13): [True: 0, False: 4]
  ------------------
 4080|      0|          HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n",
 4081|      0|                           af->getlinenum());
 4082|      0|          return false;
 4083|      0|        }
 4084|      4|        *rl = new RepList(numrl);
 4085|      4|        if (!*rl)
  ------------------
  |  Branch (4085:13): [True: 0, False: 4]
  ------------------
 4086|      0|          return false;
 4087|      4|        np++;
 4088|      4|        break;
 4089|      4|      }
 4090|      6|      default:
  ------------------
  |  Branch (4090:7): [True: 6, False: 8]
  ------------------
 4091|      6|        break;
 4092|     14|    }
 4093|     14|    ++i;
 4094|     14|    start_piece = mystrsep(line, iter);
 4095|     14|  }
 4096|      4|  if (np != 2) {
  ------------------
  |  Branch (4096:7): [True: 0, False: 4]
  ------------------
 4097|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4098|      0|                     af->getlinenum());
 4099|      0|    return false;
 4100|      0|  }
 4101|       |
 4102|       |  /* now parse the num lines to read in the remainder of the table */
 4103|     26|  for (int j = 0; j < numrl; j++) {
  ------------------
  |  Branch (4103:19): [True: 22, False: 4]
  ------------------
 4104|     22|    std::string nl;
 4105|     22|    if (!af->getline(nl))
  ------------------
  |  Branch (4105:9): [True: 0, False: 22]
  ------------------
 4106|      0|      return false;
 4107|     22|    mychomp(nl);
 4108|     22|    i = 0;
 4109|     22|    std::string pattern;
 4110|     22|    std::string pattern2;
 4111|     22|    iter = nl.begin();
 4112|     22|    start_piece = mystrsep(nl, iter);
 4113|    130|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4113:12): [True: 108, False: 22]
  ------------------
 4114|    108|      {
 4115|    108|        switch (i) {
 4116|     22|          case 0: {
  ------------------
  |  Branch (4116:11): [True: 22, False: 86]
  ------------------
 4117|     22|            if (nl.compare(start_piece - nl.begin(), keyword.size(), keyword, 0, keyword.size()) != 0) {
  ------------------
  |  Branch (4117:17): [True: 0, False: 22]
  ------------------
 4118|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4119|      0|                               af->getlinenum());
 4120|      0|              delete *rl;
 4121|      0|              *rl = nullptr;
 4122|      0|              return false;
 4123|      0|            }
 4124|     22|            break;
 4125|     22|          }
 4126|     22|          case 1: {
  ------------------
  |  Branch (4126:11): [True: 22, False: 86]
  ------------------
 4127|     22|            pattern.assign(start_piece, iter);
 4128|     22|            break;
 4129|     22|          }
 4130|     22|          case 2: {
  ------------------
  |  Branch (4130:11): [True: 22, False: 86]
  ------------------
 4131|     22|            pattern2.assign(start_piece, iter);
 4132|     22|            break;
 4133|     22|          }
 4134|     42|          default:
  ------------------
  |  Branch (4134:11): [True: 42, False: 66]
  ------------------
 4135|     42|            break;
 4136|    108|        }
 4137|    108|        ++i;
 4138|    108|      }
 4139|      0|      start_piece = mystrsep(nl, iter);
 4140|    108|    }
 4141|     22|    if (pattern.empty() || pattern2.empty()) {
  ------------------
  |  Branch (4141:9): [True: 0, False: 22]
  |  Branch (4141:28): [True: 0, False: 22]
  ------------------
 4142|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4143|      0|                       af->getlinenum());
 4144|      0|      return false;
 4145|      0|    }
 4146|       |
 4147|     22|    (*rl)->add(pattern, pattern2);
 4148|     22|  }
 4149|      4|  return true;
 4150|      4|}
_ZN8AffixMgr16parse_phonetableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4153|      2|bool AffixMgr::parse_phonetable(const std::string& line, FileMgr* af) {
 4154|      2|  if (phone) {
  ------------------
  |  Branch (4154:7): [True: 0, False: 2]
  ------------------
 4155|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4156|      0|                     af->getlinenum());
 4157|      0|    return false;
 4158|      0|  }
 4159|      2|  std::unique_ptr<phonetable> new_phone;
 4160|      2|  int num = -1;
 4161|      2|  int i = 0;
 4162|      2|  int np = 0;
 4163|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4164|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4164:10): [True: 4, False: 2]
  ------------------
 4165|      4|    switch (i) {
 4166|      2|      case 0: {
  ------------------
  |  Branch (4166:7): [True: 2, False: 2]
  ------------------
 4167|      2|        np++;
 4168|      2|        break;
 4169|      0|      }
 4170|      2|      case 1: {
  ------------------
  |  Branch (4170:7): [True: 2, False: 2]
  ------------------
 4171|      2|        num = atoi(std::string(start_piece, iter).c_str());
 4172|      2|        if (num < 1) {
  ------------------
  |  Branch (4172:13): [True: 0, False: 2]
  ------------------
 4173|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4174|      0|                           af->getlinenum());
 4175|      0|          return false;
 4176|      0|        }
 4177|      2|        new_phone = std::make_unique<phonetable>();
 4178|      2|        new_phone->utf8 = (char)utf8;
 4179|      2|        np++;
 4180|      2|        break;
 4181|      2|      }
 4182|      0|      default:
  ------------------
  |  Branch (4182:7): [True: 0, False: 4]
  ------------------
 4183|      0|        break;
 4184|      4|    }
 4185|      4|    ++i;
 4186|      4|    start_piece = mystrsep(line, iter);
 4187|      4|  }
 4188|      2|  if (np != 2) {
  ------------------
  |  Branch (4188:7): [True: 0, False: 2]
  ------------------
 4189|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4190|      0|                     af->getlinenum());
 4191|      0|    return false;
 4192|      0|  }
 4193|       |
 4194|       |  /* now parse the phone->num lines to read in the remainder of the table */
 4195|    212|  for (int j = 0; j < num; ++j) {
  ------------------
  |  Branch (4195:19): [True: 210, False: 2]
  ------------------
 4196|    210|    std::string nl;
 4197|    210|    if (!af->getline(nl))
  ------------------
  |  Branch (4197:9): [True: 0, False: 210]
  ------------------
 4198|      0|      return false;
 4199|    210|    mychomp(nl);
 4200|    210|    i = 0;
 4201|    210|    const size_t old_size = new_phone->rules.size();
 4202|    210|    iter = nl.begin();
 4203|    210|    start_piece = mystrsep(nl, iter);
 4204|    840|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4204:12): [True: 630, False: 210]
  ------------------
 4205|    630|      {
 4206|    630|        switch (i) {
 4207|    210|          case 0: {
  ------------------
  |  Branch (4207:11): [True: 210, False: 420]
  ------------------
 4208|    210|            if (nl.compare(start_piece - nl.begin(), 5, "PHONE", 5) != 0) {
  ------------------
  |  Branch (4208:17): [True: 0, False: 210]
  ------------------
 4209|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4210|      0|                               af->getlinenum());
 4211|      0|              return false;
 4212|      0|            }
 4213|    210|            break;
 4214|    210|          }
 4215|    210|          case 1: {
  ------------------
  |  Branch (4215:11): [True: 210, False: 420]
  ------------------
 4216|    210|            new_phone->rules.emplace_back(start_piece, iter);
 4217|    210|            break;
 4218|    210|          }
 4219|    210|          case 2: {
  ------------------
  |  Branch (4219:11): [True: 210, False: 420]
  ------------------
 4220|    210|            new_phone->rules.emplace_back(start_piece, iter);
 4221|    210|            mystrrep(new_phone->rules.back(), "_", "");
 4222|    210|            break;
 4223|    210|          }
 4224|      0|          default:
  ------------------
  |  Branch (4224:11): [True: 0, False: 630]
  ------------------
 4225|      0|            break;
 4226|    630|        }
 4227|    630|        ++i;
 4228|    630|      }
 4229|      0|      start_piece = mystrsep(nl, iter);
 4230|    630|    }
 4231|    210|    if (new_phone->rules.size() != old_size + 2) {
  ------------------
  |  Branch (4231:9): [True: 0, False: 210]
  ------------------
 4232|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4233|      0|                       af->getlinenum());
 4234|      0|      return false;
 4235|      0|    }
 4236|    210|  }
 4237|      2|  new_phone->rules.emplace_back("");
 4238|      2|  new_phone->rules.emplace_back("");
 4239|      2|  init_phonet_hash(*new_phone);
 4240|      2|  phone = new_phone.release();
 4241|      2|  return true;
 4242|      2|}
_ZN8AffixMgr19parse_checkcpdtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4245|      2|bool AffixMgr::parse_checkcpdtable(const std::string& line, FileMgr* af) {
 4246|      2|  if (parsedcheckcpd) {
  ------------------
  |  Branch (4246:7): [True: 0, False: 2]
  ------------------
 4247|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4248|      0|                     af->getlinenum());
 4249|      0|    return false;
 4250|      0|  }
 4251|      2|  parsedcheckcpd = true;
 4252|      2|  int numcheckcpd = -1;
 4253|      2|  int i = 0;
 4254|      2|  int np = 0;
 4255|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4256|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4256:10): [True: 4, False: 2]
  ------------------
 4257|      4|    switch (i) {
 4258|      2|      case 0: {
  ------------------
  |  Branch (4258:7): [True: 2, False: 2]
  ------------------
 4259|      2|        np++;
 4260|      2|        break;
 4261|      0|      }
 4262|      2|      case 1: {
  ------------------
  |  Branch (4262:7): [True: 2, False: 2]
  ------------------
 4263|      2|        numcheckcpd = atoi(std::string(start_piece, iter).c_str());
 4264|      2|        if (numcheckcpd < 1) {
  ------------------
  |  Branch (4264:13): [True: 0, False: 2]
  ------------------
 4265|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4266|      0|                           af->getlinenum());
 4267|      0|          return false;
 4268|      0|        }
 4269|      2|        checkcpdtable.reserve(std::min(numcheckcpd, 16384));
 4270|      2|        np++;
 4271|      2|        break;
 4272|      2|      }
 4273|      0|      default:
  ------------------
  |  Branch (4273:7): [True: 0, False: 4]
  ------------------
 4274|      0|        break;
 4275|      4|    }
 4276|      4|    ++i;
 4277|      4|    start_piece = mystrsep(line, iter);
 4278|      4|  }
 4279|      2|  if (np != 2) {
  ------------------
  |  Branch (4279:7): [True: 0, False: 2]
  ------------------
 4280|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4281|      0|                     af->getlinenum());
 4282|      0|    return false;
 4283|      0|  }
 4284|       |
 4285|       |  /* now parse the numcheckcpd lines to read in the remainder of the table */
 4286|      6|  for (int j = 0; j < numcheckcpd; ++j) {
  ------------------
  |  Branch (4286:19): [True: 4, False: 2]
  ------------------
 4287|      4|    std::string nl;
 4288|      4|    if (!af->getline(nl))
  ------------------
  |  Branch (4288:9): [True: 0, False: 4]
  ------------------
 4289|      0|      return false;
 4290|      4|    mychomp(nl);
 4291|      4|    i = 0;
 4292|      4|    checkcpdtable.emplace_back();
 4293|      4|    iter = nl.begin();
 4294|      4|    start_piece = mystrsep(nl, iter);
 4295|     16|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4295:12): [True: 12, False: 4]
  ------------------
 4296|     12|      switch (i) {
 4297|      4|        case 0: {
  ------------------
  |  Branch (4297:9): [True: 4, False: 8]
  ------------------
 4298|      4|          if (nl.compare(start_piece - nl.begin(), 20, "CHECKCOMPOUNDPATTERN", 20) != 0) {
  ------------------
  |  Branch (4298:15): [True: 0, False: 4]
  ------------------
 4299|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4300|      0|                             af->getlinenum());
 4301|      0|            checkcpdtable.clear();
 4302|      0|            return false;
 4303|      0|          }
 4304|      4|          break;
 4305|      4|        }
 4306|      4|        case 1: {
  ------------------
  |  Branch (4306:9): [True: 4, False: 8]
  ------------------
 4307|      4|          checkcpdtable.back().pattern.assign(start_piece, iter);
 4308|      4|          size_t slash_pos = checkcpdtable.back().pattern.find('/');
 4309|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4309:15): [True: 0, False: 4]
  ------------------
 4310|      0|            std::string chunk(checkcpdtable.back().pattern, slash_pos + 1);
 4311|      0|            checkcpdtable.back().pattern.resize(slash_pos);
 4312|      0|            checkcpdtable.back().cond = pHMgr->decode_flag(chunk);
 4313|      0|          }
 4314|      4|          break;
 4315|      4|        }
 4316|      4|        case 2: {
  ------------------
  |  Branch (4316:9): [True: 4, False: 8]
  ------------------
 4317|      4|          checkcpdtable.back().pattern2.assign(start_piece, iter);
 4318|      4|          size_t slash_pos = checkcpdtable.back().pattern2.find('/');
 4319|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4319:15): [True: 0, False: 4]
  ------------------
 4320|      0|            std::string chunk(checkcpdtable.back().pattern2, slash_pos + 1);
 4321|      0|            checkcpdtable.back().pattern2.resize(slash_pos);
 4322|      0|            checkcpdtable.back().cond2 = pHMgr->decode_flag(chunk);
 4323|      0|          }
 4324|      4|          break;
 4325|      4|        }
 4326|      0|        case 3: {
  ------------------
  |  Branch (4326:9): [True: 0, False: 12]
  ------------------
 4327|      0|          checkcpdtable.back().pattern3.assign(start_piece, iter);
 4328|      0|          simplifiedcpd = 1;
 4329|      0|          break;
 4330|      4|        }
 4331|      0|        default:
  ------------------
  |  Branch (4331:9): [True: 0, False: 12]
  ------------------
 4332|      0|          break;
 4333|     12|      }
 4334|     12|      i++;
 4335|     12|      start_piece = mystrsep(nl, iter);
 4336|     12|    }
 4337|      4|  }
 4338|      2|  return true;
 4339|      2|}
_ZN8AffixMgr14parse_maptableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4443|      2|bool AffixMgr::parse_maptable(const std::string& line, FileMgr* af) {
 4444|      2|  if (parsedmaptable) {
  ------------------
  |  Branch (4444:7): [True: 0, False: 2]
  ------------------
 4445|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4446|      0|                     af->getlinenum());
 4447|      0|    return false;
 4448|      0|  }
 4449|      2|  parsedmaptable = true;
 4450|      2|  int nummap = -1;
 4451|      2|  int i = 0;
 4452|      2|  int np = 0;
 4453|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4454|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4454:10): [True: 4, False: 2]
  ------------------
 4455|      4|    switch (i) {
 4456|      2|      case 0: {
  ------------------
  |  Branch (4456:7): [True: 2, False: 2]
  ------------------
 4457|      2|        np++;
 4458|      2|        break;
 4459|      0|      }
 4460|      2|      case 1: {
  ------------------
  |  Branch (4460:7): [True: 2, False: 2]
  ------------------
 4461|      2|        nummap = atoi(std::string(start_piece, iter).c_str());
 4462|      2|        if (nummap < 1) {
  ------------------
  |  Branch (4462:13): [True: 0, False: 2]
  ------------------
 4463|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4464|      0|                           af->getlinenum());
 4465|      0|          return false;
 4466|      0|        }
 4467|      2|        maptable.reserve(std::min(nummap, 16384));
 4468|      2|        np++;
 4469|      2|        break;
 4470|      2|      }
 4471|      0|      default:
  ------------------
  |  Branch (4471:7): [True: 0, False: 4]
  ------------------
 4472|      0|        break;
 4473|      4|    }
 4474|      4|    ++i;
 4475|      4|    start_piece = mystrsep(line, iter);
 4476|      4|  }
 4477|      2|  if (np != 2) {
  ------------------
  |  Branch (4477:7): [True: 0, False: 2]
  ------------------
 4478|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4479|      0|                     af->getlinenum());
 4480|      0|    return false;
 4481|      0|  }
 4482|       |
 4483|       |  /* now parse the nummap lines to read in the remainder of the table */
 4484|      8|  for (int j = 0; j < nummap; ++j) {
  ------------------
  |  Branch (4484:19): [True: 6, False: 2]
  ------------------
 4485|      6|    std::string nl;
 4486|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4486:9): [True: 0, False: 6]
  ------------------
 4487|      0|      return false;
 4488|      6|    mychomp(nl);
 4489|      6|    i = 0;
 4490|      6|    maptable.emplace_back();
 4491|      6|    iter = nl.begin();
 4492|      6|    start_piece = mystrsep(nl, iter);
 4493|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4493:12): [True: 12, False: 6]
  ------------------
 4494|     12|      switch (i) {
 4495|      6|        case 0: {
  ------------------
  |  Branch (4495:9): [True: 6, False: 6]
  ------------------
 4496|      6|          if (nl.compare(start_piece - nl.begin(), 3, "MAP", 3) != 0) {
  ------------------
  |  Branch (4496:15): [True: 0, False: 6]
  ------------------
 4497|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4498|      0|                             af->getlinenum());
 4499|      0|            nummap = 0;
 4500|      0|            return false;
 4501|      0|          }
 4502|      6|          break;
 4503|      6|        }
 4504|      6|        case 1: {
  ------------------
  |  Branch (4504:9): [True: 6, False: 6]
  ------------------
 4505|     22|          for (auto k = start_piece; k != iter; ++k) {
  ------------------
  |  Branch (4505:38): [True: 16, False: 6]
  ------------------
 4506|     16|            auto chb = k, che = k + 1;
 4507|     16|            if (*k == '(') {
  ------------------
  |  Branch (4507:17): [True: 2, False: 14]
  ------------------
 4508|      2|              auto parpos = std::find(k, iter, ')');
 4509|      2|              if (parpos != iter) {
  ------------------
  |  Branch (4509:19): [True: 2, False: 0]
  ------------------
 4510|      2|                chb = k + 1;
 4511|      2|                che = parpos;
 4512|      2|                k = parpos;
 4513|      2|              }
 4514|     14|            } else {
 4515|     14|              if (utf8 && (*k & 0xc0) == 0xc0) {
  ------------------
  |  Branch (4515:19): [True: 14, False: 0]
  |  Branch (4515:27): [True: 10, False: 4]
  ------------------
 4516|     10|                ++k;
 4517|     20|                while (k != iter && is_utf8_cont(*k))
  ------------------
  |  Branch (4517:24): [True: 18, False: 2]
  |  Branch (4517:37): [True: 10, False: 8]
  ------------------
 4518|     10|                    ++k;
 4519|     10|                che = k;
 4520|     10|                --k;
 4521|     10|              }
 4522|     14|            }
 4523|     16|            if (chb == che) {
  ------------------
  |  Branch (4523:17): [True: 0, False: 16]
  ------------------
 4524|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4525|      0|                              af->getlinenum());
 4526|      0|            }
 4527|       |
 4528|     16|            maptable.back().emplace_back(chb, che);
 4529|     16|          }
 4530|      6|          break;
 4531|      6|        }
 4532|      0|        default:
  ------------------
  |  Branch (4532:9): [True: 0, False: 12]
  ------------------
 4533|      0|          break;
 4534|     12|      }
 4535|     12|      ++i;
 4536|     12|      start_piece = mystrsep(nl, iter);
 4537|     12|    }
 4538|      6|    if (maptable.back().empty()) {
  ------------------
  |  Branch (4538:9): [True: 0, False: 6]
  ------------------
 4539|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4540|      0|                       af->getlinenum());
 4541|      0|      return false;
 4542|      0|    }
 4543|      6|  }
 4544|      2|  return true;
 4545|      2|}
_ZN8AffixMgr16parse_breaktableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4548|      4|bool AffixMgr::parse_breaktable(const std::string& line, FileMgr* af) {
 4549|      4|  if (parsedbreaktable) {
  ------------------
  |  Branch (4549:7): [True: 0, False: 4]
  ------------------
 4550|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4551|      0|                     af->getlinenum());
 4552|      0|    return false;
 4553|      0|  }
 4554|      4|  parsedbreaktable = true;
 4555|      4|  int numbreak = -1;
 4556|      4|  int i = 0;
 4557|      4|  int np = 0;
 4558|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4559|     12|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4559:10): [True: 8, False: 4]
  ------------------
 4560|      8|    switch (i) {
 4561|      4|      case 0: {
  ------------------
  |  Branch (4561:7): [True: 4, False: 4]
  ------------------
 4562|      4|        np++;
 4563|      4|        break;
 4564|      0|      }
 4565|      4|      case 1: {
  ------------------
  |  Branch (4565:7): [True: 4, False: 4]
  ------------------
 4566|      4|        numbreak = atoi(std::string(start_piece, iter).c_str());
 4567|      4|        if (numbreak < 0) {
  ------------------
  |  Branch (4567:13): [True: 0, False: 4]
  ------------------
 4568|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4569|      0|                           af->getlinenum());
 4570|      0|          return false;
 4571|      0|        }
 4572|      4|        if (numbreak == 0)
  ------------------
  |  Branch (4572:13): [True: 0, False: 4]
  ------------------
 4573|      0|          return true;
 4574|      4|        breaktable.reserve(std::min(numbreak, 16384));
 4575|      4|        np++;
 4576|      4|        break;
 4577|      4|      }
 4578|      0|      default:
  ------------------
  |  Branch (4578:7): [True: 0, False: 8]
  ------------------
 4579|      0|        break;
 4580|      8|    }
 4581|      8|    ++i;
 4582|      8|    start_piece = mystrsep(line, iter);
 4583|      8|  }
 4584|      4|  if (np != 2) {
  ------------------
  |  Branch (4584:7): [True: 0, False: 4]
  ------------------
 4585|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4586|      0|                     af->getlinenum());
 4587|      0|    return false;
 4588|      0|  }
 4589|       |
 4590|       |  /* now parse the numbreak lines to read in the remainder of the table */
 4591|     10|  for (int j = 0; j < numbreak; ++j) {
  ------------------
  |  Branch (4591:19): [True: 6, False: 4]
  ------------------
 4592|      6|    std::string nl;
 4593|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4593:9): [True: 0, False: 6]
  ------------------
 4594|      0|      return false;
 4595|      6|    mychomp(nl);
 4596|      6|    i = 0;
 4597|      6|    iter = nl.begin();
 4598|      6|    start_piece = mystrsep(nl, iter);
 4599|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4599:12): [True: 12, False: 6]
  ------------------
 4600|     12|      switch (i) {
 4601|      6|        case 0: {
  ------------------
  |  Branch (4601:9): [True: 6, False: 6]
  ------------------
 4602|      6|          if (nl.compare(start_piece - nl.begin(), 5, "BREAK", 5) != 0) {
  ------------------
  |  Branch (4602:15): [True: 0, False: 6]
  ------------------
 4603|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4604|      0|                             af->getlinenum());
 4605|      0|            numbreak = 0;
 4606|      0|            return false;
 4607|      0|          }
 4608|      6|          break;
 4609|      6|        }
 4610|      6|        case 1: {
  ------------------
  |  Branch (4610:9): [True: 6, False: 6]
  ------------------
 4611|      6|          breaktable.emplace_back(start_piece, iter);
 4612|      6|          break;
 4613|      6|        }
 4614|      0|        default:
  ------------------
  |  Branch (4614:9): [True: 0, False: 12]
  ------------------
 4615|      0|          break;
 4616|     12|      }
 4617|     12|      ++i;
 4618|     12|      start_piece = mystrsep(nl, iter);
 4619|     12|    }
 4620|      6|  }
 4621|       |
 4622|      4|  if (breaktable.size() != static_cast<size_t>(numbreak)) {
  ------------------
  |  Branch (4622:7): [True: 0, False: 4]
  ------------------
 4623|      0|    HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4624|      0|                     af->getlinenum());
 4625|      0|    return false;
 4626|      0|  }
 4627|       |
 4628|      4|  return true;
 4629|      4|}
_ZN8AffixMgr17reverse_conditionERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 4631|     38|void AffixMgr::reverse_condition(std::string& piece) {
 4632|     38|  if (piece.empty())
  ------------------
  |  Branch (4632:7): [True: 0, False: 38]
  ------------------
 4633|      0|      return;
 4634|       |
 4635|     38|  int neg = 0;
 4636|       |  // iterate backwards; k wraps to npos (SIZE_MAX) when decremented past 0
 4637|     92|  for (size_t k = piece.size() - 1; k != std::string::npos; --k) {
  ------------------
  |  Branch (4637:37): [True: 54, False: 38]
  ------------------
 4638|     54|    switch (piece[k]) {
 4639|      2|      case '[': {
  ------------------
  |  Branch (4639:7): [True: 2, False: 52]
  ------------------
 4640|      2|        if (neg)
  ------------------
  |  Branch (4640:13): [True: 0, False: 2]
  ------------------
 4641|      0|          piece[k + 1] = '[';
 4642|      2|        else
 4643|      2|          piece[k] = ']';
 4644|      2|        break;
 4645|      0|      }
 4646|      2|      case ']': {
  ------------------
  |  Branch (4646:7): [True: 2, False: 52]
  ------------------
 4647|      2|        piece[k] = '[';
 4648|      2|        if (neg)
  ------------------
  |  Branch (4648:13): [True: 0, False: 2]
  ------------------
 4649|      0|          piece[k + 1] = '^';
 4650|      2|        neg = 0;
 4651|      2|        break;
 4652|      0|      }
 4653|      0|      case '^': {
  ------------------
  |  Branch (4653:7): [True: 0, False: 54]
  ------------------
 4654|      0|        if (piece[k + 1] == ']')
  ------------------
  |  Branch (4654:13): [True: 0, False: 0]
  ------------------
 4655|      0|          neg = 1;
 4656|      0|        else if (neg)
  ------------------
  |  Branch (4656:18): [True: 0, False: 0]
  ------------------
 4657|      0|          piece[k + 1] = piece[k];
 4658|      0|        break;
 4659|      0|      }
 4660|     50|      default: {
  ------------------
  |  Branch (4660:7): [True: 50, False: 4]
  ------------------
 4661|     50|        if (neg)
  ------------------
  |  Branch (4661:13): [True: 0, False: 50]
  ------------------
 4662|      0|          piece[k + 1] = piece[k];
 4663|     50|      }
 4664|     54|    }
 4665|     54|  }
 4666|     38|}
_ZN8AffixMgr11parse_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEcP7FileMgrPc:
 4720|     26|                          char* dupflags) {
 4721|     26|  int numents = 0;  // number of AffEntry structures to parse
 4722|       |
 4723|     26|  unsigned short aflag = 0;  // affix char identifier
 4724|       |
 4725|     26|  char ff = 0;
 4726|     26|  char xprod = 0;
 4727|     26|  int headerline = af->getlinenum();
 4728|     26|  entries_container affentries(at, this);
 4729|       |
 4730|     26|  int i = 0;
 4731|       |
 4732|       |// checking lines with bad syntax
 4733|       |#ifdef DEBUG
 4734|       |  int basefieldnum = 0;
 4735|       |#endif
 4736|       |
 4737|       |  // split affix header line into pieces
 4738|       |
 4739|     26|  int np = 0;
 4740|     26|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4741|    130|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4741:10): [True: 104, False: 26]
  ------------------
 4742|    104|    switch (i) {
 4743|       |      // piece 1 - is type of affix
 4744|     26|      case 0: {
  ------------------
  |  Branch (4744:7): [True: 26, False: 78]
  ------------------
 4745|     26|        np++;
 4746|     26|        break;
 4747|      0|      }
 4748|       |
 4749|       |      // piece 2 - is affix char
 4750|     26|      case 1: {
  ------------------
  |  Branch (4750:7): [True: 26, False: 78]
  ------------------
 4751|     26|        np++;
 4752|     26|        aflag = pHMgr->decode_flag(std::string(start_piece, iter));
 4753|     26|        if (((at == 'S') && (dupflags[aflag] & dupSFX)) ||
  ------------------
  |  |   89|     18|#define dupSFX (1 << 0)
  ------------------
  |  Branch (4753:14): [True: 18, False: 8]
  |  Branch (4753:29): [True: 0, False: 18]
  ------------------
 4754|     26|            ((at == 'P') && (dupflags[aflag] & dupPFX))) {
  ------------------
  |  |   90|      8|#define dupPFX (1 << 1)
  ------------------
  |  Branch (4754:14): [True: 8, False: 18]
  |  Branch (4754:29): [True: 0, False: 8]
  ------------------
 4755|      0|          HUNSPELL_WARNING(
 4756|      0|              stderr,
 4757|      0|              "error: line %d: multiple definitions of an affix flag\n",
 4758|      0|              af->getlinenum());
 4759|      0|        }
 4760|     26|        dupflags[aflag] += (char)((at == 'S') ? dupSFX : dupPFX);
  ------------------
  |  |   89|     18|#define dupSFX (1 << 0)
  ------------------
                      dupflags[aflag] += (char)((at == 'S') ? dupSFX : dupPFX);
  ------------------
  |  |   90|      8|#define dupPFX (1 << 1)
  ------------------
  |  Branch (4760:35): [True: 18, False: 8]
  ------------------
 4761|     26|        break;
 4762|      0|      }
 4763|       |      // piece 3 - is cross product indicator
 4764|     26|      case 2: {
  ------------------
  |  Branch (4764:7): [True: 26, False: 78]
  ------------------
 4765|     26|        np++;
 4766|     26|        xprod = *start_piece;
 4767|     26|        if (xprod == 'Y')
  ------------------
  |  Branch (4767:13): [True: 26, False: 0]
  ------------------
 4768|     26|          ff = aeXPRODUCT;
  ------------------
  |  |   65|     26|#define aeXPRODUCT (1 << 0)
  ------------------
 4769|     26|        break;
 4770|      0|      }
 4771|       |
 4772|       |      // piece 4 - is number of affentries
 4773|     26|      case 3: {
  ------------------
  |  Branch (4773:7): [True: 26, False: 78]
  ------------------
 4774|     26|        np++;
 4775|     26|        numents = atoi(std::string(start_piece, iter).c_str());
 4776|     26|        if ((numents <= 0) || ((std::numeric_limits<size_t>::max() /
  ------------------
  |  Branch (4776:13): [True: 0, False: 26]
  |  Branch (4776:31): [True: 0, False: 26]
  ------------------
 4777|     26|                                sizeof(AffEntry)) < static_cast<size_t>(numents))) {
 4778|      0|          std::string err = pHMgr->encode_flag(aflag);
 4779|      0|          HUNSPELL_WARNING(stderr, "error: line %d: affix %s: bad entry number\n",
 4780|      0|                           af->getlinenum(), err.c_str());
 4781|      0|          return false;
 4782|      0|        }
 4783|       |
 4784|     26|        char opts = ff;
 4785|     26|        if (utf8)
  ------------------
  |  Branch (4785:13): [True: 6, False: 20]
  ------------------
 4786|      6|          opts |= aeUTF8;
  ------------------
  |  |   66|      6|#define aeUTF8 (1 << 1)
  ------------------
 4787|     26|        if (pHMgr->is_aliasf())
  ------------------
  |  Branch (4787:13): [True: 4, False: 22]
  ------------------
 4788|      4|          opts |= aeALIASF;
  ------------------
  |  |   67|      4|#define aeALIASF (1 << 2)
  ------------------
 4789|     26|        if (pHMgr->is_aliasm())
  ------------------
  |  Branch (4789:13): [True: 0, False: 26]
  ------------------
 4790|      0|          opts |= aeALIASM;
  ------------------
  |  |   68|      0|#define aeALIASM (1 << 3)
  ------------------
 4791|     26|        affentries.initialize(numents, opts, aflag);
 4792|     26|      }
 4793|       |
 4794|     26|      default:
  ------------------
  |  Branch (4794:7): [True: 0, False: 104]
  ------------------
 4795|     26|        break;
 4796|    104|    }
 4797|    104|    ++i;
 4798|    104|    start_piece = mystrsep(line, iter);
 4799|    104|  }
 4800|       |  // check to make sure we parsed enough pieces
 4801|     26|  if (np != 4) {
  ------------------
  |  Branch (4801:7): [True: 0, False: 26]
  ------------------
 4802|      0|    std::string err = pHMgr->encode_flag(aflag);
 4803|      0|    HUNSPELL_WARNING(stderr, "error: line %d: affix %s: missing data\n",
 4804|      0|                     af->getlinenum(), err.c_str());
 4805|      0|    return false;
 4806|      0|  }
 4807|       |
 4808|       |  // now parse numents affentries for this affix
 4809|     26|  AffEntry* entry = affentries.first_entry();
 4810|     68|  for (int ent = 0; ent < numents; ++ent) {
  ------------------
  |  Branch (4810:21): [True: 42, False: 26]
  ------------------
 4811|     42|    std::string nl;
 4812|     42|    if (!af->getline(nl))
  ------------------
  |  Branch (4812:9): [True: 0, False: 42]
  ------------------
 4813|      0|      return false;
 4814|     42|    mychomp(nl);
 4815|     42|    int ruleline = af->getlinenum();
 4816|       |
 4817|     42|    iter = nl.begin();
 4818|     42|    i = 0;
 4819|     42|    np = 0;
 4820|       |
 4821|       |    // split line into pieces
 4822|     42|    start_piece = mystrsep(nl, iter);
 4823|    258|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4823:12): [True: 216, False: 42]
  ------------------
 4824|    216|      switch (i) {
 4825|       |        // piece 1 - is type
 4826|     42|        case 0: {
  ------------------
  |  Branch (4826:9): [True: 42, False: 174]
  ------------------
 4827|     42|          np++;
 4828|     42|          if (ent != 0)
  ------------------
  |  Branch (4828:15): [True: 16, False: 26]
  ------------------
 4829|     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)
  ------------------
 4830|     42|          break;
 4831|      0|        }
 4832|       |
 4833|       |        // piece 2 - is affix char
 4834|     42|        case 1: {
  ------------------
  |  Branch (4834:9): [True: 42, False: 174]
  ------------------
 4835|     42|          np++;
 4836|     42|          std::string chunk(start_piece, iter);
 4837|     42|          if (pHMgr->decode_flag(chunk) != aflag) {
  ------------------
  |  Branch (4837:15): [True: 0, False: 42]
  ------------------
 4838|      0|            std::string err = pHMgr->encode_flag(aflag);
 4839|      0|            HUNSPELL_WARNING(stderr,
 4840|      0|                             "error: line %d: affix %s is corrupt\n",
 4841|      0|                             af->getlinenum(), err.c_str());
 4842|      0|            return false;
 4843|      0|          }
 4844|       |
 4845|     42|          if (ent != 0) {
  ------------------
  |  Branch (4845:15): [True: 16, False: 26]
  ------------------
 4846|     16|            AffEntry* start_entry = affentries.first_entry();
 4847|     16|            entry->aflag = start_entry->aflag;
 4848|     16|          }
 4849|     42|          break;
 4850|     42|        }
 4851|       |
 4852|       |        // piece 3 - is string to strip or 0 for null
 4853|     42|        case 2: {
  ------------------
  |  Branch (4853:9): [True: 42, False: 174]
  ------------------
 4854|     42|          np++;
 4855|     42|          entry->strip = std::string(start_piece, iter);
 4856|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4856:15): [True: 4, False: 38]
  ------------------
 4857|      4|            if (utf8)
  ------------------
  |  Branch (4857:17): [True: 0, False: 4]
  ------------------
 4858|      0|              reverseword_utf(entry->strip);
 4859|      4|            else
 4860|      4|              reverseword(entry->strip);
 4861|      4|          }
 4862|     42|          if (entry->strip.compare("0") == 0) {
  ------------------
  |  Branch (4862:15): [True: 36, False: 6]
  ------------------
 4863|     36|            entry->strip.clear();
 4864|     36|          }
 4865|     42|          break;
 4866|     42|        }
 4867|       |
 4868|       |        // piece 4 - is affix string or 0 for null
 4869|     42|        case 3: {
  ------------------
  |  Branch (4869:9): [True: 42, False: 174]
  ------------------
 4870|     42|          entry->morphcode = nullptr;
 4871|     42|          entry->contclass = nullptr;
 4872|     42|          entry->contclasslen = 0;
 4873|     42|          np++;
 4874|     42|          std::string::const_iterator dash = std::find(start_piece, iter, '/');
 4875|     42|          if (dash != iter) {
  ------------------
  |  Branch (4875:15): [True: 18, False: 24]
  ------------------
 4876|     18|            entry->appnd = std::string(start_piece, dash);
 4877|     18|            std::string dash_str(dash + 1, iter);
 4878|       |
 4879|     18|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4879:17): [True: 2, False: 16]
  |  Branch (4879:41): [True: 0, False: 2]
  ------------------
 4880|      0|              if (utf8) {
  ------------------
  |  Branch (4880:19): [True: 0, False: 0]
  ------------------
 4881|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4882|      0|              } else {
 4883|      0|                remove_ignored_chars(entry->appnd, ignorechars);
 4884|      0|              }
 4885|      0|            }
 4886|       |
 4887|     18|            if (complexprefixes) {
  ------------------
  |  Branch (4887:17): [True: 2, False: 16]
  ------------------
 4888|      2|              if (utf8)
  ------------------
  |  Branch (4888:19): [True: 0, False: 2]
  ------------------
 4889|      0|                reverseword_utf(entry->appnd);
 4890|      2|              else
 4891|      2|                reverseword(entry->appnd);
 4892|      2|            }
 4893|       |
 4894|     18|            if (pHMgr->is_aliasf()) {
  ------------------
  |  Branch (4894:17): [True: 2, False: 16]
  ------------------
 4895|      2|              int index = atoi(dash_str.c_str());
 4896|      2|              entry->contclasslen = (unsigned short)pHMgr->get_aliasf(
 4897|      2|                  index, &(entry->contclass), af);
 4898|      2|              if (!entry->contclasslen)
  ------------------
  |  Branch (4898:19): [True: 0, False: 2]
  ------------------
 4899|      0|                HUNSPELL_WARNING(stderr,
 4900|      0|                                 "error: bad affix flag alias: \"%s\"\n",
 4901|      0|                                 dash_str.c_str());
 4902|     16|            } else {
 4903|     16|              entry->contclasslen = (unsigned short)pHMgr->decode_flags(
 4904|     16|                  &(entry->contclass), dash_str, af);
 4905|     16|              std::sort(entry->contclass, entry->contclass + entry->contclasslen);
 4906|     16|            }
 4907|       |
 4908|     18|            havecontclass = 1;
 4909|     44|            for (unsigned short _i = 0; _i < entry->contclasslen; _i++) {
  ------------------
  |  Branch (4909:41): [True: 26, False: 18]
  ------------------
 4910|     26|              contclasses[(entry->contclass)[_i]] = 1;
 4911|     26|            }
 4912|     24|          } else {
 4913|     24|            entry->appnd = std::string(start_piece, iter);
 4914|       |
 4915|     24|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4915:17): [True: 2, False: 22]
  |  Branch (4915:41): [True: 2, False: 0]
  ------------------
 4916|      2|              if (utf8) {
  ------------------
  |  Branch (4916:19): [True: 0, False: 2]
  ------------------
 4917|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4918|      2|              } else {
 4919|      2|                remove_ignored_chars(entry->appnd, ignorechars);
 4920|      2|              }
 4921|      2|            }
 4922|       |
 4923|     24|            if (complexprefixes) {
  ------------------
  |  Branch (4923:17): [True: 2, False: 22]
  ------------------
 4924|      2|              if (utf8)
  ------------------
  |  Branch (4924:19): [True: 0, False: 2]
  ------------------
 4925|      0|                reverseword_utf(entry->appnd);
 4926|      2|              else
 4927|      2|                reverseword(entry->appnd);
 4928|      2|            }
 4929|     24|          }
 4930|       |
 4931|     42|          if (entry->appnd.compare("0") == 0) {
  ------------------
  |  Branch (4931:15): [True: 2, False: 40]
  ------------------
 4932|      2|            entry->appnd.clear();
 4933|      2|          }
 4934|     42|          break;
 4935|     42|        }
 4936|       |
 4937|       |        // piece 5 - is the conditions descriptions
 4938|     42|        case 4: {
  ------------------
  |  Branch (4938:9): [True: 42, False: 174]
  ------------------
 4939|     42|          std::string chunk(start_piece, iter);
 4940|     42|          np++;
 4941|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4941:15): [True: 4, False: 38]
  ------------------
 4942|      4|            if (utf8)
  ------------------
  |  Branch (4942:17): [True: 0, False: 4]
  ------------------
 4943|      0|              reverseword_utf(chunk);
 4944|      4|            else
 4945|      4|              reverseword(chunk);
 4946|      4|            reverse_condition(chunk);
 4947|      4|          }
 4948|     42|          if (!entry->strip.empty() && chunk != "." &&
  ------------------
  |  Branch (4948:15): [True: 6, False: 36]
  |  Branch (4948:40): [True: 6, False: 0]
  ------------------
 4949|      6|              redundant_condition(at, entry->strip, chunk,
  ------------------
  |  Branch (4949:15): [True: 6, False: 0]
  ------------------
 4950|      6|                                  af->getlinenum())) {
 4951|      6|            chunk = ".";
 4952|      6|            entry->opts |= aeREDUNDANTCOND;
  ------------------
  |  |   72|      6|#define aeREDUNDANTCOND (1 << 5)
  ------------------
 4953|      6|          }
 4954|     42|          if (at == 'S') {
  ------------------
  |  Branch (4954:15): [True: 34, False: 8]
  ------------------
 4955|     34|            reverseword(chunk);
 4956|     34|            reverse_condition(chunk);
 4957|     34|          }
 4958|     42|          if (encodeit(*entry, chunk))
  ------------------
  |  Branch (4958:15): [True: 0, False: 42]
  ------------------
 4959|      0|            return false;
 4960|     42|          break;
 4961|     42|        }
 4962|       |
 4963|     42|        case 5: {
  ------------------
  |  Branch (4963:9): [True: 6, False: 210]
  ------------------
 4964|      6|          std::string chunk(start_piece, iter);
 4965|      6|          np++;
 4966|      6|          if (pHMgr->is_aliasm()) {
  ------------------
  |  Branch (4966:15): [True: 0, False: 6]
  ------------------
 4967|      0|            int index = atoi(chunk.c_str());
 4968|      0|            entry->morphcode = pHMgr->get_aliasm(index);
 4969|      6|          } else {
 4970|      6|            if (complexprefixes) {  // XXX - fix me for morph. gen.
  ------------------
  |  Branch (4970:17): [True: 0, False: 6]
  ------------------
 4971|      0|              if (utf8)
  ------------------
  |  Branch (4971:19): [True: 0, False: 0]
  ------------------
 4972|      0|                reverseword_utf(chunk);
 4973|      0|              else
 4974|      0|                reverseword(chunk);
 4975|      0|            }
 4976|       |            // add the remaining of the line
 4977|      6|            std::string::const_iterator end = nl.end();
 4978|      6|            if (iter != end) {
  ------------------
  |  Branch (4978:17): [True: 0, False: 6]
  ------------------
 4979|      0|              chunk.append(iter, end);
 4980|      0|            }
 4981|      6|            entry->morphcode = mystrdup(chunk.c_str());
 4982|      6|          }
 4983|      6|          break;
 4984|     42|        }
 4985|      0|        default:
  ------------------
  |  Branch (4985:9): [True: 0, False: 216]
  ------------------
 4986|      0|          break;
 4987|    216|      }
 4988|    216|      i++;
 4989|    216|      start_piece = mystrsep(nl, iter);
 4990|    216|    }
 4991|       |    // check to make sure we parsed enough pieces
 4992|     42|    if (np < 4) {
  ------------------
  |  Branch (4992:9): [True: 0, False: 42]
  ------------------
 4993|      0|      std::string err = pHMgr->encode_flag(aflag);
 4994|      0|      HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n",
 4995|      0|                       af->getlinenum(), err.c_str());
 4996|      0|      return false;
 4997|      0|    }
 4998|       |
 4999|     42|    entry->line = ruleline;
 5000|     42|    entry->headerline = headerline;
 5001|     42|    entry->xprod = xprod;
 5002|       |
 5003|       |#ifdef DEBUG
 5004|       |    // detect unnecessary fields, excepting comments
 5005|       |    if (basefieldnum) {
 5006|       |      int fieldnum =
 5007|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 5008|       |      if (fieldnum != basefieldnum)
 5009|       |        HUNSPELL_WARNING(stderr, "warning: line %d: bad field number\n",
 5010|       |                         af->getlinenum());
 5011|       |    } else {
 5012|       |      basefieldnum =
 5013|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 5014|       |    }
 5015|       |#endif
 5016|     42|  }
 5017|       |
 5018|       |  // now create SfxEntry or PfxEntry objects and use links to
 5019|       |  // build an ordered (sorted by affix string) list
 5020|     26|  auto start = affentries.begin(), end = affentries.end();
 5021|     68|  for (auto affentry = start; affentry != end; ++affentry) {
  ------------------
  |  Branch (5021:31): [True: 42, False: 26]
  ------------------
 5022|     42|    if (at == 'P') {
  ------------------
  |  Branch (5022:9): [True: 8, False: 34]
  ------------------
 5023|      8|      build_pfxtree(static_cast<PfxEntry*>(*affentry));
 5024|     34|    } else {
 5025|     34|      build_sfxtree(static_cast<SfxEntry*>(*affentry));
 5026|     34|    }
 5027|     42|  }
 5028|       |
 5029|       |  //contents belong to AffixMgr now
 5030|     26|  affentries.release();
 5031|       |
 5032|     26|  return true;
 5033|     26|}
_ZN8AffixMgr19redundant_conditionEcRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 5038|      6|                                  int linenum) {
 5039|      6|  int stripl = strip.size(), condl = cond.size(), i, j, neg, in;
 5040|      6|  if (ft == 'P') {  // prefix
  ------------------
  |  Branch (5040:7): [True: 0, False: 6]
  ------------------
 5041|      0|    if (strip.compare(0, condl, cond) == 0)
  ------------------
  |  Branch (5041:9): [True: 0, False: 0]
  ------------------
 5042|      0|      return 1;
 5043|      0|    if (utf8) {
  ------------------
  |  Branch (5043:9): [True: 0, False: 0]
  ------------------
 5044|      0|    } else {
 5045|      0|      for (i = 0, j = 0; (i < stripl) && (j < condl); i++, j++) {
  ------------------
  |  Branch (5045:26): [True: 0, False: 0]
  |  Branch (5045:42): [True: 0, False: 0]
  ------------------
 5046|      0|        if (cond[j] != '[') {
  ------------------
  |  Branch (5046:13): [True: 0, False: 0]
  ------------------
 5047|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (5047:15): [True: 0, False: 0]
  ------------------
 5048|      0|            HUNSPELL_WARNING(stderr,
 5049|      0|                             "warning: line %d: incompatible stripping "
 5050|      0|                             "characters and condition\n",
 5051|      0|                             linenum);
 5052|      0|            return 0;
 5053|      0|          }
 5054|      0|        } else {
 5055|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (5055:17): [True: 0, False: 0]
  ------------------
 5056|      0|          in = 0;
 5057|      0|          do {
 5058|      0|            j++;
 5059|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (5059:17): [True: 0, False: 0]
  ------------------
 5060|      0|              in = 1;
 5061|      0|          } while ((j < (condl - 1)) && (cond[j] != ']'));
  ------------------
  |  Branch (5061:20): [True: 0, False: 0]
  |  Branch (5061:41): [True: 0, False: 0]
  ------------------
 5062|      0|          if (j == (condl - 1) && (cond[j] != ']')) {
  ------------------
  |  Branch (5062:15): [True: 0, False: 0]
  |  Branch (5062:35): [True: 0, False: 0]
  ------------------
 5063|      0|            HUNSPELL_WARNING(stderr,
 5064|      0|                             "error: line %d: missing ] in condition:\n%s\n",
 5065|      0|                             linenum, cond.c_str());
 5066|      0|            return 0;
 5067|      0|          }
 5068|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (5068:16): [True: 0, False: 0]
  |  Branch (5068:24): [True: 0, False: 0]
  |  Branch (5068:33): [True: 0, False: 0]
  |  Branch (5068:40): [True: 0, False: 0]
  ------------------
 5069|      0|            HUNSPELL_WARNING(stderr,
 5070|      0|                             "warning: line %d: incompatible stripping "
 5071|      0|                             "characters and condition\n",
 5072|      0|                             linenum);
 5073|      0|            return 0;
 5074|      0|          }
 5075|      0|        }
 5076|      0|      }
 5077|      0|      if (j >= condl)
  ------------------
  |  Branch (5077:11): [True: 0, False: 0]
  ------------------
 5078|      0|        return 1;
 5079|      0|    }
 5080|      6|  } else {  // suffix
 5081|      6|    if ((stripl >= condl) && strip.compare(stripl - condl, std::string::npos, cond) == 0)
  ------------------
  |  Branch (5081:9): [True: 6, False: 0]
  |  Branch (5081:30): [True: 6, False: 0]
  ------------------
 5082|      6|      return 1;
 5083|      0|    if (utf8) {
  ------------------
  |  Branch (5083:9): [True: 0, False: 0]
  ------------------
 5084|      0|    } else {
 5085|      0|      for (i = stripl - 1, j = condl - 1; (i >= 0) && (j >= 0); i--, j--) {
  ------------------
  |  Branch (5085:43): [True: 0, False: 0]
  |  Branch (5085:55): [True: 0, False: 0]
  ------------------
 5086|      0|        if (cond[j] != ']') {
  ------------------
  |  Branch (5086:13): [True: 0, False: 0]
  ------------------
 5087|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (5087:15): [True: 0, False: 0]
  ------------------
 5088|      0|            HUNSPELL_WARNING(stderr,
 5089|      0|                             "warning: line %d: incompatible stripping "
 5090|      0|                             "characters and condition\n",
 5091|      0|                             linenum);
 5092|      0|            return 0;
 5093|      0|          }
 5094|      0|        } else if (j > 0) {
  ------------------
  |  Branch (5094:20): [True: 0, False: 0]
  ------------------
 5095|      0|          in = 0;
 5096|      0|          do {
 5097|      0|            j--;
 5098|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (5098:17): [True: 0, False: 0]
  ------------------
 5099|      0|              in = 1;
 5100|      0|          } while ((j > 0) && (cond[j] != '['));
  ------------------
  |  Branch (5100:20): [True: 0, False: 0]
  |  Branch (5100:31): [True: 0, False: 0]
  ------------------
 5101|      0|          if ((j == 0) && (cond[j] != '[')) {
  ------------------
  |  Branch (5101:15): [True: 0, False: 0]
  |  Branch (5101:27): [True: 0, False: 0]
  ------------------
 5102|      0|            HUNSPELL_WARNING(stderr,
 5103|      0|                             "error: line: %d: missing ] in condition:\n%s\n",
 5104|      0|                             linenum, cond.c_str());
 5105|      0|            return 0;
 5106|      0|          }
 5107|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (5107:17): [True: 0, False: 0]
  ------------------
 5108|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (5108:16): [True: 0, False: 0]
  |  Branch (5108:24): [True: 0, False: 0]
  |  Branch (5108:33): [True: 0, False: 0]
  |  Branch (5108:40): [True: 0, False: 0]
  ------------------
 5109|      0|            HUNSPELL_WARNING(stderr,
 5110|      0|                             "warning: line %d: incompatible stripping "
 5111|      0|                             "characters and condition\n",
 5112|      0|                             linenum);
 5113|      0|            return 0;
 5114|      0|          }
 5115|      0|        }
 5116|      0|      }
 5117|      0|      if (j < 0)
  ------------------
  |  Branch (5117:11): [True: 0, False: 0]
  ------------------
 5118|      0|        return 1;
 5119|      0|    }
 5120|      0|  }
 5121|      0|  return 0;
 5122|      6|}
_ZN8AffixMgr8isSubsetEPKcS1_:
 1118|   132k|inline int AffixMgr::isSubset(const char* s1, const char* s2) {
 1119|   194k|  while (((*s1 == *s2) || (*s1 == '.')) && (*s1 != '\0') && (*s2 != '\0')) {
  ------------------
  |  Branch (1119:11): [True: 132k, False: 61.3k]
  |  Branch (1119:27): [True: 0, False: 61.3k]
  |  Branch (1119:44): [True: 61.5k, False: 71.3k]
  |  Branch (1119:61): [True: 61.5k, False: 0]
  ------------------
 1120|  61.5k|    s1++;
 1121|  61.5k|    s2++;
 1122|  61.5k|  }
 1123|   132k|  return (*s1 == '\0');
 1124|   132k|}
affixmgr.cxx:_ZN12_GLOBAL__N_115DistinctRecordsC2Ec:
   97|  33.3k|    explicit DistinctRecords(char breakchar) : sep(breakchar) {}
affixmgr.cxx:_ZNK12_GLOBAL__N_115DistinctRecords4joinEv:
  117|  33.3k|    std::string join() const {
  118|  33.3k|      std::string text;
  119|  33.3k|      for (const std::string& record : records) {
  ------------------
  |  Branch (119:38): [True: 0, False: 33.3k]
  ------------------
  120|      0|        text.append(record);
  121|      0|        text.push_back(sep);
  122|      0|      }
  123|  33.3k|      return text;
  124|  33.3k|    }
affixmgr.cxx:_ZZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttctENK3$_1clEP8SfxEntry:
 3020|   192k|                         &candidates](SfxEntry* se) {
 3021|   192k|    if (!t)
  ------------------
  |  Branch (3021:9): [True: 192k, False: 0]
  ------------------
 3022|   192k|      return;
 3023|      0|    ++candidates;
 3024|      0|    trace_affix(*t, "sfx", this, *se);
 3025|      0|    TraceScope trace_depth(t);
 3026|      0|    suffix_applicable(ppfx, se, cclass, in_compound, t);
 3027|      0|  };
affixmgr.cxx:_ZZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiiP8PfxEntryR12AffixScratchttctENK3$_0clEv:
 3012|   539M|  auto report_empty_pass = [t, &word, start, len, sfxopts, &candidates]() {
 3013|   539M|    if (t && candidates == 0)
  ------------------
  |  Branch (3013:9): [True: 0, False: 539M]
  |  Branch (3013:14): [True: 0, False: 0]
  ------------------
 3014|      0|      trace(*t, "sfx \"%s\" candidates=0%s", word.substr(start, len).c_str(),
 3015|      0|            (sfxopts & aeXPRODUCT) != 0 ? " xprod=Y" : "");
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (3015:13): [True: 0, False: 0]
  ------------------
 3016|   539M|  };
_ZN8AffixMgr11isRevSubsetEPKcS1_i:
 2912|   327k|                                 int len) {
 2913|   655k|  while ((len > 0) && (*s1 != '\0') && ((*s1 == *end_of_s2) || (*s1 == '.'))) {
  ------------------
  |  Branch (2913:10): [True: 651k, False: 3.94k]
  |  Branch (2913:23): [True: 367k, False: 284k]
  |  Branch (2913:41): [True: 327k, False: 39.2k]
  |  Branch (2913:64): [True: 0, False: 39.2k]
  ------------------
 2914|   327k|    s1++;
 2915|   327k|    end_of_s2--;
 2916|   327k|    len--;
 2917|   327k|  }
 2918|   327k|  return (*s1 == '\0');
 2919|   327k|}
affixmgr.cxx:_ZZN8AffixMgr11affix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiiR12AffixScratchtctPP8PfxEntryPP8SfxEntryENK3$_0clEPK6hentry:
 3366|  17.4M|  auto report_form = [this, t, &word, start, len, found_pfx, found_sfx](const struct hentry* rv) {
 3367|  17.4M|    if (!rv)
  ------------------
  |  Branch (3367:9): [True: 17.4M, False: 0]
  ------------------
 3368|  17.4M|      return;
 3369|      0|    if (t)
  ------------------
  |  Branch (3369:9): [True: 0, False: 0]
  ------------------
 3370|      0|      trace_form(*t, this, word.substr(start, len), rv->word, pfx, sfx);
 3371|      0|    if (found_pfx)
  ------------------
  |  Branch (3371:9): [True: 0, False: 0]
  ------------------
 3372|      0|      *found_pfx = pfx;
 3373|      0|    if (found_sfx)
  ------------------
  |  Branch (3373:9): [True: 0, False: 0]
  ------------------
 3374|      0|      *found_sfx = sfx;
 3375|      0|  };
affixmgr.cxx:_ZN12_GLOBAL__N_18mystrdupEPKc:
 3628|   545k|  char* mystrdup(const char* s) {
 3629|   545k|    char* d = nullptr;
 3630|   545k|    if (s) {
  ------------------
  |  Branch (3630:9): [True: 545k, False: 0]
  ------------------
 3631|   545k|      size_t sl = strlen(s) + 1;
 3632|   545k|      d = new char[sl];
 3633|   545k|      memcpy(d, s, sl);
 3634|   545k|    }
 3635|   545k|    return d;
 3636|   545k|  }
_ZN17entries_containerC2EcP8AffixMgr:
 4674|     26|    : m_mgr(mgr)
 4675|     26|    , m_at(at) {
 4676|     26|  }
_ZN17entries_container10initializeEict:
 4681|     26|                  char opts, unsigned short aflag) {
 4682|     26|    entries.reserve(std::min(numents, 16384));
 4683|       |
 4684|     26|    if (m_at == 'P') {
  ------------------
  |  Branch (4684:9): [True: 8, False: 18]
  ------------------
 4685|      8|      entries.push_back(new PfxEntry(m_mgr));
 4686|     18|    } else {
 4687|     18|      entries.push_back(new SfxEntry(m_mgr));
 4688|     18|    }
 4689|       |
 4690|     26|    entries.back()->opts = opts;
 4691|     26|    entries.back()->aflag = aflag;
 4692|     26|  }
_ZN17entries_container11first_entryEv:
 4705|     42|  AffEntry* first_entry() { return entries.empty() ? nullptr : entries[0]; }
  ------------------
  |  Branch (4705:36): [True: 0, False: 42]
  ------------------
_ZN17entries_container9add_entryEc:
 4694|     16|  AffEntry* add_entry(char opts) {
 4695|     16|    if (m_at == 'P') {
  ------------------
  |  Branch (4695:9): [True: 0, False: 16]
  ------------------
 4696|      0|      entries.push_back(new PfxEntry(m_mgr));
 4697|     16|    } else {
 4698|     16|      entries.push_back(new SfxEntry(m_mgr));
 4699|     16|    }
 4700|     16|    AffEntry* ret = entries.back();
 4701|     16|    ret->opts = entries[0]->opts & opts;
 4702|     16|    return ret;
 4703|     16|  }
_ZN17entries_container5beginEv:
 4713|     26|  std::vector<AffEntry*>::iterator begin() { return entries.begin(); }
_ZN17entries_container3endEv:
 4714|     26|  std::vector<AffEntry*>::iterator end() { return entries.end(); }
_ZN17entries_container7releaseEv:
 4677|     26|  void release() {
 4678|     26|    entries.clear();
 4679|     26|  }
_ZN17entries_containerD2Ev:
 4707|     26|  ~entries_container() {
 4708|     26|    for (auto& entry : entries) {
  ------------------
  |  Branch (4708:22): [True: 0, False: 26]
  ------------------
 4709|      0|      delete entry;
 4710|      0|    }
 4711|     26|  }
affixmgr.cxx:_ZZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEENK3$_1clE6w_char:
 1709|  3.51k|          [&](w_char wc) {
 1710|  3.51k|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1711|  3.51k|          });

_ZN9guesswordC2Ev:
  121|  4.70M|    : word(nullptr)
  122|  4.70M|    , allow(false)
  123|  4.70M|    , orig(nullptr)
  124|  4.70M|  {
  125|  4.70M|  }
_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.23M|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|   610M|  for (const w_char& wc : src) {
  ------------------
  |  Branch (138:25): [True: 610M, False: 22.5M]
  ------------------
  139|   610M|    uint16_t cp = (static_cast<uint16_t>(wc.h) << 8) | wc.l;
  140|   610M|    if (cp < 0x80) {
  ------------------
  |  Branch (140:9): [True: 532M, False: 77.5M]
  ------------------
  141|   532M|      dest.push_back(static_cast<char>(cp));
  142|   532M|    } else if (cp < 0x800) {
  ------------------
  |  Branch (142:16): [True: 2.17M, False: 75.3M]
  ------------------
  143|  2.17M|      dest.push_back(static_cast<char>(0xc0 | (cp >> 6)));
  144|  2.17M|      dest.push_back(static_cast<char>(0x80 | (cp & 0x3f)));
  145|  75.3M|    } else {
  146|  75.3M|      dest.push_back(static_cast<char>(0xe0 | (cp >> 12)));
  147|  75.3M|      dest.push_back(static_cast<char>(0x80 | ((cp >> 6) & 0x3f)));
  148|  75.3M|      dest.push_back(static_cast<char>(0x80 | (cp & 0x3f)));
  149|  75.3M|    }
  150|   610M|  }
  151|  22.5M|  return dest;
  152|  22.5M|}
_Z6u8_u16RNSt3__16vectorI6w_charNS_9allocatorIS1_EEEERKNS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEb:
  170|  3.84M|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|  3.84M|  dest.resize(only_convert_first_letter ? 1 : src.size());
  ------------------
  |  Branch (173:15): [True: 0, False: 3.84M]
  ------------------
  174|  3.84M|  auto out = dest.begin();
  175|  3.84M|  auto p = src.begin(), end = src.end();
  176|       |
  177|  36.2M|  while (p < end) {
  ------------------
  |  Branch (177:10): [True: 32.6M, False: 3.61M]
  ------------------
  178|  32.6M|    uint8_t b0 = static_cast<uint8_t>(*p);
  179|  32.6M|    uint16_t cp;
  180|       |
  181|  32.6M|    if (b0 < 0x80) {
  ------------------
  |  Branch (181:9): [True: 29.2M, False: 3.38M]
  ------------------
  182|       |      // 1-byte ASCII
  183|  29.2M|      cp = b0;
  184|  29.2M|    } else if (b0 < 0xc0) {
  ------------------
  |  Branch (184:16): [True: 291k, False: 3.09M]
  ------------------
  185|       |      // continuation byte at lead position
  186|   291k|      HUNSPELL_WARNING(stderr,
  187|   291k|                       "UTF-8 encoding error. Unexpected continuation bytes "
  188|   291k|                       "in %ld. character position\n%s\n",
  189|   291k|                       static_cast<long>(std::distance(src.begin(), p)),
  190|   291k|                       src.c_str());
  191|   291k|      cp = 0xfffd;
  192|  3.09M|    } else if (b0 < 0xe0) {
  ------------------
  |  Branch (192:16): [True: 774k, False: 2.31M]
  ------------------
  193|       |      // 2-byte sequence: 110xxxxx 10yyyyyy
  194|   774k|      if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (194:11): [True: 682k, False: 91.3k]
  |  Branch (194:11): [True: 158k, False: 615k]
  |  Branch (194:26): [True: 158k, False: 524k]
  ------------------
  195|   158k|        cp = ((b0 & 0x1f) << 6) | (static_cast<uint8_t>(p[1]) & 0x3f);
  196|   158k|        ++p;  // step past lead; loop bottom steps past cont
  197|   615k|      } else {
  198|   615k|        warn_missing_cont(src, p);
  199|   615k|        cp = 0xfffd;
  200|   615k|      }
  201|  2.31M|    } else if (b0 < 0xf0) {
  ------------------
  |  Branch (201:16): [True: 2.09M, False: 223k]
  ------------------
  202|       |      // 3-byte sequence: 1110xxxx 10yyyyyy 10zzzzzz
  203|  2.09M|      if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (203:11): [True: 2.06M, False: 26.3k]
  |  Branch (203:11): [True: 1.99M, False: 100k]
  |  Branch (203:26): [True: 1.99M, False: 73.6k]
  ------------------
  204|  1.99M|        uint8_t b1 = static_cast<uint8_t>(p[1]);
  205|  1.99M|        ++p;  // step past lead
  206|  1.99M|        if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (206:13): [True: 1.99M, False: 1.02k]
  |  Branch (206:13): [True: 1.98M, False: 5.46k]
  |  Branch (206:28): [True: 1.98M, False: 4.43k]
  ------------------
  207|  1.98M|          cp = ((b0 & 0x0f) << 12) | ((b1 & 0x3f) << 6) | (static_cast<uint8_t>(p[1]) & 0x3f);
  208|  1.98M|          ++p;  // step past first cont; loop bottom steps past second cont
  209|  1.98M|        } else {
  210|  5.46k|          warn_missing_cont(src, p);
  211|  5.46k|          cp = 0xfffd;
  212|  5.46k|        }
  213|  1.99M|      } else {
  214|   100k|        warn_missing_cont(src, p);
  215|   100k|        cp = 0xfffd;
  216|   100k|      }
  217|  2.09M|    } else {
  218|       |      // 4+ byte lead: codepoint >= U+10000, can't fit in w_char
  219|   223k|      HUNSPELL_WARNING(stderr,
  220|   223k|                       "This UTF-8 encoding can't convert to UTF-16:\n%s\n",
  221|   223k|                       src.c_str());
  222|   223k|      out->h = 0xff;
  223|   223k|      out->l = 0xfd;
  224|   223k|      ++out;
  225|   223k|      dest.resize(out - dest.begin());
  226|   223k|      return -1;
  227|   223k|    }
  228|       |
  229|  32.4M|    out->h = static_cast<unsigned char>(cp >> 8);
  230|  32.4M|    out->l = static_cast<unsigned char>(cp);
  231|  32.4M|    ++out;
  232|  32.4M|    if (only_convert_first_letter)
  ------------------
  |  Branch (232:9): [True: 0, False: 32.4M]
  ------------------
  233|      0|      break;
  234|  32.4M|    ++p;  // consume lead byte
  235|  32.4M|  }
  236|       |
  237|  3.61M|  int size = static_cast<int>(out - dest.begin());
  238|  3.61M|  dest.resize(size);
  239|  3.61M|  return size;
  240|  3.84M|}
_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|   187k|std::vector<std::string> line_tok(const std::string& text, char breakchar) {
  286|   187k|  std::vector<std::string> ret;
  287|   187k|  if (text.empty()) {
  ------------------
  |  Branch (287:7): [True: 11.3k, False: 176k]
  ------------------
  288|  11.3k|    return ret;
  289|  11.3k|  }
  290|       |
  291|   176k|  std::stringstream ss(text);
  292|   176k|  std::string tok;
  293|   352k|  while(std::getline(ss, tok, breakchar)) {
  ------------------
  |  Branch (293:9): [True: 176k, False: 176k]
  ------------------
  294|   176k|    if (!tok.empty()) {
  ------------------
  |  Branch (294:9): [True: 176k, False: 71]
  ------------------
  295|   176k|      ret.push_back(tok);
  296|   176k|    }
  297|   176k|  }
  298|       |
  299|   176k|  return ret;
  300|   187k|}
_Z9line_uniqRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEc:
  312|  12.7k|{
  313|  12.7k|  std::vector<std::string> lines = line_tok(text, breakchar);
  314|  12.7k|  text.clear();
  315|  12.7k|  if (lines.empty()) {
  ------------------
  |  Branch (315:7): [True: 11.3k, False: 1.34k]
  ------------------
  316|  11.3k|    return;
  317|  11.3k|  }
  318|       |
  319|  1.34k|  drop_repeated_lines(lines);
  320|       |
  321|  1.34k|  text = lines[0];
  322|  1.35k|  for (size_t i = 1; i < lines.size(); ++i) {
  ------------------
  |  Branch (322:22): [True: 10, False: 1.34k]
  ------------------
  323|     10|    text.push_back(breakchar);
  324|     10|    text.append(lines[i]);
  325|     10|  }
  326|  1.34k|}
_Z21append_compound_partsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_:
  377|   173k|size_t append_compound_parts(const std::string& desc, std::string& result) {
  378|       |  // find by offset, a search from a bare pointer remeasures the rest of desc on every step
  379|   173k|  size_t part = desc.find(MORPH_PART);
  ------------------
  |  |  116|   173k|#define MORPH_PART "pa:"
  ------------------
  380|   173k|  if (part == std::string::npos)
  ------------------
  |  Branch (380:7): [True: 173k, False: 0]
  ------------------
  381|   173k|    return 0;
  382|      0|  static const char separators[] = {' ', '\t', '\n', '\0'};
  383|      0|  size_t nextpart = desc.find(MORPH_PART, part + 1);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
  384|      0|  while (nextpart != std::string::npos) {
  ------------------
  |  Branch (384:10): [True: 0, False: 0]
  ------------------
  385|      0|    const auto field = desc.begin() + part + MORPH_TAG_LEN;
  ------------------
  |  |  119|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
  386|      0|    const auto end = desc.begin() + nextpart;
  387|      0|    result.append(field, std::find_first_of(field, end, std::begin(separators),
  388|      0|                                            std::end(separators)));
  389|      0|    part = nextpart;
  390|      0|    nextpart = desc.find(MORPH_PART, part + 1);
  ------------------
  |  |  116|      0|#define MORPH_PART "pa:"
  ------------------
  391|      0|  }
  392|      0|  return part;
  393|   173k|}
_Z10copy_fieldRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_S8_:
  397|   160k|                const std::string& var) {
  398|   160k|  if (morph.empty())
  ------------------
  |  Branch (398:7): [True: 0, False: 160k]
  ------------------
  399|      0|    return false;
  400|   160k|  size_t pos = morph.find(var);
  401|   160k|  if (pos == std::string::npos)
  ------------------
  |  Branch (401:7): [True: 5, False: 160k]
  ------------------
  402|      5|    return false;
  403|   160k|  pos += MORPH_TAG_LEN;
  ------------------
  |  |  119|   160k|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |  103|   160k|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
  404|       |  // copy the field value up to the next whitespace, without first
  405|       |  // making a throwaway copy of the whole remaining tail of the string
  406|   160k|  size_t end = morph.find_first_of(" \t\n", pos);
  407|   160k|  dest.assign(morph, pos, end == std::string::npos ? std::string::npos : end - pos);
  ------------------
  |  Branch (407:27): [True: 160k, False: 0]
  ------------------
  408|       |
  409|   160k|  return true;
  410|   160k|}
_Z8mystrrepRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_S8_:
  414|  1.04M|                      const std::string& replace) {
  415|  1.04M|  size_t pos = 0;
  416|  1.10M|  while ((pos = str.find(search, pos)) != std::string::npos) {
  ------------------
  |  Branch (416:10): [True: 62.5k, False: 1.04M]
  ------------------
  417|  62.5k|    str.replace(pos, search.length(), replace);
  418|  62.5k|    pos += replace.length();
  419|  62.5k|  }
  420|  1.04M|  return str;
  421|  1.04M|}
_Z11reversewordRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  424|   903k|size_t reverseword(std::string& word) {
  425|   903k|  std::reverse(word.begin(), word.end());
  426|   903k|  return word.size();
  427|   903k|}
_Z8uniqlistRNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE:
  504|  7.13k|void uniqlist(std::vector<std::string>& list) {
  505|  7.13k|  if (list.size() < 2)
  ------------------
  |  Branch (505:7): [True: 7.13k, False: 0]
  ------------------
  506|  7.13k|    return;
  507|       |
  508|      0|  std::vector<std::string> ret;
  509|      0|  ret.push_back(list[0]);
  510|       |
  511|      0|  for (size_t i = 1; i < list.size(); ++i) {
  ------------------
  |  Branch (511:22): [True: 0, False: 0]
  ------------------
  512|      0|    if (std::find(ret.begin(), ret.end(), list[i]) == ret.end())
  ------------------
  |  Branch (512:9): [True: 0, False: 0]
  ------------------
  513|      0|        ret.push_back(list[i]);
  514|      0|  }
  515|       |
  516|      0|  list.swap(ret);
  517|      0|}
_Z9upper_utf6w_chari:
  536|  4.21M|w_char upper_utf(w_char u, int langnum) {
  537|       |
  538|  4.21M|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  539|       |
  540|       |//with these optimizations, msvc can optimize this function to one jmp instruction
  541|       |//but g++ remains in five instructions
  542|       |//maybe use inline asm for g++?
  543|       |
  544|       |#if (__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)) && defined __cpp_lib_bit_cast && __cpp_lib_bit_cast >= 201806L
  545|       |  return std::bit_cast<w_char>(unicodetoupper((unsigned short)u, langnum));
  546|       |#else
  547|  4.21M|  const auto us = unicodetoupper((unsigned short)u, langnum);
  548|  4.21M|  memcpy(&u, &us, sizeof(unsigned short));
  549|  4.21M|  return u;
  550|  4.21M|#endif
  551|       |
  552|       |#else
  553|       |  const auto us = unicodetoupper((unsigned short)u, langnum);
  554|       |  u.h = (unsigned char)(us >> 8);
  555|       |  u.l = (unsigned char)(us & 0xff);
  556|       |  return u;
  557|       |#endif
  558|  4.21M|}
_Z9lower_utf6w_chari:
  560|  6.78M|w_char lower_utf(w_char u, int langnum) {
  561|       |
  562|  6.78M|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  563|       |
  564|       |//with these optimizations, msvc can optimize this function to one jmp instruction
  565|       |//but g++ remains in five instructions
  566|       |//maybe use inline asm for g++?
  567|       |
  568|       |#if (__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)) && defined __cpp_lib_bit_cast && __cpp_lib_bit_cast >= 201806L
  569|       |  return std::bit_cast<w_char>(unicodetolower((unsigned short)u, langnum));
  570|       |#else
  571|  6.78M|  const auto us = unicodetolower((unsigned short)u, langnum);
  572|  6.78M|  memcpy(&u, &us, sizeof(unsigned short));
  573|  6.78M|  return u;
  574|  6.78M|#endif
  575|       |
  576|       |#else
  577|       |  const auto us = unicodetolower((unsigned short)u, langnum);
  578|       |  u.h = (unsigned char)(us >> 8);
  579|       |  u.l = (unsigned char)(us & 0xff);
  580|       |  return u;
  581|       |#endif
  582|  6.78M|}
_Z8mkallcapRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  585|   265k|std::string& mkallcap(std::string& s, const struct cs_info* csconv) {
  586|  5.22M|  for (char& aI : s) {
  ------------------
  |  Branch (586:17): [True: 5.22M, False: 265k]
  ------------------
  587|  5.22M|    aI = cupper(csconv, static_cast<unsigned char>(aI));
  588|  5.22M|  }
  589|   265k|  return s;
  590|   265k|}
_Z10mkallsmallRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  593|  2.37M|std::string& mkallsmall(std::string& s, const struct cs_info* csconv) {
  594|  23.7M|  for (char& aI : s) {
  ------------------
  |  Branch (594:17): [True: 23.7M, False: 2.37M]
  ------------------
  595|  23.7M|    aI = clower(csconv, static_cast<unsigned char>(aI));
  596|  23.7M|  }
  597|  2.37M|  return s;
  598|  2.37M|}
_Z14mkallsmall_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  600|   942k|std::vector<w_char>& mkallsmall_utf(std::vector<w_char>& u, int langnum) {
  601|  6.73M|  for (auto& i : u) {
  ------------------
  |  Branch (601:16): [True: 6.73M, False: 942k]
  ------------------
  602|  6.73M|    i = lower_utf(i, langnum);
  603|  6.73M|  }
  604|   942k|  return u;
  605|   942k|}
_Z12mkallcap_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  607|   160k|std::vector<w_char>& mkallcap_utf(std::vector<w_char>& u, int langnum) {
  608|  1.93M|  for (auto& i : u) {
  ------------------
  |  Branch (608:16): [True: 1.93M, False: 160k]
  ------------------
  609|  1.93M|    i = upper_utf(i, langnum);
  610|  1.93M|  }
  611|   160k|  return u;
  612|   160k|}
_Z9mkinitcapRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  614|  1.64M|std::string& mkinitcap(std::string& s, const struct cs_info* csconv) {
  615|  1.64M|  if (!s.empty()) {
  ------------------
  |  Branch (615:7): [True: 1.64M, False: 164]
  ------------------
  616|  1.64M|    s[0] = cupper(csconv, static_cast<unsigned char>(s[0]));
  617|  1.64M|  }
  618|  1.64M|  return s;
  619|  1.64M|}
_Z13mkinitcap_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  621|   355k|std::vector<w_char>& mkinitcap_utf(std::vector<w_char>& u, int langnum) {
  622|   355k|  if (!u.empty()) {
  ------------------
  |  Branch (622:7): [True: 355k, False: 0]
  ------------------
  623|   355k|    u[0] = upper_utf(u[0], langnum);
  624|   355k|  }
  625|   355k|  return u;
  626|   355k|}
_Z11mkinitsmallRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  628|   200k|std::string& mkinitsmall(std::string& s, const struct cs_info* csconv) {
  629|   200k|  if (!s.empty()) {
  ------------------
  |  Branch (629:7): [True: 200k, False: 0]
  ------------------
  630|   200k|    s[0] = clower(csconv, static_cast<unsigned char>(s[0]));
  631|   200k|  }
  632|   200k|  return s;
  633|   200k|}
_Z15mkinitsmall_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  635|  33.1k|std::vector<w_char>& mkinitsmall_utf(std::vector<w_char>& u, int langnum) {
  636|  33.1k|  if (!u.empty()) {
  ------------------
  |  Branch (636:7): [True: 33.1k, False: 0]
  ------------------
  637|  33.1k|    u[0] = lower_utf(u[0], langnum);
  638|  33.1k|  }
  639|  33.1k|  return u;
  640|  33.1k|}
_Z14get_current_csRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 2298|  1.80k|const struct cs_info* get_current_cs(const std::string& es) {
 2299|  1.80k|  char* normalized_encoding = new char[es.size() + 1];
 2300|  1.80k|  toAsciiLowerAndRemoveNonAlphanumeric(es.c_str(), normalized_encoding);
 2301|       |
 2302|  1.80k|  const struct cs_info* ccs = nullptr;
 2303|  1.80k|  for (const auto& encd : encds) {
  ------------------
  |  Branch (2303:25): [True: 1.80k, False: 0]
  ------------------
 2304|  1.80k|    if (strcmp(normalized_encoding, encd.enc_name) == 0) {
  ------------------
  |  Branch (2304:9): [True: 1.80k, False: 0]
  ------------------
 2305|  1.80k|      ccs = encd.cs_table;
 2306|  1.80k|      break;
 2307|  1.80k|    }
 2308|  1.80k|  }
 2309|       |
 2310|  1.80k|  delete[] normalized_encoding;
 2311|       |
 2312|  1.80k|  if (!ccs) {
  ------------------
  |  Branch (2312:7): [True: 0, False: 1.80k]
  ------------------
 2313|      0|    HUNSPELL_WARNING(stderr,
 2314|      0|                     "error: unknown encoding %s: using %s as fallback\n", es.c_str(),
 2315|      0|                     encds[0].enc_name);
 2316|      0|    ccs = encds[0].cs_table;
 2317|      0|  }
 2318|       |
 2319|  1.80k|  return ccs;
 2320|  1.80k|}
_Z12get_lang_numRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 2450|      4|int get_lang_num(const std::string& lang) {
 2451|     72|  for (const auto& i : lang2enc) {
  ------------------
  |  Branch (2451:22): [True: 72, False: 0]
  ------------------
 2452|     72|    if (strcmp(lang.c_str(), i.lang) == 0) {
  ------------------
  |  Branch (2452:9): [True: 4, False: 68]
  ------------------
 2453|      4|      return i.num;
 2454|      4|    }
 2455|     72|  }
 2456|      0|  return LANG_xx;
 2457|      4|}
_Z14unicodetoupperti:
 2459|  26.3M|unsigned short unicodetoupper(unsigned short c, int langnum) {
 2460|       |  // In Azeri and Turkish, I and i dictinct letters:
 2461|       |  // There are a dotless lower case i pair of upper `I',
 2462|       |  // and an upper I with dot pair of lower `i'.
 2463|  26.3M|  if (c == 0x0069 && ((langnum == LANG_az) || (langnum == LANG_tr) || (langnum == LANG_crh)))
  ------------------
  |  Branch (2463:7): [True: 241k, False: 26.1M]
  |  Branch (2463:23): [True: 0, False: 241k]
  |  Branch (2463:47): [True: 0, False: 241k]
  |  Branch (2463:71): [True: 0, False: 241k]
  ------------------
 2464|      0|    return 0x0130;
 2465|       |#ifdef OPENOFFICEORG
 2466|       |  return static_cast<unsigned short>(u_toupper(c));
 2467|       |#else
 2468|       |#ifdef MOZILLA_CLIENT
 2469|       |  return ToUpperCase((char16_t)c);
 2470|       |#else
 2471|  26.3M|  unsigned short up = utf_pages[utf_page_index[c >> 8]][c & 0xFF].cupper;
 2472|  26.3M|  return up ? up : c;
  ------------------
  |  Branch (2472:10): [True: 4.13M, False: 22.2M]
  ------------------
 2473|  26.3M|#endif
 2474|  26.3M|#endif
 2475|  26.3M|}
_Z14unicodetolowerti:
 2477|  29.8M|unsigned short unicodetolower(unsigned short c, int langnum) {
 2478|       |  // In Azeri and Turkish, I and i dictinct letters:
 2479|       |  // There are a dotless lower case i pair of upper `I',
 2480|       |  // and an upper I with dot pair of lower `i'.
 2481|  29.8M|  if (c == 0x0049 && ((langnum == LANG_az) || (langnum == LANG_tr) || (langnum == LANG_crh)))
  ------------------
  |  Branch (2481:7): [True: 73.4k, False: 29.7M]
  |  Branch (2481:23): [True: 0, False: 73.4k]
  |  Branch (2481:47): [True: 0, False: 73.4k]
  |  Branch (2481:71): [True: 0, False: 73.4k]
  ------------------
 2482|      0|    return 0x0131;
 2483|       |#ifdef OPENOFFICEORG
 2484|       |  return static_cast<unsigned short>(u_tolower(c));
 2485|       |#else
 2486|       |#ifdef MOZILLA_CLIENT
 2487|       |  return ToLowerCase((char16_t)c);
 2488|       |#else
 2489|  29.8M|  unsigned short lo = utf_pages[utf_page_index[c >> 8]][c & 0xFF].clower;
 2490|  29.8M|  return lo ? lo : c;
  ------------------
  |  Branch (2490:10): [True: 2.33M, False: 27.4M]
  ------------------
 2491|  29.8M|#endif
 2492|  29.8M|#endif
 2493|  29.8M|}
_Z11get_captypeRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
 2504|  11.9M|int get_captype(const std::string& word, const cs_info* csconv) {
 2505|       |  // now determine the capitalization type of the first nl letters
 2506|  11.9M|  size_t ncap = 0;
 2507|  11.9M|  size_t nneutral = 0;
 2508|  11.9M|  size_t firstcap = 0;
 2509|  11.9M|  if (csconv == nullptr)
  ------------------
  |  Branch (2509:7): [True: 0, False: 11.9M]
  ------------------
 2510|      0|    return NOCAP;
  ------------------
  |  |   92|      0|#define NOCAP 0
  ------------------
 2511|   128M|  for (char q : word) {
  ------------------
  |  Branch (2511:15): [True: 128M, False: 11.9M]
  ------------------
 2512|   128M|    const auto nIndex = static_cast<unsigned char>(q);
 2513|   128M|    if (ccase(csconv, nIndex))
  ------------------
  |  Branch (2513:9): [True: 4.87M, False: 123M]
  ------------------
 2514|  4.87M|      ncap++;
 2515|   128M|    if (cupper(csconv, nIndex) == clower(csconv, nIndex))
  ------------------
  |  Branch (2515:9): [True: 99.2M, False: 28.8M]
  ------------------
 2516|  99.2M|      nneutral++;
 2517|   128M|  }
 2518|  11.9M|  if (ncap) {
  ------------------
  |  Branch (2518:7): [True: 1.97M, False: 9.93M]
  ------------------
 2519|  1.97M|    const auto nIndex = static_cast<unsigned char>(word[0]);
 2520|  1.97M|    firstcap = csconv[nIndex].ccase;
 2521|  1.97M|  }
 2522|       |
 2523|       |  // now finally set the captype
 2524|  11.9M|  if (ncap == 0) {
  ------------------
  |  Branch (2524:7): [True: 9.93M, False: 1.97M]
  ------------------
 2525|  9.93M|    return NOCAP;
  ------------------
  |  |   92|  9.93M|#define NOCAP 0
  ------------------
 2526|  9.93M|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (2526:14): [True: 933k, False: 1.03M]
  |  Branch (2526:29): [True: 312k, False: 621k]
  ------------------
 2527|   312k|    return INITCAP;
  ------------------
  |  |   93|   312k|#define INITCAP 1
  ------------------
 2528|  1.65M|  } else if ((ncap == word.size()) || ((ncap + nneutral) == word.size())) {
  ------------------
  |  Branch (2528:14): [True: 6.05k, False: 1.65M]
  |  Branch (2528:39): [True: 549k, False: 1.10M]
  ------------------
 2529|   555k|    return ALLCAP;
  ------------------
  |  |   94|   555k|#define ALLCAP 2
  ------------------
 2530|  1.10M|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (2530:14): [True: 661k, False: 441k]
  |  Branch (2530:28): [True: 205k, False: 455k]
  ------------------
 2531|   205k|    return HUHINITCAP;
  ------------------
  |  |   96|   205k|#define HUHINITCAP 4
  ------------------
 2532|   205k|  }
 2533|   896k|  return HUHCAP;
  ------------------
  |  |   95|   896k|#define HUHCAP 3
  ------------------
 2534|  11.9M|}
_Z16get_captype_utf8RKNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
 2536|  2.40M|int get_captype_utf8(const std::vector<w_char>& word, int langnum) {
 2537|       |  // now determine the capitalization type of the first nl letters
 2538|  2.40M|  size_t ncap = 0;
 2539|  2.40M|  size_t nneutral = 0;
 2540|  2.40M|  size_t firstcap = 0;
 2541|       |
 2542|  2.40M|  auto it = word.begin(), it_end = word.end();
 2543|  24.3M|  while (it != it_end) {
  ------------------
  |  Branch (2543:10): [True: 21.9M, False: 2.40M]
  ------------------
 2544|  21.9M|    const auto idx = (unsigned short)*it;
 2545|  21.9M|    const auto lwridx = unicodetolower(idx, langnum);
 2546|  21.9M|    if (idx != lwridx)
  ------------------
  |  Branch (2546:9): [True: 1.05M, False: 20.9M]
  ------------------
 2547|  1.05M|      ncap++;
 2548|  21.9M|    if (unicodetoupper(idx, langnum) == lwridx)
  ------------------
  |  Branch (2548:9): [True: 17.8M, False: 4.09M]
  ------------------
 2549|  17.8M|      nneutral++;
 2550|  21.9M|    ++it;
 2551|  21.9M|  }
 2552|  2.40M|  if (ncap) {
  ------------------
  |  Branch (2552:7): [True: 371k, False: 2.03M]
  ------------------
 2553|   371k|    const auto idx = (unsigned short)word[0];
 2554|   371k|    firstcap = (idx != unicodetolower(idx, langnum));
 2555|   371k|  }
 2556|       |
 2557|       |  // now finally set the captype
 2558|  2.40M|  if (ncap == 0) {
  ------------------
  |  Branch (2558:7): [True: 2.03M, False: 371k]
  ------------------
 2559|  2.03M|    return NOCAP;
  ------------------
  |  |   92|  2.03M|#define NOCAP 0
  ------------------
 2560|  2.03M|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (2560:14): [True: 248k, False: 122k]
  |  Branch (2560:29): [True: 81.7k, False: 166k]
  ------------------
 2561|  81.7k|    return INITCAP;
  ------------------
  |  |   93|  81.7k|#define INITCAP 1
  ------------------
 2562|   289k|  } else if ((ncap == word.size()) || ((ncap + nneutral) == word.size())) {
  ------------------
  |  Branch (2562:14): [True: 2.32k, False: 286k]
  |  Branch (2562:39): [True: 108k, False: 178k]
  ------------------
 2563|   110k|    return ALLCAP;
  ------------------
  |  |   94|   110k|#define ALLCAP 2
  ------------------
 2564|   178k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (2564:14): [True: 72.6k, False: 106k]
  |  Branch (2564:28): [True: 33.5k, False: 39.0k]
  ------------------
 2565|  33.5k|    return HUHINITCAP;
  ------------------
  |  |   96|  33.5k|#define HUHINITCAP 4
  ------------------
 2566|  33.5k|  }
 2567|   145k|  return HUHCAP;
  ------------------
  |  |   95|   145k|#define HUHCAP 3
  ------------------
 2568|  2.40M|}
_Z24remove_ignored_chars_utfRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEE:
 2572|   607k|                                const std::vector<w_char>& ignored_chars) {
 2573|   607k|  std::vector<w_char> w;
 2574|   607k|  std::vector<w_char> w2;
 2575|   607k|  u8_u16(w, word);
 2576|       |
 2577|   607k|  std::copy_if(w.begin(), w.end(), std::back_inserter(w2),
 2578|   607k|  [&ignored_chars](w_char wc) {
 2579|   607k|    return !std::binary_search(ignored_chars.begin(), ignored_chars.end(), wc);
 2580|   607k|  });
 2581|       |
 2582|   607k|  u16_u8(word, w2);
 2583|   607k|  return w2.size();
 2584|   607k|}
_Z20remove_ignored_charsRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_:
 2588|  2.51M|                            const std::string& ignored_chars) {
 2589|  2.51M|  word.erase(
 2590|  2.51M|      std::remove_if(word.begin(), word.end(), is_any_of(ignored_chars)),
 2591|  2.51M|      word.end());
 2592|  2.51M|  return word.size();
 2593|  2.51M|}
_Z12parse_stringRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_i:
 2595|     90|bool parse_string(const std::string& line, std::string& out, int ln) {
 2596|     90|  if (!out.empty()) {
  ------------------
  |  Branch (2596:7): [True: 0, False: 90]
  ------------------
 2597|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions\n", ln);
 2598|      0|    return false;
 2599|      0|  }
 2600|     90|  int i = 0;
 2601|     90|  int np = 0;
 2602|     90|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 2603|    270|  while (start_piece != line.end()) {
  ------------------
  |  Branch (2603:10): [True: 180, False: 90]
  ------------------
 2604|    180|    switch (i) {
 2605|     90|      case 0: {
  ------------------
  |  Branch (2605:7): [True: 90, False: 90]
  ------------------
 2606|     90|        np++;
 2607|     90|        break;
 2608|      0|      }
 2609|     90|      case 1: {
  ------------------
  |  Branch (2609:7): [True: 90, False: 90]
  ------------------
 2610|     90|        out.assign(start_piece, iter);
 2611|     90|        np++;
 2612|     90|        break;
 2613|      0|      }
 2614|      0|      default:
  ------------------
  |  Branch (2614:7): [True: 0, False: 180]
  ------------------
 2615|      0|        break;
 2616|    180|    }
 2617|    180|    ++i;
 2618|    180|     start_piece = mystrsep(line, iter);
 2619|    180|  }
 2620|     90|  if (np != 2) {
  ------------------
  |  Branch (2620:7): [True: 0, False: 90]
  ------------------
 2621|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", ln);
 2622|      0|    return false;
 2623|      0|  }
 2624|     90|  return true;
 2625|     90|}
_Z11parse_arrayRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_RNS_6vectorI6w_charNS3_ISA_EEEEii:
 2631|     14|                 int ln) {
 2632|     14|  if (!parse_string(line, out, ln))
  ------------------
  |  Branch (2632:7): [True: 0, False: 14]
  ------------------
 2633|      0|    return false;
 2634|     14|  if (utf8) {
  ------------------
  |  Branch (2634:7): [True: 8, False: 6]
  ------------------
 2635|      8|    u8_u16(out_utf16, out);
 2636|      8|    std::sort(out_utf16.begin(), out_utf16.end());
 2637|      8|  }
 2638|     14|  return true;
 2639|     14|}
csutil.cxx:_ZL17warn_missing_contRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_11__wrap_iterIPKcEE:
  154|   721k|static void warn_missing_cont(const std::string& src, std::string::const_iterator p) {
  155|       |  HUNSPELL_WARNING(stderr,
  156|   721k|                   "UTF-8 encoding error. Missing continuation byte in "
  157|   721k|                   "%ld. character position:\n%s\n",
  158|   721k|                   static_cast<long>(std::distance(src.begin(), p)),
  159|   721k|                   src.c_str());
  160|   721k|}
csutil.cxx:_ZN12_GLOBAL__N_19is_any_ofC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  245|  2.51M|  explicit is_any_of(const std::string& in) : chars(in) {}
csutil.cxx:_ZNK12_GLOBAL__N_19is_any_ofclEc:
  247|  28.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.34k|static void drop_repeated_lines(std::vector<std::string>& lines) {
  304|  1.34k|  std::unordered_set<std::string> seen;
  305|  1.34k|  auto firstrepeat = std::remove_if(lines.begin(), lines.end(),
  306|  1.34k|                                    [&seen](const std::string& line) { return !seen.insert(line).second; });
  307|  1.34k|  lines.erase(firstrepeat, lines.end());
  308|  1.34k|}
csutil.cxx:_ZZL19drop_repeated_linesRNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEEENK3$_0clERKS6_:
  306|  1.74k|                                    [&seen](const std::string& line) { return !seen.insert(line).second; });
csutil.cxx:_ZN12_GLOBAL__N_16cupperEPK7cs_infoi:
  520|   135M|unsigned char cupper(const struct cs_info* csconv, int nIndex) {
  521|   135M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (521:3): [True: 135M, False: 0]
  |  Branch (521:3): [True: 135M, False: 0]
  |  Branch (521:3): [True: 135M, False: 0]
  ------------------
  522|   135M|  return csconv[nIndex].cupper;
  523|   135M|}
csutil.cxx:_ZN12_GLOBAL__N_16clowerEPK7cs_infoi:
  525|   152M|unsigned char clower(const struct cs_info* csconv, int nIndex) {
  526|   152M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (526:3): [True: 152M, False: 0]
  |  Branch (526:3): [True: 152M, False: 0]
  |  Branch (526:3): [True: 152M, False: 0]
  ------------------
  527|   152M|  return csconv[nIndex].clower;
  528|   152M|}
csutil.cxx:_ZL36toAsciiLowerAndRemoveNonAlphanumericPKcPc:
 2278|  1.80k|                                                 char* pBuf) {
 2279|  16.3k|  while (*pName) {
  ------------------
  |  Branch (2279:10): [True: 14.5k, False: 1.80k]
  ------------------
 2280|       |    /* A-Z */
 2281|  14.5k|    if ((*pName >= 0x41) && (*pName <= 0x5A)) {
  ------------------
  |  Branch (2281:9): [True: 5.42k, False: 9.13k]
  |  Branch (2281:29): [True: 294, False: 5.13k]
  ------------------
 2282|    294|      *pBuf = (*pName) + 0x20; /* toAsciiLower */
 2283|    294|      pBuf++;
 2284|    294|    }
 2285|       |    /* a-z, 0-9 */
 2286|  14.2k|    else if (((*pName >= 0x61) && (*pName <= 0x7A)) ||
  ------------------
  |  Branch (2286:15): [True: 5.13k, False: 9.13k]
  |  Branch (2286:35): [True: 5.13k, False: 0]
  ------------------
 2287|  14.1k|             ((*pName >= 0x30) && (*pName <= 0x39))) {
  ------------------
  |  Branch (2287:15): [True: 9.04k, False: 98]
  |  Branch (2287:35): [True: 9.04k, False: 0]
  ------------------
 2288|  14.1k|      *pBuf = *pName;
 2289|  14.1k|      pBuf++;
 2290|  14.1k|    }
 2291|       |
 2292|  14.5k|    pName++;
 2293|  14.5k|  }
 2294|       |
 2295|  1.80k|  *pBuf = '\0';
 2296|  1.80k|}
csutil.cxx:_ZN12_GLOBAL__N_15ccaseEPK7cs_infoi:
  530|   128M|unsigned char ccase(const struct cs_info* csconv, int nIndex) {
  531|   128M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (531:3): [True: 128M, False: 0]
  |  Branch (531:3): [True: 128M, False: 0]
  |  Branch (531:3): [True: 128M, False: 0]
  ------------------
  532|   128M|  return csconv[nIndex].ccase;
  533|   128M|}
csutil.cxx:_ZZ24remove_ignored_chars_utfRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEEENK3$_0clES8_:
 2578|  6.44M|  [&ignored_chars](w_char wc) {
 2579|  6.44M|    return !std::binary_search(ignored_chars.begin(), ignored_chars.end(), wc);
 2580|  6.44M|  });

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

_ZN12HunspellImplC2EPKcS1_S1_:
  198|     38|  : m_trace(std::make_unique<TraceCtx>(nullptr, nullptr))
  199|     38|  , affixpath(affpath)
  200|     38|  , affixkey(key ? key : "") {
  ------------------
  |  Branch (200:14): [True: 0, False: 38]
  ------------------
  201|     38|  csconv = nullptr;
  202|     38|  utf8 = 0;
  203|     38|  complexprefixes = 0;
  204|       |
  205|       |  /* first set up the hash manager */
  206|     38|  m_HMgrs.push_back(std::make_unique<HashMgr>(dpath, affpath, key));
  207|       |
  208|       |  /* next set up the affix manager */
  209|       |  /* it needs access to the hash manager lookup methods */
  210|     38|  pAMgr = std::make_unique<AffixMgr>(affpath, m_HMgrs, key);
  211|       |
  212|       |  /* get the preferred try string and the dictionary */
  213|       |  /* encoding from the Affix Manager for that dictionary */
  214|     38|  std::string try_string = pAMgr->get_try_string();
  215|     38|  encoding = pAMgr->get_encoding();
  216|     38|  langnum = pAMgr->get_langnum();
  217|     38|  utf8 = pAMgr->get_utf8();
  218|     38|  if (!utf8)
  ------------------
  |  Branch (218:7): [True: 20, False: 18]
  ------------------
  219|     20|    csconv = get_current_cs(encoding);
  220|     38|  complexprefixes = pAMgr->get_complexprefixes();
  221|     38|  wordbreak = pAMgr->get_breaktable();
  222|       |
  223|       |  /* and finally set up the suggestion manager */
  224|     38|  pSMgr = std::make_unique<SuggestMgr>(try_string, MAXSUGGESTION, pAMgr.get());
  ------------------
  |  |   83|     38|#define MAXSUGGESTION 15
  ------------------
  225|     38|}
_ZN12HunspellImpl12clean_ignoreERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
  247|  31.8M|                                const std::string& src) {
  248|  31.8M|  dest.clear();
  249|  31.8M|  dest.assign(src);
  250|  31.8M|  const char* ignoredchars = pAMgr ? pAMgr->get_ignore() : nullptr;
  ------------------
  |  Branch (250:30): [True: 31.8M, False: 0]
  ------------------
  251|  31.8M|  if (ignoredchars != nullptr) {
  ------------------
  |  Branch (251:7): [True: 3.12M, False: 28.7M]
  ------------------
  252|  3.12M|    if (utf8) {
  ------------------
  |  Branch (252:9): [True: 607k, False: 2.51M]
  ------------------
  253|   607k|      const std::vector<w_char>& ignoredchars_utf16 =
  254|   607k|          pAMgr->get_ignore_utf16();
  255|   607k|      remove_ignored_chars_utf(dest, ignoredchars_utf16);
  256|  2.51M|    } else {
  257|  2.51M|      remove_ignored_chars(dest, ignoredchars);
  258|  2.51M|    }
  259|  3.12M|  }
  260|  31.8M|}
_ZN12HunspellImpl10cleanword2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEERKS6_PiPm:
  274|  14.5M|                         size_t* pabbrev) {
  275|  14.5M|  dest.clear();
  276|  14.5M|  dest_utf.clear();
  277|       |
  278|       |  // remove IGNORE characters from the string
  279|  14.5M|  std::string w2;
  280|  14.5M|  clean_ignore(w2, src);
  281|       |
  282|  14.5M|  const char* q = w2.c_str();
  283|  14.5M|  int nl = (int)w2.size();
  284|       |
  285|       |  // first skip over any leading blanks
  286|  14.6M|  while (*q == ' ') {
  ------------------
  |  Branch (286:10): [True: 148k, False: 14.5M]
  ------------------
  287|   148k|    ++q;
  288|   148k|    nl--;
  289|   148k|  }
  290|       |
  291|       |  // now strip off any trailing periods (recording their presence)
  292|  14.5M|  *pabbrev = 0;
  293|       |
  294|  16.3M|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (294:10): [True: 16.1M, False: 240k]
  |  Branch (294:22): [True: 1.82M, False: 14.2M]
  ------------------
  295|  1.82M|    nl--;
  296|  1.82M|    (*pabbrev)++;
  297|  1.82M|  }
  298|       |
  299|       |  // if no characters are left it can't be capitalized
  300|  14.5M|  if (nl <= 0) {
  ------------------
  |  Branch (300:7): [True: 240k, False: 14.2M]
  ------------------
  301|   240k|    *pcaptype = NOCAP;
  ------------------
  |  |   92|   240k|#define NOCAP 0
  ------------------
  302|   240k|    return 0;
  303|   240k|  }
  304|       |
  305|  14.2M|  dest.append(q, nl);
  306|  14.2M|  nl = dest.size();
  307|  14.2M|  if (utf8) {
  ------------------
  |  Branch (307:7): [True: 2.39M, False: 11.8M]
  ------------------
  308|  2.39M|    u8_u16(dest_utf, dest);
  309|  2.39M|    *pcaptype = get_captype_utf8(dest_utf, langnum);
  310|  11.8M|  } else {
  311|  11.8M|    *pcaptype = get_captype(dest, csconv);
  312|  11.8M|  }
  313|  14.2M|  return nl;
  314|  14.5M|}
_ZN12HunspellImpl9cleanwordERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_PiSA_:
  319|  6.44k|                        int* pabbrev) {
  320|  6.44k|  dest.clear();
  321|  6.44k|  const unsigned char* q = (const unsigned char*)src.c_str();
  322|  6.44k|  int firstcap = 0, nl = (int)src.size();
  323|       |
  324|       |  // first skip over any leading blanks
  325|  12.3k|  while (*q == ' ') {
  ------------------
  |  Branch (325:10): [True: 5.85k, False: 6.44k]
  ------------------
  326|  5.85k|    ++q;
  327|  5.85k|    nl--;
  328|  5.85k|  }
  329|       |
  330|       |  // now strip off any trailing periods (recording their presence)
  331|  6.44k|  *pabbrev = 0;
  332|       |
  333|  23.5k|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (333:10): [True: 23.2k, False: 285]
  |  Branch (333:22): [True: 17.0k, False: 6.16k]
  ------------------
  334|  17.0k|    nl--;
  335|  17.0k|    (*pabbrev)++;
  336|  17.0k|  }
  337|       |
  338|       |  // if no characters are left it can't be capitalized
  339|  6.44k|  if (nl <= 0) {
  ------------------
  |  Branch (339:7): [True: 285, False: 6.16k]
  ------------------
  340|    285|    *pcaptype = NOCAP;
  ------------------
  |  |   92|    285|#define NOCAP 0
  ------------------
  341|    285|    return;
  342|    285|  }
  343|       |
  344|       |  // now determine the capitalization type of the first nl letters
  345|  6.16k|  int ncap = 0;
  346|  6.16k|  int nneutral = 0;
  347|  6.16k|  int nc = 0;
  348|       |
  349|  6.16k|  if (!utf8) {
  ------------------
  |  Branch (349:7): [True: 3.26k, False: 2.90k]
  ------------------
  350|   589k|    while (nl > 0) {
  ------------------
  |  Branch (350:12): [True: 585k, False: 3.26k]
  ------------------
  351|   585k|      nc++;
  352|   585k|      if (csconv[(*q)].ccase)
  ------------------
  |  Branch (352:11): [True: 500k, False: 85.2k]
  ------------------
  353|   500k|        ncap++;
  354|   585k|      if (csconv[(*q)].cupper == csconv[(*q)].clower)
  ------------------
  |  Branch (354:11): [True: 73.0k, False: 512k]
  ------------------
  355|  73.0k|        nneutral++;
  356|   585k|      dest.push_back(*q++);
  357|   585k|      nl--;
  358|   585k|    }
  359|       |    // remember to terminate the destination string
  360|  3.26k|    firstcap = csconv[static_cast<unsigned char>(dest[0])].ccase;
  361|  3.26k|  } else {
  362|  2.90k|    std::vector<w_char> t;
  363|  2.90k|    u8_u16(t, src);
  364|   183k|    for (auto& wc : t) {
  ------------------
  |  Branch (364:19): [True: 183k, False: 2.90k]
  ------------------
  365|   183k|      const auto idx = (unsigned short)wc;
  366|   183k|      const auto low = unicodetolower(idx, langnum);
  367|   183k|      if (idx != low)
  ------------------
  |  Branch (367:11): [True: 123k, False: 59.6k]
  ------------------
  368|   123k|        ncap++;
  369|   183k|      if (unicodetoupper(idx, langnum) == low)
  ------------------
  |  Branch (369:11): [True: 57.6k, False: 125k]
  ------------------
  370|  57.6k|        nneutral++;
  371|   183k|    }
  372|  2.90k|    u16_u8(dest, t);
  373|  2.90k|    if (ncap) {
  ------------------
  |  Branch (373:9): [True: 1.71k, False: 1.18k]
  ------------------
  374|  1.71k|      const auto idx = (unsigned short)t[0];
  375|  1.71k|      firstcap = (idx != unicodetolower(idx, langnum));
  376|  1.71k|    }
  377|  2.90k|  }
  378|       |
  379|       |  // now finally set the captype
  380|  6.16k|  if (ncap == 0) {
  ------------------
  |  Branch (380:7): [True: 2.11k, False: 4.04k]
  ------------------
  381|  2.11k|    *pcaptype = NOCAP;
  ------------------
  |  |   92|  2.11k|#define NOCAP 0
  ------------------
  382|  4.04k|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (382:14): [True: 2.17k, False: 1.87k]
  |  Branch (382:29): [True: 1.84k, False: 329]
  ------------------
  383|  1.84k|    *pcaptype = INITCAP;
  ------------------
  |  |   93|  1.84k|#define INITCAP 1
  ------------------
  384|  2.20k|  } else if ((ncap == nc) || ((ncap + nneutral) == nc)) {
  ------------------
  |  Branch (384:14): [True: 120, False: 2.08k]
  |  Branch (384:30): [True: 250, False: 1.83k]
  ------------------
  385|    370|    *pcaptype = ALLCAP;
  ------------------
  |  |   94|    370|#define ALLCAP 2
  ------------------
  386|  1.83k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (386:14): [True: 1.57k, False: 259]
  |  Branch (386:28): [True: 1.39k, False: 182]
  ------------------
  387|  1.39k|    *pcaptype = HUHINITCAP;
  ------------------
  |  |   96|  1.39k|#define HUHINITCAP 4
  ------------------
  388|  1.39k|  } else {
  389|    441|    *pcaptype = HUHCAP;
  ------------------
  |  |   95|    441|#define HUHCAP 3
  ------------------
  390|    441|  }
  391|  6.16k|}
_ZN12HunspellImpl8mkallcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  393|  2.80k|void HunspellImpl::mkallcap(std::string& u8) {
  394|  2.80k|  if (utf8) {
  ------------------
  |  Branch (394:7): [True: 1.51k, False: 1.29k]
  ------------------
  395|  1.51k|    std::vector<w_char> u16;
  396|  1.51k|    u8_u16(u16, u8);
  397|  1.51k|    ::mkallcap_utf(u16, langnum);
  398|  1.51k|    u16_u8(u8, u16);
  399|  1.51k|  } else {
  400|  1.29k|    ::mkallcap(u8, csconv);
  401|  1.29k|  }
  402|  2.80k|}
_ZN12HunspellImpl11mkallsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
  404|  1.92M|int HunspellImpl::mkallsmall2(std::string& u8, std::vector<w_char>& u16) {
  405|  1.92M|  if (utf8) {
  ------------------
  |  Branch (405:7): [True: 350k, False: 1.57M]
  ------------------
  406|   350k|    ::mkallsmall_utf(u16, langnum);
  407|   350k|    u16_u8(u8, u16);
  408|  1.57M|  } else {
  409|  1.57M|    ::mkallsmall(u8, csconv);
  410|  1.57M|  }
  411|  1.92M|  return u8.size();
  412|  1.92M|}
_ZN12HunspellImpl11is_keepcaseEPK6hentry:
  450|  20.5k|int HunspellImpl::is_keepcase(const hentry* rv) {
  451|  20.5k|  return pAMgr && rv->astr && pAMgr->get_keepcase() &&
  ------------------
  |  Branch (451:10): [True: 20.5k, False: 0]
  |  Branch (451:19): [True: 437, False: 20.0k]
  |  Branch (451:31): [True: 41, False: 396]
  ------------------
  452|     41|         TESTAFF(rv->astr, pAMgr->get_keepcase(), rv->alen);
  ------------------
  |  |  102|  20.5k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 31, False: 10]
  |  |  ------------------
  ------------------
  453|  20.5k|}
_ZN12HunspellImpl10insert_sugERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_:
  456|  17.9k|void HunspellImpl::insert_sug(std::vector<std::string>& slst, const std::string& word) {
  457|  17.9k|  slst.insert(slst.begin(), word);
  458|  17.9k|}
_ZN12HunspellImpl5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  462|  15.1M|                         std::chrono::steady_clock::time_point suggest_start) {
  463|       |  // something very broken if spell ends up calling itself with the same word
  464|  15.1M|  if (std::find(candidate_stack.begin(), candidate_stack.end(), word) != candidate_stack.end())
  ------------------
  |  Branch (464:7): [True: 0, False: 15.1M]
  ------------------
  465|      0|    return false;
  466|       |
  467|  15.1M|  if (candidate_stack.size() >= MAXBREAKDEPTH)
  ------------------
  |  |   87|  15.1M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (467:7): [True: 0, False: 15.1M]
  ------------------
  468|      0|    return false;
  469|       |
  470|  15.1M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  15.1M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (470:7): [True: 0, False: 15.1M]
  ------------------
  471|      0|    return false;
  472|       |
  473|  15.1M|  TraceCtx* t = active_trace();
  474|  15.1M|  if (t)
  ------------------
  |  Branch (474:7): [True: 0, False: 15.1M]
  ------------------
  475|      0|    trace(*t, "word \"%s\"", word.c_str());
  476|       |  // A word split on a BREAK pattern nests its parts a further level in.
  477|  15.1M|  TraceScope trace_depth(t);
  478|       |
  479|  15.1M|  candidate_stack.push_back(word);
  480|  15.1M|  bool r = spell_internal(word, candidate_stack, info, root, suggest_start);
  481|  15.1M|  candidate_stack.pop_back();
  482|       |
  483|  15.1M|  if (t)
  ------------------
  |  Branch (483:7): [True: 0, False: 15.1M]
  ------------------
  484|      0|    trace(*t, "result %s", r ? "correct" : "incorrect");
  ------------------
  |  Branch (484:28): [True: 0, False: 0]
  ------------------
  485|       |
  486|  15.1M|  if (r && root) {
  ------------------
  |  Branch (486:7): [True: 2.64M, False: 12.5M]
  |  Branch (486:12): [True: 0, False: 2.64M]
  ------------------
  487|       |    // output conversion
  488|      0|    RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (488:19): [True: 0, False: 0]
  ------------------
  489|      0|    if (rl) {
  ------------------
  |  Branch (489:9): [True: 0, False: 0]
  ------------------
  490|      0|      std::string wspace;
  491|      0|      if (rl->conv(*root, wspace)) {
  ------------------
  |  Branch (491:11): [True: 0, False: 0]
  ------------------
  492|      0|        *root = std::move(wspace);
  493|      0|      }
  494|      0|    }
  495|      0|  }
  496|  15.1M|  return r;
  497|  15.1M|}
_ZN12HunspellImpl14spell_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  501|  15.1M|                                  std::chrono::steady_clock::time_point suggest_start) {
  502|  15.1M|  struct hentry* rv = nullptr;
  503|       |
  504|  15.1M|  int info2 = 0;
  505|  15.1M|  if (!info)
  ------------------
  |  Branch (505:7): [True: 15.1M, False: 148]
  ------------------
  506|  15.1M|    info = &info2;
  507|    148|  else
  508|    148|    *info = 0;
  509|       |
  510|       |  // Hunspell supports XML input of the simplified API (see manual)
  511|  15.1M|  if (word == SPELL_XML)
  ------------------
  |  |   80|  15.1M|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (511:7): [True: 727k, False: 14.4M]
  ------------------
  512|   727k|    return true;
  513|  14.4M|  if (utf8) {
  ------------------
  |  Branch (513:7): [True: 2.42M, False: 12.0M]
  ------------------
  514|  2.42M|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   87|  2.42M|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  2.42M|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (514:9): [True: 4.00k, False: 2.41M]
  ------------------
  515|  4.00k|      return false;
  516|  12.0M|  } else {
  517|  12.0M|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  12.0M|#define MAXWORDLEN 100
  ------------------
  |  Branch (517:9): [True: 7.01k, False: 12.0M]
  ------------------
  518|  7.01k|      return false;
  519|  12.0M|  }
  520|  14.4M|  int captype = NOCAP;
  ------------------
  |  |   92|  14.4M|#define NOCAP 0
  ------------------
  521|  14.4M|  size_t abbv = 0;
  522|  14.4M|  size_t wl = 0;
  523|       |
  524|  14.4M|  std::string scw;
  525|  14.4M|  std::vector<w_char> sunicw;
  526|       |
  527|       |  // input conversion
  528|  14.4M|  RepList* rl = pAMgr ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (528:17): [True: 14.4M, False: 0]
  ------------------
  529|  14.4M|  {
  530|  14.4M|    std::string wspace;
  531|       |
  532|  14.4M|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (532:23): [True: 351k, False: 14.1M]
  ------------------
  533|  14.4M|    if (convstatus) {
  ------------------
  |  Branch (533:9): [True: 0, False: 14.4M]
  ------------------
  534|       |      // the input conversion can grow the word without limit, so hold the
  535|       |      // converted word to the same maximum length as the raw word
  536|      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 (536:11): [True: 0, False: 0]
  |  Branch (536:11): [True: 0, False: 0]
  ------------------
  537|      0|        return false;
  538|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
  539|      0|    } else
  540|  14.4M|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
  541|  14.4M|  }
  542|       |
  543|  14.4M|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  544|  14.4M|    if (wl > 32768)
  ------------------
  |  Branch (544:9): [True: 0, False: 14.4M]
  ------------------
  545|      0|      return false;
  546|  14.4M|#endif
  547|       |
  548|       |#ifdef MOZILLA_CLIENT
  549|       |  // accept the abbreviated words without dots
  550|       |  // workaround for the incomplete tokenization of Mozilla
  551|       |  abbv = 1;
  552|       |#endif
  553|       |
  554|  14.4M|  if (wl == 0 || m_HMgrs.empty())
  ------------------
  |  Branch (554:7): [True: 239k, False: 14.2M]
  |  Branch (554:18): [True: 0, False: 14.2M]
  ------------------
  555|   239k|    return true;
  556|  14.2M|  if (root)
  ------------------
  |  Branch (556:7): [True: 0, False: 14.2M]
  ------------------
  557|      0|    root->clear();
  558|       |
  559|       |  // allow numbers with dots, dashes and commas (but forbid double separators:
  560|       |  // "..", "--" etc.). Besides the ASCII digits, accept the Arabic-Indic and
  561|       |  // Extended Arabic-Indic (Persian) digit ranges so those numbers are passed
  562|       |  // over the same way ASCII numbers are.
  563|  14.2M|  enum { NBEGIN, NNUM, NSEP };
  564|  14.2M|  int nstate = NBEGIN;
  565|  14.2M|  size_t i;
  566|  14.2M|  size_t n = utf8 ? sunicw.size() : wl;
  ------------------
  |  Branch (566:14): [True: 2.36M, False: 11.8M]
  ------------------
  567|       |
  568|  28.8M|  for (i = 0; (i < n); i++) {
  ------------------
  |  Branch (568:15): [True: 27.9M, False: 855k]
  ------------------
  569|  27.9M|    unsigned short c = utf8 ? static_cast<unsigned short>(sunicw[i]) : static_cast<unsigned char>(scw[i]);
  ------------------
  |  Branch (569:24): [True: 4.16M, False: 23.8M]
  ------------------
  570|  27.9M|    if ((c >= '0' && c <= '9') || (c >= 0x0660 && c <= 0x0669) ||  // Arabic-Indic digits
  ------------------
  |  Branch (570:10): [True: 20.2M, False: 7.70M]
  |  Branch (570:22): [True: 14.0M, False: 6.25M]
  |  Branch (570:36): [True: 227k, False: 13.7M]
  |  Branch (570:51): [True: 0, False: 227k]
  ------------------
  571|  14.0M|        (c >= 0x06F0 && c <= 0x06F9)) {                            // Extended Arabic-Indic (Persian) digits
  ------------------
  |  Branch (571:10): [True: 227k, False: 13.7M]
  |  Branch (571:25): [True: 0, False: 227k]
  ------------------
  572|  14.0M|      nstate = NNUM;
  573|  14.0M|    } else if ((c == ',') || (c == '.') || (c == '-')) {
  ------------------
  |  Branch (573:16): [True: 107k, False: 13.8M]
  |  Branch (573:30): [True: 911k, False: 12.9M]
  |  Branch (573:44): [True: 3.07M, False: 9.86M]
  ------------------
  574|  4.09M|      if ((nstate == NSEP) || (i == 0))
  ------------------
  |  Branch (574:11): [True: 102k, False: 3.99M]
  |  Branch (574:31): [True: 3.39M, False: 598k]
  ------------------
  575|  3.49M|        break;
  576|   598k|      nstate = NSEP;
  577|   598k|    } else
  578|  9.86M|      break;
  579|  27.9M|  }
  580|  14.2M|  if ((i == n) && (nstate == NNUM))
  ------------------
  |  Branch (580:7): [True: 855k, False: 13.3M]
  |  Branch (580:19): [True: 654k, False: 200k]
  ------------------
  581|   654k|    return true;
  582|       |
  583|  13.5M|  switch (captype) {
  ------------------
  |  Branch (583:11): [True: 13.5M, False: 0]
  ------------------
  584|  1.02M|    case HUHCAP:
  ------------------
  |  |   95|  1.02M|#define HUHCAP 3
  ------------------
  |  Branch (584:5): [True: 1.02M, False: 12.5M]
  ------------------
  585|       |    /* FALLTHROUGH */
  586|  1.24M|    case HUHINITCAP:
  ------------------
  |  |   96|  1.24M|#define HUHINITCAP 4
  ------------------
  |  Branch (586:5): [True: 222k, False: 13.3M]
  ------------------
  587|  1.24M|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   86|  1.24M|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  588|       |    /* FALLTHROUGH */
  589|  12.5M|    case NOCAP:
  ------------------
  |  |   92|  12.5M|#define NOCAP 0
  ------------------
  |  Branch (589:5): [True: 11.2M, False: 2.27M]
  ------------------
  590|  12.5M|      rv = checkword(scw, info, root, suggest_start);
  591|  12.5M|      if ((abbv) && !(rv)) {
  ------------------
  |  Branch (591:11): [True: 1.17M, False: 11.3M]
  |  Branch (591:21): [True: 1.17M, False: 290]
  ------------------
  592|  1.17M|        std::string u8buffer(scw);
  593|  1.17M|        u8buffer.push_back('.');
  594|  1.17M|        rv = checkword(u8buffer, info, root, suggest_start);
  595|  1.17M|      }
  596|       |      // A stem with an inner capital, capitalised at the start of a sentence
  597|       |      // (uLinda written ULinda), is found by lowering only the first letter.
  598|  12.5M|      if (!rv && captype == HUHINITCAP) {
  ------------------
  |  |   96|  12.5M|#define HUHINITCAP 4
  ------------------
  |  Branch (598:11): [True: 12.5M, False: 13.4k]
  |  Branch (598:18): [True: 219k, False: 12.2M]
  ------------------
  599|   219k|        std::string u8buffer(scw);
  600|   219k|        std::vector<w_char> u16buffer(sunicw);
  601|   219k|        mkinitsmall2(u8buffer, u16buffer);
  602|   219k|        rv = checkword(u8buffer, info, root, suggest_start);
  603|   219k|        if (rv && is_keepcase(rv))
  ------------------
  |  Branch (603:13): [True: 12, False: 219k]
  |  Branch (603:19): [True: 0, False: 12]
  ------------------
  604|      0|          rv = nullptr;
  605|   219k|      }
  606|  12.5M|      break;
  607|   654k|    case ALLCAP: {
  ------------------
  |  |   94|   654k|#define ALLCAP 2
  ------------------
  |  Branch (607:5): [True: 654k, False: 12.9M]
  ------------------
  608|   654k|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   86|   654k|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  609|   654k|      rv = checkword(scw, info, root, suggest_start);
  610|   654k|      if (rv)
  ------------------
  |  Branch (610:11): [True: 103, False: 654k]
  ------------------
  611|    103|        break;
  612|   654k|      if (abbv) {
  ------------------
  |  Branch (612:11): [True: 97.6k, False: 557k]
  ------------------
  613|  97.6k|        std::string u8buffer(scw);
  614|  97.6k|        u8buffer.push_back('.');
  615|  97.6k|        rv = checkword(u8buffer, info, root, suggest_start);
  616|  97.6k|        if (rv)
  ------------------
  |  Branch (616:13): [True: 0, False: 97.6k]
  ------------------
  617|      0|          break;
  618|  97.6k|      }
  619|       |      // Spec. prefix handling for Catalan, French, Italian:
  620|       |      // prefixes separated by apostrophe (SANT'ELIA -> Sant'+Elia).
  621|   654k|      size_t apos = pAMgr ? scw.find('\'') : std::string::npos;
  ------------------
  |  Branch (621:21): [True: 654k, False: 0]
  ------------------
  622|   654k|      if (apos != std::string::npos) {
  ------------------
  |  Branch (622:11): [True: 151k, False: 503k]
  ------------------
  623|   151k|        mkallsmall2(scw, sunicw);
  624|       |        //conversion may result in string with different len to pre-mkallsmall2
  625|       |        //so re-scan
  626|   151k|        if (apos != std::string::npos && apos < scw.size() - 1) {
  ------------------
  |  Branch (626:13): [True: 151k, False: 0]
  |  Branch (626:42): [True: 137k, False: 14.1k]
  ------------------
  627|   137k|          std::string part1 = scw.substr(0, apos + 1), part2 = scw.substr(apos + 1);
  628|   137k|          if (utf8) {
  ------------------
  |  Branch (628:15): [True: 29.7k, False: 107k]
  ------------------
  629|  29.7k|            std::vector<w_char> part1u, part2u;
  630|  29.7k|            u8_u16(part1u, part1);
  631|  29.7k|            u8_u16(part2u, part2);
  632|  29.7k|            mkinitcap2(part2, part2u);
  633|  29.7k|            scw = part1 + part2;
  634|  29.7k|            sunicw = std::move(part1u);
  635|  29.7k|            sunicw.insert(sunicw.end(), part2u.begin(), part2u.end());
  636|  29.7k|            rv = checkword(scw, info, root, suggest_start);
  637|  29.7k|            if (rv)
  ------------------
  |  Branch (637:17): [True: 0, False: 29.7k]
  ------------------
  638|      0|              break;
  639|   107k|          } else {
  640|   107k|            mkinitcap2(part2, sunicw);
  641|   107k|            scw = part1 + part2;
  642|   107k|            rv = checkword(scw, info, root, suggest_start);
  643|   107k|            if (rv)
  ------------------
  |  Branch (643:17): [True: 1, False: 107k]
  ------------------
  644|      1|              break;
  645|   107k|          }
  646|   137k|          mkinitcap2(scw, sunicw);
  647|   137k|          rv = checkword(scw, info, root, suggest_start);
  648|   137k|          if (rv)
  ------------------
  |  Branch (648:15): [True: 1, False: 137k]
  ------------------
  649|      1|            break;
  650|   137k|        }
  651|   151k|      }
  652|   654k|      if (pAMgr && pAMgr->get_checksharps() && scw.find("SS") != std::string::npos) {
  ------------------
  |  Branch (652:11): [True: 654k, False: 0]
  |  Branch (652:20): [True: 0, False: 654k]
  |  Branch (652:48): [True: 0, False: 0]
  ------------------
  653|       |
  654|      0|        mkallsmall2(scw, sunicw);
  655|      0|        std::string u8buffer(scw);
  656|      0|        rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  657|      0|        if (!rv) {
  ------------------
  |  Branch (657:13): [True: 0, False: 0]
  ------------------
  658|      0|          mkinitcap2(scw, sunicw);
  659|      0|          rv = spellsharps(scw, 0, 0, 0, info, root, suggest_start);
  660|      0|        }
  661|      0|        if ((abbv) && !(rv)) {
  ------------------
  |  Branch (661:13): [True: 0, False: 0]
  |  Branch (661:23): [True: 0, False: 0]
  ------------------
  662|      0|          u8buffer.push_back('.');
  663|      0|          rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  664|      0|          if (!rv) {
  ------------------
  |  Branch (664:15): [True: 0, False: 0]
  ------------------
  665|      0|            u8buffer = std::string(scw);
  666|      0|            u8buffer.push_back('.');
  667|      0|            rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  668|      0|          }
  669|      0|        }
  670|      0|        if (rv)
  ------------------
  |  Branch (670:13): [True: 0, False: 0]
  ------------------
  671|      0|          break;
  672|      0|      }
  673|   654k|    }
  674|       |      /* FALLTHROUGH */
  675|  1.02M|    case INITCAP: {
  ------------------
  |  |   93|  1.02M|#define INITCAP 1
  ------------------
  |  Branch (675:5): [True: 373k, False: 13.1M]
  ------------------
  676|       |      // handle special capitalization of dotted I
  677|  1.02M|      bool Idot = (utf8 && (unsigned char) scw[0] == 0xc4 && (unsigned char) scw[1] == 0xb0);
  ------------------
  |  Branch (677:20): [True: 174k, False: 853k]
  |  Branch (677:28): [True: 8, False: 174k]
  |  Branch (677:62): [True: 0, False: 8]
  ------------------
  678|  1.02M|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   86|  1.02M|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  679|  1.02M|      if (captype == ALLCAP) {
  ------------------
  |  |   94|  1.02M|#define ALLCAP 2
  ------------------
  |  Branch (679:11): [True: 654k, False: 373k]
  ------------------
  680|   654k|          mkallsmall2(scw, sunicw);
  681|   654k|          mkinitcap2(scw, sunicw);
  682|   654k|          if (Idot)
  ------------------
  |  Branch (682:15): [True: 0, False: 654k]
  ------------------
  683|      0|             scw.replace(0, 1, "\xc4\xb0");
  684|   654k|      }
  685|  1.02M|      if (captype == INITCAP)
  ------------------
  |  |   93|  1.02M|#define INITCAP 1
  ------------------
  |  Branch (685:11): [True: 373k, False: 654k]
  ------------------
  686|   373k|        *info |= SPELL_INITCAP;
  ------------------
  |  |   85|   373k|#define SPELL_INITCAP (1 << 4)
  ------------------
  687|  1.02M|      rv = checkword(scw, info, root, suggest_start);
  688|  1.02M|      if (captype == INITCAP)
  ------------------
  |  |   93|  1.02M|#define INITCAP 1
  ------------------
  |  Branch (688:11): [True: 373k, False: 654k]
  ------------------
  689|   373k|        *info &= ~SPELL_INITCAP;
  ------------------
  |  |   85|   373k|#define SPELL_INITCAP (1 << 4)
  ------------------
  690|       |      // forbid bad capitalization
  691|       |      // (for example, ijs -> Ijs instead of IJs in Dutch)
  692|       |      // use explicit forms in dic: Ijs/F (F = FORBIDDENWORD flag)
  693|  1.02M|      if (*info & SPELL_FORBIDDEN) {
  ------------------
  |  |   82|  1.02M|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (693:11): [True: 0, False: 1.02M]
  ------------------
  694|      0|        rv = nullptr;
  695|      0|        break;
  696|      0|      }
  697|  1.02M|      if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   94|     16|#define ALLCAP 2
  ------------------
  |  Branch (697:11): [True: 19.9k, False: 1.00M]
  |  Branch (697:17): [True: 16, False: 19.8k]
  |  Branch (697:36): [True: 0, False: 16]
  ------------------
  698|      0|        rv = nullptr;
  699|  1.02M|      if (rv || (Idot && langnum != LANG_az && langnum != LANG_tr && langnum != LANG_crh))
  ------------------
  |  Branch (699:11): [True: 19.9k, False: 1.00M]
  |  Branch (699:18): [True: 0, False: 1.00M]
  |  Branch (699:26): [True: 0, False: 0]
  |  Branch (699:48): [True: 0, False: 0]
  |  Branch (699:70): [True: 0, False: 0]
  ------------------
  700|  19.9k|        break;
  701|       |
  702|  1.00M|      mkallsmall2(scw, sunicw);
  703|  1.00M|      std::string u8buffer(scw);
  704|  1.00M|      mkinitcap2(scw, sunicw);
  705|       |
  706|  1.00M|      rv = checkword(u8buffer, info, root, suggest_start);
  707|  1.00M|      if (abbv && !rv) {
  ------------------
  |  Branch (707:11): [True: 181k, False: 826k]
  |  Branch (707:19): [True: 181k, False: 36]
  ------------------
  708|   181k|        u8buffer.push_back('.');
  709|   181k|        rv = checkword(u8buffer, info, root, suggest_start);
  710|   181k|        if (!rv) {
  ------------------
  |  Branch (710:13): [True: 181k, False: 0]
  ------------------
  711|   181k|          u8buffer = scw;
  712|   181k|          u8buffer.push_back('.');
  713|   181k|          if (captype == INITCAP)
  ------------------
  |  |   93|   181k|#define INITCAP 1
  ------------------
  |  Branch (713:15): [True: 84.3k, False: 97.6k]
  ------------------
  714|  84.3k|            *info |= SPELL_INITCAP;
  ------------------
  |  |   85|  84.3k|#define SPELL_INITCAP (1 << 4)
  ------------------
  715|   181k|          rv = checkword(u8buffer, info, root, suggest_start);
  716|   181k|          if (captype == INITCAP)
  ------------------
  |  |   93|   181k|#define INITCAP 1
  ------------------
  |  Branch (716:15): [True: 84.3k, False: 97.6k]
  ------------------
  717|  84.3k|            *info &= ~SPELL_INITCAP;
  ------------------
  |  |   85|  84.3k|#define SPELL_INITCAP (1 << 4)
  ------------------
  718|   181k|          if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   94|     12|#define ALLCAP 2
  ------------------
  |  Branch (718:15): [True: 12, False: 181k]
  |  Branch (718:21): [True: 12, False: 0]
  |  Branch (718:40): [True: 2, False: 10]
  ------------------
  719|      2|            rv = nullptr;
  720|   181k|          break;
  721|   181k|        }
  722|   181k|      }
  723|   826k|      if (rv && is_keepcase(rv) &&
  ------------------
  |  Branch (723:11): [True: 595, False: 825k]
  |  Branch (723:17): [True: 3, False: 592]
  ------------------
  724|      3|          ((captype == ALLCAP) ||
  ------------------
  |  |   94|      3|#define ALLCAP 2
  ------------------
  |  Branch (724:12): [True: 1, False: 2]
  ------------------
  725|       |           // if CHECKSHARPS: KEEPCASE words with \xDF  are allowed
  726|       |           // in INITCAP form, too.
  727|      2|           !(pAMgr->get_checksharps() &&
  ------------------
  |  Branch (727:14): [True: 0, False: 2]
  ------------------
  728|      0|             ((utf8 && u8buffer.find("\xC3\x9F") != std::string::npos) ||
  ------------------
  |  Branch (728:16): [True: 0, False: 0]
  |  Branch (728:24): [True: 0, False: 0]
  ------------------
  729|      0|              (!utf8 && u8buffer.find('\xDF') != std::string::npos)))))
  ------------------
  |  Branch (729:16): [True: 0, False: 0]
  |  Branch (729:25): [True: 0, False: 0]
  ------------------
  730|      3|        rv = nullptr;
  731|   826k|      break;
  732|  1.00M|    }
  733|  13.5M|  }
  734|       |
  735|  13.5M|  if (rv) {
  ------------------
  |  Branch (735:7): [True: 34.0k, False: 13.5M]
  ------------------
  736|  34.0k|    if (pAMgr && pAMgr->get_warn() && rv->astr &&
  ------------------
  |  Branch (736:9): [True: 34.0k, False: 0]
  |  Branch (736:9): [True: 4, False: 34.0k]
  |  Branch (736:18): [True: 2.25k, False: 31.7k]
  |  Branch (736:39): [True: 14, False: 2.24k]
  ------------------
  737|     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: 4, False: 10]
  |  |  ------------------
  ------------------
  738|      4|      *info |= SPELL_WARN;
  ------------------
  |  |   87|      4|#define SPELL_WARN (1 << 6)
  ------------------
  739|      4|      if (pAMgr->get_forbidwarn())
  ------------------
  |  Branch (739:11): [True: 0, False: 4]
  ------------------
  740|      0|        return false;
  741|      4|      return true;
  742|      4|    }
  743|  34.0k|    return true;
  744|  34.0k|  }
  745|       |
  746|       |  // recursive breaking at break points
  747|  13.5M|  if (!wordbreak.empty() && !(*info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   82|  13.5M|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (747:7): [True: 13.5M, False: 0]
  |  Branch (747:29): [True: 13.5M, False: 0]
  ------------------
  748|       |
  749|  13.5M|    int nbr = 0;
  750|  13.5M|    wl = scw.size();
  751|       |
  752|       |    // calculate break points for recursion limit
  753|  40.4M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (753:18): [True: 40.4M, False: 13.5M]
  ------------------
  754|  40.4M|      size_t pos = 0;
  755|  55.4M|      while ((pos = scw.find(j, pos)) != std::string::npos) {
  ------------------
  |  Branch (755:14): [True: 14.9M, False: 40.4M]
  ------------------
  756|  14.9M|        ++nbr;
  757|  14.9M|        pos += j.size();
  758|  14.9M|      }
  759|  40.4M|    }
  760|  13.5M|    if (nbr >= MAXBREAKDEPTH)
  ------------------
  |  |   87|  13.5M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (760:9): [True: 6.11k, False: 13.5M]
  ------------------
  761|  6.11k|      return false;
  762|       |
  763|       |    // check boundary patterns (^begin and end$)
  764|  40.4M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (764:18): [True: 40.4M, False: 12.5M]
  ------------------
  765|  40.4M|      size_t plen = j.size();
  766|  40.4M|      if (plen == 1 || plen > wl)
  ------------------
  |  Branch (766:11): [True: 13.5M, False: 26.8M]
  |  Branch (766:24): [True: 3.36M, False: 23.5M]
  ------------------
  767|  16.8M|        continue;
  768|       |
  769|  23.5M|      if (j[0] == '^' && scw.compare(0, plen - 1, j, 1, plen - 1) == 0 &&
  ------------------
  |  Branch (769:11): [True: 11.7M, False: 11.7M]
  |  Branch (769:11): [True: 74.8k, False: 23.4M]
  |  Branch (769:26): [True: 1.26M, False: 10.5M]
  ------------------
  770|  1.26M|          spell(scw.substr(plen - 1), candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (770:11): [True: 74.8k, False: 1.19M]
  ------------------
  771|  74.8k|        *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|  74.8k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  772|  74.8k|        return true;
  773|  74.8k|      }
  774|       |
  775|  23.4M|      if (j[plen - 1] == '$' &&
  ------------------
  |  Branch (775:11): [True: 11.7M, False: 11.7M]
  ------------------
  776|  11.7M|          scw.compare(wl - plen + 1, plen - 1, j, 0, plen - 1) == 0) {
  ------------------
  |  Branch (776:11): [True: 4.16M, False: 7.54M]
  ------------------
  777|  4.16M|        std::string suffix(scw.substr(wl - plen + 1));
  778|  4.16M|        scw.resize(wl - plen + 1);
  779|  4.16M|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (779:13): [True: 857k, False: 3.31M]
  ------------------
  780|   857k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|   857k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  781|   857k|          return true;
  782|   857k|        }
  783|  3.31M|        scw.append(suffix);
  784|  3.31M|      }
  785|  23.4M|    }
  786|       |
  787|       |    // other patterns
  788|  37.6M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (788:18): [True: 37.6M, False: 12.5M]
  ------------------
  789|  37.6M|      size_t plen = j.size();
  790|  37.6M|      size_t found = scw.find(j);
  791|  37.6M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (791:11): [True: 35.1M, False: 2.46M]
  |  Branch (791:26): [True: 3.98M, False: 31.1M]
  ------------------
  792|  3.98M|        size_t found2 = scw.find(j, found + 1);
  793|       |        // try to break at the second occurance
  794|       |        // to recognize dictionary words with wordbreak
  795|  3.98M|        if (found2 > 0 && (found2 < wl - plen))
  ------------------
  |  Branch (795:13): [True: 3.98M, False: 0]
  |  Branch (795:27): [True: 1.55M, False: 2.42M]
  ------------------
  796|  1.55M|            found = found2;
  797|  3.98M|        std::string substring(scw.substr(found + plen));
  798|  3.98M|        if (!spell(substring, candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (798:13): [True: 3.09M, False: 893k]
  ------------------
  799|  3.09M|          continue;
  800|   893k|        std::string suffix(scw.substr(found));
  801|   893k|        scw.resize(found);
  802|       |        // examine 2 sides of the break point
  803|   893k|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (803:13): [True: 53.1k, False: 840k]
  ------------------
  804|  53.1k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|  53.1k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  805|  53.1k|          return true;
  806|  53.1k|        }
  807|   840k|        scw.append(suffix);
  808|       |
  809|       |        // LANG_hu: spec. dash rule
  810|   840k|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (810:13): [True: 165, False: 840k]
  |  Branch (810:35): [True: 165, False: 0]
  ------------------
  811|    165|          suffix = scw.substr(found + 1);
  812|    165|          scw.resize(found + 1);
  813|    165|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (813:15): [True: 0, False: 165]
  ------------------
  814|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  815|      0|            return true;  // check the first part with dash
  816|      0|          }
  817|    165|          scw.append(suffix);
  818|    165|        }
  819|       |        // end of LANG specific region
  820|   840k|      }
  821|  37.6M|    }
  822|       |
  823|       |    // other patterns (break at first break point)
  824|  37.5M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (824:18): [True: 37.5M, False: 12.5M]
  ------------------
  825|  37.5M|      size_t plen = j.size(), found = scw.find(j);
  826|  37.5M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (826:11): [True: 35.0M, False: 2.46M]
  |  Branch (826:26): [True: 3.91M, False: 31.1M]
  ------------------
  827|  3.91M|        if (!spell(scw.substr(found + plen), candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (827:13): [True: 3.21M, False: 698k]
  ------------------
  828|  3.21M|          continue;
  829|   698k|        std::string suffix(scw.substr(found));
  830|   698k|        scw.resize(found);
  831|       |        // examine 2 sides of the break point
  832|   698k|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (832:13): [True: 5.18k, False: 693k]
  ------------------
  833|  5.18k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|  5.18k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  834|  5.18k|          return true;
  835|  5.18k|        }
  836|   693k|        scw.append(suffix);
  837|       |
  838|       |        // LANG_hu: spec. dash rule
  839|   693k|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (839:13): [True: 79, False: 693k]
  |  Branch (839:35): [True: 79, False: 0]
  ------------------
  840|     79|          suffix = scw.substr(found + 1);
  841|     79|          scw.resize(found + 1);
  842|     79|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (842:15): [True: 0, False: 79]
  ------------------
  843|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  844|      0|            return true;  // check the first part with dash
  845|      0|          }
  846|     79|          scw.append(suffix);
  847|     79|        }
  848|       |        // end of LANG specific region
  849|   693k|      }
  850|  37.5M|    }
  851|  12.5M|  }
  852|       |
  853|  12.5M|  return false;
  854|  13.5M|}
_ZN12HunspellImpl9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_NS0_6chrono10time_pointINSB_12steady_clockENSB_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  857|  17.3M|                                       std::chrono::steady_clock::time_point suggest_start) {
  858|       |  // check overall suggest time limit
  859|  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 (859:7): [True: 0, False: 17.3M]
  ------------------
  860|      0|    return nullptr;
  861|       |
  862|  17.3M|  std::string word;
  863|       |
  864|       |  // remove IGNORE characters from the string
  865|  17.3M|  clean_ignore(word, w);
  866|       |
  867|  17.3M|  if (word.empty())
  ------------------
  |  Branch (867:7): [True: 1.63k, False: 17.3M]
  ------------------
  868|  1.63k|    return nullptr;
  869|       |
  870|       |  // word reversing wrapper for complex prefixes
  871|  17.3M|  if (complexprefixes) {
  ------------------
  |  Branch (871:7): [True: 887k, False: 16.4M]
  ------------------
  872|   887k|    if (utf8)
  ------------------
  |  Branch (872:9): [True: 0, False: 887k]
  ------------------
  873|      0|      reverseword_utf(word);
  874|   887k|    else
  875|   887k|      reverseword(word);
  876|   887k|  }
  877|       |
  878|  17.3M|  int len = word.size();
  879|       |
  880|       |  // look word in hash table
  881|  17.3M|  struct hentry* he = nullptr;
  882|  17.3M|  TraceCtx* t = active_trace();
  883|  34.7M|  for (size_t i = 0; (i < m_HMgrs.size()) && !he; ++i) {
  ------------------
  |  Branch (883:22): [True: 17.3M, False: 17.3M]
  |  Branch (883:46): [True: 17.3M, False: 0]
  ------------------
  884|  17.3M|    he = m_HMgrs[i]->lookup(word.c_str(), word.size());
  885|       |
  886|  17.3M|    if (t) {
  ------------------
  |  Branch (886:9): [True: 0, False: 17.3M]
  ------------------
  887|      0|      std::string dic;
  888|      0|      if (m_HMgrs.size() > 1)
  ------------------
  |  Branch (888:11): [True: 0, False: 0]
  ------------------
  889|      0|        dic = " dic=" + std::to_string(i);
  890|      0|      if (he)
  ------------------
  |  Branch (890:11): [True: 0, False: 0]
  ------------------
  891|      0|        trace(*t, "lookup \"%s\"%s -> entry \"%s\" flags=%s", word.c_str(),
  892|      0|              dic.c_str(), he->word,
  893|      0|              trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  894|      0|      else
  895|      0|        trace(*t, "lookup \"%s\"%s -> miss", word.c_str(), dic.c_str());
  896|      0|    }
  897|       |
  898|       |    // check forbidden and onlyincompound words
  899|  17.3M|    if ((he) && (he->astr) && (pAMgr) &&
  ------------------
  |  Branch (899:9): [True: 37.2k, False: 17.3M]
  |  Branch (899:9): [True: 0, False: 17.3M]
  |  Branch (899:17): [True: 4.88k, False: 32.3k]
  |  Branch (899:31): [True: 4.88k, False: 0]
  ------------------
  900|  4.88k|        TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) {
  ------------------
  |  |  102|  4.88k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 4.88k]
  |  |  ------------------
  ------------------
  901|      0|      if (t)
  ------------------
  |  Branch (901:11): [True: 0, False: 0]
  ------------------
  902|      0|        trace(*t, "test forbidden flag=%s in=dic have=%s"
  903|      0|                  " -> fail, the word is forbidden",
  904|      0|              pAMgr->encode_flag(pAMgr->get_forbiddenword()).c_str(),
  905|      0|              trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  906|      0|      if (info)
  ------------------
  |  Branch (906:11): [True: 0, False: 0]
  ------------------
  907|      0|        *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   82|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  908|       |      // LANG_hu section: set dash information for suggestions
  909|      0|      if (langnum == LANG_hu) {
  ------------------
  |  Branch (909:11): [True: 0, False: 0]
  ------------------
  910|      0|        if (pAMgr->get_compoundflag() &&
  ------------------
  |  Branch (910:13): [True: 0, False: 0]
  |  Branch (910:13): [True: 0, False: 0]
  ------------------
  911|      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]
  |  |  ------------------
  ------------------
  912|      0|          if (info)
  ------------------
  |  Branch (912:15): [True: 0, False: 0]
  ------------------
  913|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  914|      0|        }
  915|      0|      }
  916|      0|      return nullptr;
  917|      0|    }
  918|       |
  919|       |    // he = next not needaffix, onlyincompound homonym or onlyupcase word
  920|  17.3M|    const struct hentry* first_he = he;
  921|  17.3M|    while (he && (he->astr) && pAMgr &&
  ------------------
  |  Branch (921:12): [True: 37.2k, False: 17.3M]
  |  Branch (921:12): [True: 3.18k, False: 17.3M]
  |  Branch (921:18): [True: 4.88k, False: 32.3k]
  |  Branch (921:32): [True: 4.88k, False: 0]
  ------------------
  922|  4.88k|           ((pAMgr->get_needaffix() &&
  ------------------
  |  Branch (922:14): [True: 380, False: 4.50k]
  ------------------
  923|    380|             TESTAFF(he->astr, pAMgr->get_needaffix(), he->alen)) ||
  ------------------
  |  |  102|    380|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 380]
  |  |  ------------------
  ------------------
  924|  4.88k|            (pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (924:14): [True: 0, False: 4.88k]
  ------------------
  925|      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]
  |  |  ------------------
  ------------------
  926|  4.88k|            (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   85|  4.88k|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (926:14): [True: 4.88k, False: 0]
  |  Branch (926:22): [True: 3.21k, False: 1.67k]
  ------------------
  927|  3.21k|             TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen)))) {
  ------------------
  |  |  102|  3.21k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 3.18k, False: 26]
  |  |  ------------------
  ------------------
  928|  3.18k|      if (t) {
  ------------------
  |  Branch (928:11): [True: 0, False: 3.18k]
  ------------------
  929|       |        // Name the branch that fired, in the order the condition tests them.
  930|      0|        const char* reason = "onlyupcase";
  931|      0|        FLAG flag = ONLYUPCASEFLAG;
  ------------------
  |  |   98|      0|#define FLAG unsigned short
  ------------------
                      FLAG flag = ONLYUPCASEFLAG;
  ------------------
  |  |  128|      0|#define ONLYUPCASEFLAG 65511
  ------------------
  932|      0|        if (pAMgr->get_needaffix() &&
  ------------------
  |  Branch (932:13): [True: 0, False: 0]
  |  Branch (932:13): [True: 0, False: 0]
  ------------------
  933|      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]
  |  |  ------------------
  ------------------
  934|      0|          reason = "needaffix";
  935|      0|          flag = pAMgr->get_needaffix();
  936|      0|        } else if (pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (936:20): [True: 0, False: 0]
  |  Branch (936:20): [True: 0, False: 0]
  ------------------
  937|      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]
  |  |  ------------------
  ------------------
  938|      0|          reason = "onlyincompound";
  939|      0|          flag = pAMgr->get_onlyincompound();
  940|      0|        }
  941|      0|        trace(*t, "test %s flag=%s in=dic have=%s"
  942|      0|                  " -> fail, on to the next homonym",
  943|      0|              reason, trace_flag(pAMgr.get(), flag).c_str(),
  944|      0|              trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  945|      0|      }
  946|  3.18k|      he = he->next_homonym;
  947|  3.18k|    }
  948|       |
  949|       |    // Say which entry the walk left in hand, so the transcript does not end
  950|       |    // on a homonym that was passed over.
  951|  17.3M|    if (t && he != first_he) {
  ------------------
  |  Branch (951:9): [True: 0, False: 17.3M]
  |  Branch (951:14): [True: 0, False: 0]
  ------------------
  952|      0|      if (he)
  ------------------
  |  Branch (952:11): [True: 0, False: 0]
  ------------------
  953|      0|        trace(*t, "lookup \"%s\" -> entry \"%s\" flags=%s", word.c_str(),
  954|      0|              he->word, trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  955|      0|      else
  956|      0|        trace(*t, "lookup \"%s\" -> no more homonyms", word.c_str());
  957|      0|    }
  958|  17.3M|  }
  959|       |
  960|       |  // check with affixes
  961|  17.3M|  if (!he && pAMgr) {
  ------------------
  |  Branch (961:7): [True: 17.3M, False: 34.0k]
  |  Branch (961:14): [True: 17.3M, False: 0]
  ------------------
  962|       |    // try stripping off affixes
  963|  17.3M|    AffixScratch scratch;
  964|  17.3M|    scratch.trace = t;
  965|       |    // For an initial-capital query, make affix_check skip an all-uppercase-only
  966|       |    // stem and keep looking, so a valid mixed-case match behind it is found.
  967|  17.3M|    FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   98|  17.3M|#define FLAG unsigned short
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   85|  17.3M|#define SPELL_INITCAP (1 << 4)
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |  128|   439k|#define ONLYUPCASEFLAG 65511
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   99|  34.2M|#define FLAG_NULL 0x00
  ------------------
  |  Branch (967:23): [True: 17.3M, False: 0]
  |  Branch (967:31): [True: 439k, False: 16.8M]
  ------------------
  968|  17.3M|    he = pAMgr->affix_check(word, 0, len, scratch, 0, IN_CPD_NOT, avoidflag);
  ------------------
  |  |   75|  17.3M|#define IN_CPD_NOT 0
  ------------------
  969|       |
  970|       |    // check compound restriction and onlyupcase
  971|  17.3M|    if (he && he->astr &&
  ------------------
  |  Branch (971:9): [True: 0, False: 17.3M]
  |  Branch (971:9): [True: 0, False: 17.3M]
  |  Branch (971:15): [True: 0, False: 0]
  ------------------
  972|      0|        ((pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (972:11): [True: 0, False: 0]
  ------------------
  973|      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]
  |  |  ------------------
  ------------------
  974|      0|         (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   85|      0|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (974:11): [True: 0, False: 0]
  |  Branch (974:19): [True: 0, False: 0]
  ------------------
  975|      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]
  |  |  ------------------
  ------------------
  976|      0|      he = nullptr;
  977|      0|    }
  978|       |
  979|  17.3M|    if (he) {
  ------------------
  |  Branch (979:9): [True: 0, False: 17.3M]
  ------------------
  980|      0|      if ((he->astr) && (pAMgr) &&
  ------------------
  |  Branch (980:11): [True: 0, False: 0]
  |  Branch (980:11): [True: 0, False: 0]
  |  Branch (980:25): [True: 0, False: 0]
  ------------------
  981|      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]
  |  |  ------------------
  ------------------
  982|      0|        if (info)
  ------------------
  |  Branch (982:13): [True: 0, False: 0]
  ------------------
  983|      0|          *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   82|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  984|      0|        return nullptr;
  985|      0|      }
  986|      0|      if (root) {
  ------------------
  |  Branch (986:11): [True: 0, False: 0]
  ------------------
  987|      0|        root->assign(he->word);
  988|      0|        if (complexprefixes) {
  ------------------
  |  Branch (988:13): [True: 0, False: 0]
  ------------------
  989|      0|          if (utf8)
  ------------------
  |  Branch (989:15): [True: 0, False: 0]
  ------------------
  990|      0|            reverseword_utf(*root);
  991|      0|          else
  992|      0|            reverseword(*root);
  993|      0|        }
  994|      0|      }
  995|       |      // try check compound word
  996|  17.3M|    } else if (pAMgr->get_compound()) {
  ------------------
  |  Branch (996:16): [True: 4.49M, False: 12.8M]
  ------------------
  997|  4.49M|      struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
  998|       |
  999|       |      // first allow only 2 words in the compound
 1000|  4.49M|      int setinfo = SPELL_COMPOUND_2;
  ------------------
  |  |   88|  4.49M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
 1001|  4.49M|      if (info)
  ------------------
  |  Branch (1001:11): [True: 4.49M, False: 0]
  ------------------
 1002|  4.49M|        setinfo |= *info;
 1003|  4.49M|      if (TraceCtx* t = trace_on(scratch.trace))
  ------------------
  |  Branch (1003:21): [True: 0, False: 4.49M]
  ------------------
 1004|      0|        trace(*t, "compound words=2");
 1005|  4.49M|      {
 1006|  4.49M|        TraceScope compound_depth(trace_on(scratch.trace));
 1007|  4.49M|        he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, &setinfo, scratch);
 1008|  4.49M|      }
 1009|  4.49M|      if (info)
  ------------------
  |  Branch (1009:11): [True: 4.49M, False: 0]
  ------------------
 1010|  4.49M|        *info = setinfo & ~SPELL_COMPOUND_2;
  ------------------
  |  |   88|  4.49M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
 1011|       |      // if not 2-word compoud word, try with 3 or more words
 1012|       |      // (only if original info didn't forbid it)
 1013|  4.49M|      if (!he && info && !(*info & SPELL_COMPOUND_2)) {
  ------------------
  |  |   88|  4.49M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (1013:11): [True: 4.49M, False: 0]
  |  Branch (1013:18): [True: 4.49M, False: 0]
  |  Branch (1013:26): [True: 4.49M, False: 0]
  ------------------
 1014|  4.49M|        *info &= ~SPELL_COMPOUND_2;
  ------------------
  |  |   88|  4.49M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
 1015|  4.49M|        if (TraceCtx* t = trace_on(scratch.trace))
  ------------------
  |  Branch (1015:23): [True: 0, False: 4.49M]
  ------------------
 1016|      0|          trace(*t, "compound words=3+");
 1017|  4.49M|        {
 1018|  4.49M|          TraceScope compound_depth(trace_on(scratch.trace));
 1019|  4.49M|          he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, info, scratch);
 1020|  4.49M|        }
 1021|       |        // accept the compound with 3 or more words only if it is
 1022|       |        // - not a dictionary word with a typo and
 1023|       |        // - not two words written separately,
 1024|       |        // - or if it's an arbitrary number accepted by compound rules (e.g. 999%)
 1025|  4.49M|        if (he && !isdigit(word[0]))
  ------------------
  |  Branch (1025:13): [True: 0, False: 4.49M]
  |  Branch (1025:19): [True: 0, False: 0]
  ------------------
 1026|      0|        {
 1027|      0|          std::vector<std::string> slst;
 1028|      0|          bool simple;
 1029|      0|          {
 1030|       |            // the suggester runs its whole search here, so report what it
 1031|       |            // decided rather than every candidate it tried
 1032|      0|            TraceSuppress no_trace(scratch.trace);
 1033|      0|            simple = pSMgr->suggest(slst, word, nullptr, /*test_simplesug=*/true);
 1034|      0|          }
 1035|      0|          if (TraceCtx* t = trace_on(scratch.trace))
  ------------------
  |  Branch (1035:25): [True: 0, False: 0]
  ------------------
 1036|      0|            trace(*t, "test simplesug -> %s",
 1037|      0|                  simple ? "fail, a simpler form of this word exists"
  ------------------
  |  Branch (1037:19): [True: 0, False: 0]
  ------------------
 1038|      0|                         : "pass, no simpler form of this word exists");
 1039|      0|          if (simple)
  ------------------
  |  Branch (1039:15): [True: 0, False: 0]
  ------------------
 1040|      0|            he = nullptr;
 1041|      0|        }
 1042|  4.49M|      }
 1043|       |
 1044|       |      // LANG_hu section: `moving rule' with last dash
 1045|  4.49M|      if ((!he) && (langnum == LANG_hu) && (word[len - 1] == '-')) {
  ------------------
  |  Branch (1045:11): [True: 4.49M, False: 0]
  |  Branch (1045:20): [True: 33.8k, False: 4.46M]
  |  Branch (1045:44): [True: 13.8k, False: 20.0k]
  ------------------
 1046|  13.8k|        std::string dup(word, 0, len - 1);
 1047|  13.8k|        he = pAMgr->compound_check(dup, -5, 0, 100, 0, nullptr, (hentry**)&rwords, 1, 0, info, scratch);
 1048|  13.8k|      }
 1049|       |      // end of LANG specific region
 1050|  4.49M|      if (he) {
  ------------------
  |  Branch (1050:11): [True: 0, False: 4.49M]
  ------------------
 1051|      0|        if (root) {
  ------------------
  |  Branch (1051:13): [True: 0, False: 0]
  ------------------
 1052|      0|          root->assign(he->word);
 1053|      0|          if (complexprefixes) {
  ------------------
  |  Branch (1053:15): [True: 0, False: 0]
  ------------------
 1054|      0|            if (utf8)
  ------------------
  |  Branch (1054:17): [True: 0, False: 0]
  ------------------
 1055|      0|              reverseword_utf(*root);
 1056|      0|            else
 1057|      0|              reverseword(*root);
 1058|      0|          }
 1059|      0|        }
 1060|      0|        if (info)
  ------------------
  |  Branch (1060:13): [True: 0, False: 0]
  ------------------
 1061|      0|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
 1062|      0|      }
 1063|  4.49M|    }
 1064|  17.3M|  }
 1065|       |
 1066|  17.3M|  return he;
 1067|  17.3M|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEENS0_6chrono10time_pointINSD_12steady_clockENSD_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1075|  92.9k|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) {
 1076|       |
 1077|  92.9k|  if (suggest_candidate_stack.size() > MAX_CANDIDATE_STACK_DEPTH || // apply a fairly arbitrary depth limit
  ------------------
  |  | 1070|   185k|#define MAX_CANDIDATE_STACK_DEPTH 512
  ------------------
  |  Branch (1077:7): [True: 0, False: 92.9k]
  |  Branch (1077:7): [True: 0, False: 92.9k]
  ------------------
 1078|       |      // something very broken if suggest ends up calling itself with the same word
 1079|  92.9k|      std::find(suggest_candidate_stack.begin(), suggest_candidate_stack.end(), word) != suggest_candidate_stack.end()) {
  ------------------
  |  Branch (1079:7): [True: 0, False: 92.9k]
  ------------------
 1080|      0|    return { };
 1081|      0|  }
 1082|       |
 1083|  92.9k|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  92.9k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1083:7): [True: 0, False: 92.9k]
  ------------------
 1084|      0|    return { };
 1085|       |
 1086|  92.9k|  bool capwords;
 1087|  92.9k|  size_t abbv;
 1088|  92.9k|  int captype;
 1089|  92.9k|  std::vector<std::string> spell_candidate_stack;
 1090|  92.9k|  suggest_candidate_stack.push_back(word);
 1091|  92.9k|  std::vector<std::string> slst = suggest_internal(word, spell_candidate_stack, suggest_candidate_stack,
 1092|  92.9k|                                                   capwords, abbv, captype, suggest_start);
 1093|  92.9k|  suggest_candidate_stack.pop_back();
 1094|       |  // word reversing wrapper for complex prefixes
 1095|  92.9k|  if (complexprefixes) {
  ------------------
  |  Branch (1095:7): [True: 4.76k, False: 88.1k]
  ------------------
 1096|  4.76k|    for (auto& j : slst) {
  ------------------
  |  Branch (1096:18): [True: 2.37k, False: 4.76k]
  ------------------
 1097|  2.37k|      if (utf8)
  ------------------
  |  Branch (1097:11): [True: 0, False: 2.37k]
  ------------------
 1098|      0|        reverseword_utf(j);
 1099|  2.37k|      else
 1100|  2.37k|        reverseword(j);
 1101|  2.37k|    }
 1102|  4.76k|  }
 1103|       |
 1104|       |  // capitalize
 1105|  92.9k|  if (capwords) {
  ------------------
  |  Branch (1105:7): [True: 24.1k, False: 68.7k]
  ------------------
 1106|  24.1k|    for (auto& j : slst) {
  ------------------
  |  Branch (1106:18): [True: 16.7k, False: 24.1k]
  ------------------
 1107|  16.7k|      std::string capitalized(j);
 1108|  16.7k|      mkinitcap(capitalized);
 1109|  16.7k|      if (capitalized == word)
  ------------------
  |  Branch (1109:11): [True: 0, False: 16.7k]
  ------------------
 1110|      0|        continue;  // capitalizing would just reproduce the misspelled word
 1111|  16.7k|      j = std::move(capitalized);
 1112|  16.7k|    }
 1113|  24.1k|  }
 1114|       |
 1115|       |  // expand suggestions with dot(s)
 1116|  92.9k|  if (abbv && pAMgr && pAMgr->get_sugswithdots() && word.size() >= abbv) {
  ------------------
  |  Branch (1116:7): [True: 3.51k, False: 89.4k]
  |  Branch (1116:15): [True: 3.51k, False: 0]
  |  Branch (1116:24): [True: 0, False: 3.51k]
  |  Branch (1116:53): [True: 0, False: 0]
  ------------------
 1117|      0|    for (auto& j : slst) {
  ------------------
  |  Branch (1117:18): [True: 0, False: 0]
  ------------------
 1118|      0|      j.append(word.substr(word.size() - abbv));
 1119|      0|    }
 1120|      0|  }
 1121|       |
 1122|       |  // remove bad capitalized and forbidden forms
 1123|  92.9k|  if (pAMgr && (pAMgr->get_keepcase() || pAMgr->get_forbiddenword())) {
  ------------------
  |  Branch (1123:7): [True: 92.9k, False: 0]
  |  Branch (1123:17): [True: 4.80k, False: 88.1k]
  |  Branch (1123:42): [True: 88.1k, False: 0]
  ------------------
 1124|  92.9k|    switch (captype) {
  ------------------
  |  Branch (1124:13): [True: 48.9k, False: 43.9k]
  ------------------
 1125|  10.1k|      case INITCAP:
  ------------------
  |  |   93|  10.1k|#define INITCAP 1
  ------------------
  |  Branch (1125:7): [True: 10.1k, False: 82.8k]
  ------------------
 1126|  19.6k|      case ALLCAP:
  ------------------
  |  |   94|  19.6k|#define ALLCAP 2
  ------------------
  |  Branch (1126:7): [True: 9.56k, False: 83.3k]
  ------------------
 1127|  34.9k|      case HUHCAP:
  ------------------
  |  |   95|  34.9k|#define HUHCAP 3
  ------------------
  |  Branch (1127:7): [True: 15.2k, False: 77.6k]
  ------------------
 1128|  48.9k|      case HUHINITCAP: {
  ------------------
  |  |   96|  48.9k|#define HUHINITCAP 4
  ------------------
  |  Branch (1128:7): [True: 14.0k, False: 78.8k]
  ------------------
 1129|  48.9k|        size_t l = 0;
 1130|  82.5k|        for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1130:28): [True: 33.5k, False: 48.9k]
  ------------------
 1131|       |          // A space-containing suggestion can be an "insert a space" split
 1132|       |          // whose parts each spell on their own, so it is good when every
 1133|       |          // part spells even though the whole string does not.
 1134|  33.5k|          bool bad = !spell(slst[j], spell_candidate_stack, nullptr, nullptr, suggest_start);
 1135|  33.5k|          if (bad && slst[j].find(' ') != std::string::npos) {
  ------------------
  |  Branch (1135:15): [True: 17.6k, False: 15.8k]
  |  Branch (1135:22): [True: 8.61k, False: 9.04k]
  ------------------
 1136|  8.61k|            bad = false;
 1137|  16.9k|            for (size_t start = 0; start <= slst[j].size(); ) {
  ------------------
  |  Branch (1137:36): [True: 16.9k, False: 0]
  ------------------
 1138|  16.9k|              size_t sp = slst[j].find(' ', start);
 1139|  16.9k|              size_t end = (sp == std::string::npos) ? slst[j].size() : sp;
  ------------------
  |  Branch (1139:28): [True: 2.02k, False: 14.9k]
  ------------------
 1140|  16.9k|              std::string part = slst[j].substr(start, end - start);
 1141|  16.9k|              if (!part.empty() &&
  ------------------
  |  Branch (1141:19): [True: 11.4k, False: 5.56k]
  ------------------
 1142|  11.4k|                  !spell(part, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1142:19): [True: 7.70k, False: 3.71k]
  ------------------
 1143|  7.70k|                bad = true;
 1144|  7.70k|                break;
 1145|  7.70k|              }
 1146|  9.28k|              if (sp == std::string::npos)
  ------------------
  |  Branch (1146:19): [True: 912, False: 8.37k]
  ------------------
 1147|    912|                break;
 1148|  8.37k|              start = sp + 1;
 1149|  8.37k|            }
 1150|  8.61k|          }
 1151|  33.5k|          if (bad) {
  ------------------
  |  Branch (1151:15): [True: 16.7k, False: 16.7k]
  ------------------
 1152|  16.7k|            std::string s;
 1153|  16.7k|            std::vector<w_char> w;
 1154|  16.7k|            if (utf8) {
  ------------------
  |  Branch (1154:17): [True: 6.67k, False: 10.0k]
  ------------------
 1155|  6.67k|              u8_u16(w, slst[j]);
 1156|  10.0k|            } else {
 1157|  10.0k|              s = slst[j];
 1158|  10.0k|            }
 1159|  16.7k|            mkallsmall2(s, w);
 1160|  16.7k|            if (spell(s, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1160:17): [True: 54, False: 16.6k]
  ------------------
 1161|     54|              slst[l] = std::move(s);
 1162|     54|              ++l;
 1163|  16.6k|            } else {
 1164|  16.6k|              mkinitcap2(s, w);
 1165|  16.6k|              if (spell(s, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1165:19): [True: 51, False: 16.6k]
  ------------------
 1166|     51|                slst[l] = std::move(s);
 1167|     51|                ++l;
 1168|     51|              }
 1169|  16.6k|            }
 1170|  16.7k|          } else {
 1171|  16.7k|            slst[l] = slst[j];
 1172|  16.7k|            ++l;
 1173|  16.7k|          }
 1174|  33.5k|        }
 1175|  48.9k|        slst.resize(l);
 1176|  48.9k|      }
 1177|  92.9k|    }
 1178|  92.9k|  }
 1179|       |
 1180|       |  // remove duplications
 1181|  92.9k|  size_t l = 0;
 1182|   112k|  for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1182:22): [True: 19.2k, False: 92.9k]
  ------------------
 1183|  19.2k|    slst[l] = slst[j];
 1184|  29.0k|    for (size_t k = 0; k < l; ++k) {
  ------------------
  |  Branch (1184:24): [True: 10.7k, False: 18.3k]
  ------------------
 1185|  10.7k|      if (slst[k] == slst[j]) {
  ------------------
  |  Branch (1185:11): [True: 866, False: 9.87k]
  ------------------
 1186|    866|        --l;
 1187|    866|        break;
 1188|    866|      }
 1189|  10.7k|    }
 1190|  19.2k|    ++l;
 1191|  19.2k|  }
 1192|  92.9k|  slst.resize(l);
 1193|       |
 1194|       |  // output conversion
 1195|  92.9k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1195:17): [True: 92.9k, False: 0]
  ------------------
 1196|  92.9k|  if (rl) {
  ------------------
  |  Branch (1196:7): [True: 5.04k, False: 87.9k]
  ------------------
 1197|       |    // hold the converted suggestions to the same ceiling as an analysis
 1198|  5.04k|    size_t total = 0;
 1199|  5.04k|    size_t l = 0;
 1200|  5.83k|    for (size_t i = 0; i < slst.size(); ++i) {
  ------------------
  |  Branch (1200:24): [True: 792, False: 5.04k]
  ------------------
 1201|    792|      std::string wspace;
 1202|    792|      if (rl->conv(slst[i], wspace, MAXMORPHRESULT - total)) {
  ------------------
  |  |  114|    792|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1202:11): [True: 233, False: 559]
  ------------------
 1203|    233|        slst[i] = std::move(wspace);
 1204|    233|      }
 1205|    792|      if (slst[i].size() > MAXMORPHRESULT - total)
  ------------------
  |  |  114|    792|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1205:11): [True: 0, False: 792]
  ------------------
 1206|      0|        break;
 1207|    792|      total += slst[i].size();
 1208|       |      // gh#1002: OCONV can map a generated form back to the input word
 1209|       |      // (e.g. "románórum" -> "romanórum" when the user typed "romanórum"),
 1210|       |      // leaving the misspelled word as its own suggestion.
 1211|    792|      if (slst[i] == word)
  ------------------
  |  Branch (1211:11): [True: 0, False: 792]
  ------------------
 1212|      0|        continue;
 1213|    792|      if (l != i)
  ------------------
  |  Branch (1213:11): [True: 0, False: 792]
  ------------------
 1214|      0|        slst[l] = std::move(slst[i]);
 1215|    792|      ++l;
 1216|    792|    }
 1217|  5.04k|    slst.resize(l);
 1218|  5.04k|  }
 1219|  92.9k|  return slst;
 1220|  92.9k|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1222|  64.9k|std::vector<std::string> HunspellImpl::suggest(const std::string& word) {
 1223|  64.9k|  std::vector<std::string> suggest_candidate_stack;
 1224|  64.9k|  auto suggest_start = std::chrono::steady_clock::now();
 1225|  64.9k|  return suggest(word, suggest_candidate_stack, suggest_start);
 1226|  64.9k|}
_ZN12HunspellImpl16suggest_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEESC_RbRmRiNS0_6chrono10time_pointINSG_12steady_clockENSG_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1232|  92.9k|        std::chrono::steady_clock::time_point suggest_start) {
 1233|       |  // The candidates tried here are the tool's own guesses, not the word the
 1234|       |  // user asked about.
 1235|  92.9k|  TraceSuppress no_trace(m_trace.get());
 1236|       |
 1237|  92.9k|  captype = NOCAP;
  ------------------
  |  |   92|  92.9k|#define NOCAP 0
  ------------------
 1238|  92.9k|  abbv = 0;
 1239|  92.9k|  capwords = false;
 1240|       |
 1241|  92.9k|  std::vector<std::string> slst;
 1242|       |
 1243|  92.9k|  int onlycmpdsug = 0;
 1244|  92.9k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1244:7): [True: 0, False: 92.9k]
  |  Branch (1244:17): [True: 0, False: 92.9k]
  ------------------
 1245|      0|    return slst;
 1246|       |
 1247|       |  // process XML input of the simplified API (see manual)
 1248|  92.9k|  if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  92.9k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  92.9k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  92.9k|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (1248:7): [True: 23.4k, False: 69.4k]
  ------------------
 1249|  23.4k|    if (word.size() > MAXSPELLMLLEN)
  ------------------
  |  |   88|  23.4k|#define MAXSPELLMLLEN 8192
  ------------------
  |  Branch (1249:9): [True: 456, False: 23.0k]
  ------------------
 1250|    456|      return slst;
 1251|  23.0k|    return spellml(word);
 1252|  23.4k|  }
 1253|  69.4k|  if (utf8) {
  ------------------
  |  Branch (1253:7): [True: 33.8k, False: 35.5k]
  ------------------
 1254|  33.8k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   87|  33.8k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  33.8k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1254:9): [True: 108, False: 33.7k]
  ------------------
 1255|    108|      return slst;
 1256|  35.5k|  } else {
 1257|  35.5k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  35.5k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1257:9): [True: 140, False: 35.4k]
  ------------------
 1258|    140|      return slst;
 1259|  35.5k|  }
 1260|  69.2k|  size_t wl = 0;
 1261|       |
 1262|  69.2k|  std::string scw;
 1263|  69.2k|  std::vector<w_char> sunicw;
 1264|       |
 1265|       |  // input conversion
 1266|  69.2k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1266:17): [True: 69.2k, False: 0]
  ------------------
 1267|  69.2k|  {
 1268|  69.2k|    std::string wspace;
 1269|       |
 1270|  69.2k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1270:23): [True: 3.79k, False: 65.4k]
  ------------------
 1271|  69.2k|    if (convstatus) {
  ------------------
  |  Branch (1271:9): [True: 0, False: 69.2k]
  ------------------
 1272|       |      // the input conversion can grow the word without limit, so hold the
 1273|       |      // converted word to the same maximum length as the raw word
 1274|      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 (1274:11): [True: 0, False: 0]
  |  Branch (1274:11): [True: 0, False: 0]
  ------------------
 1275|      0|        return slst;
 1276|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1277|      0|    } else
 1278|  69.2k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1279|       |
 1280|  69.2k|    if (wl == 0)
  ------------------
  |  Branch (1280:9): [True: 0, False: 69.2k]
  ------------------
 1281|      0|      return slst;
 1282|       |
 1283|  69.2k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1284|  69.2k|    if (wl > 32768)
  ------------------
  |  Branch (1284:9): [True: 0, False: 69.2k]
  ------------------
 1285|      0|      return slst;
 1286|  69.2k|#endif
 1287|  69.2k|  }
 1288|       |
 1289|  69.2k|  bool good = false;
 1290|       |
 1291|       |  // check capitalized form for FORCEUCASE
 1292|  69.2k|  if (pAMgr && captype == NOCAP && pAMgr->get_forceucase()) {
  ------------------
  |  |   92|   138k|#define NOCAP 0
  ------------------
  |  Branch (1292:7): [True: 69.2k, False: 0]
  |  Branch (1292:16): [True: 20.2k, False: 48.9k]
  |  Branch (1292:36): [True: 0, False: 20.2k]
  ------------------
 1293|      0|    int info = SPELL_ORIGCAP;
  ------------------
  |  |   86|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
 1294|      0|    if (checkword(scw, &info, nullptr, suggest_start)) {
  ------------------
  |  Branch (1294:9): [True: 0, False: 0]
  ------------------
 1295|      0|      std::string form(std::move(scw));
 1296|      0|      mkinitcap(form);
 1297|      0|      slst.push_back(std::move(form));
 1298|      0|      return slst;
 1299|      0|    }
 1300|      0|  }
 1301|       |
 1302|  69.2k|  switch (captype) {
  ------------------
  |  Branch (1302:11): [True: 69.2k, False: 0]
  ------------------
 1303|  20.2k|    case NOCAP: {
  ------------------
  |  |   92|  20.2k|#define NOCAP 0
  ------------------
  |  Branch (1303:5): [True: 20.2k, False: 48.9k]
  ------------------
 1304|  20.2k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1305|  20.2k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  20.2k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1305:11): [True: 0, False: 20.2k]
  ------------------
 1306|      0|          return slst;
 1307|  20.2k|      if (abbv) {
  ------------------
  |  Branch (1307:11): [True: 1.66k, False: 18.5k]
  ------------------
 1308|  1.66k|        std::string wspace(scw);
 1309|  1.66k|        wspace.push_back('.');
 1310|  1.66k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1311|  1.66k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  1.66k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1311:13): [True: 0, False: 1.66k]
  ------------------
 1312|      0|            return slst;
 1313|  1.66k|      }
 1314|  20.2k|      break;
 1315|  20.2k|    }
 1316|       |
 1317|  20.2k|    case INITCAP: {
  ------------------
  |  |   93|  10.1k|#define INITCAP 1
  ------------------
  |  Branch (1317:5): [True: 10.1k, False: 59.1k]
  ------------------
 1318|  10.1k|      capwords = true;
 1319|  10.1k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1320|  10.1k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  10.1k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1320:11): [True: 0, False: 10.1k]
  ------------------
 1321|      0|          return slst;
 1322|  10.1k|      std::string wspace(scw);
 1323|  10.1k|      mkallsmall2(wspace, sunicw);
 1324|  10.1k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1325|  10.1k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  10.1k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1325:11): [True: 0, False: 10.1k]
  ------------------
 1326|      0|          return slst;
 1327|  10.1k|      break;
 1328|  10.1k|    }
 1329|  14.0k|    case HUHINITCAP:
  ------------------
  |  |   96|  14.0k|#define HUHINITCAP 4
  ------------------
  |  Branch (1329:5): [True: 14.0k, False: 55.1k]
  ------------------
 1330|  14.0k|      capwords = true;
 1331|       |      /* FALLTHROUGH */
 1332|  29.3k|    case HUHCAP: {
  ------------------
  |  |   95|  29.3k|#define HUHCAP 3
  ------------------
  |  Branch (1332:5): [True: 15.2k, False: 53.9k]
  ------------------
 1333|  29.3k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1334|  29.3k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  29.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1334:11): [True: 0, False: 29.3k]
  ------------------
 1335|      0|          return slst;
 1336|       |      // something.The -> something. The
 1337|  29.3k|      size_t dot_pos = scw.find('.');
 1338|  29.3k|      if (dot_pos != std::string::npos) {
  ------------------
  |  Branch (1338:11): [True: 10.6k, False: 18.7k]
  ------------------
 1339|  10.6k|        std::string postdot = scw.substr(dot_pos + 1);
 1340|  10.6k|        int captype_;
 1341|  10.6k|        if (utf8) {
  ------------------
  |  Branch (1341:13): [True: 2.89k, False: 7.72k]
  ------------------
 1342|  2.89k|          std::vector<w_char> postdotu;
 1343|  2.89k|          u8_u16(postdotu, postdot);
 1344|  2.89k|          captype_ = get_captype_utf8(postdotu, langnum);
 1345|  7.72k|        } else {
 1346|  7.72k|          captype_ = get_captype(postdot, csconv);
 1347|  7.72k|        }
 1348|  10.6k|        if (captype_ == INITCAP) {
  ------------------
  |  |   93|  10.6k|#define INITCAP 1
  ------------------
  |  Branch (1348:13): [True: 5.94k, False: 4.68k]
  ------------------
 1349|  5.94k|          std::string str(scw);
 1350|  5.94k|          str.insert(dot_pos + 1, 1, ' ');
 1351|  5.94k|          insert_sug(slst, str);
 1352|  5.94k|        }
 1353|  10.6k|      }
 1354|       |
 1355|  29.3k|      std::string wspace;
 1356|       |
 1357|  29.3k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   96|  29.3k|#define HUHINITCAP 4
  ------------------
  |  Branch (1357:11): [True: 14.0k, False: 15.2k]
  ------------------
 1358|       |        // TheOpenOffice.org -> The OpenOffice.org
 1359|  14.0k|        wspace = scw;
 1360|  14.0k|        mkinitsmall2(wspace, sunicw);
 1361|  14.0k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1362|  14.0k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  14.0k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1362:13): [True: 0, False: 14.0k]
  ------------------
 1363|      0|            return slst;
 1364|  14.0k|      }
 1365|  29.3k|      wspace = scw;
 1366|  29.3k|      mkallsmall2(wspace, sunicw);
 1367|  29.3k|      if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1367:11): [True: 1.28k, False: 28.0k]
  ------------------
 1368|  1.28k|        insert_sug(slst, wspace);
 1369|  29.3k|      size_t prevns = slst.size();
 1370|  29.3k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1371|  29.3k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  29.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1371:11): [True: 1, False: 29.3k]
  ------------------
 1372|      1|          return slst;
 1373|  29.3k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   96|  29.3k|#define HUHINITCAP 4
  ------------------
  |  Branch (1373:11): [True: 14.0k, False: 15.2k]
  ------------------
 1374|  14.0k|        mkinitcap2(wspace, sunicw);
 1375|  14.0k|        if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1375:13): [True: 513, False: 13.5k]
  ------------------
 1376|    513|          insert_sug(slst, wspace);
 1377|  14.0k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1378|  14.0k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  14.0k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1378:13): [True: 0, False: 14.0k]
  ------------------
 1379|      0|            return slst;
 1380|  14.0k|      }
 1381|       |      // aNew -> "a New" (instead of "a new")
 1382|  30.1k|      for (size_t j = prevns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1382:31): [True: 774, False: 29.3k]
  ------------------
 1383|    774|        const char* space = strchr(slst[j].c_str(), ' ');
 1384|    774|        if (space) {
  ------------------
  |  Branch (1384:13): [True: 420, False: 354]
  ------------------
 1385|    420|          size_t slen = strlen(space + 1);
 1386|       |          // different case after space (need capitalisation)
 1387|    420|          if ((slen < wl) && strcmp(scw.c_str() + wl - slen, space + 1) != 0) {
  ------------------
  |  Branch (1387:15): [True: 420, False: 0]
  |  Branch (1387:30): [True: 420, False: 0]
  ------------------
 1388|    420|            std::string first(slst[j].c_str(), space + 1);
 1389|    420|            std::string second(space + 1);
 1390|    420|            std::vector<w_char> w;
 1391|    420|            if (utf8)
  ------------------
  |  Branch (1391:17): [True: 133, False: 287]
  ------------------
 1392|    133|              u8_u16(w, second);
 1393|    420|            mkinitcap2(second, w);
 1394|       |            // set as first suggestion
 1395|    420|            slst.erase(slst.begin() + j);
 1396|    420|            slst.insert(slst.begin(), first + second);
 1397|    420|          }
 1398|    420|        }
 1399|    774|      }
 1400|  29.3k|      break;
 1401|  29.3k|    }
 1402|       |
 1403|  9.56k|    case ALLCAP: {
  ------------------
  |  |   94|  9.56k|#define ALLCAP 2
  ------------------
  |  Branch (1403:5): [True: 9.56k, False: 59.6k]
  ------------------
 1404|  9.56k|      std::string wspace(scw);
 1405|  9.56k|      mkallsmall2(wspace, sunicw);
 1406|  9.56k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1407|  9.56k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  9.56k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1407:11): [True: 0, False: 9.56k]
  ------------------
 1408|      0|          return slst;
 1409|  9.56k|      if (pAMgr && pAMgr->get_keepcase() && spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1409:11): [True: 9.56k, False: 0]
  |  Branch (1409:20): [True: 394, False: 9.16k]
  |  Branch (1409:45): [True: 0, False: 394]
  ------------------
 1410|      0|        insert_sug(slst, wspace);
 1411|  9.56k|      mkinitcap2(wspace, sunicw);
 1412|  9.56k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1413|  9.56k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  9.56k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1413:11): [True: 0, False: 9.56k]
  ------------------
 1414|      0|          return slst;
 1415|  9.56k|      for (auto& j : slst) {
  ------------------
  |  Branch (1415:20): [True: 465, False: 9.56k]
  ------------------
 1416|    465|        mkallcap(j);
 1417|    465|        if (pAMgr && pAMgr->get_checksharps()) {
  ------------------
  |  Branch (1417:13): [True: 465, False: 0]
  |  Branch (1417:22): [True: 0, False: 465]
  ------------------
 1418|      0|          if (utf8) {
  ------------------
  |  Branch (1418:15): [True: 0, False: 0]
  ------------------
 1419|      0|            mystrrep(j, "\xC3\x9F", "SS");
 1420|      0|          } else {
 1421|      0|            mystrrep(j, "\xDF", "SS");
 1422|      0|          }
 1423|      0|        }
 1424|    465|      }
 1425|  9.56k|      break;
 1426|  9.56k|    }
 1427|  69.2k|  }
 1428|       |
 1429|       |  // LANG_hu section: replace '-' with ' ' in Hungarian
 1430|  69.2k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1430:7): [True: 3.85k, False: 65.3k]
  ------------------
 1431|  3.85k|    for (auto& j : slst) {
  ------------------
  |  Branch (1431:18): [True: 373, False: 3.85k]
  ------------------
 1432|    373|      size_t pos = j.find('-');
 1433|    373|      if (pos != std::string::npos) {
  ------------------
  |  Branch (1433:11): [True: 148, False: 225]
  ------------------
 1434|    148|        int info = 0;
 1435|    148|        std::string w(j.substr(0, pos));
 1436|    148|        w.append(j.substr(pos + 1));
 1437|    148|        (void)spell(w, spell_candidate_stack, &info, nullptr, suggest_start);
 1438|    148|        if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   81|    148|#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 (1438:13): [True: 0, False: 148]
  |  Branch (1438:40): [True: 0, False: 0]
  ------------------
 1439|      0|          j[pos] = ' ';
 1440|      0|        } else
 1441|    148|          j[pos] = '-';
 1442|    148|      }
 1443|    373|    }
 1444|  3.85k|  }
 1445|       |  // END OF LANG_hu section
 1446|       |  // try ngram approach since found nothing good suggestion
 1447|  69.2k|  if (!good && pAMgr && (slst.empty() || onlycmpdsug) && (pAMgr->get_maxngramsugs() != 0)) {
  ------------------
  |  Branch (1447:7): [True: 69.1k, False: 59]
  |  Branch (1447:16): [True: 69.1k, False: 0]
  |  Branch (1447:26): [True: 59.3k, False: 9.83k]
  |  Branch (1447:42): [True: 9.68k, False: 147]
  |  Branch (1447:58): [True: 61.4k, False: 7.58k]
  ------------------
 1448|  61.4k|    switch (captype) {
  ------------------
  |  Branch (1448:13): [True: 61.4k, False: 0]
  ------------------
 1449|  17.2k|      case NOCAP: {
  ------------------
  |  |   92|  17.2k|#define NOCAP 0
  ------------------
  |  Branch (1449:7): [True: 17.2k, False: 44.1k]
  ------------------
 1450|  17.2k|        pSMgr->ngsuggest(slst, scw.c_str(), m_HMgrs, NOCAP);
  ------------------
  |  |   92|  17.2k|#define NOCAP 0
  ------------------
 1451|  17.2k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  17.2k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1451:13): [True: 0, False: 17.2k]
  ------------------
 1452|      0|            return slst;
 1453|  17.2k|        break;
 1454|  17.2k|      }
 1455|       |      /* FALLTHROUGH */
 1456|  17.2k|      case HUHINITCAP:
  ------------------
  |  |   96|  13.2k|#define HUHINITCAP 4
  ------------------
  |  Branch (1456:7): [True: 13.2k, False: 48.1k]
  ------------------
 1457|  13.2k|        capwords = true;
 1458|       |      /* FALLTHROUGH */
 1459|  27.2k|      case HUHCAP: {
  ------------------
  |  |   95|  27.2k|#define HUHCAP 3
  ------------------
  |  Branch (1459:7): [True: 14.0k, False: 47.3k]
  ------------------
 1460|  27.2k|        std::string wspace(scw);
 1461|  27.2k|        mkallsmall2(wspace, sunicw);
 1462|  27.2k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, HUHCAP);
  ------------------
  |  |   95|  27.2k|#define HUHCAP 3
  ------------------
 1463|  27.2k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  27.2k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1463:13): [True: 0, False: 27.2k]
  ------------------
 1464|      0|            return slst;
 1465|  27.2k|        break;
 1466|  27.2k|      }
 1467|  27.2k|      case INITCAP: {
  ------------------
  |  |   93|  8.56k|#define INITCAP 1
  ------------------
  |  Branch (1467:7): [True: 8.56k, False: 52.8k]
  ------------------
 1468|  8.56k|        capwords = true;
 1469|  8.56k|        std::string wspace(scw);
 1470|  8.56k|        mkallsmall2(wspace, sunicw);
 1471|  8.56k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, INITCAP);
  ------------------
  |  |   93|  8.56k|#define INITCAP 1
  ------------------
 1472|  8.56k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  8.56k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1472:13): [True: 0, False: 8.56k]
  ------------------
 1473|      0|            return slst;
 1474|  8.56k|        break;
 1475|  8.56k|      }
 1476|  8.56k|      case ALLCAP: {
  ------------------
  |  |   94|  8.30k|#define ALLCAP 2
  ------------------
  |  Branch (1476:7): [True: 8.30k, False: 53.1k]
  ------------------
 1477|  8.30k|        std::string wspace(scw);
 1478|  8.30k|        mkallsmall2(wspace, sunicw);
 1479|  8.30k|        size_t oldns = slst.size();
 1480|  8.30k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, ALLCAP);
  ------------------
  |  |   94|  8.30k|#define ALLCAP 2
  ------------------
 1481|  8.30k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  8.30k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1481:13): [True: 0, False: 8.30k]
  ------------------
 1482|      0|            return slst;
 1483|  10.6k|        for (size_t j = oldns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1483:32): [True: 2.33k, False: 8.30k]
  ------------------
 1484|  2.33k|          mkallcap(slst[j]);
 1485|  2.33k|        }
 1486|  8.30k|        break;
 1487|  8.30k|      }
 1488|  61.4k|    }
 1489|  61.4k|  }
 1490|       |
 1491|       |  // try dash suggestion (Afo-American -> Afro-American)
 1492|       |  // Note: LibreOffice was modified to treat dashes as word
 1493|       |  // characters to check "scot-free" etc. word forms, but
 1494|       |  // we need to handle suggestions for "Afo-American", etc.,
 1495|       |  // while "Afro-American" is missing from the dictionary.
 1496|       |  // TODO avoid possible overgeneration
 1497|  69.2k|  size_t dash_pos = scw.find('-');
 1498|  69.2k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1498:7): [True: 34.7k, False: 34.4k]
  ------------------
 1499|  34.7k|    int nodashsug = 1;
 1500|  45.1k|    for (size_t j = 0; j < slst.size() && nodashsug == 1; ++j) {
  ------------------
  |  Branch (1500:24): [True: 11.0k, False: 34.1k]
  |  Branch (1500:43): [True: 10.3k, False: 668]
  ------------------
 1501|  10.3k|      if (slst[j].find('-') != std::string::npos)
  ------------------
  |  Branch (1501:11): [True: 6.16k, False: 4.17k]
  ------------------
 1502|  6.16k|        nodashsug = 0;
 1503|  10.3k|    }
 1504|       |
 1505|  34.7k|    size_t prev_pos = 0;
 1506|  34.7k|    bool last = false;
 1507|       |
 1508|   104k|    while (!good && nodashsug && !last) {
  ------------------
  |  Branch (1508:12): [True: 104k, False: 27]
  |  Branch (1508:21): [True: 69.9k, False: 34.1k]
  |  Branch (1508:34): [True: 69.3k, False: 650]
  ------------------
 1509|  69.3k|      if (dash_pos == scw.size())
  ------------------
  |  Branch (1509:11): [True: 5.09k, False: 64.2k]
  ------------------
 1510|  5.09k|        last = true;
 1511|  69.3k|      std::string chunk = scw.substr(prev_pos, dash_pos - prev_pos);
 1512|  69.3k|      if (chunk != word && !spell(chunk, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1512:11): [True: 69.3k, False: 0]
  |  Branch (1512:28): [True: 27.9k, False: 41.3k]
  ------------------
 1513|  27.9k|        std::vector<std::string> nlst = suggest(chunk, suggest_candidate_stack, suggest_start);
 1514|  27.9k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  27.9k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1514:13): [True: 1, False: 27.9k]
  ------------------
 1515|      1|            return slst;
 1516|  38.1k|        for (auto j = nlst.rbegin(); j != nlst.rend(); ++j) {
  ------------------
  |  Branch (1516:38): [True: 10.1k, False: 27.9k]
  ------------------
 1517|  10.1k|          std::string wspace = scw.substr(0, prev_pos);
 1518|  10.1k|          wspace.append(*j);
 1519|  10.1k|          if (!last) {
  ------------------
  |  Branch (1519:15): [True: 8.64k, False: 1.54k]
  ------------------
 1520|  8.64k|            wspace.append("-");
 1521|  8.64k|            wspace.append(scw.substr(dash_pos + 1));
 1522|  8.64k|          }
 1523|  10.1k|          int info = 0;
 1524|  10.1k|          if (pAMgr && pAMgr->get_forbiddenword())
  ------------------
  |  Branch (1524:15): [True: 10.1k, False: 0]
  |  Branch (1524:24): [True: 10.1k, False: 0]
  ------------------
 1525|  10.1k|            checkword(wspace, &info, nullptr, suggest_start);
 1526|  10.1k|          if (!(info & SPELL_FORBIDDEN))
  ------------------
  |  |   82|  10.1k|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (1526:15): [True: 10.1k, False: 0]
  ------------------
 1527|  10.1k|            insert_sug(slst, wspace);
 1528|  10.1k|        }
 1529|  27.9k|        nodashsug = 0;
 1530|  27.9k|      }
 1531|  69.3k|      if (!last) {
  ------------------
  |  Branch (1531:11): [True: 64.2k, False: 5.09k]
  ------------------
 1532|  64.2k|        prev_pos = dash_pos + 1;
 1533|  64.2k|        dash_pos = scw.find('-', prev_pos);
 1534|  64.2k|      }
 1535|  69.3k|      if (dash_pos == std::string::npos)
  ------------------
  |  Branch (1535:11): [True: 12.7k, False: 56.5k]
  ------------------
 1536|  12.7k|        dash_pos = scw.size();
 1537|  69.3k|    }
 1538|  34.7k|  }
 1539|  69.2k|  return slst;
 1540|  69.2k|}
_ZN12HunspellImpl4stemERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
 1546|  1.00k|std::vector<std::string> HunspellImpl::stem(const std::vector<std::string>& desc) {
 1547|  1.00k|  std::vector<std::string> slst;
 1548|       |
 1549|  1.00k|  std::string result2;
 1550|  1.00k|  if (desc.empty())
  ------------------
  |  Branch (1550:7): [True: 935, False: 71]
  ------------------
 1551|    935|    return slst;
 1552|     71|  for (const auto& i : desc) {
  ------------------
  |  Branch (1552:22): [True: 71, False: 71]
  ------------------
 1553|     71|    if (result2.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|     71|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1553:9): [True: 0, False: 71]
  ------------------
 1554|      0|      break;
 1555|       |
 1556|     71|    std::string result;
 1557|       |
 1558|       |    // add compound word parts (except the last one)
 1559|     71|    std::string tok(i, append_compound_parts(i, result));
 1560|     71|    size_t alt = 0;
 1561|     71|    while ((alt = tok.find(" | ", alt)) != std::string::npos) {
  ------------------
  |  Branch (1561:12): [True: 0, False: 71]
  ------------------
 1562|      0|      tok[alt + 1] = MSEP_ALT;
  ------------------
  |  |  123|      0|#define MSEP_ALT '\v'
  ------------------
 1563|      0|    }
 1564|     71|    std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  123|     71|#define MSEP_ALT '\v'
  ------------------
 1565|     71|    for (auto& k : pl) {
  ------------------
  |  Branch (1565:18): [True: 71, False: 71]
  ------------------
 1566|     71|      if (result2.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|     71|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1566:11): [True: 0, False: 71]
  ------------------
 1567|      0|        break;
 1568|       |
 1569|       |      // add derivational suffixes
 1570|     71|      if (k.find(MORPH_DERI_SFX) != std::string::npos) {
  ------------------
  |  |  109|     71|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (1570:11): [True: 0, False: 71]
  ------------------
 1571|       |        // remove inflectional suffixes
 1572|      0|        const size_t is = k.find(MORPH_INFL_SFX);
  ------------------
  |  |  110|      0|#define MORPH_INFL_SFX "is:"
  ------------------
 1573|      0|        if (is != std::string::npos)
  ------------------
  |  Branch (1573:13): [True: 0, False: 0]
  ------------------
 1574|      0|          k.resize(is);
 1575|      0|        std::vector<std::string> singlepl;
 1576|      0|        singlepl.push_back(k);
 1577|      0|        std::string sg = pSMgr->suggest_gen(singlepl, k);
 1578|      0|        if (!sg.empty()) {
  ------------------
  |  Branch (1578:13): [True: 0, False: 0]
  ------------------
 1579|      0|          std::vector<std::string> gen = line_tok(sg, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1580|      0|          for (auto& j : gen) {
  ------------------
  |  Branch (1580:24): [True: 0, False: 0]
  ------------------
 1581|      0|            result2.push_back(MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1582|      0|            result2.append(result);
 1583|      0|            result2.append(j);
 1584|      0|          }
 1585|      0|        }
 1586|     71|      } else {
 1587|     71|        result2.push_back(MSEP_REC);
  ------------------
  |  |  122|     71|#define MSEP_REC '\n'
  ------------------
 1588|     71|        result2.append(result);
 1589|     71|        if (k.find(MORPH_SURF_PFX) != std::string::npos) {
  ------------------
  |  |  112|     71|#define MORPH_SURF_PFX "sp:"
  ------------------
  |  Branch (1589:13): [True: 0, False: 71]
  ------------------
 1590|      0|          std::string field;
 1591|      0|          copy_field(field, k, MORPH_SURF_PFX);
  ------------------
  |  |  112|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
 1592|      0|          result2.append(field);
 1593|      0|        }
 1594|     71|        std::string field;
 1595|     71|        copy_field(field, k, MORPH_STEM);
  ------------------
  |  |  103|     71|#define MORPH_STEM "st:"
  ------------------
 1596|     71|        result2.append(field);
 1597|     71|      }
 1598|     71|    }
 1599|     71|  }
 1600|     71|  slst = line_tok(result2, MSEP_REC);
  ------------------
  |  |  122|     71|#define MSEP_REC '\n'
  ------------------
 1601|     71|  uniqlist(slst);
 1602|     71|  return slst;
 1603|  1.00k|}
_ZN12HunspellImpl4stemERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1605|  1.00k|std::vector<std::string> HunspellImpl::stem(const std::string& word) {
 1606|  1.00k|  return stem(analyze(word));
 1607|  1.00k|}
_ZN12HunspellImpl9mkinitcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1617|  16.7k|void HunspellImpl::mkinitcap(std::string& u8) {
 1618|  16.7k|  if (utf8) {
  ------------------
  |  Branch (1618:7): [True: 4.84k, False: 11.9k]
  ------------------
 1619|  4.84k|    std::vector<w_char> u16;
 1620|  4.84k|    u8_u16(u16, u8);
 1621|  4.84k|    ::mkinitcap_utf(u16, langnum);
 1622|  4.84k|    u16_u8(u8, u16);
 1623|  11.9k|  } else {
 1624|  11.9k|    ::mkinitcap(u8, csconv);
 1625|  11.9k|  }
 1626|  16.7k|}
_ZN12HunspellImpl10mkinitcap2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1628|  1.98M|int HunspellImpl::mkinitcap2(std::string& u8, std::vector<w_char>& u16) {
 1629|  1.98M|  if (utf8) {
  ------------------
  |  Branch (1629:7): [True: 350k, False: 1.63M]
  ------------------
 1630|   350k|    ::mkinitcap_utf(u16, langnum);
 1631|   350k|    u16_u8(u8, u16);
 1632|  1.63M|  } else {
 1633|  1.63M|    ::mkinitcap(u8, csconv);
 1634|  1.63M|  }
 1635|  1.98M|  return u8.size();
 1636|  1.98M|}
_ZN12HunspellImpl12mkinitsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1638|   233k|int HunspellImpl::mkinitsmall2(std::string& u8, std::vector<w_char>& u16) {
 1639|   233k|  if (utf8) {
  ------------------
  |  Branch (1639:7): [True: 33.1k, False: 200k]
  ------------------
 1640|  33.1k|    ::mkinitsmall_utf(u16, langnum);
 1641|  33.1k|    u16_u8(u8, u16);
 1642|   200k|  } else {
 1643|   200k|    ::mkinitsmall(u8, csconv);
 1644|   200k|  }
 1645|   233k|  return u8.size();
 1646|   233k|}
_ZN12HunspellImpl3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1648|  5.80k|int HunspellImpl::add(const std::string& word) {
 1649|  5.80k|  if (!m_HMgrs.empty())
  ------------------
  |  Branch (1649:7): [True: 5.80k, False: 0]
  ------------------
 1650|  5.80k|    return m_HMgrs[0]->add(word);
 1651|      0|  return 0;
 1652|  5.80k|}
_ZN12HunspellImpl14add_with_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 1660|  2.37k|int HunspellImpl::add_with_affix(const std::string& word, const std::string& example) {
 1661|  2.37k|  if (!m_HMgrs.empty())
  ------------------
  |  Branch (1661:7): [True: 2.37k, False: 0]
  ------------------
 1662|  2.37k|    return m_HMgrs[0]->add_with_affix(word, example);
 1663|      0|  return 0;
 1664|  2.37k|}
_ZN12HunspellImpl10cat_resultERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
 1683|   429k|void HunspellImpl::cat_result(std::string& result, const std::string& st) {
 1684|   429k|  if (result.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|   429k|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1684:7): [True: 0, False: 429k]
  ------------------
 1685|      0|    return;
 1686|   429k|  if (!st.empty()) {
  ------------------
  |  Branch (1686:7): [True: 1.34k, False: 428k]
  ------------------
 1687|  1.34k|    if (!result.empty())
  ------------------
  |  Branch (1687:9): [True: 0, False: 1.34k]
  ------------------
 1688|      0|      result.append("\n");
 1689|  1.34k|    result.append(st);
 1690|  1.34k|  }
 1691|   429k|}
_ZN12HunspellImpl7analyzeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1693|  8.31k|std::vector<std::string> HunspellImpl::analyze(const std::string& word) {
 1694|  8.31k|  std::vector<std::string> slst = analyze_internal(word);
 1695|       |  // output conversion
 1696|  8.31k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1696:17): [True: 8.31k, False: 0]
  ------------------
 1697|  8.31k|  if (rl) {
  ------------------
  |  Branch (1697:7): [True: 434, False: 7.87k]
  ------------------
 1698|       |    // the output conversion can multiply the length of every line, so hold the
 1699|       |    // converted analysis to the same ceiling as the raw analysis
 1700|    434|    size_t total = 0;
 1701|    434|    size_t i = 0;
 1702|    459|    for (; i < slst.size(); ++i) {
  ------------------
  |  Branch (1702:12): [True: 25, False: 434]
  ------------------
 1703|     25|      std::string wspace;
 1704|     25|      if (rl->conv(slst[i], wspace, MAXMORPHRESULT - total)) {
  ------------------
  |  |  114|     25|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1704:11): [True: 0, False: 25]
  ------------------
 1705|      0|        slst[i] = std::move(wspace);
 1706|      0|      }
 1707|     25|      if (slst[i].size() > MAXMORPHRESULT - total)
  ------------------
  |  |  114|     25|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1707:11): [True: 0, False: 25]
  ------------------
 1708|      0|        break;
 1709|     25|      total += slst[i].size();
 1710|     25|    }
 1711|    434|    slst.resize(i);
 1712|    434|  }
 1713|  8.31k|  return slst;
 1714|  8.31k|}
_ZN12HunspellImpl16analyze_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1716|  8.31k|std::vector<std::string> HunspellImpl::analyze_internal(const std::string& word) {
 1717|  8.31k|  std::vector<std::string> candidate_stack, slst;
 1718|  8.31k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1718:7): [True: 0, False: 8.31k]
  |  Branch (1718:17): [True: 0, False: 8.31k]
  ------------------
 1719|      0|    return slst;
 1720|  8.31k|  if (utf8) {
  ------------------
  |  Branch (1720:7): [True: 3.92k, False: 4.38k]
  ------------------
 1721|  3.92k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   87|  3.92k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  3.92k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1721:9): [True: 333, False: 3.58k]
  ------------------
 1722|    333|      return slst;
 1723|  4.38k|  } else {
 1724|  4.38k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  4.38k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1724:9): [True: 580, False: 3.80k]
  ------------------
 1725|    580|      return slst;
 1726|  4.38k|  }
 1727|  7.39k|  int captype = NOCAP;
  ------------------
  |  |   92|  7.39k|#define NOCAP 0
  ------------------
 1728|  7.39k|  size_t abbv = 0;
 1729|  7.39k|  size_t wl = 0;
 1730|       |
 1731|  7.39k|  std::string scw;
 1732|  7.39k|  std::vector<w_char> sunicw;
 1733|       |
 1734|       |  // input conversion
 1735|  7.39k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1735:17): [True: 7.39k, False: 0]
  ------------------
 1736|  7.39k|  {
 1737|  7.39k|    std::string wspace;
 1738|       |
 1739|  7.39k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1739:23): [True: 397, False: 7.00k]
  ------------------
 1740|  7.39k|    if (convstatus) {
  ------------------
  |  Branch (1740:9): [True: 0, False: 7.39k]
  ------------------
 1741|       |      // the input conversion can grow the word without limit, so hold the
 1742|       |      // converted word to the same maximum length as the raw word
 1743|      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 (1743:11): [True: 0, False: 0]
  |  Branch (1743:11): [True: 0, False: 0]
  ------------------
 1744|      0|        return slst;
 1745|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1746|      0|    } else
 1747|  7.39k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1748|       |
 1749|  7.39k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1750|  7.39k|    if (wl > 32768)
  ------------------
  |  Branch (1750:9): [True: 0, False: 7.39k]
  ------------------
 1751|      0|      return slst;
 1752|  7.39k|#endif
 1753|  7.39k|  }
 1754|       |
 1755|  7.39k|  if (wl == 0) {
  ------------------
  |  Branch (1755:7): [True: 509, False: 6.88k]
  ------------------
 1756|    509|    if (abbv) {
  ------------------
  |  Branch (1756:9): [True: 294, False: 215]
  ------------------
 1757|    294|      scw.clear();
 1758|  7.19k|      for (wl = 0; wl < abbv; wl++)
  ------------------
  |  Branch (1758:20): [True: 6.90k, False: 294]
  ------------------
 1759|  6.90k|        scw.push_back('.');
 1760|    294|      abbv = 0;
 1761|    294|    } else
 1762|    215|      return slst;
 1763|    509|  }
 1764|       |
 1765|  7.18k|  std::string result;
 1766|       |
 1767|  7.18k|  auto suggest_start = std::chrono::steady_clock::now();
 1768|       |
 1769|  7.18k|  size_t n = 0;
 1770|       |  // test numbers
 1771|       |  // LANG_hu section: set dash information for suggestions
 1772|  7.18k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1772:7): [True: 386, False: 6.79k]
  ------------------
 1773|    386|    size_t n2 = 0;
 1774|    386|    size_t n3 = 0;
 1775|       |
 1776|    525|    while ((n < wl) && (((scw[n] <= '9') && (scw[n] >= '0')) ||
  ------------------
  |  Branch (1776:12): [True: 501, False: 24]
  |  Branch (1776:26): [True: 275, False: 226]
  |  Branch (1776:45): [True: 139, False: 136]
  ------------------
 1777|    362|                        (((scw[n] == '.') || (scw[n] == ',')) && (n > 0)))) {
  ------------------
  |  Branch (1777:27): [True: 29, False: 333]
  |  Branch (1777:46): [True: 0, False: 333]
  |  Branch (1777:66): [True: 0, False: 29]
  ------------------
 1778|    139|      n++;
 1779|    139|      if ((scw[n] == '.') || (scw[n] == ',')) {
  ------------------
  |  Branch (1779:11): [True: 0, False: 139]
  |  Branch (1779:30): [True: 0, False: 139]
  ------------------
 1780|      0|        if (((n2 == 0) && (n > 3)) ||
  ------------------
  |  Branch (1780:14): [True: 0, False: 0]
  |  Branch (1780:27): [True: 0, False: 0]
  ------------------
 1781|      0|            ((n2 > 0) && ((scw[n - 1] == '.') || (scw[n - 1] == ','))))
  ------------------
  |  Branch (1781:14): [True: 0, False: 0]
  |  Branch (1781:27): [True: 0, False: 0]
  |  Branch (1781:50): [True: 0, False: 0]
  ------------------
 1782|      0|          break;
 1783|      0|        n2++;
 1784|      0|        n3 = n;
 1785|      0|      }
 1786|    139|    }
 1787|       |
 1788|    386|    if ((n == wl) && (n3 > 0) && (n - n3 > 3))
  ------------------
  |  Branch (1788:9): [True: 24, False: 362]
  |  Branch (1788:22): [True: 0, False: 24]
  |  Branch (1788:34): [True: 0, False: 0]
  ------------------
 1789|      0|      return slst;
 1790|    386|    if ((n == wl) || ((n > 0) && ((scw[n] == '%') || (scw[n] == '\xB0')) && checkword(scw.substr(n), nullptr, nullptr, suggest_start))) {
  ------------------
  |  Branch (1790:9): [True: 24, False: 362]
  |  Branch (1790:9): [True: 24, False: 362]
  |  Branch (1790:23): [True: 11, False: 351]
  |  Branch (1790:35): [True: 0, False: 11]
  |  Branch (1790:54): [True: 0, False: 11]
  |  Branch (1790:77): [True: 0, False: 0]
  ------------------
 1791|     24|      result.append(scw);
 1792|     24|      result.resize(n - 1);
 1793|     24|      if (n == wl)
  ------------------
  |  Branch (1793:11): [True: 24, False: 0]
  ------------------
 1794|     24|        cat_result(result, pSMgr->suggest_morph(scw.substr(n - 1)));
 1795|      0|      else {
 1796|      0|        std::string chunk = scw.substr(n - 1, 1);
 1797|      0|        cat_result(result, pSMgr->suggest_morph(chunk));
 1798|      0|        result.push_back('+');  // XXX SPEC. MORPHCODE
 1799|      0|        cat_result(result, pSMgr->suggest_morph(scw.substr(n)));
 1800|      0|      }
 1801|     24|      return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|     24|#define MSEP_REC '\n'
  ------------------
 1802|     24|    }
 1803|    386|  }
 1804|       |  // END OF LANG_hu section
 1805|       |
 1806|  7.15k|  switch (captype) {
  ------------------
  |  Branch (1806:11): [True: 7.15k, False: 0]
  ------------------
 1807|    379|    case HUHCAP:
  ------------------
  |  |   95|    379|#define HUHCAP 3
  ------------------
  |  Branch (1807:5): [True: 379, False: 6.77k]
  ------------------
 1808|  1.29k|    case HUHINITCAP:
  ------------------
  |  |   96|  1.29k|#define HUHINITCAP 4
  ------------------
  |  Branch (1808:5): [True: 913, False: 6.24k]
  ------------------
 1809|  3.94k|    case NOCAP: {
  ------------------
  |  |   92|  3.94k|#define NOCAP 0
  ------------------
  |  Branch (1809:5): [True: 2.65k, False: 4.50k]
  ------------------
 1810|  3.94k|      cat_result(result, pSMgr->suggest_morph(scw));
 1811|  3.94k|      if (abbv) {
  ------------------
  |  Branch (1811:11): [True: 234, False: 3.71k]
  ------------------
 1812|    234|        std::string u8buffer(scw);
 1813|    234|        u8buffer.push_back('.');
 1814|    234|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1815|    234|      }
 1816|  3.94k|      break;
 1817|  1.29k|    }
 1818|  2.21k|    case INITCAP: {
  ------------------
  |  |   93|  2.21k|#define INITCAP 1
  ------------------
  |  Branch (1818:5): [True: 2.21k, False: 4.93k]
  ------------------
 1819|  2.21k|      mkallsmall2(scw, sunicw);
 1820|  2.21k|      std::string u8buffer(scw);
 1821|  2.21k|      mkinitcap2(scw, sunicw);
 1822|  2.21k|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1823|  2.21k|      cat_result(result, pSMgr->suggest_morph(scw));
 1824|  2.21k|      if (abbv) {
  ------------------
  |  Branch (1824:11): [True: 185, False: 2.03k]
  ------------------
 1825|    185|        u8buffer.push_back('.');
 1826|    185|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1827|       |
 1828|    185|        u8buffer = scw;
 1829|    185|        u8buffer.push_back('.');
 1830|       |
 1831|    185|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1832|    185|      }
 1833|  2.21k|      break;
 1834|  1.29k|    }
 1835|    990|    case ALLCAP: {
  ------------------
  |  |   94|    990|#define ALLCAP 2
  ------------------
  |  Branch (1835:5): [True: 990, False: 6.16k]
  ------------------
 1836|    990|      cat_result(result, pSMgr->suggest_morph(scw));
 1837|    990|      if (abbv) {
  ------------------
  |  Branch (1837:11): [True: 243, False: 747]
  ------------------
 1838|    243|        std::string u8buffer(scw);
 1839|    243|        u8buffer.push_back('.');
 1840|    243|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1841|    243|      }
 1842|    990|      mkallsmall2(scw, sunicw);
 1843|    990|      std::string u8buffer(scw);
 1844|    990|      mkinitcap2(scw, sunicw);
 1845|       |
 1846|    990|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1847|    990|      cat_result(result, pSMgr->suggest_morph(scw));
 1848|    990|      if (abbv) {
  ------------------
  |  Branch (1848:11): [True: 243, False: 747]
  ------------------
 1849|    243|        u8buffer.push_back('.');
 1850|    243|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1851|       |
 1852|    243|        u8buffer = scw;
 1853|    243|        u8buffer.push_back('.');
 1854|       |
 1855|    243|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1856|    243|      }
 1857|    990|      break;
 1858|  1.29k|    }
 1859|  7.15k|  }
 1860|       |
 1861|  7.15k|  if (!result.empty()) {
  ------------------
  |  Branch (1861:7): [True: 1.34k, False: 5.81k]
  ------------------
 1862|       |    // word reversing wrapper for complex prefixes
 1863|  1.34k|    if (complexprefixes) {
  ------------------
  |  Branch (1863:9): [True: 100, False: 1.24k]
  ------------------
 1864|    100|      if (utf8)
  ------------------
  |  Branch (1864:11): [True: 0, False: 100]
  ------------------
 1865|      0|        reverseword_utf(result);
 1866|    100|      else
 1867|    100|        reverseword(result);
 1868|    100|    }
 1869|  1.34k|    return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|  1.34k|#define MSEP_REC '\n'
  ------------------
 1870|  1.34k|  }
 1871|       |
 1872|       |  // compound word with dash (HU) I18n
 1873|       |  // LANG_hu section: set dash information for suggestions
 1874|       |
 1875|  5.81k|  size_t dash_pos = langnum == LANG_hu ? scw.find('-') : std::string::npos;
  ------------------
  |  Branch (1875:21): [True: 345, False: 5.47k]
  ------------------
 1876|  5.81k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1876:7): [True: 32, False: 5.78k]
  ------------------
 1877|     32|    int nresult = 0;
 1878|       |
 1879|     32|    std::string part1 = scw.substr(0, dash_pos), part2 = scw.substr(dash_pos + 1);
 1880|       |
 1881|       |    // examine 2 sides of the dash
 1882|     32|    if (part2.empty()) {  // base word ending with dash
  ------------------
  |  Branch (1882:9): [True: 6, False: 26]
  ------------------
 1883|      6|      if (spell(part1, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1883:11): [True: 0, False: 6]
  ------------------
 1884|      0|        std::string p = pSMgr->suggest_morph(part1);
 1885|      0|        if (!p.empty()) {
  ------------------
  |  Branch (1885:13): [True: 0, False: 0]
  ------------------
 1886|      0|          slst = line_tok(p, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1887|      0|          return slst;
 1888|      0|        }
 1889|      0|      }
 1890|     26|    } else if (part2.size() == 1 && part2[0] == 'e') {  // XXX (HU) -e hat.
  ------------------
  |  Branch (1890:16): [True: 1, False: 25]
  |  Branch (1890:37): [True: 0, False: 1]
  ------------------
 1891|      0|      if (spell(part1, candidate_stack, nullptr, nullptr, suggest_start) &&
  ------------------
  |  Branch (1891:11): [True: 0, False: 0]
  |  Branch (1891:11): [True: 0, False: 0]
  ------------------
 1892|      0|          (spell("-e", candidate_stack, nullptr, nullptr, suggest_start))) {
  ------------------
  |  Branch (1892:11): [True: 0, False: 0]
  ------------------
 1893|      0|        std::string st = pSMgr->suggest_morph(part1);
 1894|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1894:13): [True: 0, False: 0]
  ------------------
 1895|      0|          result.append(st);
 1896|      0|        }
 1897|      0|        result.push_back('+');  // XXX spec. separator in MORPHCODE
 1898|      0|        st = pSMgr->suggest_morph("-e");
 1899|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1899:13): [True: 0, False: 0]
  ------------------
 1900|      0|          result.append(st);
 1901|      0|        }
 1902|      0|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1903|      0|      }
 1904|     26|    } else {
 1905|       |      // first word ending with dash: word- XXX ???
 1906|     26|      part1.push_back(' ');
 1907|     26|      nresult = spell(part1, candidate_stack, nullptr, nullptr, suggest_start);
 1908|     26|      part1.erase(part1.size() - 1);
 1909|     26|      if (nresult && spell(part2, candidate_stack, nullptr, nullptr, suggest_start) &&
  ------------------
  |  Branch (1909:11): [True: 1, False: 25]
  |  Branch (1909:22): [True: 1, False: 0]
  ------------------
 1910|      1|          ((part2.size() > 1) || ((part2[0] > '0') && (part2[0] < '9')))) {
  ------------------
  |  Branch (1910:12): [True: 0, False: 1]
  |  Branch (1910:35): [True: 0, False: 1]
  |  Branch (1910:55): [True: 0, False: 0]
  ------------------
 1911|      0|        std::string st = pSMgr->suggest_morph(part1);
 1912|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1912:13): [True: 0, False: 0]
  ------------------
 1913|      0|          result.append(st);
 1914|      0|          result.push_back('+');  // XXX spec. separator in MORPHCODE
 1915|      0|        }
 1916|      0|        st = pSMgr->suggest_morph(part2);
 1917|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1917:13): [True: 0, False: 0]
  ------------------
 1918|      0|          result.append(st);
 1919|      0|        }
 1920|      0|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1921|      0|      }
 1922|     26|    }
 1923|       |    // affixed number in correct word
 1924|     32|    if (nresult && (dash_pos > 0) &&
  ------------------
  |  Branch (1924:9): [True: 1, False: 31]
  |  Branch (1924:20): [True: 0, False: 1]
  ------------------
 1925|      0|        (((scw[dash_pos - 1] <= '9') && (scw[dash_pos - 1] >= '0')) ||
  ------------------
  |  Branch (1925:11): [True: 0, False: 0]
  |  Branch (1925:41): [True: 0, False: 0]
  ------------------
 1926|      0|         (scw[dash_pos - 1] == '.'))) {
  ------------------
  |  Branch (1926:10): [True: 0, False: 0]
  ------------------
 1927|      0|      n = 1;
 1928|      0|      if (scw[dash_pos - n] == '.')
  ------------------
  |  Branch (1928:11): [True: 0, False: 0]
  ------------------
 1929|      0|        n++;
 1930|       |      // search first not a number character to left from dash
 1931|      0|      while ((dash_pos >= n) && ((scw[dash_pos - n] == '0') || (n < 3)) &&
  ------------------
  |  Branch (1931:14): [True: 0, False: 0]
  |  Branch (1931:34): [True: 0, False: 0]
  |  Branch (1931:64): [True: 0, False: 0]
  ------------------
 1932|      0|             (n < 6)) {
  ------------------
  |  Branch (1932:14): [True: 0, False: 0]
  ------------------
 1933|      0|        n++;
 1934|      0|      }
 1935|      0|      if (dash_pos < n)
  ------------------
  |  Branch (1935:11): [True: 0, False: 0]
  ------------------
 1936|      0|        n--;
 1937|       |      // numbers: valami1000000-hoz
 1938|       |      // examine 100000-hoz, 10000-hoz 1000-hoz, 10-hoz,
 1939|       |      // 56-hoz, 6-hoz
 1940|      0|      for (; n >= 1; n--) {
  ------------------
  |  Branch (1940:14): [True: 0, False: 0]
  ------------------
 1941|      0|        if (scw[dash_pos - n] < '0' || scw[dash_pos - n] > '9') {
  ------------------
  |  Branch (1941:13): [True: 0, False: 0]
  |  Branch (1941:40): [True: 0, False: 0]
  ------------------
 1942|      0|            continue;
 1943|      0|        }
 1944|      0|        std::string chunk = scw.substr(dash_pos - n);
 1945|      0|        if (checkword(chunk, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1945:13): [True: 0, False: 0]
  ------------------
 1946|      0|          result.append(chunk);
 1947|      0|          std::string st = pSMgr->suggest_morph(chunk);
 1948|      0|          if (!st.empty()) {
  ------------------
  |  Branch (1948:15): [True: 0, False: 0]
  ------------------
 1949|      0|            result.append(st);
 1950|      0|          }
 1951|      0|          return line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1952|      0|        }
 1953|      0|      }
 1954|      0|    }
 1955|     32|  }
 1956|  5.81k|  return slst;
 1957|  5.81k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS0_6vectorIS6_NS4_IS6_EEEE:
 1959|  7.06k|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::vector<std::string>& pl) {
 1960|  7.06k|  std::vector<std::string> slst;
 1961|  7.06k|  if (!pSMgr || pl.empty())
  ------------------
  |  Branch (1961:7): [True: 0, False: 7.06k]
  |  Branch (1961:17): [True: 619, False: 6.44k]
  ------------------
 1962|    619|    return slst;
 1963|  6.44k|  std::vector<std::string> pl2 = analyze(word);
 1964|  6.44k|  int captype = NOCAP, abbv = 0;
  ------------------
  |  |   92|  6.44k|#define NOCAP 0
  ------------------
 1965|  6.44k|  std::string cw;
 1966|  6.44k|  cleanword(cw, word, &captype, &abbv);
 1967|  6.44k|  std::string result;
 1968|       |
 1969|  6.44k|  auto suggest_start = std::chrono::steady_clock::now();
 1970|   416k|  for (const auto& i : pl) {
  ------------------
  |  Branch (1970:22): [True: 416k, False: 6.44k]
  ------------------
 1971|   416k|    cat_result(result, pSMgr->suggest_gen(pl2, i, suggest_start));
 1972|   416k|  }
 1973|       |
 1974|  6.44k|  if (!result.empty()) {
  ------------------
  |  Branch (1974:7): [True: 0, False: 6.44k]
  ------------------
 1975|       |    // allcap
 1976|      0|    if (captype == ALLCAP)
  ------------------
  |  |   94|      0|#define ALLCAP 2
  ------------------
  |  Branch (1976:9): [True: 0, False: 0]
  ------------------
 1977|      0|      mkallcap(result);
 1978|       |
 1979|       |    // line split
 1980|      0|    slst = line_tok(result, MSEP_REC);
  ------------------
  |  |  122|      0|#define MSEP_REC '\n'
  ------------------
 1981|       |
 1982|       |    // capitalize
 1983|      0|    if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   93|      0|#define INITCAP 1
  ------------------
                  if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   96|      0|#define HUHINITCAP 4
  ------------------
  |  Branch (1983:9): [True: 0, False: 0]
  |  Branch (1983:31): [True: 0, False: 0]
  ------------------
 1984|      0|      for (auto& str : slst) {
  ------------------
  |  Branch (1984:22): [True: 0, False: 0]
  ------------------
 1985|      0|        mkinitcap(str);
 1986|      0|      }
 1987|      0|    }
 1988|       |
 1989|       |    // temporary filtering of prefix related errors (eg.
 1990|       |    // generate("undrinkable", "eats") --> "undrinkables" and "*undrinks")
 1991|      0|    auto it = slst.begin();
 1992|      0|    while (it != slst.end()) {
  ------------------
  |  Branch (1992:12): [True: 0, False: 0]
  ------------------
 1993|      0|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|      0|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1993:11): [True: 0, False: 0]
  ------------------
 1994|      0|        break;
 1995|      0|      std::vector<std::string> candidate_stack;
 1996|      0|      if (!spell(*it, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1996:11): [True: 0, False: 0]
  ------------------
 1997|      0|        it = slst.erase(it);
 1998|      0|      } else  {
 1999|      0|        ++it;
 2000|      0|      }
 2001|      0|    }
 2002|      0|  }
 2003|  6.44k|  return slst;
 2004|  7.06k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 2006|    741|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::string& pattern) {
 2007|    741|  std::vector<std::string> pl = analyze(pattern);
 2008|    741|  std::vector<std::string> slst = generate(word, pl);
 2009|    741|  uniqlist(slst);
 2010|    741|  return slst;
 2011|    741|}
_ZN12HunspellImpl11get_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEm:
 2014|   515k|std::string HunspellImpl::get_xml_par(const std::string& in_par, std::string::size_type pos) {
 2015|   515k|  std::string dest;
 2016|   515k|  if (pos == std::string::npos)
  ------------------
  |  Branch (2016:7): [True: 7.06k, False: 508k]
  ------------------
 2017|  7.06k|    return dest;
 2018|   508k|  const char* par = in_par.c_str() + pos;
 2019|   508k|  char end = *par;
 2020|   508k|  if (end == '>')
  ------------------
  |  Branch (2020:7): [True: 505k, False: 3.45k]
  ------------------
 2021|   505k|    end = '<';
 2022|  3.45k|  else if (end != '\'' && end != '"')
  ------------------
  |  Branch (2022:12): [True: 2.79k, False: 665]
  |  Branch (2022:27): [True: 1.21k, False: 1.57k]
  ------------------
 2023|  1.21k|    return dest;  // bad XML
 2024|  10.5M|  for (par++; *par != '\0' && *par != end; ++par) {
  ------------------
  |  Branch (2024:15): [True: 10.5M, False: 31.8k]
  |  Branch (2024:31): [True: 10.0M, False: 475k]
  ------------------
 2025|  10.0M|    dest.push_back(*par);
 2026|  10.0M|  }
 2027|   507k|  mystrrep(dest, "&lt;", "<");
 2028|   507k|  mystrrep(dest, "&amp;", "&");
 2029|   507k|  return dest;
 2030|   508k|}
_ZN12HunspellImpl11get_xml_posERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 2046|  75.2k|std::string::size_type HunspellImpl::get_xml_pos(const std::string& s, std::string::size_type pos, const char* attr) {
 2047|  75.2k|  if (pos == std::string::npos)
  ------------------
  |  Branch (2047:7): [True: 0, False: 75.2k]
  ------------------
 2048|      0|    return std::string::npos;
 2049|       |
 2050|  75.2k|  std::string::size_type endpos = s.find('>', pos);
 2051|  75.2k|  if (attr == nullptr)
  ------------------
  |  Branch (2051:7): [True: 0, False: 75.2k]
  ------------------
 2052|      0|    return endpos;
 2053|   266k|  while (true) {
  ------------------
  |  Branch (2053:10): [True: 266k, Folded]
  ------------------
 2054|   266k|    pos = s.find(attr, pos);
 2055|   266k|    if (pos == std::string::npos || pos >= endpos)
  ------------------
  |  Branch (2055:9): [True: 4.18k, False: 262k]
  |  Branch (2055:37): [True: 1.67k, False: 260k]
  ------------------
 2056|  5.85k|      return std::string::npos;
 2057|   260k|    if (pos == 0 || s[pos - 1] == ' ' || s[pos - 1] == '\n')
  ------------------
  |  Branch (2057:9): [True: 0, False: 260k]
  |  Branch (2057:21): [True: 1.44k, False: 259k]
  |  Branch (2057:42): [True: 67.9k, False: 191k]
  ------------------
 2058|  69.4k|      break;
 2059|   191k|    pos += strlen(attr);
 2060|   191k|  }
 2061|  69.4k|  return pos + strlen(attr);
 2062|  75.2k|}
_ZN12HunspellImpl13check_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKcSA_:
 2066|  75.2k|                                const char* value) {
 2067|  75.2k|  const std::string cw = get_xml_par(q, get_xml_pos(q, pos, attr));
 2068|  75.2k|  return cw == value ? 1 : 0;
  ------------------
  |  Branch (2068:10): [True: 18.5k, False: 56.6k]
  ------------------
 2069|  75.2k|}
_ZN12HunspellImpl12get_xml_listERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 2071|  7.33k|std::vector<std::string> HunspellImpl::get_xml_list(const std::string& list, std::string::size_type pos, const char* tag) {
 2072|  7.33k|  std::vector<std::string> slst;
 2073|  7.33k|  if (pos == std::string::npos)
  ------------------
  |  Branch (2073:7): [True: 76, False: 7.25k]
  ------------------
 2074|     76|    return slst;
 2075|   424k|  while (true) {
  ------------------
  |  Branch (2075:10): [True: 424k, Folded]
  ------------------
 2076|   424k|    pos = list.find(tag, pos);
 2077|   424k|    if (pos == std::string::npos)
  ------------------
  |  Branch (2077:9): [True: 6.06k, False: 418k]
  ------------------
 2078|  6.06k|        break;
 2079|   418k|    std::string cw = get_xml_par(list, pos + strlen(tag) - 1);
 2080|   418k|    if (cw.empty()) {
  ------------------
  |  Branch (2080:9): [True: 1.19k, False: 416k]
  ------------------
 2081|  1.19k|      break;
 2082|  1.19k|    }
 2083|   416k|    slst.push_back(std::move(cw));
 2084|   416k|    ++pos;
 2085|   416k|  }
 2086|  7.25k|  return slst;
 2087|  7.33k|}
_ZN12HunspellImpl7spellmlERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 2089|  23.0k|std::vector<std::string> HunspellImpl::spellml(const std::string& in_word) {
 2090|       |  // The XML interface spell checks words of its own to answer the query.
 2091|  23.0k|  TraceSuppress no_trace(m_trace.get());
 2092|       |
 2093|  23.0k|  std::vector<std::string> slst;
 2094|       |
 2095|  23.0k|  std::string::size_type qpos = in_word.find("<query");
 2096|  23.0k|  if (qpos == std::string::npos)
  ------------------
  |  Branch (2096:7): [True: 464, False: 22.5k]
  ------------------
 2097|    464|    return slst;  // bad XML input
 2098|       |
 2099|  22.5k|  std::string::size_type q2pos = in_word.find('>', qpos);
 2100|  22.5k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (2100:7): [True: 264, False: 22.2k]
  ------------------
 2101|    264|    return slst;  // bad XML input
 2102|       |
 2103|  22.2k|  q2pos = in_word.find("<word", q2pos);
 2104|  22.2k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (2104:7): [True: 342, False: 21.9k]
  ------------------
 2105|    342|    return slst;  // bad XML input
 2106|       |
 2107|  21.9k|  if (check_xml_par(in_word, qpos, "type=", "analyze")) {
  ------------------
  |  Branch (2107:7): [True: 399, False: 21.5k]
  ------------------
 2108|    399|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2109|    399|    if (!cw.empty())
  ------------------
  |  Branch (2109:9): [True: 114, False: 285]
  ------------------
 2110|    114|      slst = analyze(cw);
 2111|    399|    if (slst.empty())
  ------------------
  |  Branch (2111:9): [True: 369, False: 30]
  ------------------
 2112|    369|      return slst;
 2113|       |    // convert the result to <code><a>ana1</a><a>ana2</a></code> format
 2114|     30|    std::string r;
 2115|     30|    r.append("<code>");
 2116|     30|    for (auto entry : slst) {
  ------------------
  |  Branch (2116:21): [True: 30, False: 30]
  ------------------
 2117|     30|      r.append("<a>");
 2118|       |
 2119|     30|      mystrrep(entry, "\t", " ");
 2120|     30|      mystrrep(entry, "&", "&amp;");
 2121|     30|      mystrrep(entry, "<", "&lt;");
 2122|     30|      r.append(entry);
 2123|       |
 2124|     30|      r.append("</a>");
 2125|     30|    }
 2126|     30|    r.append("</code>");
 2127|     30|    slst.clear();
 2128|     30|    slst.push_back(std::move(r));
 2129|     30|    return slst;
 2130|  21.5k|  } else if (check_xml_par(in_word, qpos, "type=", "stem")) {
  ------------------
  |  Branch (2130:14): [True: 1.40k, False: 20.1k]
  ------------------
 2131|  1.40k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2132|  1.40k|    if (!cw.empty())
  ------------------
  |  Branch (2132:9): [True: 1.00k, False: 399]
  ------------------
 2133|  1.00k|      return stem(cw);
 2134|  20.1k|  } else if (check_xml_par(in_word, qpos, "type=", "generate")) {
  ------------------
  |  Branch (2134:14): [True: 8.53k, False: 11.6k]
  ------------------
 2135|  8.53k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2136|  8.53k|    if (cw.empty())
  ------------------
  |  Branch (2136:9): [True: 152, False: 8.37k]
  ------------------
 2137|    152|      return slst;
 2138|  8.37k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 2139|  8.37k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (2139:9): [True: 855, False: 7.52k]
  ------------------
 2140|    855|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2141|    855|      if (!cw2.empty()) {
  ------------------
  |  Branch (2141:11): [True: 741, False: 114]
  ------------------
 2142|    741|        return generate(cw, cw2);
 2143|    741|      }
 2144|  7.52k|    } else {
 2145|  7.52k|      q2pos = in_word.find("<code", q2pos + 1);
 2146|  7.52k|      if (q2pos != std::string::npos) {
  ------------------
  |  Branch (2146:11): [True: 7.33k, False: 190]
  ------------------
 2147|  7.33k|        std::vector<std::string> slst2 = get_xml_list(in_word, in_word.find('>', q2pos), "<a>");
 2148|  7.33k|        if (!slst2.empty()) {
  ------------------
  |  Branch (2148:13): [True: 6.32k, False: 1.00k]
  ------------------
 2149|  6.32k|          slst = generate(cw, slst2);
 2150|  6.32k|          uniqlist(slst);
 2151|  6.32k|          return slst;
 2152|  6.32k|        }
 2153|  7.33k|      }
 2154|  7.52k|    }
 2155|  11.6k|  } else if (check_xml_par(in_word, qpos, "type=", "add")) {
  ------------------
  |  Branch (2155:14): [True: 8.25k, False: 3.36k]
  ------------------
 2156|  8.25k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2157|  8.25k|    if (cw.empty())
  ------------------
  |  Branch (2157:9): [True: 76, False: 8.18k]
  ------------------
 2158|     76|      return slst;
 2159|  8.18k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 2160|  8.18k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (2160:9): [True: 2.75k, False: 5.42k]
  ------------------
 2161|  2.75k|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2162|  2.75k|      if (!cw2.empty()) {
  ------------------
  |  Branch (2162:11): [True: 2.37k, False: 380]
  ------------------
 2163|  2.37k|        add_with_affix(cw, cw2);
 2164|  2.37k|      } else {
 2165|    380|        add(cw);
 2166|    380|      }
 2167|  5.42k|    } else {
 2168|  5.42k|        add(cw);
 2169|  5.42k|    }
 2170|  8.18k|  }
 2171|  13.2k|  return slst;
 2172|  21.9k|}
_ZN8HunspellC2EPKcS1_S1_:
 2326|     38|  : m_Impl(new HunspellImpl(affpath, dpath, key)) {
 2327|     38|}
_ZN8Hunspell5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_:
 2338|  65.5k|bool Hunspell::spell(const std::string& word, int* info, std::string* root) {
 2339|  65.5k|  std::vector<std::string> candidate_stack;
 2340|  65.5k|  return m_Impl->spell(word, candidate_stack, info, root,
 2341|  65.5k|                       std::chrono::steady_clock::now());
 2342|  65.5k|}
_ZN8Hunspell7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 2344|  64.9k|std::vector<std::string> Hunspell::suggest(const std::string& word) {
 2345|  64.9k|  return m_Impl->suggest(word);
 2346|  64.9k|}
_ZNK12HunspellImpl12active_traceEv:
  143|  32.5M|  TraceCtx* active_trace() const {
  144|  32.5M|    return m_trace->on() ? m_trace.get() : nullptr;
  ------------------
  |  Branch (144:12): [True: 0, False: 32.5M]
  ------------------
  145|  32.5M|  }

_ZNK8TraceCtx2onEv:
  110|  32.5M|  bool on() const { return m_callback && m_suppressed == 0; }
  ------------------
  |  Branch (110:28): [True: 0, False: 32.5M]
  |  Branch (110:42): [True: 0, False: 0]
  ------------------
_ZN10TraceScopeC2EP8TraceCtx:
  129|   516M|  explicit TraceScope(TraceCtx* context) : m_context(context) {
  130|   516M|    if (m_context)
  ------------------
  |  Branch (130:9): [True: 0, False: 516M]
  ------------------
  131|      0|      ++m_context->m_depth;
  132|   516M|  }
_ZN10TraceScopeD2Ev:
  133|   516M|  ~TraceScope() {
  134|   516M|    if (m_context)
  ------------------
  |  Branch (134:9): [True: 0, False: 516M]
  ------------------
  135|      0|      --m_context->m_depth;
  136|   516M|  }
_Z8trace_onP8TraceCtx:
  163|  1.13G|inline TraceCtx* trace_on(TraceCtx* context) {
  164|  1.13G|  return (context && context->on()) ? context : nullptr;
  ------------------
  |  Branch (164:11): [True: 0, False: 1.13G]
  |  Branch (164:22): [True: 0, False: 0]
  ------------------
  165|  1.13G|}
_ZN13TraceSuppressC2EP8TraceCtx:
  146|   115k|  explicit TraceSuppress(TraceCtx* context) : m_context(context) {
  147|   115k|    if (m_context)
  ------------------
  |  Branch (147:9): [True: 115k, False: 0]
  ------------------
  148|   115k|      ++m_context->m_suppressed;
  149|   115k|  }
_ZN13TraceSuppressD2Ev:
  150|   115k|  ~TraceSuppress() {
  151|   115k|    if (m_context)
  ------------------
  |  Branch (151:9): [True: 115k, False: 0]
  ------------------
  152|   115k|      --m_context->m_suppressed;
  153|   115k|  }
_ZN8TraceCtxC2EPFvPviPKcES0_:
  103|     38|      : m_callback(callback), m_userdata(userdata) {}

_Z16init_phonet_hashR10phonetable:
   38|      2|void init_phonet_hash(phonetable& parms) {
   39|      2|  memset(parms.hash, 0xff, HASHSIZE * sizeof(int));
  ------------------
  |  |   33|      2|#define HASHSIZE 256
  ------------------
   40|       |
   41|    212|  for (int i = 0; parms.rules[i][0] != '\0'; i += 2) {
  ------------------
  |  Branch (41:19): [True: 210, False: 2]
  ------------------
   42|       |    /**  set hash value  **/
   43|    210|    int k = (unsigned char)parms.rules[i][0];
   44|       |
   45|    210|    if (parms.hash[k] < 0) {
  ------------------
  |  Branch (45:9): [True: 54, False: 156]
  ------------------
   46|     54|      parms.hash[k] = i;
   47|     54|    }
   48|    210|  }
   49|      2|}
_Z6phonetRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEER10phonetable:
   69|  10.1k|std::string phonet(const std::string& inword, phonetable& parms) {
   70|       |
   71|  10.1k|  int i, k = 0, p, z, k0, n0, p0 = -333;
   72|  10.1k|  char c;
   73|  10.1k|  using uchar = unsigned char;
   74|       |
   75|  10.1k|  size_t len = inword.size();
   76|  10.1k|  if (len > MAXPHONETUTF8LEN)
  ------------------
  |  |   35|  10.1k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.1k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
  |  Branch (76:7): [True: 0, False: 10.1k]
  ------------------
   77|      0|    return {};
   78|  10.1k|  char word[MAXPHONETUTF8LEN + 1];
   79|  10.1k|  strncpy(word, inword.c_str(), MAXPHONETUTF8LEN);
  ------------------
  |  |   35|  10.1k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.1k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   80|  10.1k|  word[MAXPHONETUTF8LEN] = '\0';
  ------------------
  |  |   35|  10.1k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  10.1k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   81|       |
   82|  10.1k|  std::string target;
   83|       |  /**  check word  **/
   84|  10.1k|  i = z = 0;
   85|  92.2k|  while ((c = word[i]) != '\0') {
  ------------------
  |  Branch (85:10): [True: 82.1k, False: 10.1k]
  ------------------
   86|  82.1k|    int n = parms.hash[(uchar)c];
   87|  82.1k|    int z0 = 0;
   88|       |
   89|  82.1k|    if (n >= 0 && !parms.rules[n].empty()) {
  ------------------
  |  Branch (89:9): [True: 25.1k, False: 56.9k]
  |  Branch (89:19): [True: 25.1k, False: 0]
  ------------------
   90|       |      /**  check all rules for the same letter  **/
   91|  65.3k|      while (parms.rules[n][0] == c) {
  ------------------
  |  Branch (91:14): [True: 63.3k, False: 2.01k]
  ------------------
   92|       |        /**  check whole string  **/
   93|  63.3k|        k = 1; /** number of found letters  **/
   94|  63.3k|        p = 5; /** default priority  **/
   95|  63.3k|        const char*s = parms.rules[n].c_str();
   96|  63.3k|        s++; /**  important for (see below)  "*(s-1)"  **/
   97|       |
   98|  65.2k|        while (*s != '\0' && word[i + k] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (98:16): [True: 44.2k, False: 21.0k]
  |  Branch (98:30): [True: 1.93k, False: 42.2k]
  |  Branch (98:51): [True: 1.93k, False: 0]
  |  Branch (98:82): [True: 1.89k, False: 41]
  ------------------
   99|  1.89k|          k++;
  100|  1.89k|          s++;
  101|  1.89k|        }
  102|  63.3k|        if (*s == '(') {
  ------------------
  |  Branch (102:13): [True: 4.52k, False: 58.8k]
  ------------------
  103|       |          /**  check letters in "(..)"  **/
  104|  4.52k|          if (myisalpha(word[i + k])  // ...could be implied?
  ------------------
  |  Branch (104:15): [True: 3.35k, False: 1.16k]
  ------------------
  105|  3.35k|              && strchr(s + 1, word[i + k]) != nullptr) {
  ------------------
  |  Branch (105:18): [True: 353, False: 3.00k]
  ------------------
  106|    353|            k++;
  107|  1.95k|            while (*s && *s != ')')
  ------------------
  |  Branch (107:20): [True: 1.95k, False: 0]
  |  Branch (107:26): [True: 1.60k, False: 353]
  ------------------
  108|  1.60k|              s++;
  109|    353|            if (*s == ')')
  ------------------
  |  Branch (109:17): [True: 353, False: 0]
  ------------------
  110|    353|              s++;
  111|    353|          }
  112|  4.52k|        }
  113|  63.3k|        p0 = (int)*s;
  114|  63.3k|        k0 = k;
  115|  64.7k|        while (*s == '-' && k > 1) {
  ------------------
  |  Branch (115:16): [True: 1.39k, False: 63.3k]
  |  Branch (115:29): [True: 1.39k, False: 0]
  ------------------
  116|  1.39k|          k--;
  117|  1.39k|          s++;
  118|  1.39k|        }
  119|  63.3k|        if (*s == '<')
  ------------------
  |  Branch (119:13): [True: 96, False: 63.2k]
  ------------------
  120|     96|          s++;
  121|  63.3k|        if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (121:13): [True: 1, False: 63.3k]
  ------------------
  122|       |          /**  determine priority  **/
  123|      1|          p = *s - '0';
  124|      1|          s++;
  125|      1|        }
  126|  63.3k|        if (*s == '^' && *(s + 1) == '^')
  ------------------
  |  Branch (126:13): [True: 2.84k, False: 60.5k]
  |  Branch (126:26): [True: 0, False: 2.84k]
  ------------------
  127|      0|          s++;
  128|       |
  129|  63.3k|        if (*s == '\0' || (*s == '^' && (i == 0 || !myisalpha(word[i - 1])) &&
  ------------------
  |  Branch (129:13): [True: 22.5k, False: 40.8k]
  |  Branch (129:28): [True: 2.84k, False: 37.9k]
  |  Branch (129:42): [True: 148, False: 2.70k]
  |  Branch (129:52): [True: 720, False: 1.98k]
  ------------------
  130|    868|                           (*(s + 1) != '$' || (!myisalpha(word[i + k0])))) ||
  ------------------
  |  Branch (130:29): [True: 868, False: 0]
  |  Branch (130:48): [True: 0, False: 0]
  ------------------
  131|  39.9k|            (*s == '$' && i > 0 && myisalpha(word[i - 1]) &&
  ------------------
  |  Branch (131:14): [True: 0, False: 39.9k]
  |  Branch (131:27): [True: 0, False: 0]
  |  Branch (131:36): [True: 0, False: 0]
  ------------------
  132|  23.3k|             (!myisalpha(word[i + k0])))) {
  ------------------
  |  Branch (132:14): [True: 0, False: 0]
  ------------------
  133|       |          /**  search for followup rules, if:     **/
  134|       |          /**  parms.followup and k > 1  and  NO '-' in searchstring **/
  135|  23.3k|          char c0 = word[i + k - 1];
  136|  23.3k|          n0 = parms.hash[(uchar)c0];
  137|       |
  138|       |          //            if (parms.followup  &&  k > 1  &&  n0 >= 0
  139|  23.3k|          if (k > 1 && n0 >= 0 && p0 != (int)'-' && word[i + k] != '\0' && !parms.rules[n0].empty()) {
  ------------------
  |  Branch (139:15): [True: 503, False: 22.8k]
  |  Branch (139:24): [True: 503, False: 0]
  |  Branch (139:35): [True: 452, False: 51]
  |  Branch (139:53): [True: 401, False: 51]
  |  Branch (139:76): [True: 401, False: 0]
  ------------------
  140|       |            /**  test follow-up rule for "word[i+k]"  **/
  141|  1.04k|            while (parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (141:20): [True: 925, False: 118]
  ------------------
  142|       |              /**  check whole string  **/
  143|    925|              k0 = k;
  144|    925|              p0 = 5;
  145|    925|              s = parms.rules[n0].c_str();
  146|    925|              s++;
  147|  1.20k|              while (*s != '\0' && word[i + k0] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (147:22): [True: 807, False: 401]
  |  Branch (147:36): [True: 283, False: 524]
  |  Branch (147:58): [True: 283, False: 0]
  |  Branch (147:89): [True: 283, False: 0]
  ------------------
  148|    283|                k0++;
  149|    283|                s++;
  150|    283|              }
  151|    925|              if (*s == '(') {
  ------------------
  |  Branch (151:19): [True: 0, False: 925]
  ------------------
  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|    925|              while (*s == '-') {
  ------------------
  |  Branch (161:22): [True: 0, False: 925]
  ------------------
  162|       |                /**  "k0" gets NOT reduced   **/
  163|       |                /**  because "if (k0 == k)"  **/
  164|      0|                s++;
  165|      0|              }
  166|    925|              if (*s == '<')
  ------------------
  |  Branch (166:19): [True: 0, False: 925]
  ------------------
  167|      0|                s++;
  168|    925|              if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (168:19): [True: 0, False: 925]
  ------------------
  169|      0|                p0 = *s - '0';
  170|      0|                s++;
  171|      0|              }
  172|       |
  173|    925|              if (*s == '\0'
  ------------------
  |  Branch (173:19): [True: 401, False: 524]
  ------------------
  174|       |                  /**  *s == '^' cuts  **/
  175|    524|                  || (*s == '$' && !myisalpha(word[i + k0]))) {
  ------------------
  |  Branch (175:23): [True: 0, False: 524]
  |  Branch (175:36): [True: 0, False: 0]
  ------------------
  176|    401|                if (k0 == k) {
  ------------------
  |  Branch (176:21): [True: 118, False: 283]
  ------------------
  177|       |                  /**  this is just a piece of the string  **/
  178|    118|                  n0 += 2;
  179|    118|                  continue;
  180|    118|                }
  181|       |
  182|    283|                if (p0 < p) {
  ------------------
  |  Branch (182:21): [True: 0, False: 283]
  ------------------
  183|       |                  /**  priority too low  **/
  184|      0|                  n0 += 2;
  185|      0|                  continue;
  186|      0|                }
  187|       |                /**  rule fits; stop search  **/
  188|    283|                break;
  189|    283|              }
  190|    524|              n0 += 2;
  191|    524|            } /**  End of "while (parms.rules[n0][0] == c0)"  **/
  192|       |
  193|    401|            if (p0 >= p && parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (193:17): [True: 400, False: 1]
  |  Branch (193:28): [True: 283, False: 117]
  ------------------
  194|    283|              n += 2;
  195|    283|              continue;
  196|    283|            }
  197|    401|          } /** end of follow-up stuff **/
  198|       |
  199|       |          /**  replace string  **/
  200|  23.1k|          s = parms.rules[n + 1].c_str();
  201|  23.1k|          p0 = (!parms.rules[n].empty() && strchr(parms.rules[n].c_str() + 1, '<') != nullptr) ? 1 : 0;
  ------------------
  |  Branch (201:17): [True: 23.1k, False: 0]
  |  Branch (201:44): [True: 96, False: 23.0k]
  ------------------
  202|  23.1k|          if (p0 == 1 && z == 0) {
  ------------------
  |  Branch (202:15): [True: 96, False: 23.0k]
  |  Branch (202:26): [True: 96, False: 0]
  ------------------
  203|       |            /**  rule with '<' is used  **/
  204|     96|            if (!target.empty() && *s != '\0' &&
  ------------------
  |  Branch (204:17): [True: 80, False: 16]
  |  Branch (204:36): [True: 80, False: 0]
  ------------------
  205|     80|                (target[target.size()-1] == c || target[target.size()-1] == *s)) {
  ------------------
  |  Branch (205:18): [True: 0, False: 80]
  |  Branch (205:50): [True: 0, False: 80]
  ------------------
  206|      0|              target.erase(target.size() - 1);
  207|      0|            }
  208|     96|            z0 = 1;
  209|     96|            z = 1;
  210|     96|            k0 = 0;
  211|    192|            while (*s != '\0' && word[i + k0] != '\0') {
  ------------------
  |  Branch (211:20): [True: 96, False: 96]
  |  Branch (211:34): [True: 96, False: 0]
  ------------------
  212|     96|              word[i + k0] = *s;
  213|     96|              k0++;
  214|     96|              s++;
  215|     96|            }
  216|     96|            if (k > k0)
  ------------------
  |  Branch (216:17): [True: 0, False: 96]
  ------------------
  217|      0|              strmove(&word[0] + i + k0, &word[0] + i + k);
  218|       |
  219|       |            /**  new "actual letter"  **/
  220|     96|            c = word[i];
  221|  23.0k|          } else { /** no '<' rule used **/
  222|  23.0k|            i += k - 1;
  223|  23.0k|            z = 0;
  224|  23.1k|            while (*s != '\0' && *(s + 1) != '\0' && target.size() < len) {
  ------------------
  |  Branch (224:20): [True: 21.9k, False: 1.26k]
  |  Branch (224:34): [True: 227, False: 21.6k]
  |  Branch (224:54): [True: 147, False: 80]
  ------------------
  225|    147|              if (target.empty() || target[target.size()-1] != *s) {
  ------------------
  |  Branch (225:19): [True: 8, False: 139]
  |  Branch (225:37): [True: 131, False: 8]
  ------------------
  226|    139|                target.push_back(*s);
  227|    139|              }
  228|    147|              s++;
  229|    147|            }
  230|       |            /**  new "actual letter"  **/
  231|  23.0k|            c = *s;
  232|  23.0k|            if (!parms.rules[n].empty() && strstr(parms.rules[n].c_str() + 1, "^^") != nullptr) {
  ------------------
  |  Branch (232:17): [True: 23.0k, False: 0]
  |  Branch (232:44): [True: 0, False: 23.0k]
  ------------------
  233|      0|              if (c != '\0') {
  ------------------
  |  Branch (233:19): [True: 0, False: 0]
  ------------------
  234|      0|                target.push_back(c);
  235|      0|              }
  236|      0|              strmove(&word[0], &word[0] + i + 1);
  237|      0|              i = 0;
  238|      0|              z0 = 1;
  239|      0|            }
  240|  23.0k|          }
  241|  23.1k|          break;
  242|  23.3k|        } /** end of follow-up stuff **/
  243|  39.9k|        n += 2;
  244|  39.9k|      } /**  end of while (parms.rules[n][0] == c)  **/
  245|  25.1k|    }   /**  end of if (n >= 0)  **/
  246|  82.1k|    if (z0 == 0) {
  ------------------
  |  Branch (246:9): [True: 82.0k, False: 96]
  ------------------
  247|  82.0k|      if (k && !p0 && target.size() < len && c != '\0') {
  ------------------
  |  Branch (247:11): [True: 25.0k, False: 56.9k]
  |  Branch (247:16): [True: 23.0k, False: 2.01k]
  |  Branch (247:23): [True: 22.9k, False: 100]
  |  Branch (247:46): [True: 21.6k, False: 1.26k]
  ------------------
  248|       |        /**  condense only double letters  **/
  249|  21.6k|        target.push_back(c);
  250|       |        /// printf("\n setting \n");
  251|  21.6k|      }
  252|       |
  253|  82.0k|      i++;
  254|  82.0k|      z = 0;
  255|  82.0k|      k = 0;
  256|  82.0k|    }
  257|  82.1k|  } /**  end of   while ((c = word[i]) != '\0')  **/
  258|       |
  259|  10.1k|  return target;
  260|  10.1k|} /**  end of function "phonet"  **/
phonet.cxx:_ZL9myisalphac:
   59|  7.22k|static int myisalpha(char ch) {
   60|  7.22k|  if ((unsigned char)ch < 128)
  ------------------
  |  Branch (60:7): [True: 6.79k, False: 426]
  ------------------
   61|  6.79k|    return isalpha(ch);
   62|    426|  return 1;
   63|  7.22k|}

_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_m:
  184|   356k|bool RepList::conv(const std::string& in_word, std::string& dest, size_t maxlen) {
  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|   356k|  if (can_use_trie && trie.get_status())
  ------------------
  |  Branch (187:7): [True: 356k, False: 0]
  |  Branch (187:23): [True: 356k, False: 0]
  ------------------
  188|   356k|    return trie.transcode(in_word, dest, maxlen) != 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 && dest.size() <= maxlen; ++i) {
  ------------------
  |  Branch (196:22): [True: 0, False: 0]
  |  Branch (196:37): [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|   356k|}
_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|   356k|    bool get_status() const { return status_ok; }
_ZNK4TrieItLb1EE9transcodeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7_m:
  205|   356k|    TranscodeResult transcode(const std::string& src, std::string& dst, size_t maxlen) const {
  206|       |        // Halt and return None if the trie is in an invalid memory state
  207|   356k|        if (!status_ok || src.empty()) return TranscodeResult::None;
  ------------------
  |  Branch (207:13): [True: 0, False: 356k]
  |  Branch (207:27): [True: 1.89k, False: 354k]
  ------------------
  208|       |        
  209|   354k|        dst.clear();
  210|   354k|        dst.reserve(src.size()); 
  211|       |        
  212|       |        // State trackers for the 3-way outcome
  213|   354k|        bool any_substituted = false;
  214|   354k|        bool any_copied = false;
  215|       |        
  216|   354k|        size_t i = 0;
  217|       |        
  218|  4.47M|        while (i < src.size() && dst.size() <= maxlen) {
  ------------------
  |  Branch (218:16): [True: 4.12M, False: 354k]
  |  Branch (218:34): [True: 4.12M, False: 0]
  ------------------
  219|  4.12M|            size_t curr_idx = 0;
  220|  4.12M|            size_t match_len = 0;
  221|  4.12M|            uint32_t best_sub = 0xFFFFFFFF;
  222|       |
  223|  4.12M|            size_t j = i;
  224|       |            
  225|       |            // Greedily traverse the trie to find the longest matching sequence
  226|  4.12M|            while (j < src.size()) {
  ------------------
  |  Branch (226:20): [True: 4.12M, False: 168]
  ------------------
  227|  4.12M|                uint8_t byte = static_cast<uint8_t>(src[j]);
  228|       |                
  229|  4.12M|                if (UseNibbles) {
  ------------------
  |  Branch (229:21): [True: 4.12M, Folded]
  ------------------
  230|  4.12M|                    IndexType r1 = nodes[curr_idx].children[(byte >> 4) & 0x0F];
  231|  4.12M|                    if (r1 == 0) break;
  ------------------
  |  Branch (231:25): [True: 4.07M, False: 54.1k]
  ------------------
  232|  54.1k|                    curr_idx += r1;
  233|       |
  234|  54.1k|                    IndexType r2 = nodes[curr_idx].children[byte & 0x0F];
  235|  54.1k|                    if (r2 == 0) break;
  ------------------
  |  Branch (235:25): [True: 52.8k, False: 1.27k]
  ------------------
  236|  1.27k|                    curr_idx += r2;
  237|  1.27k|                } 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|  1.27k|                ++j;
  244|       |                
  245|       |                // Track the deepest valid match found during traversal
  246|  1.27k|                if (sub_info_arena[curr_idx] != 0xFFFFFFFF) {
  ------------------
  |  Branch (246:21): [True: 370, False: 900]
  ------------------
  247|    370|                    best_sub = sub_info_arena[curr_idx];
  248|    370|                    match_len = j - i;
  249|    370|                }
  250|  1.27k|            }
  251|       |
  252|  4.12M|            if (best_sub != 0xFFFFFFFF) {
  ------------------
  |  Branch (252:17): [True: 370, False: 4.12M]
  ------------------
  253|       |                // Decode the 24-bit offset and 8-bit size, append directly from arena
  254|    370|                dst.append(&char_arena[best_sub >> 8], best_sub & 0xFF);
  255|    370|                i += match_len;
  256|    370|                any_substituted = true; // State update: Substitution occurred
  257|  4.12M|            } else {
  258|       |                // Fallback: copy unmapped character directly to output
  259|  4.12M|                dst.push_back(src[i]);
  260|  4.12M|                ++i;
  261|  4.12M|                any_copied = true; // State update: Verbatim copy occurred
  262|  4.12M|            }
  263|  4.12M|        }
  264|       |        
  265|       |        // ALGORITHM: Outcome Evaluation
  266|   354k|        if (any_substituted && any_copied) {
  ------------------
  |  Branch (266:13): [True: 233, False: 354k]
  |  Branch (266:32): [True: 228, False: 5]
  ------------------
  267|    228|            return TranscodeResult::Partial;
  268|   354k|        } else if (any_substituted) {
  ------------------
  |  Branch (268:20): [True: 5, False: 354k]
  ------------------
  269|      5|            return TranscodeResult::All;
  270|      5|        }
  271|       |        
  272|   354k|        return TranscodeResult::None;
  273|   354k|    }

_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|  81.4M|                        int& info) {
  167|  81.4M|  if (wlst.size() == maxSug)
  ------------------
  |  Branch (167:7): [True: 0, False: 81.4M]
  ------------------
  168|      0|    return;
  169|       |
  170|  81.4M|  const int cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (170:20): [True: 31.3k, False: 81.4M]
  ------------------
  171|       |
  172|  81.4M|  if (cwrd) {
  ------------------
  |  Branch (172:7): [True: 81.4M, False: 31.3k]
  ------------------
  173|  81.4M|    if (int result = checkword(candidate, cpdsuggest, timer, timelimit)) {
  ------------------
  |  Branch (173:13): [True: 2.08k, False: 81.4M]
  ------------------
  174|       |      // compound word in the dictionary
  175|  2.08k|      if (cpdsuggest == 0 && result >= 2)
  ------------------
  |  Branch (175:11): [True: 2.08k, False: 0]
  |  Branch (175:30): [True: 0, False: 2.08k]
  ------------------
  176|      0|          info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  177|  2.08k|      wlst.push_back(candidate);
  178|  2.08k|    }
  179|  81.4M|  }
  180|  81.4M|}
_ZN10SuggestMgr7suggestERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_Pib:
  190|   147k|                        int* onlycompoundsug, bool test_simplesug) {
  191|   147k|  int nocompoundtwowords = 0; // no second or third loops, see below
  192|   147k|  std::vector<w_char> word_utf;
  193|   147k|  size_t nsugorig = slst.size(), oldSug = 0;
  194|   147k|  std::string w2;
  195|   147k|  bool good_suggestion = false;
  196|       |
  197|       |  // word reversing wrapper for complex prefixes
  198|   147k|  if (complexprefixes) {
  ------------------
  |  Branch (198:7): [True: 8.44k, False: 139k]
  ------------------
  199|  8.44k|    w2.assign(w);
  200|  8.44k|    if (utf8)
  ------------------
  |  Branch (200:9): [True: 0, False: 8.44k]
  ------------------
  201|      0|      reverseword_utf(w2);
  202|  8.44k|    else
  203|  8.44k|      reverseword(w2);
  204|  8.44k|  }
  205|       |
  206|   147k|  const std::string& word = complexprefixes ? w2 : w;
  ------------------
  |  Branch (206:29): [True: 8.44k, False: 139k]
  ------------------
  207|       |
  208|   147k|  suggest_start = std::chrono::steady_clock::now();
  209|       |
  210|   147k|  if (utf8) {
  ------------------
  |  Branch (210:7): [True: 63.0k, False: 84.9k]
  ------------------
  211|  63.0k|    int wl = u8_u16(word_utf, word);
  212|  63.0k|    if (wl == -1) {
  ------------------
  |  Branch (212:9): [True: 9.87k, False: 53.1k]
  ------------------
  213|  9.87k|      return false;
  214|  9.87k|    }
  215|  63.0k|  }
  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|   138k|  int info = 0;
  225|   551k|  for (int cpdsuggest = 0; cpdsuggest < 3 && nocompoundtwowords == 0; cpdsuggest++) {
  ------------------
  |  Branch (225:28): [True: 413k, False: 137k]
  |  Branch (225:46): [True: 413k, False: 147]
  ------------------
  226|       |
  227|       |    // limit compound suggestion
  228|   413k|    if (cpdsuggest > 0)
  ------------------
  |  Branch (228:9): [True: 275k, False: 138k]
  ------------------
  229|   275k|      oldSug = slst.size();
  230|       |
  231|       |    // suggestions for an uppercase word (html -> HTML)
  232|   413k|    if (slst.size() < maxSug) {
  ------------------
  |  Branch (232:9): [True: 413k, False: 15]
  ------------------
  233|   413k|      size_t i = slst.size();
  234|   413k|      if (utf8)
  ------------------
  |  Branch (234:11): [True: 159k, False: 254k]
  ------------------
  235|   159k|        capchars_utf(slst, word_utf, cpdsuggest, info);
  236|   254k|      else
  237|   254k|        capchars(slst, word, cpdsuggest, info);
  238|   413k|      if (slst.size() > i)
  ------------------
  |  Branch (238:11): [True: 147, False: 413k]
  ------------------
  239|    147|        good_suggestion = true;
  240|   413k|    }
  241|       |
  242|       |    // perhaps we made a typical fault of spelling
  243|   413k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (243:9): [True: 413k, False: 15]
  |  Branch (243:36): [True: 138k, False: 275k]
  |  Branch (243:51): [True: 275k, False: 0]
  ------------------
  244|   413k|      size_t i = slst.size();
  245|   413k|      replchars(slst, word, cpdsuggest, info);
  246|   413k|      if (slst.size() > i) {
  ------------------
  |  Branch (246:11): [True: 0, False: 413k]
  ------------------
  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|   413k|    }
  252|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (252:9): [True: 0, False: 413k]
  ------------------
  253|      0|      return good_suggestion;
  254|   413k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (254:9): [True: 0, False: 413k]
  |  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|   413k|    if ((slst.size() < maxSug) &&
  ------------------
  |  Branch (258:9): [True: 413k, False: 15]
  ------------------
  259|   413k|        (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (259:10): [True: 138k, False: 275k]
  |  Branch (259:25): [True: 275k, False: 0]
  ------------------
  260|   413k|      mapchars(slst, word, cpdsuggest, info);
  261|   413k|    }
  262|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (262:9): [True: 11, False: 413k]
  ------------------
  263|     11|      return good_suggestion;
  264|   413k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (264:9): [True: 0, False: 413k]
  |  Branch (264:27): [True: 0, False: 0]
  ------------------
  265|      0|      return true;
  266|       |
  267|       |    // only suggest compound words when no other ~good suggestion
  268|   413k|    if ((cpdsuggest == 0) && (slst.size() > nsugorig))
  ------------------
  |  Branch (268:9): [True: 138k, False: 275k]
  |  Branch (268:30): [True: 147, False: 137k]
  ------------------
  269|    147|      nocompoundtwowords = 1;
  270|       |
  271|       |    // did we swap the order of chars by mistake
  272|   413k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (272:9): [True: 413k, False: 15]
  |  Branch (272:36): [True: 138k, False: 275k]
  |  Branch (272:51): [True: 275k, False: 0]
  ------------------
  273|   413k|      if (utf8)
  ------------------
  |  Branch (273:11): [True: 159k, False: 254k]
  ------------------
  274|   159k|        swapchar_utf(slst, word_utf, cpdsuggest, info);
  275|   254k|      else
  276|   254k|        swapchar(slst, word, cpdsuggest, info);
  277|   413k|    }
  278|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (278:9): [True: 0, False: 413k]
  ------------------
  279|      0|      return good_suggestion;
  280|   413k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (280:9): [True: 0, False: 413k]
  |  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|   413k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (284:9): [True: 413k, False: 15]
  |  Branch (284:36): [True: 138k, False: 275k]
  |  Branch (284:51): [True: 275k, False: 0]
  ------------------
  285|   413k|      if (utf8)
  ------------------
  |  Branch (285:11): [True: 159k, False: 254k]
  ------------------
  286|   159k|        longswapchar_utf(slst, word_utf, cpdsuggest, info);
  287|   254k|      else
  288|   254k|        longswapchar(slst, word, cpdsuggest, info);
  289|   413k|    }
  290|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (290:9): [True: 0, False: 413k]
  ------------------
  291|      0|      return good_suggestion;
  292|   413k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (292:9): [True: 0, False: 413k]
  |  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|   413k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (296:9): [True: 413k, False: 15]
  |  Branch (296:36): [True: 138k, False: 275k]
  |  Branch (296:51): [True: 275k, False: 0]
  ------------------
  297|   413k|      if (utf8)
  ------------------
  |  Branch (297:11): [True: 159k, False: 254k]
  ------------------
  298|   159k|        badcharkey_utf(slst, word_utf, cpdsuggest, info);
  299|   254k|      else
  300|   254k|        badcharkey(slst, word, cpdsuggest, info);
  301|   413k|    }
  302|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (302:9): [True: 0, False: 413k]
  ------------------
  303|      0|      return good_suggestion;
  304|   413k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (304:9): [True: 0, False: 413k]
  |  Branch (304:27): [True: 0, False: 0]
  ------------------
  305|      0|      return true;
  306|       |
  307|       |    // did we add a char that should not be there
  308|   413k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (308:9): [True: 413k, False: 15]
  |  Branch (308:36): [True: 138k, False: 275k]
  |  Branch (308:51): [True: 275k, False: 0]
  ------------------
  309|   413k|      if (utf8)
  ------------------
  |  Branch (309:11): [True: 159k, False: 254k]
  ------------------
  310|   159k|        extrachar_utf(slst, word_utf, cpdsuggest, info);
  311|   254k|      else
  312|   254k|        extrachar(slst, word, cpdsuggest, info);
  313|   413k|    }
  314|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (314:9): [True: 0, False: 413k]
  ------------------
  315|      0|      return good_suggestion;
  316|   413k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (316:9): [True: 0, False: 413k]
  |  Branch (316:27): [True: 0, False: 0]
  ------------------
  317|      0|      return true;
  318|       |
  319|       |    // did we forgot a char
  320|   413k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (320:9): [True: 413k, False: 15]
  |  Branch (320:36): [True: 138k, False: 275k]
  |  Branch (320:51): [True: 275k, False: 0]
  ------------------
  321|   413k|      if (utf8)
  ------------------
  |  Branch (321:11): [True: 159k, False: 254k]
  ------------------
  322|   159k|        forgotchar_utf(slst, word_utf, cpdsuggest, info);
  323|   254k|      else
  324|   254k|        forgotchar(slst, word, cpdsuggest, info);
  325|   413k|    }
  326|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (326:9): [True: 0, False: 413k]
  ------------------
  327|      0|      return good_suggestion;
  328|   413k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (328:9): [True: 0, False: 413k]
  |  Branch (328:27): [True: 0, False: 0]
  ------------------
  329|      0|      return true;
  330|       |
  331|       |    // did we move a char
  332|   413k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (332:9): [True: 413k, False: 15]
  |  Branch (332:36): [True: 138k, False: 275k]
  |  Branch (332:51): [True: 275k, False: 0]
  ------------------
  333|   413k|      if (utf8)
  ------------------
  |  Branch (333:11): [True: 159k, False: 254k]
  ------------------
  334|   159k|        movechar_utf(slst, word_utf, cpdsuggest, info);
  335|   254k|      else
  336|   254k|        movechar(slst, word, cpdsuggest, info);
  337|   413k|    }
  338|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (338:9): [True: 0, False: 413k]
  ------------------
  339|      0|      return good_suggestion;
  340|   413k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (340:9): [True: 0, False: 413k]
  |  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|   413k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (344:9): [True: 413k, False: 15]
  |  Branch (344:36): [True: 138k, False: 275k]
  |  Branch (344:51): [True: 275k, False: 0]
  ------------------
  345|   413k|      if (utf8)
  ------------------
  |  Branch (345:11): [True: 159k, False: 254k]
  ------------------
  346|   159k|        badchar_utf(slst, word_utf, cpdsuggest, info);
  347|   254k|      else
  348|   254k|        badchar(slst, word, cpdsuggest, info);
  349|   413k|    }
  350|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (350:9): [True: 0, False: 413k]
  ------------------
  351|      0|      return good_suggestion;
  352|   413k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (352:9): [True: 0, False: 413k]
  |  Branch (352:27): [True: 0, False: 0]
  ------------------
  353|      0|      return true;
  354|       |
  355|       |    // did we double two characters
  356|   413k|    if ((slst.size() < maxSug) && (!cpdsuggest || (slst.size() < oldSug + maxcpdsugs))) {
  ------------------
  |  Branch (356:9): [True: 413k, False: 15]
  |  Branch (356:36): [True: 138k, False: 275k]
  |  Branch (356:51): [True: 275k, False: 0]
  ------------------
  357|   413k|      if (utf8)
  ------------------
  |  Branch (357:11): [True: 159k, False: 254k]
  ------------------
  358|   159k|        doubletwochars_utf(slst, word_utf, cpdsuggest, info);
  359|   254k|      else
  360|   254k|        doubletwochars(slst, word, cpdsuggest, info);
  361|   413k|    }
  362|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (362:9): [True: 0, False: 413k]
  ------------------
  363|      0|      return good_suggestion;
  364|   413k|    if (test_simplesug && slst.size())
  ------------------
  |  Branch (364:9): [True: 0, False: 413k]
  |  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|   413k|    if (!cpdsuggest || (!nosplitsugs && slst.size() < oldSug + maxcpdsugs)) {
  ------------------
  |  Branch (371:9): [True: 138k, False: 275k]
  |  Branch (371:25): [True: 275k, False: 0]
  |  Branch (371:41): [True: 275k, False: 0]
  ------------------
  372|   413k|      good_suggestion = twowords(slst, word, cpdsuggest, good_suggestion, info);
  373|       |
  374|   413k|      if (info & SPELL_BEST_SUG)
  ------------------
  |  |   89|   413k|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  |  Branch (374:11): [True: 137, False: 413k]
  ------------------
  375|    137|        return true;
  376|   413k|    }
  377|   413k|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   413k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (377:9): [True: 0, False: 413k]
  ------------------
  378|      0|      return good_suggestion;
  379|       |
  380|       |    // testing returns after the first loop
  381|   413k|    if (test_simplesug)
  ------------------
  |  Branch (381:9): [True: 0, False: 413k]
  ------------------
  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|   413k|    if (cpdsuggest == 1 && (slst.size() > oldSug || (info & SPELL_COMPOUND)))
  ------------------
  |  |   81|   137k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  |  Branch (387:9): [True: 137k, False: 275k]
  |  Branch (387:29): [True: 0, False: 137k]
  |  Branch (387:53): [True: 0, False: 137k]
  ------------------
  388|      0|       nocompoundtwowords = 1;
  389|       |
  390|   413k|  }  // repeating ``for'' statement compounding support
  391|       |
  392|   137k|  if (!nocompoundtwowords && (!slst.empty()) && onlycompoundsug)
  ------------------
  |  Branch (392:7): [True: 137k, False: 147]
  |  Branch (392:30): [True: 17.6k, False: 120k]
  |  Branch (392:49): [True: 17.6k, False: 0]
  ------------------
  393|  17.6k|    *onlycompoundsug = 1;
  394|       |
  395|   137k|  return good_suggestion;
  396|   138k|}
_ZN10SuggestMgr12capchars_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  401|   159k|                              int cpdsuggest, int& info) {
  402|   159k|  std::vector<w_char> candidate_utf(word);
  403|   159k|  mkallcap_utf(candidate_utf, langnum);
  404|   159k|  std::string candidate;
  405|   159k|  u16_u8(candidate, candidate_utf);
  406|   159k|  testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  407|   159k|}
_ZN10SuggestMgr8capcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  412|   254k|                          int cpdsuggest, int& info) {
  413|   254k|  std::string candidate(word);
  414|   254k|  mkallcap(candidate, csconv);
  415|   254k|  testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  416|   254k|}
_ZN10SuggestMgr8mapcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  421|   413k|                         int cpdsuggest, int& info) {
  422|   413k|  std::string candidate;
  423|   413k|  std::chrono::steady_clock::time_point timelimit;
  424|   413k|  int timer;
  425|       |
  426|   413k|  if (word.size() < 2 || !pAMgr)
  ------------------
  |  Branch (426:7): [True: 33.0k, False: 380k]
  |  Branch (426:26): [True: 0, False: 380k]
  ------------------
  427|  33.0k|    return wlst.size();
  428|       |
  429|   380k|  const std::vector<mapentry>& maptable = pAMgr->get_maptable();
  430|   380k|  if (maptable.empty())
  ------------------
  |  Branch (430:7): [True: 364k, False: 15.8k]
  ------------------
  431|   364k|    return wlst.size();
  432|       |
  433|  15.8k|  timelimit = std::chrono::steady_clock::now();
  434|  15.8k|  timer = MINTIMER;
  ------------------
  |  |  110|  15.8k|#define MINTIMER 100
  ------------------
  435|  15.8k|  return map_related(word, candidate, 0, wlst, cpdsuggest,
  436|  15.8k|                     maptable, &timer, &timelimit, 0, info);
  437|   380k|}
_ZN10SuggestMgr11map_relatedERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERS6_mRNS0_6vectorIS6_NS4_IS6_EEEEiRKNSA_ISC_NS4_ISC_EEEEPiPNS0_6chrono10time_pointINSJ_12steady_clockENSJ_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEEiRi:
  447|  6.42M|                            int depth, int& info) {
  448|  6.42M|  if (word.size() == wn) {
  ------------------
  |  Branch (448:7): [True: 2.82M, False: 3.60M]
  ------------------
  449|  2.82M|    if (candidate == word)
  ------------------
  |  Branch (449:9): [True: 15.8k, False: 2.80M]
  ------------------
  450|  15.8k|      return wlst.size();
  451|  2.80M|    const int cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (451:22): [True: 0, False: 2.80M]
  ------------------
  452|  2.80M|    if ((cwrd) && checkword(candidate, cpdsuggest, timer, timelimit)) {
  ------------------
  |  Branch (452:9): [True: 2.80M, False: 0]
  |  Branch (452:19): [True: 0, False: 2.80M]
  ------------------
  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.80M|    return wlst.size();
  458|  2.82M|  }
  459|       |
  460|  3.60M|  if (depth > 0x3F00) {
  ------------------
  |  Branch (460:7): [True: 0, False: 3.60M]
  ------------------
  461|      0|    *timer = 0;
  462|      0|    return wlst.size();
  463|      0|  }
  464|       |
  465|  3.60M|  int in_map = 0;
  466|  14.4M|  for (size_t j = 0; j < maptable.size(); ++j) {
  ------------------
  |  Branch (466:22): [True: 10.8M, False: 3.60M]
  ------------------
  467|  39.6M|    for (size_t k = 0; k < maptable[j].size(); ++k) {
  ------------------
  |  Branch (467:24): [True: 28.8M, False: 10.8M]
  ------------------
  468|  28.8M|      size_t len = maptable[j][k].size();
  469|  28.8M|      if (len && word.compare(wn, len, maptable[j][k]) == 0) {
  ------------------
  |  Branch (469:11): [True: 28.8M, False: 0]
  |  Branch (469:18): [True: 1.40M, False: 27.4M]
  ------------------
  470|  1.40M|        in_map = 1;
  471|  1.40M|        size_t cn = candidate.size();
  472|  5.61M|        for (size_t l = 0; l < maptable[j].size(); ++l) {
  ------------------
  |  Branch (472:28): [True: 4.21M, False: 1.40M]
  ------------------
  473|  4.21M|          candidate.resize(cn);
  474|  4.21M|          candidate.append(maptable[j][l]);
  475|  4.21M|          map_related(word, candidate, wn + len, wlst,
  476|  4.21M|                           cpdsuggest, maptable, timer, timelimit, depth + 1, info);
  477|  4.21M|          if (!(*timer))
  ------------------
  |  Branch (477:15): [True: 555, False: 4.21M]
  ------------------
  478|    555|            return wlst.size();
  479|  4.21M|          if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS) {
  ------------------
  |  |  108|  4.21M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (479:15): [True: 11, False: 4.21M]
  ------------------
  480|     11|            *timer = 0;
  481|     11|            return wlst.size();
  482|     11|          }
  483|  4.21M|        }
  484|  1.40M|      }
  485|  28.8M|    }
  486|  10.8M|  }
  487|  3.60M|  if (!in_map) {
  ------------------
  |  Branch (487:7): [True: 2.19M, False: 1.40M]
  ------------------
  488|  2.19M|    candidate.push_back(word[wn]);
  489|  2.19M|    map_related(word, candidate, wn + 1, wlst, cpdsuggest,
  490|  2.19M|                maptable, timer, timelimit, depth + 1, info);
  491|  2.19M|  }
  492|  3.60M|  return wlst.size();
  493|  3.60M|}
_ZN10SuggestMgr9replcharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  499|   413k|                          int cpdsuggest, int& info) {
  500|   413k|  std::string candidate;
  501|   413k|  int wl = word.size();
  502|   413k|  if (wl < 2 || !pAMgr)
  ------------------
  |  Branch (502:7): [True: 33.0k, False: 380k]
  |  Branch (502:17): [True: 0, False: 380k]
  ------------------
  503|  33.0k|    return wlst.size();
  504|   380k|  const std::vector<replentry>& reptable = pAMgr->get_reptable();
  505|   380k|  auto replchars_start = std::chrono::steady_clock::now();
  506|   380k|  for (const auto& entry : reptable) {
  ------------------
  |  Branch (506:26): [True: 79.0k, False: 380k]
  ------------------
  507|  79.0k|    size_t r = 0;
  508|       |    // search every occurence of the pattern in the word
  509|  79.0k|    while ((r = word.find(entry.pattern, r)) != std::string::npos) {
  ------------------
  |  Branch (509:12): [True: 6, False: 79.0k]
  ------------------
  510|      6|      if (std::chrono::steady_clock::now() - replchars_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|      6|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (510:11): [True: 0, False: 6]
  ------------------
  511|      0|        return wlst.size();
  512|      6|      int type = (r == 0) ? 1 : 0;
  ------------------
  |  Branch (512:18): [True: 0, False: 6]
  ------------------
  513|      6|      if (r + entry.pattern.size() == word.size())
  ------------------
  |  Branch (513:11): [True: 0, False: 6]
  ------------------
  514|      0|        type += 2;
  515|      6|      while (type && entry.outstrings[type].empty())
  ------------------
  |  Branch (515:14): [True: 0, False: 6]
  |  Branch (515:22): [True: 0, False: 0]
  ------------------
  516|      0|        type = (type == 2 && r != 0) ? 0 : type - 1;
  ------------------
  |  Branch (516:17): [True: 0, False: 0]
  |  Branch (516:30): [True: 0, False: 0]
  ------------------
  517|      6|      const std::string&out = entry.outstrings[type];
  518|      6|      if (out.empty()) {
  ------------------
  |  Branch (518:11): [True: 0, False: 6]
  ------------------
  519|      0|        ++r;
  520|      0|        continue;
  521|      0|      }
  522|      6|      candidate.assign(word, 0, r);
  523|      6|      candidate.append(entry.outstrings[type]);
  524|      6|      candidate.append(word, r + entry.pattern.size(), std::string::npos);
  525|      6|      size_t sp = candidate.find(' ');
  526|      6|      size_t oldns = wlst.size();
  527|      6|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  528|      6|      if (oldns < wlst.size()) {
  ------------------
  |  Branch (528:11): [True: 0, False: 6]
  ------------------
  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|      6|      if (sp != std::string::npos) {
  ------------------
  |  Branch (534:11): [True: 0, False: 6]
  ------------------
  535|      0|        size_t prev = 0;
  536|      0|        while (sp != std::string::npos) {
  ------------------
  |  Branch (536:16): [True: 0, False: 0]
  ------------------
  537|      0|          std::string prev_chunk = candidate.substr(prev, sp - prev);
  538|      0|          if (checkword(prev_chunk, 0, nullptr, nullptr)) {
  ------------------
  |  Branch (538:15): [True: 0, False: 0]
  ------------------
  539|      0|            oldns = wlst.size();
  540|      0|            std::string post_chunk = candidate.substr(sp + 1);
  541|      0|            testsug(wlst, post_chunk, cpdsuggest, nullptr, nullptr, info);
  542|      0|            if (oldns < wlst.size()) {
  ------------------
  |  Branch (542:17): [True: 0, False: 0]
  ------------------
  543|      0|              wlst[wlst.size() - 1] = candidate;
  544|      0|            }
  545|      0|          }
  546|      0|          prev = sp + 1;
  547|      0|          sp = candidate.find(' ', prev);
  548|      0|        }
  549|      0|      }
  550|      6|      r++;  // search for the next letter
  551|      6|    }
  552|  79.0k|  }
  553|   380k|  return wlst.size();
  554|   380k|}
_ZN10SuggestMgr14doubletwocharsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  563|   254k|                               int cpdsuggest, int& info) {
  564|   254k|  size_t wl = word.size();
  565|   254k|  if (wl < 5 || !pAMgr)
  ------------------
  |  Branch (565:7): [True: 51.1k, False: 203k]
  |  Branch (565:17): [True: 0, False: 203k]
  ------------------
  566|  51.1k|    return wlst.size();
  567|       |
  568|   203k|  int state = 0;
  569|  4.81M|  for (size_t i = 2; i < wl; ++i) {
  ------------------
  |  Branch (569:22): [True: 4.61M, False: 203k]
  ------------------
  570|  4.61M|    if (word[i] == word[i - 2]) {
  ------------------
  |  Branch (570:9): [True: 1.18M, False: 3.43M]
  ------------------
  571|  1.18M|      state++;
  572|  1.18M|      if (state == 3 || (state == 2 && i >= 4)) {
  ------------------
  |  Branch (572:11): [True: 6.26k, False: 1.17M]
  |  Branch (572:26): [True: 417k, False: 758k]
  |  Branch (572:40): [True: 408k, False: 8.78k]
  ------------------
  573|   414k|        auto word_iter = word.begin();
  574|   414k|        std::string candidate(word_iter, word_iter + i - 1);
  575|   414k|        candidate.insert(candidate.end(), word_iter + i + 1, word.end());
  576|   414k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  577|   414k|        state = 0;
  578|   414k|      }
  579|  3.43M|    } else {
  580|  3.43M|      state = 0;
  581|  3.43M|    }
  582|  4.61M|  }
  583|   203k|  return wlst.size();
  584|   254k|}
_ZN10SuggestMgr18doubletwochars_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  593|   159k|                                   int cpdsuggest, int& info) {
  594|   159k|  size_t wl = word.size();
  595|   159k|  int state = 0;
  596|   159k|  if (wl < 5 || !pAMgr)
  ------------------
  |  Branch (596:7): [True: 56.0k, False: 103k]
  |  Branch (596:17): [True: 0, False: 103k]
  ------------------
  597|  56.0k|    return wlst.size();
  598|  1.67M|  for (size_t i = 2; i < wl; ++i) {
  ------------------
  |  Branch (598:22): [True: 1.57M, False: 103k]
  ------------------
  599|  1.57M|    if (word[i] == word[i - 2]) {
  ------------------
  |  Branch (599:9): [True: 473k, False: 1.10M]
  ------------------
  600|   473k|      state++;
  601|   473k|      if (state == 3 || (state == 2 && i >= 4)) {
  ------------------
  |  Branch (601:11): [True: 3.61k, False: 470k]
  |  Branch (601:26): [True: 164k, False: 305k]
  |  Branch (601:40): [True: 159k, False: 5.04k]
  ------------------
  602|   163k|        auto word_iter = word.begin();
  603|   163k|        std::vector<w_char> candidate_utf(word_iter, word_iter + i - 1);
  604|   163k|        candidate_utf.insert(candidate_utf.end(), word_iter + i + 1, word.end());
  605|   163k|        std::string candidate;
  606|   163k|        u16_u8(candidate, candidate_utf);
  607|   163k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  608|   163k|        state = 0;
  609|   163k|      }
  610|  1.10M|    } else {
  611|  1.10M|      state = 0;
  612|  1.10M|    }
  613|  1.57M|  }
  614|   103k|  return wlst.size();
  615|   159k|}
_ZN10SuggestMgr10badcharkeyERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  621|   254k|                           int cpdsuggest, int& info) {
  622|   254k|  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.39M|  for (size_t i = 0, wl = candidate.size(); i < wl; ++i) {
  ------------------
  |  Branch (626:45): [True: 5.14M, False: 254k]
  ------------------
  627|  5.14M|    char tmpc = candidate[i];
  628|       |    // check with uppercase letters
  629|  5.14M|    candidate[i] = csconv[((unsigned char)tmpc)].cupper;
  630|  5.14M|    if (tmpc != candidate[i]) {
  ------------------
  |  Branch (630:9): [True: 1.35M, False: 3.78M]
  ------------------
  631|  1.35M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  632|  1.35M|      candidate[i] = tmpc;
  633|  1.35M|    }
  634|       |    // check neighbor characters in keyboard string
  635|  5.14M|    if (ckey.empty())
  ------------------
  |  Branch (635:9): [True: 0, False: 5.14M]
  ------------------
  636|      0|      continue;
  637|  5.14M|    size_t loc = 0;
  638|   133M|    while ((loc < ckeyl) && ckey[loc] != tmpc)
  ------------------
  |  Branch (638:12): [True: 129M, False: 4.22M]
  |  Branch (638:29): [True: 128M, False: 915k]
  ------------------
  639|   128M|      ++loc;
  640|  6.08M|    while (loc < ckeyl) {
  ------------------
  |  Branch (640:12): [True: 944k, False: 5.14M]
  ------------------
  641|       |      // a long keyboard string can hold many neighbours for this
  642|       |      // character, so give up once the overall time budget is spent
  643|   944k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   944k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (643:11): [True: 0, False: 944k]
  ------------------
  644|      0|        return wlst.size();
  645|   944k|      if ((loc > 0) && ckey[loc - 1] != '|') {
  ------------------
  |  Branch (645:11): [True: 780k, False: 164k]
  |  Branch (645:24): [True: 746k, False: 33.8k]
  ------------------
  646|   746k|        candidate[i] = ckey[loc - 1];
  647|   746k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  648|   746k|      }
  649|   944k|      if (((loc + 1) < ckeyl) && (ckey[loc + 1] != '|')) {
  ------------------
  |  Branch (649:11): [True: 867k, False: 77.5k]
  |  Branch (649:34): [True: 785k, False: 81.6k]
  ------------------
  650|   785k|        candidate[i] = ckey[loc + 1];
  651|   785k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  652|   785k|      }
  653|  15.2M|      do {
  654|  15.2M|        loc++;
  655|  15.2M|      } while ((loc < ckeyl) && ckey[loc] != tmpc);
  ------------------
  |  Branch (655:16): [True: 14.2M, False: 915k]
  |  Branch (655:33): [True: 14.2M, False: 29.4k]
  ------------------
  656|   944k|    }
  657|  5.14M|    candidate[i] = tmpc;
  658|  5.14M|  }
  659|   254k|  return wlst.size();
  660|   254k|}
_ZN10SuggestMgr14badcharkey_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  666|   159k|                               int cpdsuggest, int& info) {
  667|   159k|  std::string candidate;
  668|   159k|  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.08M|  for (size_t i = 0, wl = word.size(); i < wl; ++i) {
  ------------------
  |  Branch (671:40): [True: 1.92M, False: 159k]
  ------------------
  672|  1.92M|    w_char tmpc = candidate_utf[i];
  673|       |    // check with uppercase letters
  674|  1.92M|    candidate_utf[i] = upper_utf(candidate_utf[i], 1);
  675|  1.92M|    if (tmpc != candidate_utf[i]) {
  ------------------
  |  Branch (675:9): [True: 485k, False: 1.44M]
  ------------------
  676|   485k|      u16_u8(candidate, candidate_utf);
  677|   485k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  678|   485k|      candidate_utf[i] = tmpc;
  679|   485k|    }
  680|       |    // check neighbor characters in keyboard string
  681|  1.92M|    if (ckey_utf.empty())
  ------------------
  |  Branch (681:9): [True: 0, False: 1.92M]
  ------------------
  682|      0|      continue;
  683|  1.92M|    size_t loc = 0;
  684|  47.6M|    while ((loc < ckeyl) && ckey_utf[loc] != tmpc)
  ------------------
  |  Branch (684:12): [True: 46.2M, False: 1.42M]
  |  Branch (684:29): [True: 45.7M, False: 497k]
  ------------------
  685|  45.7M|      ++loc;
  686|  2.44M|    while (loc < ckeyl) {
  ------------------
  |  Branch (686:12): [True: 513k, False: 1.92M]
  ------------------
  687|       |      // a long keyboard string can hold many neighbours for this
  688|       |      // character, so give up once the overall time budget is spent
  689|   513k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|   513k|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (689:11): [True: 0, False: 513k]
  ------------------
  690|      0|        return wlst.size();
  691|   513k|      if ((loc > 0) && ckey_utf[loc - 1] != W_VLINE) {
  ------------------
  |  Branch (691:11): [True: 410k, False: 103k]
  |  Branch (691:24): [True: 410k, False: 0]
  ------------------
  692|   410k|        candidate_utf[i] = ckey_utf[loc - 1];
  693|   410k|        u16_u8(candidate, candidate_utf);
  694|   410k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  695|   410k|      }
  696|   513k|      if (((loc + 1) < ckeyl) && (ckey_utf[loc + 1] != W_VLINE)) {
  ------------------
  |  Branch (696:11): [True: 462k, False: 51.5k]
  |  Branch (696:34): [True: 462k, False: 0]
  ------------------
  697|   462k|        candidate_utf[i] = ckey_utf[loc + 1];
  698|   462k|        u16_u8(candidate, candidate_utf);
  699|   462k|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  700|   462k|      }
  701|  8.23M|      do {
  702|  8.23M|        loc++;
  703|  8.23M|      } while ((loc < ckeyl) && ckey_utf[loc] != tmpc);
  ------------------
  |  Branch (703:16): [True: 7.73M, False: 497k]
  |  Branch (703:33): [True: 7.72M, False: 15.9k]
  ------------------
  704|   513k|    }
  705|  1.92M|    candidate_utf[i] = tmpc;
  706|  1.92M|  }
  707|   159k|  return wlst.size();
  708|   159k|}
_ZN10SuggestMgr7badcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  713|   254k|                               int cpdsuggest, int& info) {
  714|   254k|  std::string candidate(word);
  715|   254k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  716|   254k|  int timer = MINTIMER;
  ------------------
  |  |  110|   254k|#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|   254k|  for (size_t j = 0; j < ctryl; ++j) {
  ------------------
  |  Branch (719:22): [True: 0, False: 254k]
  ------------------
  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|   254k|  return wlst.size();
  732|   254k|}
_ZN10SuggestMgr11badchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  737|   159k|                            int cpdsuggest, int& info) {
  738|   159k|  std::vector<w_char> candidate_utf(word);
  739|   159k|  std::string candidate;
  740|   159k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  741|   159k|  int timer = MINTIMER;
  ------------------
  |  |  110|   159k|#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|   177k|  for (size_t j = 0; j < ctryl; ++j) {
  ------------------
  |  Branch (744:22): [True: 18.1k, False: 159k]
  ------------------
  745|   240k|    for (auto aI = candidate_utf.rbegin(), aEnd = candidate_utf.rend(); aI != aEnd; ++aI) {
  ------------------
  |  Branch (745:73): [True: 222k, False: 18.1k]
  ------------------
  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|  18.1k|  }
  757|   159k|  return wlst.size();
  758|   159k|}
_ZN10SuggestMgr13extrachar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  763|   159k|                              int cpdsuggest, int& info) {
  764|   159k|  std::vector<w_char> candidate_utf(word);
  765|   159k|  if (candidate_utf.size() < 2)
  ------------------
  |  Branch (765:7): [True: 16.0k, False: 143k]
  ------------------
  766|  16.0k|    return wlst.size();
  767|       |  // try omitting one char of word at a time
  768|  2.05M|  for (size_t i = 0; i < candidate_utf.size(); ++i) {
  ------------------
  |  Branch (768:22): [True: 1.91M, False: 143k]
  ------------------
  769|  1.91M|    size_t index = candidate_utf.size() - 1 - i;
  770|  1.91M|    w_char tmpc = candidate_utf[index];
  771|  1.91M|    candidate_utf.erase(candidate_utf.begin() + index);
  772|  1.91M|    std::string candidate;
  773|  1.91M|    u16_u8(candidate, candidate_utf);
  774|  1.91M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  775|  1.91M|    candidate_utf.insert(candidate_utf.begin() + index, tmpc);
  776|  1.91M|  }
  777|   143k|  return wlst.size();
  778|   159k|}
_ZN10SuggestMgr9extracharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  783|   254k|                          int cpdsuggest, int& info) {
  784|   254k|  std::string candidate(word);
  785|   254k|  if (candidate.size() < 2)
  ------------------
  |  Branch (785:7): [True: 17.4k, False: 236k]
  ------------------
  786|  17.4k|    return wlst.size();
  787|       |  // try omitting one char of word at a time
  788|  5.35M|  for (size_t i = 0; i < candidate.size(); ++i) {
  ------------------
  |  Branch (788:22): [True: 5.12M, False: 236k]
  ------------------
  789|  5.12M|    size_t index = candidate.size() - 1 - i;
  790|  5.12M|    char tmpc = candidate[index];
  791|  5.12M|    candidate.erase(candidate.begin() + index);
  792|  5.12M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  793|  5.12M|    candidate.insert(candidate.begin() + index, tmpc);
  794|  5.12M|  }
  795|   236k|  return wlst.size();
  796|   254k|}
_ZN10SuggestMgr10forgotcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  801|   254k|                           int cpdsuggest, int& info) {
  802|   254k|  std::string candidate(word);
  803|   254k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  804|   254k|  int timer = MINTIMER;
  ------------------
  |  |  110|   254k|#define MINTIMER 100
  ------------------
  805|       |
  806|       |  // try inserting a tryme character before every letter (and the null
  807|       |  // terminator)
  808|   254k|  for (size_t k = 0; k < ctryl; ++k) {
  ------------------
  |  Branch (808:22): [True: 0, False: 254k]
  ------------------
  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|   254k|  return wlst.size();
  819|   254k|}
_ZN10SuggestMgr14forgotchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
  824|   159k|                               int cpdsuggest, int& info) {
  825|   159k|  std::vector<w_char> candidate_utf(word);
  826|   159k|  std::chrono::steady_clock::time_point timelimit = std::chrono::steady_clock::now();
  827|   159k|  int timer = MINTIMER;
  ------------------
  |  |  110|   159k|#define MINTIMER 100
  ------------------
  828|       |
  829|       |  // try inserting a tryme character at the end of the word and before every
  830|       |  // letter
  831|   177k|  for (size_t k = 0; k < ctryl; ++k) {
  ------------------
  |  Branch (831:22): [True: 18.1k, False: 159k]
  ------------------
  832|   259k|    for (size_t i = 0; i <= candidate_utf.size(); ++i) {
  ------------------
  |  Branch (832:24): [True: 240k, False: 18.1k]
  ------------------
  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|  18.1k|  }
  843|   159k|  return wlst.size();
  844|   159k|}
_ZN10SuggestMgr8twowordsERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_ibRi:
  854|   413k|                         bool good, int& info) {
  855|   413k|  int c2, forbidden = 0, cwrd, wl = word.size();
  856|   413k|  if (wl < 3)
  ------------------
  |  Branch (856:7): [True: 52.7k, False: 360k]
  ------------------
  857|  52.7k|    return false;
  858|       |
  859|   360k|  if (langnum == LANG_hu)
  ------------------
  |  Branch (859:7): [True: 15.1k, False: 345k]
  ------------------
  860|  15.1k|    forbidden = check_forbidden(word);
  861|       |
  862|   360k|  char* candidate = new char[wl + 2];
  863|   360k|  memcpy(candidate + 1, word.data(), wl);
  864|   360k|  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.64M|  for (char* p = candidate + 1; p[1] != '\0'; p++) {
  ------------------
  |  Branch (868:33): [True: 4.31M, False: 324k]
  ------------------
  869|  4.31M|    p[-1] = *p;
  870|       |    // go to end of the UTF-8 character
  871|  4.60M|    while (utf8 && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (871:12): [True: 1.59M, False: 3.01M]
  |  Branch (871:20): [True: 292k, False: 1.30M]
  ------------------
  872|   292k|      *p = p[1];
  873|   292k|      p++;
  874|   292k|    }
  875|  4.31M|    if (utf8 && p[1] == '\0')
  ------------------
  |  Branch (875:9): [True: 1.30M, False: 3.01M]
  |  Branch (875:17): [True: 36.2k, False: 1.26M]
  ------------------
  876|  36.2k|      break;  // last UTF-8 character
  877|       |
  878|       |    // Suggest only word pairs, if they are listed in the dictionary.
  879|       |    // For example, adding "a lot" to the English dic file will
  880|       |    // result only "alot" -> "a lot" suggestion instead of
  881|       |    // "alto, slot, alt, lot, allot, aloft, aloe, clot, plot, blot, a lot".
  882|       |    // Note: using "ph:alot" keeps the other suggestions:
  883|       |    // a lot ph:alot
  884|       |    // alot -> a lot, alto, slot...
  885|  4.28M|    *p = ' ';
  886|  4.28M|    if (!cpdsuggest && checkword(candidate, cpdsuggest, nullptr, nullptr)) {
  ------------------
  |  Branch (886:9): [True: 1.42M, False: 2.85M]
  |  Branch (886:9): [True: 1.37k, False: 4.27M]
  |  Branch (886:24): [True: 1.37k, False: 1.42M]
  ------------------
  887|       |      // best solution
  888|  1.37k|      info |= SPELL_BEST_SUG;
  ------------------
  |  |   89|  1.37k|#define SPELL_BEST_SUG (1 << 8)    // limit suggestions for the best ones, i.e. ph:
  ------------------
  889|       |
  890|       |      // remove not word pair suggestions
  891|  1.37k|      if (!good) {
  ------------------
  |  Branch (891:11): [True: 137, False: 1.23k]
  ------------------
  892|    137|        good = true;
  893|    137|        wlst.clear();
  894|    137|      }
  895|       |
  896|  1.37k|      wlst.insert(wlst.begin(), candidate);
  897|  1.37k|    }
  898|       |
  899|       |    // word pairs with dash?
  900|  4.28M|    if (lang_with_dash_usage) {
  ------------------
  |  Branch (900:9): [True: 0, False: 4.28M]
  ------------------
  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.28M|    if (wlst.size() < maxSug && !nosplitsugs && !good) {
  ------------------
  |  Branch (916:9): [True: 4.27M, False: 496]
  |  Branch (916:33): [True: 4.27M, False: 0]
  |  Branch (916:49): [True: 4.27M, False: 874]
  ------------------
  917|  4.27M|      *p = '\0';
  918|  4.27M|      int c1 = checkword(candidate, cpdsuggest, nullptr, nullptr);
  919|  4.27M|      if (c1) {
  ------------------
  |  Branch (919:11): [True: 28.9k, False: 4.24M]
  ------------------
  920|  28.9k|        c2 = checkword((p + 1), cpdsuggest, nullptr, nullptr);
  921|  28.9k|        if (c2) {
  ------------------
  |  Branch (921:13): [True: 793, False: 28.1k]
  ------------------
  922|       |          // spec. Hungarian code (TODO need a better compound word support)
  923|    793|          if ((langnum == LANG_hu) && !forbidden &&
  ------------------
  |  Branch (923:15): [True: 7, False: 786]
  |  Branch (923:39): [True: 7, False: 0]
  ------------------
  924|       |              // if 3 repeating letter, use - instead of space
  925|      7|              (((p[-1] == p[1]) &&
  ------------------
  |  Branch (925:17): [True: 5, False: 2]
  ------------------
  926|      5|              (((p > candidate + 1) && (p[-1] == p[-2])) || (p[-1] == p[2]))) ||
  ------------------
  |  Branch (926:17): [True: 0, False: 5]
  |  Branch (926:40): [True: 0, False: 0]
  |  Branch (926:61): [True: 0, False: 5]
  ------------------
  927|       |              // or multiple compounding, with more, than 6 syllables
  928|      7|              ((c1 == 3) && (c2 >= 2))))
  ------------------
  |  Branch (928:16): [True: 0, False: 7]
  |  Branch (928:29): [True: 0, False: 0]
  ------------------
  929|      0|            *p = '-';
  930|    793|          else
  931|    793|            *p = ' ';
  932|       |
  933|    793|          cwrd = std::find(wlst.begin(), wlst.end(), candidate) != wlst.end() ? 0 : 1;
  ------------------
  |  Branch (933:18): [True: 1, False: 792]
  ------------------
  934|       |
  935|    793|          if (cwrd && (wlst.size() < maxSug))
  ------------------
  |  Branch (935:15): [True: 792, False: 1]
  |  Branch (935:23): [True: 792, False: 0]
  ------------------
  936|    792|              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|    793|          if ( !nosplitsugs && lang_with_dash_usage &&
  ------------------
  |  Branch (940:16): [True: 793, False: 0]
  |  Branch (940:32): [True: 0, False: 793]
  ------------------
  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|    793|        }
  954|  28.9k|      }
  955|  4.27M|    }
  956|  4.28M|  }
  957|   360k|  delete[] candidate;
  958|   360k|  return good;
  959|   413k|}
_ZN10SuggestMgr8swapcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
  964|   254k|                         int cpdsuggest, int& info) {
  965|   254k|  if (word.size() < 2)
  ------------------
  |  Branch (965:7): [True: 17.4k, False: 236k]
  ------------------
  966|  17.4k|    return wlst.size();
  967|       |
  968|   236k|  std::string candidate(word);
  969|       |
  970|       |  // try swapping adjacent chars one by one
  971|  5.12M|  for (size_t i = 0; i < candidate.size() - 1; ++i) {
  ------------------
  |  Branch (971:22): [True: 4.88M, False: 236k]
  ------------------
  972|  4.88M|    std::swap(candidate[i], candidate[i+1]);
  973|  4.88M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  974|  4.88M|    std::swap(candidate[i], candidate[i+1]);
  975|  4.88M|  }
  976|       |
  977|       |  // try double swaps for short words
  978|       |  // ahev -> have, owudl -> would
  979|   236k|  if (candidate.size() == 4 || candidate.size() == 5) {
  ------------------
  |  Branch (979:7): [True: 11.4k, False: 225k]
  |  Branch (979:32): [True: 10.3k, False: 215k]
  ------------------
  980|  21.8k|    candidate[0] = word[1];
  981|  21.8k|    candidate[1] = word[0];
  982|  21.8k|    candidate[2] = word[2];
  983|  21.8k|    candidate[candidate.size() - 2] = word[candidate.size() - 1];
  984|  21.8k|    candidate[candidate.size() - 1] = word[candidate.size() - 2];
  985|  21.8k|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  986|  21.8k|    if (candidate.size() == 5) {
  ------------------
  |  Branch (986:9): [True: 10.3k, False: 11.4k]
  ------------------
  987|  10.3k|      candidate[0] = word[0];
  988|  10.3k|      candidate[1] = word[2];
  989|  10.3k|      candidate[2] = word[1];
  990|  10.3k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
  991|  10.3k|    }
  992|  21.8k|  }
  993|       |
  994|   236k|  return wlst.size();
  995|   254k|}
_ZN10SuggestMgr12swapchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1000|   159k|                             int cpdsuggest, int& info) {
 1001|   159k|  if (word.size() < 2)
  ------------------
  |  Branch (1001:7): [True: 16.0k, False: 143k]
  ------------------
 1002|  16.0k|    return wlst.size();
 1003|       |
 1004|   143k|  std::vector<w_char> candidate_utf(word);
 1005|       |
 1006|   143k|  std::string candidate;
 1007|       |  // try swapping adjacent chars one by one
 1008|  1.91M|  for (size_t i = 0; i < candidate_utf.size() - 1; ++i) {
  ------------------
  |  Branch (1008:22): [True: 1.76M, False: 143k]
  ------------------
 1009|  1.76M|    if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|  1.76M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (1009:9): [True: 0, False: 1.76M]
  ------------------
 1010|      0|      return wlst.size();
 1011|  1.76M|    std::swap(candidate_utf[i], candidate_utf[i+1]);
 1012|  1.76M|    u16_u8(candidate, candidate_utf);
 1013|  1.76M|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1014|  1.76M|    std::swap(candidate_utf[i], candidate_utf[i+1]);
 1015|  1.76M|  }
 1016|       |
 1017|       |  // try double swaps for short words
 1018|       |  // ahev -> have, owudl -> would, suodn -> sound
 1019|   143k|  if (candidate_utf.size() == 4 || candidate_utf.size() == 5) {
  ------------------
  |  Branch (1019:7): [True: 18.7k, False: 124k]
  |  Branch (1019:36): [True: 10.4k, False: 114k]
  ------------------
 1020|  29.2k|    candidate_utf[0] = word[1];
 1021|  29.2k|    candidate_utf[1] = word[0];
 1022|  29.2k|    candidate_utf[2] = word[2];
 1023|  29.2k|    candidate_utf[candidate_utf.size() - 2] = word[candidate_utf.size() - 1];
 1024|  29.2k|    candidate_utf[candidate_utf.size() - 1] = word[candidate_utf.size() - 2];
 1025|  29.2k|    u16_u8(candidate, candidate_utf);
 1026|  29.2k|    testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1027|  29.2k|    if (candidate_utf.size() == 5) {
  ------------------
  |  Branch (1027:9): [True: 10.4k, False: 18.7k]
  ------------------
 1028|  10.4k|      candidate_utf[0] = word[0];
 1029|  10.4k|      candidate_utf[1] = word[2];
 1030|  10.4k|      candidate_utf[2] = word[1];
 1031|  10.4k|      u16_u8(candidate, candidate_utf);
 1032|  10.4k|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1033|  10.4k|    }
 1034|  29.2k|  }
 1035|   143k|  return wlst.size();
 1036|   143k|}
_ZN10SuggestMgr12longswapcharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
 1041|   254k|                             int cpdsuggest, int& info) {
 1042|   254k|  std::string candidate(word);
 1043|       |  // try swapping not adjacent chars one by one
 1044|  5.39M|  for (auto p = candidate.begin(); p < candidate.end(); ++p) {
  ------------------
  |  Branch (1044:36): [True: 5.14M, False: 254k]
  ------------------
 1045|   185M|    for (auto q = candidate.begin(); q < candidate.end(); ++q) {
  ------------------
  |  Branch (1045:38): [True: 180M, False: 5.14M]
  ------------------
 1046|   180M|      const auto distance = std::abs(std::distance(q, p));
 1047|   180M|      if (distance > 1 && distance <= MAX_CHAR_DISTANCE && *p != *q) {
  ------------------
  |  |   84|   346M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1047:11): [True: 165M, False: 14.9M]
  |  Branch (1047:27): [True: 26.5M, False: 139M]
  |  Branch (1047:60): [True: 20.1M, False: 6.44M]
  ------------------
 1048|  20.1M|        std::swap(*p, *q);
 1049|  20.1M|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1050|  20.1M|        std::swap(*p, *q);
 1051|  20.1M|      }
 1052|   180M|    }
 1053|  5.14M|  }
 1054|   254k|  return wlst.size();
 1055|   254k|}
_ZN10SuggestMgr16longswapchar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1060|   159k|                                 int cpdsuggest, int& info) {
 1061|   159k|  std::vector<w_char> candidate_utf(word);
 1062|       |  // try swapping not adjacent chars
 1063|  2.08M|  for (auto p = candidate_utf.begin(); p < candidate_utf.end(); ++p) {
  ------------------
  |  Branch (1063:40): [True: 1.92M, False: 159k]
  ------------------
 1064|  52.3M|    for (auto q = candidate_utf.begin(); q < candidate_utf.end(); ++q) {
  ------------------
  |  Branch (1064:42): [True: 50.3M, False: 1.92M]
  ------------------
 1065|  50.3M|      const auto distance = std::abs(std::distance(q, p));
 1066|  50.3M|      if (distance > 1 && distance <= MAX_CHAR_DISTANCE && *p != *q) {
  ------------------
  |  |   84|  95.3M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1066:11): [True: 44.9M, False: 5.46M]
  |  Branch (1066:27): [True: 8.97M, False: 35.9M]
  |  Branch (1066:60): [True: 6.36M, False: 2.61M]
  ------------------
 1067|  6.36M|        std::swap(*p, *q);
 1068|  6.36M|        std::string candidate;
 1069|  6.36M|        u16_u8(candidate, candidate_utf);
 1070|  6.36M|        testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1071|  6.36M|        std::swap(*p, *q);
 1072|  6.36M|      }
 1073|  50.3M|    }
 1074|  1.92M|  }
 1075|   159k|  return wlst.size();
 1076|   159k|}
_ZN10SuggestMgr8movecharERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_iRi:
 1081|   254k|                         int cpdsuggest, int& info) {
 1082|   254k|  if (word.size() < 2)
  ------------------
  |  Branch (1082:7): [True: 17.4k, False: 236k]
  ------------------
 1083|  17.4k|    return wlst.size();
 1084|       |
 1085|   236k|  std::string candidate(word);
 1086|       |
 1087|       |  // try moving a char
 1088|  5.35M|  for (auto p = candidate.begin(); p < candidate.end(); ++p) {
  ------------------
  |  Branch (1088:36): [True: 5.12M, False: 236k]
  ------------------
 1089|  23.2M|    for (auto q = p + 1; q < candidate.end() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  22.1M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1089:26): [True: 22.1M, False: 1.11M]
  |  Branch (1089:26): [True: 18.1M, False: 5.12M]
  |  Branch (1089:49): [True: 18.1M, False: 4.00M]
  ------------------
 1090|  18.1M|      std::swap(*q, *(q - 1));
 1091|  18.1M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1091:11): [True: 4.88M, False: 13.2M]
  ------------------
 1092|  4.88M|        continue;  // omit swap char
 1093|  13.2M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1094|  13.2M|    }
 1095|  5.12M|    const auto word_iter = word.begin();
 1096|  5.12M|    std::copy_n(word_iter, candidate.size(), candidate.begin());
 1097|  5.12M|  }
 1098|       |
 1099|  5.12M|  for (auto p = candidate.rbegin(), pEnd = candidate.rend() - 1; p != pEnd; ++p) {
  ------------------
  |  Branch (1099:66): [True: 4.88M, False: 236k]
  ------------------
 1100|  23.0M|    for (auto q = p + 1, qEnd = candidate.rend(); q != qEnd && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  22.1M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1100:51): [True: 22.1M, False: 880k]
  |  Branch (1100:64): [True: 18.1M, False: 4.00M]
  ------------------
 1101|  18.1M|      std::swap(*q, *(q - 1));
 1102|  18.1M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1102:11): [True: 4.88M, False: 13.2M]
  ------------------
 1103|  4.88M|        continue;  // omit swap char
 1104|  13.2M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1105|  13.2M|    }
 1106|  4.88M|    const auto word_iter = word.begin();
 1107|  4.88M|    std::copy_n(word_iter, candidate.size(), candidate.begin());
 1108|  4.88M|  }
 1109|       |
 1110|   236k|  return wlst.size();
 1111|   254k|}
_ZN10SuggestMgr12movechar_utfERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKNS1_I6w_charNS5_ISB_EEEEiRi:
 1116|   159k|                             int cpdsuggest, int& info) {
 1117|   159k|  if (word.size() < 2)
  ------------------
  |  Branch (1117:7): [True: 16.0k, False: 143k]
  ------------------
 1118|  16.0k|    return wlst.size();
 1119|       |
 1120|   143k|  std::vector<w_char> candidate_utf(word);
 1121|       |
 1122|       |  // try moving a char
 1123|  2.05M|  for (auto p = candidate_utf.begin(); p < candidate_utf.end(); ++p) {
  ------------------
  |  Branch (1123:40): [True: 1.91M, False: 143k]
  ------------------
 1124|  8.16M|    for (auto q = p + 1; q < candidate_utf.end() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  7.52M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1124:26): [True: 7.52M, False: 643k]
  |  Branch (1124:26): [True: 6.25M, False: 1.91M]
  |  Branch (1124:53): [True: 6.25M, False: 1.26M]
  ------------------
 1125|  6.25M|      std::swap(*q, *(q - 1));
 1126|  6.25M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1126:11): [True: 1.76M, False: 4.48M]
  ------------------
 1127|  1.76M|        continue;  // omit swap char
 1128|  4.48M|      std::string candidate;
 1129|  4.48M|      u16_u8(candidate, candidate_utf);
 1130|  4.48M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1131|  4.48M|    }
 1132|  1.91M|    const auto word_iter = word.begin();
 1133|  1.91M|    std::copy_n(word_iter, candidate_utf.size(), candidate_utf.begin());
 1134|  1.91M|  }
 1135|       |
 1136|  2.05M|  for (auto p = candidate_utf.rbegin(); p < candidate_utf.rend(); ++p) {
  ------------------
  |  Branch (1136:41): [True: 1.91M, False: 143k]
  ------------------
 1137|  8.16M|    for (auto q = p + 1; q < candidate_utf.rend() && std::distance(p, q) <= MAX_CHAR_DISTANCE; ++q) {
  ------------------
  |  |   84|  7.52M|#define MAX_CHAR_DISTANCE 4
  ------------------
  |  Branch (1137:26): [True: 7.52M, False: 643k]
  |  Branch (1137:26): [True: 6.25M, False: 1.91M]
  |  Branch (1137:54): [True: 6.25M, False: 1.26M]
  ------------------
 1138|  6.25M|      std::swap(*q, *(q - 1));
 1139|  6.25M|      if (std::distance(p, q) < 2)
  ------------------
  |  Branch (1139:11): [True: 1.76M, False: 4.48M]
  ------------------
 1140|  1.76M|        continue;  // omit swap char
 1141|  4.48M|      std::string candidate;
 1142|  4.48M|      u16_u8(candidate, candidate_utf);
 1143|  4.48M|      testsug(wlst, candidate, cpdsuggest, nullptr, nullptr, info);
 1144|  4.48M|    }
 1145|  1.91M|    const auto word_iter = word.begin();
 1146|  1.91M|    std::copy_n(word_iter, candidate_utf.size(), candidate_utf.begin());
 1147|  1.91M|  }
 1148|       |
 1149|   143k|  return wlst.size();
 1150|   159k|}
_ZN10SuggestMgr9ngsuggestERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEEPKcRKNS1_INS0_10unique_ptrI7HashMgrNS0_14default_deleteISE_EEEENS5_ISH_EEEEi:
 1185|  61.4k|                          int captype) {
 1186|  61.4k|  int lval, sc, lp, lpphon, nonbmp = 0;
 1187|       |
 1188|       |  // exhaustively search through all root words
 1189|       |  // keeping track of the MAX_ROOTS most similar root words
 1190|  61.4k|  struct hentry* roots[MAX_ROOTS];
 1191|  61.4k|  char* rootsphon[MAX_ROOTS];
 1192|  61.4k|  int scores[MAX_ROOTS];
 1193|  61.4k|  int scoresphon[MAX_ROOTS];
 1194|  6.20M|  for (int i = 0; i < MAX_ROOTS; i++) {
  ------------------
  |  |   74|  6.20M|#define MAX_ROOTS 100
  ------------------
  |  Branch (1194:19): [True: 6.14M, False: 61.4k]
  ------------------
 1195|  6.14M|    roots[i] = nullptr;
 1196|  6.14M|    scores[i] = -100 * i;
 1197|  6.14M|    rootsphon[i] = nullptr;
 1198|  6.14M|    scoresphon[i] = -100 * i;
 1199|  6.14M|  }
 1200|  61.4k|  bool has_roots = false;
 1201|  61.4k|  bool has_rootsphon = false;
 1202|  61.4k|  lp = MAX_ROOTS - 1;
  ------------------
  |  |   74|  61.4k|#define MAX_ROOTS 100
  ------------------
 1203|  61.4k|  lpphon = MAX_ROOTS - 1;
  ------------------
  |  |   74|  61.4k|#define MAX_ROOTS 100
  ------------------
 1204|  61.4k|  int low = NGRAM_LOWERING;
  ------------------
  |  |   83|  61.4k|#define NGRAM_LOWERING (1 << 2)
  ------------------
 1205|       |
 1206|  61.4k|  std::string w2;
 1207|  61.4k|  const char* word = w;
 1208|       |
 1209|  61.4k|  int nc;
 1210|       |  // word reversing wrapper for complex prefixes
 1211|  61.4k|  if (complexprefixes) {
  ------------------
  |  Branch (1211:7): [True: 3.45k, False: 57.9k]
  ------------------
 1212|  3.45k|    w2.assign(w);
 1213|  3.45k|    if (utf8)
  ------------------
  |  Branch (1213:9): [True: 0, False: 3.45k]
  ------------------
 1214|      0|      reverseword_utf(w2);
 1215|  3.45k|    else
 1216|  3.45k|      reverseword(w2);
 1217|  3.45k|    word = w2.c_str();
 1218|  3.45k|    nc = (int)w2.size();
 1219|  57.9k|  } else {
 1220|  57.9k|    nc = (int)strlen(word);
 1221|  57.9k|  }
 1222|       |
 1223|  61.4k|  std::vector<w_char> u8;
 1224|  61.4k|  int n = (utf8) ? u8_u16(u8, word) : nc;
  ------------------
  |  Branch (1224:11): [True: 26.1k, False: 35.3k]
  ------------------
 1225|       |
 1226|       |  // set character based ngram suggestion for words with non-BMP Unicode
 1227|       |  // characters
 1228|  61.4k|  const struct cs_info* origconv = csconv;
 1229|  61.4k|  if (n == -1) {
  ------------------
  |  Branch (1229:7): [True: 1.71k, False: 59.7k]
  ------------------
 1230|  1.71k|    utf8 = 0;  // XXX not state-free
 1231|  1.71k|    if (!csconv)
  ------------------
  |  Branch (1231:9): [True: 1.71k, False: 0]
  ------------------
 1232|  1.71k|      csconv = get_current_cs("iso88591"); // XXX not state-free
 1233|  1.71k|    n = nc;
 1234|  1.71k|    nonbmp = 1;
 1235|  1.71k|    low = 0;
 1236|  1.71k|  }
 1237|  61.4k|  ngsuggest_guard restore_state(nonbmp, origconv, &utf8, &csconv);
 1238|  61.4k|  int max_word_len = (utf8) ? MAXWORDUTF8LEN : MAXWORDLEN;
  ------------------
  |  |   85|  24.3k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  24.3k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
                int max_word_len = (utf8) ? MAXWORDUTF8LEN : MAXWORDLEN;
  ------------------
  |  |   90|  37.0k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1238:22): [True: 24.3k, False: 37.0k]
  ------------------
 1239|       |  // ofz#59067 a replist entry can generate a very long word, abandon
 1240|       |  // ngram if that odd-edge case arises
 1241|  61.4k|  if (n > max_word_len * 4)
  ------------------
  |  Branch (1241:7): [True: 0, False: 61.4k]
  ------------------
 1242|      0|      return;
 1243|       |
 1244|  61.4k|  struct hentry* hp = nullptr;
 1245|  61.4k|  int col = -1;
 1246|  61.4k|  phonetable* ph = (pAMgr) ? pAMgr->get_phonetable() : nullptr;
  ------------------
  |  Branch (1246:20): [True: 61.4k, False: 0]
  ------------------
 1247|  61.4k|  std::string target;
 1248|  61.4k|  std::string candidate;
 1249|  61.4k|  std::vector<w_char> w_candidate;
 1250|  61.4k|  if (ph) {
  ------------------
  |  Branch (1250:7): [True: 3.49k, False: 57.9k]
  ------------------
 1251|  3.49k|    if (utf8) {
  ------------------
  |  Branch (1251:9): [True: 0, False: 3.49k]
  ------------------
 1252|      0|      u8_u16(w_candidate, word);
 1253|      0|      mkallcap_utf(w_candidate, langnum);
 1254|      0|      u16_u8(candidate, w_candidate);
 1255|  3.49k|    } else {
 1256|  3.49k|      candidate.assign(word);
 1257|  3.49k|      if (!nonbmp)
  ------------------
  |  Branch (1257:11): [True: 3.49k, False: 0]
  ------------------
 1258|  3.49k|        mkallcap(candidate, csconv);
 1259|  3.49k|    }
 1260|  3.49k|    target = phonet(candidate, *ph);  // XXX phonet() is 8-bit (nc, not n)
 1261|  3.49k|  }
 1262|       |
 1263|  61.4k|  FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL;
  ------------------
  |  |   98|  61.4k|#define FLAG unsigned short
  ------------------
                FLAG forbiddenword = pAMgr ? pAMgr->get_forbiddenword() : FLAG_NULL;
  ------------------
  |  |   99|  61.4k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1263:24): [True: 61.4k, False: 0]
  ------------------
 1264|  61.4k|  FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL;
  ------------------
  |  |   98|  61.4k|#define FLAG unsigned short
  ------------------
                FLAG nosuggest = pAMgr ? pAMgr->get_nosuggest() : FLAG_NULL;
  ------------------
  |  |   99|  61.4k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1264:20): [True: 61.4k, False: 0]
  ------------------
 1265|  61.4k|  FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL;
  ------------------
  |  |   98|  61.4k|#define FLAG unsigned short
  ------------------
                FLAG nongramsuggest = pAMgr ? pAMgr->get_nongramsuggest() : FLAG_NULL;
  ------------------
  |  |   99|  61.4k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1265:25): [True: 61.4k, False: 0]
  ------------------
 1266|  61.4k|  FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL;
  ------------------
  |  |   98|  61.4k|#define FLAG unsigned short
  ------------------
                FLAG onlyincompound = pAMgr ? pAMgr->get_onlyincompound() : FLAG_NULL;
  ------------------
  |  |   99|  61.4k|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1266:25): [True: 61.4k, False: 0]
  ------------------
 1267|       |
 1268|  61.4k|  std::vector<w_char> w_word, w_target;
 1269|  61.4k|  if (utf8) {
  ------------------
  |  Branch (1269:7): [True: 24.3k, False: 37.0k]
  ------------------
 1270|  24.3k|    u8_u16(w_word, word);
 1271|  24.3k|    u8_u16(w_target, target);
 1272|  24.3k|  }
 1273|       |
 1274|  61.4k|  std::string f;
 1275|  61.4k|  std::vector<w_char> w_f;
 1276|       |
 1277|  61.4k|  for (const auto& i : rHMgr) {
  ------------------
  |  Branch (1277:22): [True: 61.4k, False: 61.4k]
  ------------------
 1278|  1.98M|    while (nullptr != (hp = i->walk_hashtable(col, hp))) {
  ------------------
  |  Branch (1278:12): [True: 1.92M, False: 61.4k]
  ------------------
 1279|       |      // skip exceptions
 1280|  1.92M|      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.92M|           (((abs(n - hp->clen) > 4) && !nonbmp)) ||
  ------------------
  |  Branch (1284:12): [True: 1.37M, False: 545k]
  |  Branch (1284:14): [True: 1.29M, False: 620k]
  |  Branch (1284:41): [True: 1.24M, False: 53.4k]
  ------------------
 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|   673k|           ((captype == NOCAP) && (hp->var & H_OPT_INITCAP) &&
  ------------------
  |  |   92|   673k|#define NOCAP 0
  ------------------
                         ((captype == NOCAP) && (hp->var & H_OPT_INITCAP) &&
  ------------------
  |  |   50|   161k|#define H_OPT_INITCAP (1 << 3)  // is dictionary word capitalized?
  ------------------
  |  Branch (1291:13): [True: 161k, False: 512k]
  |  Branch (1291:35): [True: 71.1k, False: 90.1k]
  ------------------
 1292|  71.1k|              !ph && (langnum != LANG_de) && !(hp->var & H_OPT_PHON)) ||
  ------------------
  |  |   49|  69.6k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  |  Branch (1292:15): [True: 69.6k, False: 1.50k]
  |  Branch (1292:22): [True: 69.6k, False: 0]
  |  Branch (1292:46): [True: 69.6k, False: 0]
  ------------------
 1293|       |           // or it has one of the following special flags
 1294|   604k|           ((hp->astr) && (pAMgr) &&
  ------------------
  |  Branch (1294:13): [True: 154k, False: 449k]
  |  Branch (1294:27): [True: 154k, False: 0]
  ------------------
 1295|   154k|             (TESTAFF(hp->astr, forbiddenword, hp->alen) ||
  ------------------
  |  |  102|   309k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 2.11k, False: 152k]
  |  |  ------------------
  ------------------
 1296|   152k|             TESTAFF(hp->astr, ONLYUPCASEFLAG, hp->alen) ||
  ------------------
  |  |  102|   307k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 56.7k, False: 96.0k]
  |  |  ------------------
  ------------------
 1297|  96.0k|             TESTAFF(hp->astr, nosuggest, hp->alen) ||
  ------------------
  |  |  102|   250k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 96.0k]
  |  |  ------------------
  ------------------
 1298|  96.0k|             TESTAFF(hp->astr, nongramsuggest, hp->alen) ||
  ------------------
  |  |  102|   250k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 96.0k]
  |  |  ------------------
  ------------------
 1299|  96.0k|             TESTAFF(hp->astr, onlyincompound, hp->alen)))
  ------------------
  |  |  102|  96.0k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 96.0k]
  |  |  ------------------
  ------------------
 1300|  1.92M|         )
 1301|  1.37M|        continue;
 1302|       |
 1303|   545k|      if (utf8) {
  ------------------
  |  Branch (1303:11): [True: 245k, False: 300k]
  ------------------
 1304|   245k|        u8_u16(w_f, HENTRY_WORD(hp));
  ------------------
  |  |   54|   245k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1305|       |
 1306|   245k|        int leftcommon = leftcommonsubstring(w_word, w_f);
 1307|   245k|        if (low) {
  ------------------
  |  Branch (1307:13): [True: 245k, False: 0]
  ------------------
 1308|       |          // lowering dictionary word
 1309|   245k|          mkallsmall_utf(w_f, langnum);
 1310|   245k|        }
 1311|   245k|        sc = ngram(3, w_word, w_f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|   245k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1312|   300k|      } else {
 1313|   300k|        f.assign(HENTRY_WORD(hp));
  ------------------
  |  |   54|   300k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1314|       |
 1315|   300k|        int leftcommon = leftcommonsubstring(word, f.c_str());
 1316|   300k|        if (low) {
  ------------------
  |  Branch (1316:13): [True: 278k, False: 22.2k]
  ------------------
 1317|       |          // lowering dictionary word
 1318|   278k|          mkallsmall(f, csconv);
 1319|   278k|        }
 1320|   300k|        sc = ngram(3, word, f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|   300k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1321|   300k|      }
 1322|       |
 1323|       |      // check special pronunciation
 1324|   545k|      f.clear();
 1325|   545k|      if ((hp->var & H_OPT_PHON) &&
  ------------------
  |  |   49|   545k|#define H_OPT_PHON (1 << 2)     // is there ph: field in the morphological data?
  ------------------
  |  Branch (1325:11): [True: 887, False: 544k]
  |  Branch (1325:11): [True: 887, False: 544k]
  ------------------
 1326|    887|          copy_field(f, HENTRY_DATA(hp), MORPH_PHON)) {
  ------------------
  |  |  114|    887|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (1326:11): [True: 887, False: 0]
  ------------------
 1327|    887|        int sc2;
 1328|    887|        if (utf8) {
  ------------------
  |  Branch (1328:13): [True: 0, False: 887]
  ------------------
 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|    887|        } else {
 1338|    887|          int leftcommon = leftcommonsubstring(word, f.c_str());
 1339|    887|          if (low) {
  ------------------
  |  Branch (1339:15): [True: 887, False: 0]
  ------------------
 1340|       |            // lowering dictionary word
 1341|    887|            mkallsmall(f, csconv);
 1342|    887|          }
 1343|    887|          sc2 = ngram(3, word, f, NGRAM_LONGER_WORSE) + leftcommon;
  ------------------
  |  |   81|    887|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1344|    887|        }
 1345|    887|        if (sc2 > sc)
  ------------------
  |  Branch (1345:13): [True: 452, False: 435]
  ------------------
 1346|    452|          sc = sc2;
 1347|    887|      }
 1348|       |
 1349|   545k|      int scphon = -20000;
 1350|   545k|      if (ph && (sc > 2) && (abs(n - (int)hp->clen) <= 3)) {
  ------------------
  |  Branch (1350:11): [True: 33.6k, False: 511k]
  |  Branch (1350:17): [True: 7.84k, False: 25.8k]
  |  Branch (1350:29): [True: 6.65k, False: 1.18k]
  ------------------
 1351|  6.65k|        if (utf8) {
  ------------------
  |  Branch (1351:13): [True: 0, False: 6.65k]
  ------------------
 1352|      0|          u8_u16(w_candidate, HENTRY_WORD(hp));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1353|      0|          mkallcap_utf(w_candidate, langnum);
 1354|      0|          u16_u8(candidate, w_candidate);
 1355|  6.65k|        } else {
 1356|  6.65k|          candidate = HENTRY_WORD(hp);
  ------------------
  |  |   54|  6.65k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1357|  6.65k|          mkallcap(candidate, csconv);
 1358|  6.65k|        }
 1359|  6.65k|        f = phonet(candidate, *ph);
 1360|  6.65k|        if (utf8) {
  ------------------
  |  Branch (1360:13): [True: 0, False: 6.65k]
  ------------------
 1361|      0|          u8_u16(w_f, f);
 1362|      0|          scphon = 2 * ngram(3, w_target, w_f,
 1363|      0|                             NGRAM_LONGER_WORSE);
  ------------------
  |  |   81|      0|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1364|  6.65k|        } else {
 1365|  6.65k|          scphon = 2 * ngram(3, target, f,
 1366|  6.65k|                             NGRAM_LONGER_WORSE);
  ------------------
  |  |   81|  6.65k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
 1367|  6.65k|        }
 1368|  6.65k|      }
 1369|       |
 1370|   545k|      if (sc > scores[lp]) {
  ------------------
  |  Branch (1370:11): [True: 545k, False: 0]
  ------------------
 1371|   545k|        scores[lp] = sc;
 1372|   545k|        roots[lp] = hp;
 1373|   545k|        has_roots = true;
 1374|   545k|        lval = sc;
 1375|  55.0M|        for (int j = 0; j < MAX_ROOTS; j++)
  ------------------
  |  |   74|  55.0M|#define MAX_ROOTS 100
  ------------------
  |  Branch (1375:25): [True: 54.5M, False: 545k]
  ------------------
 1376|  54.5M|          if (scores[j] < lval) {
  ------------------
  |  Branch (1376:15): [True: 45.4M, False: 9.12M]
  ------------------
 1377|  45.4M|            lp = j;
 1378|  45.4M|            lval = scores[j];
 1379|  45.4M|          }
 1380|   545k|      }
 1381|       |
 1382|   545k|      if (scphon > scoresphon[lpphon]) {
  ------------------
  |  Branch (1382:11): [True: 6.65k, False: 538k]
  ------------------
 1383|  6.65k|        scoresphon[lpphon] = scphon;
 1384|  6.65k|        rootsphon[lpphon] = HENTRY_WORD(hp);
  ------------------
  |  |   54|  6.65k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1385|  6.65k|        has_rootsphon = true;
 1386|  6.65k|        lval = scphon;
 1387|   671k|        for (int j = 0; j < MAX_ROOTS; j++)
  ------------------
  |  |   74|   671k|#define MAX_ROOTS 100
  ------------------
  |  Branch (1387:25): [True: 665k, False: 6.65k]
  ------------------
 1388|   665k|          if (scoresphon[j] < lval) {
  ------------------
  |  Branch (1388:15): [True: 583k, False: 81.8k]
  ------------------
 1389|   583k|            lpphon = j;
 1390|   583k|            lval = scoresphon[j];
 1391|   583k|          }
 1392|  6.65k|      }
 1393|   545k|    }
 1394|  61.4k|  }
 1395|       |
 1396|  61.4k|  if (!has_roots && !has_rootsphon) {
  ------------------
  |  Branch (1396:7): [True: 14.3k, False: 47.0k]
  |  Branch (1396:21): [True: 14.3k, False: 0]
  ------------------
 1397|       |    // with no roots there will be no guesses and no point running
 1398|       |    // ngram
 1399|  14.3k|    return;
 1400|  14.3k|  }
 1401|       |
 1402|       |  // find minimum threshold for a passable suggestion
 1403|       |  // mangle original word three differnt ways
 1404|       |  // and score them to generate a minimum acceptable score
 1405|  47.0k|  std::vector<w_char> w_mw;
 1406|  47.0k|  int thresh = 0;
 1407|   188k|  for (int sp = 1; sp < 4; sp++) {
  ------------------
  |  Branch (1407:20): [True: 141k, False: 47.0k]
  ------------------
 1408|   141k|    if (utf8) {
  ------------------
  |  Branch (1408:9): [True: 59.2k, False: 81.8k]
  ------------------
 1409|  59.2k|      w_mw = w_word;
 1410|   112k|      for (int k = sp; k < n; k += 4) {
  ------------------
  |  Branch (1410:24): [True: 53.2k, False: 59.2k]
  ------------------
 1411|  53.2k|        w_mw[k].l = '*';
 1412|  53.2k|        w_mw[k].h = 0;
 1413|  53.2k|      }
 1414|       |
 1415|  59.2k|      if (low) {
  ------------------
  |  Branch (1415:11): [True: 59.2k, False: 0]
  ------------------
 1416|       |        // lowering dictionary word
 1417|  59.2k|        mkallsmall_utf(w_mw, langnum);
 1418|  59.2k|      }
 1419|       |
 1420|  59.2k|      thresh += ngram(n, w_word, w_mw, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  59.2k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1421|  81.8k|    } else {
 1422|  81.8k|      std::string mw = word;
 1423|   194k|      for (int k = sp; k < n; k += 4)
  ------------------
  |  Branch (1423:24): [True: 112k, False: 81.8k]
  ------------------
 1424|   112k|        mw[k] = '*';
 1425|       |
 1426|  81.8k|      if (low) {
  ------------------
  |  Branch (1426:11): [True: 76.6k, False: 5.13k]
  ------------------
 1427|       |        // lowering dictionary word
 1428|  76.6k|        mkallsmall(mw, csconv);
 1429|  76.6k|      }
 1430|       |
 1431|  81.8k|      thresh += ngram(n, word, mw, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  81.8k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1432|  81.8k|    }
 1433|   141k|  }
 1434|  47.0k|  thresh = thresh / 3;
 1435|  47.0k|  thresh--;
 1436|       |
 1437|       |  // now expand affixes on each of these root words and
 1438|       |  // and use length adjusted ngram scores to select
 1439|       |  // possible suggestions
 1440|  47.0k|  char* guess[MAX_GUESS];
 1441|  47.0k|  char* guessorig[MAX_GUESS];
 1442|  47.0k|  int gscore[MAX_GUESS];
 1443|  9.45M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.45M|#define MAX_GUESS 200
  ------------------
  |  Branch (1443:19): [True: 9.40M, False: 47.0k]
  ------------------
 1444|  9.40M|    guess[i] = nullptr;
 1445|  9.40M|    guessorig[i] = nullptr;
 1446|  9.40M|    gscore[i] = -100 * i;
 1447|  9.40M|  }
 1448|       |
 1449|  47.0k|  lp = MAX_GUESS - 1;
  ------------------
  |  |   76|  47.0k|#define MAX_GUESS 200
  ------------------
 1450|       |
 1451|  47.0k|  std::vector<guessword> glst(MAX_WORDS);
  ------------------
  |  |   75|  47.0k|#define MAX_WORDS 100
  ------------------
 1452|       |
 1453|  4.70M|  for (auto& root : roots) {
  ------------------
  |  Branch (1453:19): [True: 4.70M, False: 47.0k]
  ------------------
 1454|  4.70M|    if (root) {
  ------------------
  |  Branch (1454:9): [True: 545k, False: 4.15M]
  ------------------
 1455|   545k|      struct hentry* rp = root;
 1456|       |
 1457|   545k|      f.clear();
 1458|   545k|      const char* field = nullptr;
 1459|   545k|      if ((rp->var & H_OPT_PHON) && copy_field(f, HENTRY_DATA(rp), MORPH_PHON))
  ------------------
  |  |   49|   545k|#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|    887|#define MORPH_PHON "ph:"
  ------------------
  |  Branch (1459:11): [True: 887, False: 544k]
  |  Branch (1459:11): [True: 887, False: 544k]
  |  Branch (1459:37): [True: 887, False: 0]
  ------------------
 1460|    887|          field = f.c_str();
 1461|   545k|      int nw = pAMgr->expand_rootword(
 1462|   545k|          glst.data(), MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word,
  ------------------
  |  |   75|   545k|#define MAX_WORDS 100
  ------------------
                        glst.data(), MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word,
  ------------------
  |  |   54|   545k|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 1463|   545k|          nc, field);
 1464|       |
 1465|  1.08M|      for (int k = 0; k < nw; k++) {
  ------------------
  |  Branch (1465:23): [True: 544k, False: 545k]
  ------------------
 1466|   544k|        if (utf8) {
  ------------------
  |  Branch (1466:13): [True: 245k, False: 299k]
  ------------------
 1467|   245k|          u8_u16(w_f, glst[k].word);
 1468|       |
 1469|   245k|          int leftcommon = leftcommonsubstring(w_word, w_f);
 1470|   245k|          if (low) {
  ------------------
  |  Branch (1470:15): [True: 245k, False: 0]
  ------------------
 1471|       |            // lowering dictionary word
 1472|   245k|            mkallsmall_utf(w_f, langnum);
 1473|   245k|          }
 1474|       |
 1475|   245k|          sc = ngram(n, w_word, w_f, NGRAM_ANY_MISMATCH) + leftcommon;
  ------------------
  |  |   82|   245k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1476|   299k|        } else {
 1477|   299k|          f = glst[k].word;
 1478|       |
 1479|   299k|          int leftcommon = leftcommonsubstring(word, f.c_str());
 1480|   299k|          if (low) {
  ------------------
  |  Branch (1480:15): [True: 276k, False: 22.2k]
  ------------------
 1481|       |            // lowering dictionary word
 1482|   276k|            mkallsmall(f, csconv);
 1483|   276k|          }
 1484|       |
 1485|   299k|          sc = ngram(n, word, f, NGRAM_ANY_MISMATCH) + leftcommon;
  ------------------
  |  |   82|   299k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1486|   299k|        }
 1487|       |
 1488|   544k|        if (sc > thresh) {
  ------------------
  |  Branch (1488:13): [True: 98.0k, False: 446k]
  ------------------
 1489|  98.0k|          if (sc > gscore[lp]) {
  ------------------
  |  Branch (1489:15): [True: 98.0k, False: 0]
  ------------------
 1490|  98.0k|            if (guess[lp]) {
  ------------------
  |  Branch (1490:17): [True: 0, False: 98.0k]
  ------------------
 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|  98.0k|            gscore[lp] = sc;
 1498|  98.0k|            guess[lp] = glst[k].word;
 1499|  98.0k|            guessorig[lp] = glst[k].orig;
 1500|  98.0k|            lval = sc;
 1501|  19.7M|            for (int j = 0; j < MAX_GUESS; j++)
  ------------------
  |  |   76|  19.7M|#define MAX_GUESS 200
  ------------------
  |  Branch (1501:29): [True: 19.6M, False: 98.0k]
  ------------------
 1502|  19.6M|              if (gscore[j] < lval) {
  ------------------
  |  Branch (1502:19): [True: 18.7M, False: 893k]
  ------------------
 1503|  18.7M|                lp = j;
 1504|  18.7M|                lval = gscore[j];
 1505|  18.7M|              }
 1506|  98.0k|          } else {
 1507|      0|            delete[] glst[k].word;
 1508|      0|            delete[] glst[k].orig;
 1509|      0|          }
 1510|   446k|        } else {
 1511|   446k|          delete[] glst[k].word;
 1512|   446k|          delete[] glst[k].orig;
 1513|   446k|        }
 1514|   544k|      }
 1515|   545k|    }
 1516|  4.70M|  }
 1517|  47.0k|  glst.clear();
 1518|       |
 1519|       |  // now we are done generating guesses
 1520|       |  // sort in order of decreasing score
 1521|       |
 1522|  47.0k|  bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS);
  ------------------
  |  |   76|  47.0k|#define MAX_GUESS 200
  ------------------
 1523|  47.0k|  if (ph)
  ------------------
  |  Branch (1523:7): [True: 2.77k, False: 44.2k]
  ------------------
 1524|  2.77k|    bubblesort(&rootsphon[0], nullptr, &scoresphon[0], MAX_ROOTS);
  ------------------
  |  |   74|  2.77k|#define MAX_ROOTS 100
  ------------------
 1525|       |
 1526|       |  // weight suggestions with a similarity index, based on
 1527|       |  // the longest common subsequent algorithm and resort
 1528|       |
 1529|  47.0k|  int is_swap = 0;
 1530|  47.0k|  int re = 0;
 1531|  47.0k|  double fact = 1.0;
 1532|  47.0k|  if (pAMgr) {
  ------------------
  |  Branch (1532:7): [True: 47.0k, False: 0]
  ------------------
 1533|  47.0k|    int maxd = pAMgr->get_maxdiff();
 1534|  47.0k|    if (maxd >= 0)
  ------------------
  |  Branch (1534:9): [True: 0, False: 47.0k]
  ------------------
 1535|      0|      fact = (10.0 - maxd) / 5.0;
 1536|  47.0k|  }
 1537|       |
 1538|  47.0k|  std::vector<w_char> w_gl;
 1539|  9.01M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.01M|#define MAX_GUESS 200
  ------------------
  |  Branch (1539:19): [True: 8.96M, False: 44.8k]
  ------------------
 1540|  8.96M|    if (guess[i]) {
  ------------------
  |  Branch (1540:9): [True: 78.0k, False: 8.89M]
  ------------------
 1541|       |      // lowering guess[i]
 1542|  78.0k|      std::string gl;
 1543|  78.0k|      int len;
 1544|  78.0k|      if (utf8) {
  ------------------
  |  Branch (1544:11): [True: 21.4k, False: 56.6k]
  ------------------
 1545|  21.4k|        len = u8_u16(w_gl, guess[i]);
 1546|  21.4k|        mkallsmall_utf(w_gl, langnum);
 1547|  21.4k|        u16_u8(gl, w_gl);
 1548|  56.6k|      } else {
 1549|  56.6k|        gl.assign(guess[i]);
 1550|  56.6k|        if (!nonbmp)
  ------------------
  |  Branch (1550:13): [True: 56.5k, False: 72]
  ------------------
 1551|  56.5k|          mkallsmall(gl, csconv);
 1552|  56.6k|        len = strlen(guess[i]);
 1553|  56.6k|      }
 1554|       |
 1555|  78.0k|      int _lcs = lcslen(word, gl.c_str());
 1556|       |
 1557|       |      // same characters with different casing
 1558|  78.0k|      if ((n == len) && (n == _lcs)) {
  ------------------
  |  Branch (1558:11): [True: 17.1k, False: 60.9k]
  |  Branch (1558:25): [True: 2.19k, False: 14.9k]
  ------------------
 1559|  2.19k|        gscore[i] += 2000;
 1560|  2.19k|        break;
 1561|  2.19k|      }
 1562|       |      // using 2-gram instead of 3, and other weightening
 1563|       |
 1564|  75.8k|      if (utf8) {
  ------------------
  |  Branch (1564:11): [True: 19.6k, False: 56.2k]
  ------------------
 1565|  19.6k|        u8_u16(w_gl, gl);
 1566|       |        //w_gl is lowercase already at this point
 1567|  19.6k|        re = ngram(2, w_word, w_gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  19.6k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                      re = ngram(2, w_word, w_gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  19.6k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1568|  19.6k|        if (low) {
  ------------------
  |  Branch (1568:13): [True: 19.6k, False: 0]
  ------------------
 1569|  19.6k|          w_f = w_word;
 1570|       |          // lowering dictionary word
 1571|  19.6k|          mkallsmall_utf(w_f, langnum);
 1572|  19.6k|          re += ngram(2, w_gl, w_f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  19.6k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, w_gl, w_f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  19.6k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1573|  19.6k|        } 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|  56.2k|      } else {
 1577|       |        //gl is lowercase already at this point
 1578|  56.2k|        re = ngram(2, word, gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  56.2k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                      re = ngram(2, word, gl, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  56.2k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1579|  56.2k|        if (low) {
  ------------------
  |  Branch (1579:13): [True: 56.1k, False: 72]
  ------------------
 1580|  56.1k|          f = word;
 1581|       |          // lowering dictionary word
 1582|  56.1k|          mkallsmall(f, csconv);
 1583|  56.1k|          re += ngram(2, gl, f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|  56.1k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, gl, f, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|  56.1k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1584|  56.1k|        } else {
 1585|     72|          re += ngram(2, gl, word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   82|     72|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
                        re += ngram(2, gl, word, NGRAM_ANY_MISMATCH | NGRAM_WEIGHTED);
  ------------------
  |  |   84|     72|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
 1586|     72|        }
 1587|  56.2k|      }
 1588|       |
 1589|  75.8k|      int ngram_score, leftcommon_score;
 1590|  75.8k|      if (utf8) {
  ------------------
  |  Branch (1590:11): [True: 19.6k, False: 56.2k]
  ------------------
 1591|       |        //w_gl is lowercase already at this point
 1592|  19.6k|        ngram_score = ngram(4, w_word, w_gl, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  19.6k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1593|  19.6k|        leftcommon_score = leftcommonsubstring(w_word, w_gl);
 1594|  56.2k|      } else {
 1595|       |        //gl is lowercase already at this point
 1596|  56.2k|        ngram_score = ngram(4, word, gl, NGRAM_ANY_MISMATCH);
  ------------------
  |  |   82|  56.2k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
 1597|  56.2k|        leftcommon_score = leftcommonsubstring(word, gl.c_str());
 1598|  56.2k|      }
 1599|  75.8k|      gscore[i] =
 1600|       |          // length of longest common subsequent minus length difference
 1601|  75.8k|          2 * _lcs - abs((int)(n - len)) +
 1602|       |          // weight length of the left common substring
 1603|  75.8k|          leftcommon_score +
 1604|       |          // weight equal character positions
 1605|  75.8k|          (!nonbmp && commoncharacterpositions(word, gl.c_str(), &is_swap)
  ------------------
  |  Branch (1605:12): [True: 75.8k, False: 72]
  |  Branch (1605:23): [True: 60.1k, False: 15.6k]
  ------------------
 1606|  75.8k|               ? 1
 1607|  75.8k|               : 0) +
 1608|       |          // swap character (not neighboring)
 1609|  75.8k|          ((is_swap) ? 10 : 0) +
  ------------------
  |  Branch (1609:12): [True: 128, False: 75.7k]
  ------------------
 1610|       |          // ngram
 1611|  75.8k|          ngram_score +
 1612|       |          // weighted ngrams
 1613|  75.8k|          re +
 1614|       |          // different limit for dictionaries with PHONE rules
 1615|  75.8k|          (ph ? (re < len * fact ? -1000 : 0)
  ------------------
  |  Branch (1615:12): [True: 5.44k, False: 70.4k]
  |  Branch (1615:18): [True: 3.87k, False: 1.56k]
  ------------------
 1616|  75.8k|              : (re < (n + len) * fact ? -1000 : 0));
  ------------------
  |  Branch (1616:18): [True: 63.5k, False: 6.85k]
  ------------------
 1617|  75.8k|    }
 1618|  8.96M|  }
 1619|       |
 1620|  47.0k|  bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS);
  ------------------
  |  |   76|  47.0k|#define MAX_GUESS 200
  ------------------
 1621|       |
 1622|       |  // phonetic version
 1623|  47.0k|  if (ph)
  ------------------
  |  Branch (1623:7): [True: 2.77k, False: 44.2k]
  ------------------
 1624|   280k|    for (int i = 0; i < MAX_ROOTS; i++) {
  ------------------
  |  |   74|   280k|#define MAX_ROOTS 100
  ------------------
  |  Branch (1624:21): [True: 277k, False: 2.77k]
  ------------------
 1625|   277k|      if (rootsphon[i]) {
  ------------------
  |  Branch (1625:11): [True: 6.65k, False: 270k]
  ------------------
 1626|       |        // lowering rootphon[i]
 1627|  6.65k|        std::string gl;
 1628|  6.65k|        int len;
 1629|  6.65k|        if (utf8) {
  ------------------
  |  Branch (1629:13): [True: 0, False: 6.65k]
  ------------------
 1630|      0|          len = u8_u16(w_gl, rootsphon[i]);
 1631|      0|          mkallsmall_utf(w_gl, langnum);
 1632|      0|          u16_u8(gl, w_gl);
 1633|  6.65k|        } else {
 1634|  6.65k|          gl.assign(rootsphon[i]);
 1635|  6.65k|          if (!nonbmp)
  ------------------
  |  Branch (1635:15): [True: 6.65k, False: 0]
  ------------------
 1636|  6.65k|            mkallsmall(gl, csconv);
 1637|  6.65k|          len = strlen(rootsphon[i]);
 1638|  6.65k|        }
 1639|       |
 1640|       |        // weight length of the left common substring
 1641|  6.65k|        int leftcommon_score;
 1642|  6.65k|        if (utf8)
  ------------------
  |  Branch (1642:13): [True: 0, False: 6.65k]
  ------------------
 1643|      0|          leftcommon_score = leftcommonsubstring(w_word, w_gl);
 1644|  6.65k|        else
 1645|  6.65k|          leftcommon_score = leftcommonsubstring(word, gl.c_str());
 1646|       |        // heuristic weigthing of ngram scores
 1647|  6.65k|        scoresphon[i] += 2 * lcslen(word, gl) - abs((int)(n - len)) +
 1648|  6.65k|                         leftcommon_score;
 1649|  6.65k|      }
 1650|   277k|    }
 1651|       |
 1652|  47.0k|  if (ph)
  ------------------
  |  Branch (1652:7): [True: 2.77k, False: 44.2k]
  ------------------
 1653|  2.77k|    bubblesort(&rootsphon[0], nullptr, &scoresphon[0], MAX_ROOTS);
  ------------------
  |  |   74|  2.77k|#define MAX_ROOTS 100
  ------------------
 1654|       |
 1655|       |  // copy over
 1656|  47.0k|  size_t oldns = wlst.size();
 1657|       |
 1658|  47.0k|  int same = 0;
 1659|  9.45M|  for (int i = 0; i < MAX_GUESS; i++) {
  ------------------
  |  |   76|  9.45M|#define MAX_GUESS 200
  ------------------
  |  Branch (1659:19): [True: 9.40M, False: 47.0k]
  ------------------
 1660|  9.40M|    if (guess[i]) {
  ------------------
  |  Branch (1660:9): [True: 98.0k, False: 9.30M]
  ------------------
 1661|  98.0k|      if ((wlst.size() < oldns + maxngramsugs) && (wlst.size() < maxSug) &&
  ------------------
  |  Branch (1661:11): [True: 92.1k, False: 5.85k]
  |  Branch (1661:51): [True: 92.1k, False: 0]
  ------------------
 1662|  92.1k|          (!same || (gscore[i] > 1000))) {
  ------------------
  |  Branch (1662:12): [True: 17.4k, False: 74.7k]
  |  Branch (1662:21): [True: 0, False: 74.7k]
  ------------------
 1663|  17.4k|        int unique = 1;
 1664|       |        // leave only excellent suggestions, if exists
 1665|  17.4k|        if (gscore[i] > 1000)
  ------------------
  |  Branch (1665:13): [True: 2.19k, False: 15.2k]
  ------------------
 1666|  2.19k|          same = 1;
 1667|  15.2k|        else if (gscore[i] < -100) {
  ------------------
  |  Branch (1667:18): [True: 8.79k, False: 6.48k]
  ------------------
 1668|  8.79k|          same = 1;
 1669|       |          // keep the best ngram suggestions, unless in ONLYMAXDIFF mode
 1670|  8.79k|          if (wlst.size() > oldns || (pAMgr && pAMgr->get_onlymaxdiff())) {
  ------------------
  |  Branch (1670:15): [True: 1.34k, False: 7.44k]
  |  Branch (1670:39): [True: 7.44k, False: 0]
  |  Branch (1670:48): [True: 0, False: 7.44k]
  ------------------
 1671|  1.34k|            delete[] guess[i];
 1672|  1.34k|            delete[] guessorig[i];
 1673|  1.34k|            continue;
 1674|  1.34k|          }
 1675|  8.79k|        }
 1676|  16.1k|        for (auto& j : wlst) {
  ------------------
  |  Branch (1676:22): [True: 10.9k, False: 13.4k]
  ------------------
 1677|       |          // don't suggest previous suggestions or a previous suggestion with
 1678|       |          // prefixes or affixes
 1679|  10.9k|          if ((!guessorig[i] && strstr(guess[i], j.c_str())) || (guessorig[i] && strstr(guessorig[i], j.c_str())) ||
  ------------------
  |  Branch (1679:15): [True: 2.65k, False: 8.33k]
  |  Branch (1679:16): [True: 10.9k, False: 0]
  |  Branch (1679:33): [True: 2.65k, False: 8.33k]
  |  Branch (1679:66): [True: 0, False: 8.33k]
  |  Branch (1679:82): [True: 0, False: 0]
  ------------------
 1680|       |              // check forbidden words
 1681|  8.33k|              !checkword(guess[i], 0, nullptr, nullptr)) {
  ------------------
  |  Branch (1681:15): [True: 0, False: 8.33k]
  ------------------
 1682|  2.65k|            unique = 0;
 1683|  2.65k|            break;
 1684|  2.65k|          }
 1685|  10.9k|        }
 1686|  16.1k|        if (unique) {
  ------------------
  |  Branch (1686:13): [True: 13.4k, False: 2.65k]
  ------------------
 1687|  13.4k|          if (guessorig[i]) {
  ------------------
  |  Branch (1687:15): [True: 0, False: 13.4k]
  ------------------
 1688|      0|            wlst.emplace_back(guessorig[i]);
 1689|  13.4k|          } else {
 1690|  13.4k|            wlst.emplace_back(guess[i]);
 1691|  13.4k|          }
 1692|  13.4k|        }
 1693|  16.1k|        delete[] guess[i];
 1694|  16.1k|        delete[] guessorig[i];
 1695|  80.5k|      } else {
 1696|  80.5k|        delete[] guess[i];
 1697|  80.5k|        delete[] guessorig[i];
 1698|  80.5k|      }
 1699|  98.0k|    }
 1700|  9.40M|  }
 1701|       |
 1702|  47.0k|  oldns = wlst.size();
 1703|  47.0k|  if (ph)
  ------------------
  |  Branch (1703:7): [True: 2.77k, False: 44.2k]
  ------------------
 1704|   277k|    for (auto& i : rootsphon) {
  ------------------
  |  Branch (1704:18): [True: 277k, False: 2.77k]
  ------------------
 1705|   277k|      if (i) {
  ------------------
  |  Branch (1705:11): [True: 6.65k, False: 270k]
  ------------------
 1706|  6.65k|        if ((wlst.size() < oldns + MAXPHONSUGS) && (wlst.size() < maxSug)) {
  ------------------
  |  |   78|  6.65k|#define MAXPHONSUGS 2
  ------------------
  |  Branch (1706:13): [True: 2.77k, False: 3.87k]
  |  Branch (1706:52): [True: 2.77k, False: 0]
  ------------------
 1707|  2.77k|          int unique = 1;
 1708|  5.52k|          for (auto& j : wlst) {
  ------------------
  |  Branch (1708:24): [True: 5.52k, False: 984]
  ------------------
 1709|       |            // don't suggest previous suggestions or a previous suggestion with
 1710|       |            // prefixes or affixes
 1711|  5.52k|            if (strstr(i, j.c_str()) ||
  ------------------
  |  Branch (1711:17): [True: 1.79k, False: 3.73k]
  |  Branch (1711:17): [True: 1.79k, False: 3.73k]
  ------------------
 1712|       |                // check forbidden words
 1713|  3.73k|                !checkword(i, 0, nullptr, nullptr)) {
  ------------------
  |  Branch (1713:17): [True: 0, False: 3.73k]
  ------------------
 1714|  1.79k|              unique = 0;
 1715|  1.79k|              break;
 1716|  1.79k|            }
 1717|  5.52k|          }
 1718|  2.77k|          if (unique) {
  ------------------
  |  Branch (1718:15): [True: 984, False: 1.79k]
  ------------------
 1719|    984|            wlst.emplace_back(i);
 1720|    984|          }
 1721|  2.77k|        }
 1722|  6.65k|      }
 1723|   277k|    }
 1724|  47.0k|}
_ZN10SuggestMgr9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEiPiPNS0_6chrono10time_pointINSA_12steady_clockENSA_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1735|  89.9M|                          std::chrono::steady_clock::time_point* timelimit) {
 1736|       |  // check overall suggestion time limit
 1737|  89.9M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_SUGGESTION_MS)
  ------------------
  |  |  108|  89.9M|#define TIMELIMIT_SUGGESTION_MS std::chrono::milliseconds(100)
  ------------------
  |  Branch (1737:7): [True: 7, False: 89.9M]
  ------------------
 1738|      7|    return 0;
 1739|       |
 1740|       |  // check time limit
 1741|  89.9M|  if (timer) {
  ------------------
  |  Branch (1741:7): [True: 3.27M, False: 86.7M]
  ------------------
 1742|  3.27M|    (*timer)--;
 1743|  3.27M|    if (!(*timer) && timelimit) {
  ------------------
  |  Branch (1743:9): [True: 28.0k, False: 3.24M]
  |  Branch (1743:22): [True: 28.0k, False: 0]
  ------------------
 1744|  28.0k|      if (std::chrono::steady_clock::now() - *timelimit > TIMELIMIT_MS)
  ------------------
  |  |  109|  28.0k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1744:11): [True: 11, False: 28.0k]
  ------------------
 1745|     11|        return 0;
 1746|  28.0k|      *timer = MAXPLUSTIMER;
  ------------------
  |  |  111|  28.0k|#define MAXPLUSTIMER 100
  ------------------
 1747|  28.0k|    }
 1748|  3.27M|  }
 1749|       |
 1750|  89.9M|  if (pAMgr) {
  ------------------
  |  Branch (1750:7): [True: 89.9M, False: 0]
  ------------------
 1751|  89.9M|    struct hentry* rv = nullptr;
 1752|  89.9M|    int nosuffix = 0;
 1753|       |
 1754|  89.9M|    if (cpdsuggest >= 1) {
  ------------------
  |  Branch (1754:9): [True: 58.8M, False: 31.1M]
  ------------------
 1755|  58.8M|      if (pAMgr->get_compound()) {
  ------------------
  |  Branch (1755:11): [True: 14.3M, False: 44.4M]
  ------------------
 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.18M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (1758:20): [True: 7.18M, False: 7.18M]
  ------------------
 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.8M|      return 0;
 1771|  58.8M|    }
 1772|       |
 1773|  31.1M|    rv = pAMgr->lookup(word.c_str(), word.size());
 1774|       |
 1775|  31.1M|    if (rv) {
  ------------------
  |  Branch (1775:9): [True: 45.3k, False: 31.1M]
  ------------------
 1776|  45.3k|      if ((rv->astr) &&
  ------------------
  |  Branch (1776:11): [True: 143, False: 45.2k]
  |  Branch (1776:11): [True: 0, False: 45.3k]
  ------------------
 1777|    143|          (TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |  102|    286|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 143]
  |  |  ------------------
  ------------------
 1778|    143|           TESTAFF(rv->astr, pAMgr->get_nosuggest(), rv->alen) ||
  ------------------
  |  |  102|    286|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 143]
  |  |  ------------------
  ------------------
 1779|    143|           TESTAFF(rv->astr, pAMgr->get_substandard(), rv->alen)))
  ------------------
  |  |  102|    143|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 143]
  |  |  ------------------
  ------------------
 1780|      0|        return 0;
 1781|  45.5k|      while (rv) {
  ------------------
  |  Branch (1781:14): [True: 45.3k, False: 143]
  ------------------
 1782|  45.3k|        if (rv->astr &&
  ------------------
  |  Branch (1782:13): [True: 143, False: 45.2k]
  |  Branch (1782:13): [True: 143, False: 45.2k]
  ------------------
 1783|    143|            (TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |  102|    286|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 143]
  |  |  ------------------
  ------------------
 1784|    143|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|    286|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 143, False: 0]
  |  |  ------------------
  ------------------
 1785|    143|             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]
  |  |  ------------------
  ------------------
 1786|    143|          rv = rv->next_homonym;
 1787|    143|        } else
 1788|  45.2k|          break;
 1789|  45.3k|      }
 1790|  31.1M|    } else {
 1791|  31.1M|      AffixScratch scratch;
 1792|  31.1M|      rv = pAMgr->prefix_check(word, 0, word.size(),
 1793|  31.1M|                               0, scratch);  // only prefix, and prefix + suffix XXX
 1794|  31.1M|    }
 1795|       |
 1796|  31.1M|    if (rv) {
  ------------------
  |  Branch (1796:9): [True: 45.2k, False: 31.1M]
  ------------------
 1797|  45.2k|      nosuffix = 1;
 1798|  31.1M|    } else {
 1799|  31.1M|      AffixScratch scratch;
 1800|  31.1M|      rv = pAMgr->suffix_check(word, 0, word.size(), 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // only suffix
  ------------------
  |  |   99|  31.1M|#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.1M|#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.1M|#define IN_CPD_NOT 0
  ------------------
 1801|  31.1M|    }
 1802|       |
 1803|  31.1M|    if (!rv && pAMgr->have_contclass()) {
  ------------------
  |  Branch (1803:9): [True: 31.1M, False: 45.2k]
  |  Branch (1803:16): [True: 10.7M, False: 20.3M]
  ------------------
 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.1M|    if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1811:9): [True: 45.2k, False: 31.1M]
  |  Branch (1811:9): [True: 0, False: 31.1M]
  |  Branch (1811:17): [True: 0, False: 45.2k]
  ------------------
 1812|      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]
  |  |  ------------------
  ------------------
 1813|      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]
  |  |  ------------------
  ------------------
 1814|      0|         TESTAFF(rv->astr, pAMgr->get_nosuggest(), rv->alen) ||
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1815|      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]
  |  |  ------------------
  ------------------
 1816|      0|      return 0;
 1817|       |
 1818|  31.1M|    if (rv) {  // XXX obsolote
  ------------------
  |  Branch (1818:9): [True: 45.2k, False: 31.1M]
  ------------------
 1819|  45.2k|      if ((pAMgr->get_compoundflag()) &&
  ------------------
  |  Branch (1819:11): [True: 10.8k, False: 34.4k]
  |  Branch (1819:11): [True: 0, False: 45.2k]
  ------------------
 1820|  10.8k|          TESTAFF(rv->astr, pAMgr->get_compoundflag(), rv->alen))
  ------------------
  |  |  102|  10.8k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 10.8k]
  |  |  ------------------
  ------------------
 1821|      0|        return 2 + nosuffix;
 1822|  45.2k|      return 1;
 1823|  45.2k|    }
 1824|  31.1M|  }
 1825|  31.1M|  return 0;
 1826|  89.9M|}
_ZN10SuggestMgr15check_forbiddenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1828|  15.1k|int SuggestMgr::check_forbidden(const std::string& word) {
 1829|  15.1k|  if (pAMgr) {
  ------------------
  |  Branch (1829:7): [True: 15.1k, False: 0]
  ------------------
 1830|  15.1k|    struct hentry* rv = pAMgr->lookup(word.c_str(), word.size());
 1831|  15.1k|    if (rv && rv->astr &&
  ------------------
  |  Branch (1831:9): [True: 0, False: 15.1k]
  |  Branch (1831:9): [True: 0, False: 15.1k]
  |  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|  15.1k|    size_t len = word.size();
 1836|  15.1k|    AffixScratch scratch;
 1837|  15.1k|    if (!(pAMgr->prefix_check(word, 0, len, 1, scratch)))
  ------------------
  |  Branch (1837:9): [True: 15.1k, False: 0]
  ------------------
 1838|  15.1k|      rv = pAMgr->suffix_check(word, 0, len, 0, nullptr, scratch, FLAG_NULL, FLAG_NULL, IN_CPD_NOT);  // prefix+suffix, suffix
  ------------------
  |  |   99|  15.1k|#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|  15.1k|#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|  15.1k|#define IN_CPD_NOT 0
  ------------------
 1839|       |    // check forbidden words
 1840|  15.1k|    if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (1840:9): [True: 0, False: 15.1k]
  |  Branch (1840:9): [True: 0, False: 15.1k]
  |  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|  15.1k|  }
 1844|  15.1k|  return 0;
 1845|  15.1k|}
_ZN10SuggestMgr13suggest_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1847|  12.7k|std::string SuggestMgr::suggest_morph(const std::string& in_w) {
 1848|  12.7k|  std::string result;
 1849|       |
 1850|  12.7k|  struct hentry* rv = nullptr;
 1851|       |
 1852|  12.7k|  if (!pAMgr)
  ------------------
  |  Branch (1852:7): [True: 0, False: 12.7k]
  ------------------
 1853|      0|    return {};
 1854|       |
 1855|  12.7k|  std::string w(in_w);
 1856|       |
 1857|       |  // word reversing wrapper for complex prefixes
 1858|  12.7k|  if (complexprefixes) {
  ------------------
  |  Branch (1858:7): [True: 643, False: 12.0k]
  ------------------
 1859|    643|    if (utf8)
  ------------------
  |  Branch (1859:9): [True: 0, False: 643]
  ------------------
 1860|      0|      reverseword_utf(w);
 1861|    643|    else
 1862|    643|      reverseword(w);
 1863|    643|  }
 1864|       |
 1865|  12.7k|  rv = pAMgr->lookup(w.c_str(), w.size());
 1866|       |
 1867|  14.4k|  while (rv) {
  ------------------
  |  Branch (1867:10): [True: 1.73k, False: 12.7k]
  ------------------
 1868|  1.73k|    if ((!rv->astr) ||
  ------------------
  |  Branch (1868:9): [True: 1.18k, False: 556]
  |  Branch (1868:9): [True: 1.73k, False: 0]
  ------------------
 1869|    556|        !(TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) ||
  ------------------
  |  |  102|  1.11k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 556]
  |  |  ------------------
  ------------------
 1870|    556|          TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) ||
  ------------------
  |  |  102|  1.11k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 556]
  |  |  ------------------
  ------------------
 1871|  1.73k|          TESTAFF(rv->astr, pAMgr->get_onlyincompound(), rv->alen))) {
  ------------------
  |  |  102|    556|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 556]
  |  |  ------------------
  ------------------
 1872|  1.73k|      if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |  103|  1.73k|#define MORPH_STEM "st:"
  ------------------
  |  Branch (1872:11): [True: 1.73k, False: 0]
  ------------------
 1873|  1.73k|        result.push_back(MSEP_FLD);
  ------------------
  |  |  121|  1.73k|#define MSEP_FLD ' '
  ------------------
 1874|  1.73k|        result.append(MORPH_STEM);
  ------------------
  |  |  103|  1.73k|#define MORPH_STEM "st:"
  ------------------
 1875|  1.73k|        result.append(w);
 1876|  1.73k|      }
 1877|  1.73k|      if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (1877:11): [True: 0, False: 1.73k]
  ------------------
 1878|      0|        result.push_back(MSEP_FLD);
  ------------------
  |  |  121|      0|#define MSEP_FLD ' '
  ------------------
 1879|      0|        result.append(HENTRY_DATA2(rv));
 1880|      0|      }
 1881|  1.73k|      result.push_back(MSEP_REC);
  ------------------
  |  |  122|  1.73k|#define MSEP_REC '\n'
  ------------------
 1882|  1.73k|    }
 1883|  1.73k|    rv = rv->next_homonym;
 1884|  1.73k|  }
 1885|       |
 1886|  12.7k|  AffixScratch scratch;
 1887|  12.7k|  std::string st = pAMgr->affix_check_morph(w, 0, w.size(), scratch);
 1888|  12.7k|  if (!st.empty()) {
  ------------------
  |  Branch (1888:7): [True: 0, False: 12.7k]
  ------------------
 1889|      0|    result.append(st);
 1890|      0|  }
 1891|       |
 1892|  12.7k|  if (pAMgr->get_compound() && result.empty()) {
  ------------------
  |  Branch (1892:7): [True: 2.62k, False: 10.0k]
  |  Branch (1892:32): [True: 2.30k, False: 325]
  ------------------
 1893|  2.30k|    struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
 1894|  2.30k|    pAMgr->compound_check_morph(w, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, result, nullptr, scratch);
 1895|  2.30k|  }
 1896|       |
 1897|  12.7k|  line_uniq(result, MSEP_REC);
  ------------------
  |  |  122|  12.7k|#define MSEP_REC '\n'
  ------------------
 1898|       |
 1899|  12.7k|  return result;
 1900|  12.7k|}
_ZN10SuggestMgr18suggest_hentry_genEP6hentryPKc:
 1925|   461k|std::string SuggestMgr::suggest_hentry_gen(hentry* rv, const char* pattern) {
 1926|   461k|  std::string result;
 1927|   461k|  int sfxcount = get_sfxcount(pattern);
 1928|       |
 1929|   461k|  if (get_sfxcount(HENTRY_DATA(rv)) > sfxcount)
  ------------------
  |  Branch (1929:7): [True: 0, False: 461k]
  ------------------
 1930|      0|    return result;
 1931|       |
 1932|   461k|  if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (1932:7): [True: 0, False: 461k]
  ------------------
 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|   461k|  char* p = nullptr;
 1943|   461k|  if (HENTRY_DATA(rv))
  ------------------
  |  Branch (1943:7): [True: 0, False: 461k]
  ------------------
 1944|      0|    p = (char*)strstr(HENTRY_DATA2(rv), MORPH_ALLOMORPH);
  ------------------
  |  |  104|      0|#define MORPH_ALLOMORPH "al:"
  ------------------
 1945|   461k|  while (p) {
  ------------------
  |  Branch (1945:10): [True: 0, False: 461k]
  ------------------
 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|   461k|  return result;
 1971|   461k|}
_ZN10SuggestMgr11suggest_genERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_NS0_6chrono10time_pointINSE_12steady_clockENSE_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1974|   416k|                                    std::chrono::steady_clock::time_point start_time) {
 1975|   416k|  if (desc.empty() || !pAMgr)
  ------------------
  |  Branch (1975:7): [True: 275k, False: 141k]
  |  Branch (1975:23): [True: 0, False: 141k]
  ------------------
 1976|   275k|    return {};
 1977|       |
 1978|   141k|  const char* pattern = in_pattern.c_str();
 1979|   141k|  std::string result2;
 1980|   141k|  std::string newpattern;
 1981|   141k|  struct hentry* rv = nullptr;
 1982|       |
 1983|       |  // search affixed forms with and without derivational suffixes
 1984|   173k|  while (true) {
  ------------------
  |  Branch (1984:10): [True: 173k, Folded]
  ------------------
 1985|   173k|    for (const auto& k : desc) {
  ------------------
  |  Branch (1985:24): [True: 173k, False: 173k]
  ------------------
 1986|   173k|      if (std::chrono::steady_clock::now() - start_time > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|   173k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1986:11): [True: 0, False: 173k]
  ------------------
 1987|      0|        return result2;
 1988|   173k|      std::string result;
 1989|       |
 1990|       |      // add compound word parts (except the last one)
 1991|   173k|      const size_t lastpart = append_compound_parts(k, result);
 1992|   173k|      const char* s = k.c_str() + lastpart;
 1993|   173k|      std::string tok(k, lastpart);
 1994|   173k|      size_t pos = tok.find(" | ");
 1995|   173k|      while (pos != std::string::npos) {
  ------------------
  |  Branch (1995:14): [True: 0, False: 173k]
  ------------------
 1996|      0|        tok[pos + 1] = MSEP_ALT;
  ------------------
  |  |  123|      0|#define MSEP_ALT '\v'
  ------------------
 1997|      0|        pos = tok.find(" | ", pos);
 1998|      0|      }
 1999|   173k|      std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  123|   173k|#define MSEP_ALT '\v'
  ------------------
 2000|   173k|      for (auto& i : pl) {
  ------------------
  |  Branch (2000:20): [True: 173k, False: 173k]
  ------------------
 2001|       |        // remove inflectional and terminal suffixes
 2002|   173k|        size_t is = i.find(MORPH_INFL_SFX);
  ------------------
  |  |  110|   173k|#define MORPH_INFL_SFX "is:"
  ------------------
 2003|   173k|        if (is != std::string::npos)
  ------------------
  |  Branch (2003:13): [True: 0, False: 173k]
  ------------------
 2004|      0|          i.resize(is);
 2005|   173k|        size_t ts = i.find(MORPH_TERM_SFX);
  ------------------
  |  |  111|   173k|#define MORPH_TERM_SFX "ts:"
  ------------------
 2006|   173k|        while (ts != std::string::npos) {
  ------------------
  |  Branch (2006:16): [True: 0, False: 173k]
  ------------------
 2007|      0|          i[ts] = '_';
 2008|      0|          ts = i.find(MORPH_TERM_SFX);
  ------------------
  |  |  111|      0|#define MORPH_TERM_SFX "ts:"
  ------------------
 2009|      0|        }
 2010|   173k|        const char* st = strstr(s, MORPH_STEM);
  ------------------
  |  |  103|   173k|#define MORPH_STEM "st:"
  ------------------
 2011|   173k|        if (st) {
  ------------------
  |  Branch (2011:13): [True: 158k, False: 14.2k]
  ------------------
 2012|   158k|          copy_field(tok, st, MORPH_STEM);
  ------------------
  |  |  103|   158k|#define MORPH_STEM "st:"
  ------------------
 2013|   158k|          rv = pAMgr->lookup(tok.c_str(), tok.size());
 2014|   389k|          while (rv) {
  ------------------
  |  Branch (2014:18): [True: 230k, False: 158k]
  ------------------
 2015|   230k|            if (std::chrono::steady_clock::now() - start_time > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|   230k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (2015:17): [True: 0, False: 230k]
  ------------------
 2016|      0|              return result2;
 2017|   230k|            std::string newpat(i);
 2018|   230k|            newpat.append(pattern);
 2019|   230k|            std::string sg = suggest_hentry_gen(rv, newpat.c_str());
 2020|   230k|            if (sg.empty())
  ------------------
  |  Branch (2020:17): [True: 230k, False: 0]
  ------------------
 2021|   230k|              sg = suggest_hentry_gen(rv, pattern);
 2022|   230k|            if (!sg.empty()) {
  ------------------
  |  Branch (2022:17): [True: 0, False: 230k]
  ------------------
 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|   230k|            rv = rv->next_homonym;
 2036|   230k|          }
 2037|   158k|        }
 2038|   173k|      }
 2039|   173k|    }
 2040|       |
 2041|   173k|    if (!result2.empty() || !strstr(pattern, MORPH_DERI_SFX))
  ------------------
  |  |  109|   173k|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (2041:9): [True: 0, False: 173k]
  |  Branch (2041:29): [True: 141k, False: 32.0k]
  ------------------
 2042|   141k|      break;
 2043|       |
 2044|  32.0k|    newpattern.assign(pattern);
 2045|  32.0k|    mystrrep(newpattern, MORPH_DERI_SFX, MORPH_TERM_SFX);
  ------------------
  |  |  109|  32.0k|#define MORPH_DERI_SFX "ds:"
  ------------------
                  mystrrep(newpattern, MORPH_DERI_SFX, MORPH_TERM_SFX);
  ------------------
  |  |  111|  32.0k|#define MORPH_TERM_SFX "ts:"
  ------------------
 2046|  32.0k|    pattern = newpattern.c_str();
 2047|  32.0k|  }
 2048|   141k|  return result2;
 2049|   141k|}
_ZN10SuggestMgr5ngramEiRKNSt3__16vectorI6w_charNS0_9allocatorIS2_EEEES7_i:
 2055|   608k|                      int opt) {
 2056|   608k|  int nscore = 0, ns, l1 = su1.size(), l2 = su2.size();
 2057|       |
 2058|   608k|  if (l2 == 0)
  ------------------
  |  Branch (2058:7): [True: 7.14k, False: 601k]
  ------------------
 2059|  7.14k|    return 0;
 2060|   919k|  for (int j = 1; j <= n; j++) {
  ------------------
  |  Branch (2060:19): [True: 871k, False: 48.5k]
  ------------------
 2061|   871k|    ns = 0;
 2062|  4.23M|    for (int i = 0; i <= (l1 - j); i++) {
  ------------------
  |  Branch (2062:21): [True: 3.36M, False: 871k]
  ------------------
 2063|  3.36M|      int k = 0;
 2064|  17.1M|      for (int l = 0; l <= (l2 - j); l++) {
  ------------------
  |  Branch (2064:23): [True: 14.9M, False: 2.18M]
  ------------------
 2065|  25.5M|        for (k = 0; k < j; k++) {
  ------------------
  |  Branch (2065:21): [True: 24.4M, False: 1.17M]
  ------------------
 2066|  24.4M|          if (su1[i + k] != su2[l + k])
  ------------------
  |  Branch (2066:15): [True: 13.7M, False: 10.6M]
  ------------------
 2067|  13.7M|            break;
 2068|  24.4M|        }
 2069|  14.9M|        if (k == j) {
  ------------------
  |  Branch (2069:13): [True: 1.17M, False: 13.7M]
  ------------------
 2070|  1.17M|          ns++;
 2071|  1.17M|          break;
 2072|  1.17M|        }
 2073|  14.9M|      }
 2074|  3.36M|      if (k != j && opt & NGRAM_WEIGHTED) {
  ------------------
  |  |   84|  2.18M|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2074:11): [True: 2.18M, False: 1.17M]
  |  Branch (2074:21): [True: 75.1k, False: 2.10M]
  ------------------
 2075|  75.1k|        ns--;
 2076|  75.1k|        if (i == 0 || i == l1 - j)
  ------------------
  |  Branch (2076:13): [True: 20.2k, False: 54.9k]
  |  Branch (2076:23): [True: 27.7k, False: 27.2k]
  ------------------
 2077|  47.9k|          ns--;  // side weight
 2078|  75.1k|      }
 2079|  3.36M|    }
 2080|   871k|    nscore = nscore + ns;
 2081|   871k|    if (ns < 2 && !(opt & NGRAM_WEIGHTED))
  ------------------
  |  |   84|   606k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2081:9): [True: 606k, False: 264k]
  |  Branch (2081:19): [True: 552k, False: 53.8k]
  ------------------
 2082|   552k|      break;
 2083|   871k|  }
 2084|       |
 2085|   601k|  ns = 0;
 2086|   601k|  if (opt & NGRAM_LONGER_WORSE)
  ------------------
  |  |   81|   601k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
  |  Branch (2086:7): [True: 245k, False: 356k]
  ------------------
 2087|   245k|    ns = (l2 - l1) - 2;
 2088|   601k|  if (opt & NGRAM_ANY_MISMATCH)
  ------------------
  |  |   82|   601k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
  |  Branch (2088:7): [True: 356k, False: 245k]
  ------------------
 2089|   356k|    ns = abs(l2 - l1) - 2;
 2090|   601k|  ns = (nscore - ((ns > 0) ? ns : 0));
  ------------------
  |  Branch (2090:19): [True: 102k, False: 499k]
  ------------------
 2091|   601k|  return ns;
 2092|   608k|}
_ZN10SuggestMgr5ngramEiRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 2098|   857k|                      int opt) {
 2099|   857k|  int nscore = 0, ns, l1, l2 = s2.size();
 2100|       |
 2101|   857k|  if (l2 == 0)
  ------------------
  |  Branch (2101:7): [True: 12.1k, False: 845k]
  ------------------
 2102|  12.1k|    return 0;
 2103|   845k|  l1 = s1.size();
 2104|  1.64M|  for (int j = 1; j <= n; j++) {
  ------------------
  |  Branch (2104:19): [True: 1.49M, False: 150k]
  ------------------
 2105|  1.49M|    ns = 0;
 2106|  11.6M|    for (int i = 0; i <= (l1 - j); i++) {
  ------------------
  |  Branch (2106:21): [True: 10.1M, False: 1.49M]
  ------------------
 2107|       |      //s2 is haystack, s1[i..i+j) is needle
 2108|  10.1M|      if (s2.find(s1.c_str()+i, 0, j) != std::string::npos) {
  ------------------
  |  Branch (2108:11): [True: 4.00M, False: 6.17M]
  ------------------
 2109|  4.00M|        ns++;
 2110|  6.17M|      } else if (opt & NGRAM_WEIGHTED) {
  ------------------
  |  |   84|  6.17M|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2110:18): [True: 419k, False: 5.75M]
  ------------------
 2111|   419k|        ns--;
 2112|   419k|        if (i == 0 || i == l1 - j)
  ------------------
  |  Branch (2112:13): [True: 44.9k, False: 374k]
  |  Branch (2112:23): [True: 113k, False: 260k]
  ------------------
 2113|   158k|          ns--;  // side weight
 2114|   419k|      }
 2115|  10.1M|    }
 2116|  1.49M|    nscore = nscore + ns;
 2117|  1.49M|    if (ns < 2 && !(opt & NGRAM_WEIGHTED))
  ------------------
  |  |   84|   837k|#define NGRAM_WEIGHTED (1 << 3)
  ------------------
  |  Branch (2117:9): [True: 837k, False: 660k]
  |  Branch (2117:19): [True: 694k, False: 142k]
  ------------------
 2118|   694k|      break;
 2119|  1.49M|  }
 2120|       |
 2121|   845k|  ns = 0;
 2122|   845k|  if (opt & NGRAM_LONGER_WORSE)
  ------------------
  |  |   81|   845k|#define NGRAM_LONGER_WORSE (1 << 0)
  ------------------
  |  Branch (2122:7): [True: 306k, False: 539k]
  ------------------
 2123|   306k|    ns = (l2 - l1) - 2;
 2124|   845k|  if (opt & NGRAM_ANY_MISMATCH)
  ------------------
  |  |   82|   845k|#define NGRAM_ANY_MISMATCH (1 << 1)
  ------------------
  |  Branch (2124:7): [True: 539k, False: 306k]
  ------------------
 2125|   539k|    ns = abs(l2 - l1) - 2;
 2126|   845k|  ns = (nscore - ((ns > 0) ? ns : 0));
  ------------------
  |  Branch (2126:19): [True: 182k, False: 662k]
  ------------------
 2127|   845k|  return ns;
 2128|   857k|}
_ZN10SuggestMgr19leftcommonsubstringERKNSt3__16vectorI6w_charNS0_9allocatorIS2_EEEES7_:
 2133|   510k|    const std::vector<w_char>& su2) {
 2134|   510k|  int l1 = su1.size(), l2 = su2.size();
 2135|       |  // decapitalize dictionary word
 2136|   510k|  if (complexprefixes) {
  ------------------
  |  Branch (2136:7): [True: 0, False: 510k]
  ------------------
 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|   510k|  } else {
 2140|   510k|    unsigned short idx = su2.empty() ? 0 : (unsigned short)(su2[0]),
  ------------------
  |  Branch (2140:26): [True: 0, False: 510k]
  ------------------
 2141|   510k|                   otheridx = su1.empty() ? 0 : (unsigned short)(su1[0]);
  ------------------
  |  Branch (2141:31): [True: 18.7k, False: 491k]
  ------------------
 2142|   510k|    if (otheridx != idx && (otheridx != unicodetolower(idx, langnum)))
  ------------------
  |  Branch (2142:9): [True: 478k, False: 31.5k]
  |  Branch (2142:28): [True: 379k, False: 98.6k]
  ------------------
 2143|   379k|      return 0;
 2144|   130k|    int i;
 2145|   213k|    for (i = 1; (i < l1) && (i < l2) && (su1[i] == su2[i]);
  ------------------
  |  Branch (2145:17): [True: 201k, False: 12.1k]
  |  Branch (2145:29): [True: 186k, False: 15.5k]
  |  Branch (2145:41): [True: 83.6k, False: 102k]
  ------------------
 2146|   130k|         i++)
 2147|  83.6k|      ;
 2148|   130k|    return i;
 2149|   510k|  }
 2150|      0|  return 0;
 2151|   510k|}
_ZN10SuggestMgr19leftcommonsubstringEPKcS1_:
 2156|   663k|    const char* s2) {
 2157|   663k|  if (complexprefixes) {
  ------------------
  |  Branch (2157:7): [True: 54.1k, False: 608k]
  ------------------
 2158|  54.1k|    int l1 = strlen(s1), l2 = strlen(s2);
 2159|  54.1k|    if (l1 && l1 <= l2 && s1[l1 - 1] == s2[l2 - 1])
  ------------------
  |  Branch (2159:9): [True: 52.2k, False: 1.83k]
  |  Branch (2159:15): [True: 22.9k, False: 29.3k]
  |  Branch (2159:27): [True: 2.23k, False: 20.7k]
  ------------------
 2160|  2.23k|      return 1;
 2161|   608k|  } else if (csconv) {
  ------------------
  |  Branch (2161:14): [True: 608k, False: 0]
  ------------------
 2162|   608k|    const char* olds = s1;
 2163|       |    // decapitalise dictionary word
 2164|   608k|    if ((*s1 != *s2) && (((unsigned char)*s1) != csconv[((unsigned char)*s2)].clower))
  ------------------
  |  Branch (2164:9): [True: 545k, False: 63.5k]
  |  Branch (2164:25): [True: 397k, False: 147k]
  ------------------
 2165|   397k|      return 0;
 2166|   477k|    do {
 2167|   477k|      s1++;
 2168|   477k|      s2++;
 2169|   477k|    } while ((*s1 == *s2) && (*s1 != '\0'));
  ------------------
  |  Branch (2169:14): [True: 266k, False: 210k]
  |  Branch (2169:30): [True: 266k, False: 379]
  ------------------
 2170|   211k|    return (int)(s1 - olds);
 2171|   608k|  }
 2172|  51.8k|  return 0;
 2173|   663k|}
_ZN10SuggestMgr24commoncharacterpositionsEPKcS1_Pi:
 2177|  75.8k|                                         int* is_swap) {
 2178|  75.8k|  int num = 0, diff = 0, diffpos[2];
 2179|  75.8k|  *is_swap = 0;
 2180|  75.8k|  if (utf8) {
  ------------------
  |  Branch (2180:7): [True: 19.6k, False: 56.1k]
  ------------------
 2181|  19.6k|    std::vector<w_char> su1;
 2182|  19.6k|    std::vector<w_char> su2;
 2183|  19.6k|    int l1 = u8_u16(su1, s1), l2 = u8_u16(su2, s2);
 2184|       |
 2185|  19.6k|    if (l1 <= 0 || l2 <= 0)
  ------------------
  |  Branch (2185:9): [True: 4.22k, False: 15.4k]
  |  Branch (2185:20): [True: 0, False: 15.4k]
  ------------------
 2186|  4.22k|      return 0;
 2187|       |
 2188|       |    // decapitalize dictionary word
 2189|  15.4k|    if (complexprefixes) {
  ------------------
  |  Branch (2189:9): [True: 0, False: 15.4k]
  ------------------
 2190|      0|      su2[l2 - 1] = lower_utf(su2[l2 - 1], langnum);
 2191|  15.4k|    } else {
 2192|  15.4k|      su2[0] = lower_utf(su2[0], langnum);
 2193|  15.4k|    }
 2194|  58.9k|    for (int i = 0; (i < l1) && (i < l2); i++) {
  ------------------
  |  Branch (2194:21): [True: 48.9k, False: 9.98k]
  |  Branch (2194:33): [True: 43.5k, False: 5.43k]
  ------------------
 2195|  43.5k|      if (su1[i] == su2[i]) {
  ------------------
  |  Branch (2195:11): [True: 23.3k, False: 20.1k]
  ------------------
 2196|  23.3k|        num++;
 2197|  23.3k|      } else {
 2198|  20.1k|        if (diff < 2)
  ------------------
  |  Branch (2198:13): [True: 16.9k, False: 3.17k]
  ------------------
 2199|  16.9k|          diffpos[diff] = i;
 2200|  20.1k|        diff++;
 2201|  20.1k|      }
 2202|  43.5k|    }
 2203|  15.4k|    if ((diff == 2) && (l1 == l2) &&
  ------------------
  |  Branch (2203:9): [True: 3.31k, False: 12.1k]
  |  Branch (2203:24): [True: 827, False: 2.48k]
  ------------------
 2204|    827|        (su1[diffpos[0]] == su2[diffpos[1]]) &&
  ------------------
  |  Branch (2204:9): [True: 438, False: 389]
  ------------------
 2205|    438|        (su1[diffpos[1]] == su2[diffpos[0]]))
  ------------------
  |  Branch (2205:9): [True: 50, False: 388]
  ------------------
 2206|     50|      *is_swap = 1;
 2207|  56.1k|  } else {
 2208|  56.1k|    if (!*s1 || !*s2)
  ------------------
  |  Branch (2208:9): [True: 5.22k, False: 50.9k]
  |  Branch (2208:17): [True: 0, False: 50.9k]
  ------------------
 2209|  5.22k|      return 0;
 2210|       |
 2211|  50.9k|    size_t i;
 2212|  50.9k|    std::string t(s2);
 2213|       |    // decapitalize dictionary word
 2214|  50.9k|    if (complexprefixes) {
  ------------------
  |  Branch (2214:9): [True: 3.43k, False: 47.5k]
  ------------------
 2215|  3.43k|      size_t l2 = t.size();
 2216|  3.43k|      t[l2 - 1] = csconv[(unsigned char)t[l2 - 1]].clower;
 2217|  47.5k|    } else {
 2218|  47.5k|      mkallsmall(t, csconv);
 2219|  47.5k|    }
 2220|   309k|    for (i = 0; i < t.size() && (*(s1 + i) != 0); ++i) {
  ------------------
  |  Branch (2220:17): [True: 278k, False: 31.4k]
  |  Branch (2220:33): [True: 258k, False: 19.4k]
  ------------------
 2221|   258k|      if (*(s1 + i) == t[i]) {
  ------------------
  |  Branch (2221:11): [True: 129k, False: 129k]
  ------------------
 2222|   129k|        num++;
 2223|   129k|      } else {
 2224|   129k|        if (diff < 2)
  ------------------
  |  Branch (2224:13): [True: 71.2k, False: 58.4k]
  ------------------
 2225|  71.2k|          diffpos[diff] = i;
 2226|   129k|        diff++;
 2227|   129k|      }
 2228|   258k|    }
 2229|  50.9k|    if ((diff == 2) && (*(s1 + i) == 0) && i == t.size() &&
  ------------------
  |  Branch (2229:9): [True: 12.8k, False: 38.1k]
  |  Branch (2229:24): [True: 8.54k, False: 4.28k]
  |  Branch (2229:44): [True: 2.74k, False: 5.79k]
  ------------------
 2230|  2.74k|        (*(s1 + diffpos[0]) == t[diffpos[1]]) &&
  ------------------
  |  Branch (2230:9): [True: 625, False: 2.12k]
  ------------------
 2231|    625|        (*(s1 + diffpos[1]) == t[diffpos[0]]))
  ------------------
  |  Branch (2231:9): [True: 78, False: 547]
  ------------------
 2232|     78|      *is_swap = 1;
 2233|  50.9k|  }
 2234|  66.3k|  return num;
 2235|  75.8k|}
_ZN10SuggestMgr10bubblesortEPPcS1_Pii:
 2246|  99.6k|void SuggestMgr::bubblesort(char** rword, char** rword2, int* rsc, int n) {
 2247|  99.6k|  int m = 1;
 2248|  19.3M|  while (m < n) {
  ------------------
  |  Branch (2248:10): [True: 19.2M, False: 99.6k]
  ------------------
 2249|  19.2M|    int j = m;
 2250|  38.7M|    while (j > 0) {
  ------------------
  |  Branch (2250:12): [True: 38.7M, False: 25.1k]
  ------------------
 2251|  38.7M|      if (rsc[j - 1] < rsc[j]) {
  ------------------
  |  Branch (2251:11): [True: 19.4M, False: 19.2M]
  ------------------
 2252|  19.4M|        int sctmp = rsc[j - 1];
 2253|  19.4M|        char* wdtmp = rword[j - 1];
 2254|  19.4M|        rsc[j - 1] = rsc[j];
 2255|  19.4M|        rword[j - 1] = rword[j];
 2256|  19.4M|        rsc[j] = sctmp;
 2257|  19.4M|        rword[j] = wdtmp;
 2258|  19.4M|        if (rword2) {
  ------------------
  |  Branch (2258:13): [True: 18.9M, False: 540k]
  ------------------
 2259|  18.9M|          wdtmp = rword2[j - 1];
 2260|  18.9M|          rword2[j - 1] = rword2[j];
 2261|  18.9M|          rword2[j] = wdtmp;
 2262|  18.9M|        }
 2263|  19.4M|        j--;
 2264|  19.4M|      } else
 2265|  19.2M|        break;
 2266|  38.7M|    }
 2267|  19.2M|    m++;
 2268|  19.2M|  }
 2269|  99.6k|}
_ZN10SuggestMgr3lcsEPKcS1_PiS2_:
 2275|  84.7k|                      int* l2) {
 2276|  84.7k|  int n, m, i, j;
 2277|  84.7k|  std::vector<w_char> su;
 2278|  84.7k|  std::vector<w_char> su2;
 2279|  84.7k|  if (utf8) {
  ------------------
  |  Branch (2279:7): [True: 21.4k, False: 63.2k]
  ------------------
 2280|  21.4k|    m = u8_u16(su, s);
 2281|  21.4k|    n = u8_u16(su2, s2);
 2282|  63.2k|  } else {
 2283|  63.2k|    m = strlen(s);
 2284|  63.2k|    n = strlen(s2);
 2285|  63.2k|  }
 2286|  84.7k|  if (m <= 0 || n <= 0) {
  ------------------
  |  Branch (2286:7): [True: 9.58k, False: 75.1k]
  |  Branch (2286:17): [True: 0, False: 75.1k]
  ------------------
 2287|  9.58k|    *l1 = 0;
 2288|  9.58k|    *l2 = 0;
 2289|  9.58k|    return nullptr;
 2290|  9.58k|  }
 2291|  75.1k|  char* c = new char[(m + 1) * (n + 1)]();
 2292|  75.1k|  char* b = new char[(m + 1) * (n + 1)]();
 2293|   482k|  for (i = 1; i <= m; i++) {
  ------------------
  |  Branch (2293:15): [True: 407k, False: 75.1k]
  ------------------
 2294|  4.35M|    for (j = 1; j <= n; j++) {
  ------------------
  |  Branch (2294:17): [True: 3.94M, False: 407k]
  ------------------
 2295|  3.94M|      if (((utf8) && (su[i - 1] == su2[j - 1])) ||
  ------------------
  |  Branch (2295:12): [True: 273k, False: 3.67M]
  |  Branch (2295:22): [True: 59.8k, False: 213k]
  ------------------
 2296|  3.88M|          ((!utf8) && (s[i - 1] == s2[j - 1]))) {
  ------------------
  |  Branch (2296:12): [True: 3.67M, False: 213k]
  |  Branch (2296:23): [True: 503k, False: 3.17M]
  ------------------
 2297|   563k|        c[i * (n + 1) + j] = c[(i - 1) * (n + 1) + j - 1] + 1;
 2298|   563k|        b[i * (n + 1) + j] = LCS_UPLEFT;
 2299|  3.38M|      } else if (c[(i - 1) * (n + 1) + j] >= c[i * (n + 1) + j - 1]) {
  ------------------
  |  Branch (2299:18): [True: 2.45M, False: 928k]
  ------------------
 2300|  2.45M|        c[i * (n + 1) + j] = c[(i - 1) * (n + 1) + j];
 2301|  2.45M|        b[i * (n + 1) + j] = LCS_UP;
 2302|  2.45M|      } else {
 2303|   928k|        c[i * (n + 1) + j] = c[i * (n + 1) + j - 1];
 2304|   928k|        b[i * (n + 1) + j] = LCS_LEFT;
 2305|   928k|      }
 2306|  3.94M|    }
 2307|   407k|  }
 2308|  75.1k|  delete[] c;
 2309|  75.1k|  *l1 = m;
 2310|  75.1k|  *l2 = n;
 2311|  75.1k|  return b;
 2312|  84.7k|}
_ZN10SuggestMgr6lcslenEPKcS1_:
 2314|  84.7k|int SuggestMgr::lcslen(const char* s, const char* s2) {
 2315|  84.7k|  int m, n, len = 0;
 2316|  84.7k|  char* result = lcs(s, s2, &m, &n);
 2317|  84.7k|  if (!result)
  ------------------
  |  Branch (2317:7): [True: 9.58k, False: 75.1k]
  ------------------
 2318|  9.58k|    return 0;
 2319|  75.1k|  int i = m, j = n;
 2320|   630k|  while ((i != 0) && (j != 0)) {
  ------------------
  |  Branch (2320:10): [True: 562k, False: 67.4k]
  |  Branch (2320:22): [True: 554k, False: 7.73k]
  ------------------
 2321|   554k|    if (result[i * (n + 1) + j] == LCS_UPLEFT) {
  ------------------
  |  Branch (2321:9): [True: 222k, False: 332k]
  ------------------
 2322|   222k|      len++;
 2323|   222k|      i--;
 2324|   222k|      j--;
 2325|   332k|    } else if (result[i * (n + 1) + j] == LCS_UP) {
  ------------------
  |  Branch (2325:16): [True: 168k, False: 163k]
  ------------------
 2326|   168k|      i--;
 2327|   168k|    } else
 2328|   163k|      j--;
 2329|   554k|  }
 2330|  75.1k|  delete[] result;
 2331|  75.1k|  return len;
 2332|  84.7k|}
_ZN10SuggestMgr6lcslenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 2334|  6.65k|int SuggestMgr::lcslen(const std::string& s, const std::string& s2) {
 2335|  6.65k|  return lcslen(s.c_str(), s2.c_str());
 2336|  6.65k|}
suggestmgr.cxx:_ZN12_GLOBAL__N_115ngsuggest_guardC2EbPK7cs_infoPiPS3_:
 1164|  61.4k|      : m_nonbmp(nonbmp)
 1165|  61.4k|      , m_origconv(origconv)
 1166|  61.4k|      , m_utf8(utf8)
 1167|  61.4k|      , m_csconv(csconv)
 1168|  61.4k|    {
 1169|  61.4k|    }
suggestmgr.cxx:_ZN12_GLOBAL__N_115ngsuggest_guardD2Ev:
 1172|  61.4k|    {
 1173|  61.4k|      if (m_nonbmp) {
  ------------------
  |  Branch (1173:11): [True: 1.71k, False: 59.7k]
  ------------------
 1174|  1.71k|        *m_csconv = m_origconv;
 1175|  1.71k|        *m_utf8 = 1;
 1176|  1.71k|      }
 1177|  61.4k|    }
suggestmgr.cxx:_ZL12get_sfxcountPKc:
 1902|   923k|static int get_sfxcount(const char* morph) {
 1903|   923k|  if (!morph || !*morph)
  ------------------
  |  Branch (1903:7): [True: 461k, False: 461k]
  |  Branch (1903:17): [True: 0, False: 461k]
  ------------------
 1904|   461k|    return 0;
 1905|   461k|  int n = 0;
 1906|   461k|  const char* old = morph;
 1907|   461k|  morph = strstr(morph, MORPH_DERI_SFX);
  ------------------
  |  |  109|   461k|#define MORPH_DERI_SFX "ds:"
  ------------------
 1908|   461k|  if (!morph)
  ------------------
  |  Branch (1908:7): [True: 401k, False: 59.6k]
  ------------------
 1909|   401k|    morph = strstr(old, MORPH_INFL_SFX);
  ------------------
  |  |  110|   401k|#define MORPH_INFL_SFX "is:"
  ------------------
 1910|   461k|  if (!morph)
  ------------------
  |  Branch (1910:7): [True: 401k, False: 59.8k]
  ------------------
 1911|   401k|    morph = strstr(old, MORPH_TERM_SFX);
  ------------------
  |  |  111|   401k|#define MORPH_TERM_SFX "ts:"
  ------------------
 1912|   629k|  while (morph) {
  ------------------
  |  Branch (1912:10): [True: 167k, False: 461k]
  ------------------
 1913|   167k|    n++;
 1914|   167k|    old = morph;
 1915|   167k|    morph = strstr(morph + 1, MORPH_DERI_SFX);
  ------------------
  |  |  109|   167k|#define MORPH_DERI_SFX "ds:"
  ------------------
 1916|   167k|    if (!morph)
  ------------------
  |  Branch (1916:9): [True: 143k, False: 24.2k]
  ------------------
 1917|   143k|      morph = strstr(old + 1, MORPH_INFL_SFX);
  ------------------
  |  |  110|   143k|#define MORPH_INFL_SFX "is:"
  ------------------
 1918|   167k|    if (!morph)
  ------------------
  |  Branch (1918:9): [True: 143k, False: 24.2k]
  ------------------
 1919|   143k|      morph = strstr(old + 1, MORPH_TERM_SFX);
  ------------------
  |  |  111|   143k|#define MORPH_TERM_SFX "ts:"
  ------------------
 1920|   167k|  }
 1921|   461k|  return n;
 1922|   923k|}

_ZNK6w_charcvtEv:
   57|   274M|  {
   58|   274M|#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|   274M|    unsigned short u;
   64|   274M|    memcpy(&u, this, sizeof(unsigned short));
   65|   274M|    return u;
   66|   274M|#endif
   67|       |
   68|       |#else
   69|       |    return ((unsigned short)h << 8) | (unsigned short)l;
   70|       |#endif
   71|   274M|  }
_Zlt6w_charS_:
   73|  25.2M|  friend bool operator<(const w_char a, const w_char b) {
   74|  25.2M|    return (unsigned short)a < (unsigned short)b;
   75|  25.2M|  }
_Zeq6w_charS_:
   77|  92.4M|  friend bool operator==(const w_char a, const w_char b) {
   78|  92.4M|    return (unsigned short)a == (unsigned short)b;
   79|  92.4M|  }
_Zne6w_charS_:
   81|  90.1M|  friend bool operator!=(const w_char a, const w_char b) {
   82|  90.1M|    return !(a == b);
   83|  90.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.44k|{
   77|  3.44k|    std::string word(data, size);
   78|  3.44k|    for (auto& dict : dictionaries)
  ------------------
  |  Branch (78:21): [True: 65.5k, False: 3.44k]
  ------------------
   79|  65.5k|    {
   80|  65.5k|        if (!dict->spell(word))
  ------------------
  |  Branch (80:13): [True: 64.9k, False: 539]
  ------------------
   81|  64.9k|            dict->suggest(word);
   82|  65.5k|    }
   83|  3.44k|    return 0;
   84|  3.44k|}

