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

_ZN8PfxEntry7getContEv:
  136|  4.94M|  inline const unsigned short* getCont() { return contclass; }
_ZN8PfxEntry10getContLenEv:
  137|  1.64M|  inline unsigned short getContLen() { return contclasslen; }
_ZN8SfxEntry7getContEv:
  226|   360k|  inline const unsigned short* getCont() { return contclass; }
_ZN8SfxEntry10getContLenEv:
  227|  29.7k|  inline unsigned short getContLen() { return contclasslen; }
_ZN8PfxEntry7getFlagEv:
  128|    932|  FLAG getFlag() { return aflag; }
_ZN8PfxEntry6getKeyEv:
  129|   141k|  const char* getKey() { return appnd.c_str(); }
_ZN8SfxEntry7getFlagEv:
  220|   108k|  FLAG getFlag() { return aflag; }
_ZN8SfxEntry8getAffixEv:
  228|  36.8k|  inline const char* getAffix() { return appnd.c_str(); }
_ZNK8PfxEntry10allowCrossEv:
   94|      5|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|      5|#define aeXPRODUCT (1 << 0)
  ------------------
_ZN8PfxEntry9getKeyLenEv:
  132|  2.77k|  inline size_t getKeyLen() { return appnd.size(); }
_ZN8PfxEntry7getNextEv:
  139|  3.22M|  inline PfxEntry* getNext() { return next; }
_ZN8PfxEntry9getNextNEEv:
  140|  63.5k|  inline PfxEntry* getNextNE() { return nextne; }
_ZN8PfxEntry9getNextEQEv:
  141|  76.8k|  inline PfxEntry* getNextEQ() { return nexteq; }
_ZN8PfxEntry9getFlgNxtEv:
  142|    924|  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|     31|  bool allowCross() const { return ((opts & aeXPRODUCT) != 0); }
  ------------------
  |  |   65|     31|#define aeXPRODUCT (1 << 0)
  ------------------
_ZN8SfxEntry6getKeyEv:
  221|   342k|  const char* getKey() { return rappnd.c_str(); }
_ZN8SfxEntry9getKeyLenEv:
  230|   169k|  inline size_t getKeyLen() { return appnd.size(); }
_ZN8SfxEntry7getNextEv:
  232|    228|  inline SfxEntry* getNext() { return next; }
_ZN8SfxEntry9getNextNEEv:
  233|  46.7k|  inline SfxEntry* getNextNE() { return nextne; }
_ZN8SfxEntry9getNextEQEv:
  234|   295k|  inline SfxEntry* getNextEQ() { return nexteq; }
_ZN8SfxEntry9getFlgNxtEv:
  239|  66.3k|  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
  ------------------
  |  |  123|     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|  if (parse_file(affpath, key)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 38]
  ------------------
  213|      0|    fprintf(stderr, "Failure loading aff file %s\n", affpath);
  214|      0|  }
  215|       |
  216|       |  /* get encoding for CHECKCOMPOUNDCASE */
  217|     38|  if (!utf8) {
  ------------------
  |  Branch (217:7): [True: 20, False: 18]
  ------------------
  218|     20|    csconv = get_current_cs(get_encoding());
  219|  5.14k|    for (int i = 0; i <= 255; i++) {
  ------------------
  |  Branch (219:21): [True: 5.12k, False: 20]
  ------------------
  220|  5.12k|      if ((csconv[i].cupper != csconv[i].clower) &&
  ------------------
  |  Branch (220:11): [True: 2.24k, False: 2.88k]
  ------------------
  221|  2.24k|          (wordchars.find((char)i) == std::string::npos)) {
  ------------------
  |  Branch (221:11): [True: 2.24k, False: 0]
  ------------------
  222|  2.24k|        wordchars.push_back((char)i);
  223|  2.24k|      }
  224|  5.12k|    }
  225|     20|  }
  226|       |
  227|       |  // default BREAK definition
  228|     38|  if (!parsedbreaktable) {
  ------------------
  |  Branch (228:7): [True: 34, False: 4]
  ------------------
  229|     34|    breaktable.emplace_back("-");
  230|     34|    breaktable.emplace_back("^-");
  231|     34|    breaktable.emplace_back("-$");
  232|     34|    parsedbreaktable = true;
  233|     34|  }
  234|       |
  235|     38|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  236|       |  // not entirely sure this is invalid, so only for fuzzing for now
  237|     38|  if (iconvtable && !iconvtable->check_against_breaktable(breaktable)) {
  ------------------
  |  Branch (237:7): [True: 2, False: 36]
  |  Branch (237:21): [True: 0, False: 2]
  ------------------
  238|      0|      delete iconvtable;
  239|      0|      iconvtable = nullptr;
  240|      0|  }
  241|     38|#endif
  242|       |
  243|     38|  if (cpdmin == -1)
  ------------------
  |  Branch (243:7): [True: 34, False: 4]
  ------------------
  244|     34|    cpdmin = MINCPDLEN;
  ------------------
  |  |   91|     34|#define MINCPDLEN 3
  ------------------
  245|     38|}
_ZN8AffixMgr13finishFileMgrEP7FileMgr:
  302|     38|void AffixMgr::finishFileMgr(FileMgr* afflst) {
  303|     38|  delete afflst;
  304|       |
  305|       |  // convert affix trees to sorted list
  306|     38|  process_pfx_tree_to_list();
  307|     38|  process_sfx_tree_to_list();
  308|     38|}
_ZN8AffixMgr10parse_fileEPKcS1_:
  311|     38|int AffixMgr::parse_file(const char* affpath, const char* key) {
  312|       |
  313|       |  // checking flag duplication
  314|     38|  char dupflags[CONTSIZE];
  315|     38|  char dupflags_ini = 1;
  316|     38|  std::unordered_set<std::string> affix_rules;
  317|       |
  318|       |  // first line indicator for removing byte order mark
  319|     38|  int firstline = 1;
  320|       |
  321|       |  // open the affix file
  322|     38|  FileMgr* afflst = new FileMgr(affpath, key);
  323|       |
  324|       |  // step one is to parse the affix file building up the internal
  325|       |  // affix data structures
  326|       |
  327|       |  // read in each line ignoring any that do not
  328|       |  // start with a known line type indicator
  329|     38|  std::string line;
  330|    646|  while (afflst->getline(line)) {
  ------------------
  |  Branch (330:10): [True: 608, False: 38]
  ------------------
  331|    608|    mychomp(line);
  332|       |
  333|       |    /* remove byte order mark */
  334|    608|    if (firstline) {
  ------------------
  |  Branch (334:9): [True: 38, False: 570]
  ------------------
  335|     38|      firstline = 0;
  336|       |      // Affix file begins with byte order mark: possible incompatibility with
  337|       |      // old Hunspell versions
  338|     38|      if (line.compare(0, 3, "\xEF\xBB\xBF", 3) == 0) {
  ------------------
  |  Branch (338:11): [True: 0, False: 38]
  ------------------
  339|      0|        line.erase(0, 3);
  340|      0|      }
  341|     38|    }
  342|       |
  343|       |    /* parse in the keyboard string */
  344|    608|    if (line.compare(0, 3, "KEY", 3) == 0) {
  ------------------
  |  Branch (344:9): [True: 0, False: 608]
  ------------------
  345|      0|      if (!parse_string(line, keystring, afflst->getlinenum())) {
  ------------------
  |  Branch (345:11): [True: 0, False: 0]
  ------------------
  346|      0|        finishFileMgr(afflst);
  347|      0|        return 1;
  348|      0|      }
  349|      0|    }
  350|       |
  351|       |    /* parse in the try string */
  352|    608|    if (line.compare(0, 3, "TRY", 3) == 0) {
  ------------------
  |  Branch (352:9): [True: 2, False: 606]
  ------------------
  353|      2|      if (!parse_string(line, trystring, afflst->getlinenum())) {
  ------------------
  |  Branch (353:11): [True: 0, False: 2]
  ------------------
  354|      0|        finishFileMgr(afflst);
  355|      0|        return 1;
  356|      0|      }
  357|      2|    }
  358|       |
  359|       |    /* parse in the name of the character set used by the .dict and .aff */
  360|    608|    if (line.compare(0, 3, "SET", 3) == 0) {
  ------------------
  |  Branch (360:9): [True: 18, False: 590]
  ------------------
  361|     18|      if (!parse_string(line, encoding, afflst->getlinenum())) {
  ------------------
  |  Branch (361:11): [True: 0, False: 18]
  ------------------
  362|      0|        finishFileMgr(afflst);
  363|      0|        return 1;
  364|      0|      }
  365|     18|      if (encoding == "UTF-8") {
  ------------------
  |  Branch (365:11): [True: 18, False: 0]
  ------------------
  366|     18|        utf8 = 1;
  367|     18|      }
  368|     18|    }
  369|       |
  370|       |    /* parse COMPLEXPREFIXES for agglutinative languages with right-to-left
  371|       |     * writing system */
  372|    608|    if (line.compare(0, 15, "COMPLEXPREFIXES", 15) == 0)
  ------------------
  |  Branch (372:9): [True: 2, False: 606]
  ------------------
  373|      2|      complexprefixes = 1;
  374|       |
  375|       |    /* parse in the flag used by the controlled compound words */
  376|    608|    if (line.compare(0, 12, "COMPOUNDFLAG", 12) == 0) {
  ------------------
  |  Branch (376:9): [True: 8, False: 600]
  ------------------
  377|      8|      if (!parse_flag(line, &compoundflag, afflst)) {
  ------------------
  |  Branch (377:11): [True: 0, False: 8]
  ------------------
  378|      0|        finishFileMgr(afflst);
  379|      0|        return 1;
  380|      0|      }
  381|      8|    }
  382|       |
  383|       |    /* parse in the flag used by compound words */
  384|    608|    if (line.compare(0, 13, "COMPOUNDBEGIN", 13) == 0) {
  ------------------
  |  Branch (384:9): [True: 0, False: 608]
  ------------------
  385|      0|      if (complexprefixes) {
  ------------------
  |  Branch (385:11): [True: 0, False: 0]
  ------------------
  386|      0|        if (!parse_flag(line, &compoundend, afflst)) {
  ------------------
  |  Branch (386:13): [True: 0, False: 0]
  ------------------
  387|      0|          finishFileMgr(afflst);
  388|      0|          return 1;
  389|      0|        }
  390|      0|      } else {
  391|      0|        if (!parse_flag(line, &compoundbegin, afflst)) {
  ------------------
  |  Branch (391:13): [True: 0, False: 0]
  ------------------
  392|      0|          finishFileMgr(afflst);
  393|      0|          return 1;
  394|      0|        }
  395|      0|      }
  396|      0|    }
  397|       |
  398|       |    /* parse in the flag used by compound words */
  399|    608|    if (line.compare(0, 14, "COMPOUNDMIDDLE", 14) == 0) {
  ------------------
  |  Branch (399:9): [True: 0, False: 608]
  ------------------
  400|      0|      if (!parse_flag(line, &compoundmiddle, afflst)) {
  ------------------
  |  Branch (400:11): [True: 0, False: 0]
  ------------------
  401|      0|        finishFileMgr(afflst);
  402|      0|        return 1;
  403|      0|      }
  404|      0|    }
  405|       |
  406|       |    /* parse in the flag used by compound words */
  407|    608|    if (line.compare(0, 11, "COMPOUNDEND", 11) == 0) {
  ------------------
  |  Branch (407:9): [True: 0, False: 608]
  ------------------
  408|      0|      if (complexprefixes) {
  ------------------
  |  Branch (408:11): [True: 0, False: 0]
  ------------------
  409|      0|        if (!parse_flag(line, &compoundbegin, afflst)) {
  ------------------
  |  Branch (409:13): [True: 0, False: 0]
  ------------------
  410|      0|          finishFileMgr(afflst);
  411|      0|          return 1;
  412|      0|        }
  413|      0|      } else {
  414|      0|        if (!parse_flag(line, &compoundend, afflst)) {
  ------------------
  |  Branch (414:13): [True: 0, False: 0]
  ------------------
  415|      0|          finishFileMgr(afflst);
  416|      0|          return 1;
  417|      0|        }
  418|      0|      }
  419|      0|    }
  420|       |
  421|       |    /* parse in the data used by compound_check() method */
  422|    608|    if (line.compare(0, 15, "COMPOUNDWORDMAX", 15) == 0) {
  ------------------
  |  Branch (422:9): [True: 2, False: 606]
  ------------------
  423|      2|      if (!parse_num(line, &cpdwordmax, afflst)) {
  ------------------
  |  Branch (423:11): [True: 0, False: 2]
  ------------------
  424|      0|        finishFileMgr(afflst);
  425|      0|        return 1;
  426|      0|      }
  427|      2|    }
  428|       |
  429|       |    /* parse in the flag sign compounds in dictionary */
  430|    608|    if (line.compare(0, 12, "COMPOUNDROOT", 12) == 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 608]
  ------------------
  431|      0|      if (!parse_flag(line, &compoundroot, afflst)) {
  ------------------
  |  Branch (431:11): [True: 0, False: 0]
  ------------------
  432|      0|        finishFileMgr(afflst);
  433|      0|        return 1;
  434|      0|      }
  435|      0|    }
  436|       |
  437|       |    /* parse in the flag used by compound_check() method */
  438|    608|    if (line.compare(0, 18, "COMPOUNDPERMITFLAG", 18) == 0) {
  ------------------
  |  Branch (438:9): [True: 2, False: 606]
  ------------------
  439|      2|      if (!parse_flag(line, &compoundpermitflag, afflst)) {
  ------------------
  |  Branch (439:11): [True: 0, False: 2]
  ------------------
  440|      0|        finishFileMgr(afflst);
  441|      0|        return 1;
  442|      0|      }
  443|      2|    }
  444|       |
  445|       |    /* parse in the flag used by compound_check() method */
  446|    608|    if (line.compare(0, 18, "COMPOUNDFORBIDFLAG", 18) == 0) {
  ------------------
  |  Branch (446:9): [True: 2, False: 606]
  ------------------
  447|      2|      if (!parse_flag(line, &compoundforbidflag, afflst)) {
  ------------------
  |  Branch (447:11): [True: 0, False: 2]
  ------------------
  448|      0|        finishFileMgr(afflst);
  449|      0|        return 1;
  450|      0|      }
  451|      2|    }
  452|       |
  453|    608|    if (line.compare(0, 20, "COMPOUNDMORESUFFIXES", 20) == 0) {
  ------------------
  |  Branch (453:9): [True: 0, False: 608]
  ------------------
  454|      0|      compoundmoresuffixes = 1;
  455|      0|    }
  456|       |
  457|    608|    if (line.compare(0, 16, "CHECKCOMPOUNDDUP", 16) == 0) {
  ------------------
  |  Branch (457:9): [True: 0, False: 608]
  ------------------
  458|      0|      checkcompounddup = 1;
  459|      0|    }
  460|       |
  461|    608|    if (line.compare(0, 16, "CHECKCOMPOUNDREP", 16) == 0) {
  ------------------
  |  Branch (461:9): [True: 2, False: 606]
  ------------------
  462|      2|      checkcompoundrep = 1;
  463|      2|    }
  464|       |
  465|    608|    if (line.compare(0, 19, "CHECKCOMPOUNDTRIPLE", 19) == 0) {
  ------------------
  |  Branch (465:9): [True: 0, False: 608]
  ------------------
  466|      0|      checkcompoundtriple = 1;
  467|      0|    }
  468|       |
  469|    608|    if (line.compare(0, 16, "SIMPLIFIEDTRIPLE", 16) == 0) {
  ------------------
  |  Branch (469:9): [True: 0, False: 608]
  ------------------
  470|      0|      simplifiedtriple = 1;
  471|      0|    }
  472|       |
  473|    608|    if (line.compare(0, 17, "CHECKCOMPOUNDCASE", 17) == 0) {
  ------------------
  |  Branch (473:9): [True: 0, False: 608]
  ------------------
  474|      0|      checkcompoundcase = 1;
  475|      0|    }
  476|       |
  477|    608|    if (line.compare(0, 9, "NOSUGGEST", 9) == 0) {
  ------------------
  |  Branch (477:9): [True: 0, False: 608]
  ------------------
  478|      0|      if (!parse_flag(line, &nosuggest, afflst)) {
  ------------------
  |  Branch (478:11): [True: 0, False: 0]
  ------------------
  479|      0|        finishFileMgr(afflst);
  480|      0|        return 1;
  481|      0|      }
  482|      0|    }
  483|       |
  484|    608|    if (line.compare(0, 14, "NONGRAMSUGGEST", 14) == 0) {
  ------------------
  |  Branch (484:9): [True: 0, False: 608]
  ------------------
  485|      0|      if (!parse_flag(line, &nongramsuggest, afflst)) {
  ------------------
  |  Branch (485:11): [True: 0, False: 0]
  ------------------
  486|      0|        finishFileMgr(afflst);
  487|      0|        return 1;
  488|      0|      }
  489|      0|    }
  490|       |
  491|       |    /* parse in the flag used by forbidden words */
  492|    608|    if (line.compare(0, 13, "FORBIDDENWORD", 13) == 0) {
  ------------------
  |  Branch (492:9): [True: 2, False: 606]
  ------------------
  493|      2|      if (!parse_flag(line, &forbiddenword, afflst)) {
  ------------------
  |  Branch (493:11): [True: 0, False: 2]
  ------------------
  494|      0|        finishFileMgr(afflst);
  495|      0|        return 1;
  496|      0|      }
  497|      2|    }
  498|       |
  499|       |    /* parse in the flag used by forbidden words (is deprecated) */
  500|    608|    if (line.compare(0, 13, "LEMMA_PRESENT", 13) == 0) {
  ------------------
  |  Branch (500:9): [True: 0, False: 608]
  ------------------
  501|      0|      if (!parse_flag(line, &lemma_present, afflst)) {
  ------------------
  |  Branch (501:11): [True: 0, False: 0]
  ------------------
  502|      0|        finishFileMgr(afflst);
  503|      0|        return 1;
  504|      0|      }
  505|      0|    }
  506|       |
  507|       |    /* parse in the flag used by circumfixes */
  508|    608|    if (line.compare(0, 9, "CIRCUMFIX", 9) == 0) {
  ------------------
  |  Branch (508:9): [True: 2, False: 606]
  ------------------
  509|      2|      if (!parse_flag(line, &circumfix, afflst)) {
  ------------------
  |  Branch (509:11): [True: 0, False: 2]
  ------------------
  510|      0|        finishFileMgr(afflst);
  511|      0|        return 1;
  512|      0|      }
  513|      2|    }
  514|       |
  515|       |    /* parse in the flag used by fogemorphemes */
  516|    608|    if (line.compare(0, 14, "ONLYINCOMPOUND", 14) == 0) {
  ------------------
  |  Branch (516:9): [True: 0, False: 608]
  ------------------
  517|      0|      if (!parse_flag(line, &onlyincompound, afflst)) {
  ------------------
  |  Branch (517:11): [True: 0, False: 0]
  ------------------
  518|      0|        finishFileMgr(afflst);
  519|      0|        return 1;
  520|      0|      }
  521|      0|    }
  522|       |
  523|       |    /* parse in the flag used by `needaffixs' (is deprecated) */
  524|    608|    if (line.compare(0, 10, "PSEUDOROOT", 10) == 0) {
  ------------------
  |  Branch (524:9): [True: 0, False: 608]
  ------------------
  525|      0|      if (!parse_flag(line, &needaffix, afflst)) {
  ------------------
  |  Branch (525:11): [True: 0, False: 0]
  ------------------
  526|      0|        finishFileMgr(afflst);
  527|      0|        return 1;
  528|      0|      }
  529|      0|    }
  530|       |
  531|       |    /* parse in the flag used by `needaffixs' */
  532|    608|    if (line.compare(0, 9, "NEEDAFFIX", 9) == 0) {
  ------------------
  |  Branch (532:9): [True: 2, False: 606]
  ------------------
  533|      2|      if (!parse_flag(line, &needaffix, afflst)) {
  ------------------
  |  Branch (533:11): [True: 0, False: 2]
  ------------------
  534|      0|        finishFileMgr(afflst);
  535|      0|        return 1;
  536|      0|      }
  537|      2|    }
  538|       |
  539|       |    /* parse in the minimal length for words in compounds */
  540|    608|    if (line.compare(0, 11, "COMPOUNDMIN", 11) == 0) {
  ------------------
  |  Branch (540:9): [True: 4, False: 604]
  ------------------
  541|      4|      if (!parse_num(line, &cpdmin, afflst)) {
  ------------------
  |  Branch (541:11): [True: 0, False: 4]
  ------------------
  542|      0|        finishFileMgr(afflst);
  543|      0|        return 1;
  544|      0|      }
  545|      4|      if (cpdmin < 1)
  ------------------
  |  Branch (545:11): [True: 0, False: 4]
  ------------------
  546|      0|        cpdmin = 1;
  547|      4|    }
  548|       |
  549|       |    /* parse in the max. words and syllables in compounds */
  550|    608|    if (line.compare(0, 16, "COMPOUNDSYLLABLE", 16) == 0) {
  ------------------
  |  Branch (550:9): [True: 2, False: 606]
  ------------------
  551|      2|      if (!parse_cpdsyllable(line, afflst)) {
  ------------------
  |  Branch (551:11): [True: 0, False: 2]
  ------------------
  552|      0|        finishFileMgr(afflst);
  553|      0|        return 1;
  554|      0|      }
  555|      2|    }
  556|       |
  557|       |    /* parse in the flag used by compound_check() method */
  558|    608|    if (line.compare(0, 11, "SYLLABLENUM", 11) == 0) {
  ------------------
  |  Branch (558:9): [True: 0, False: 608]
  ------------------
  559|      0|      if (!parse_string(line, cpdsyllablenum, afflst->getlinenum())) {
  ------------------
  |  Branch (559:11): [True: 0, False: 0]
  ------------------
  560|      0|        finishFileMgr(afflst);
  561|      0|        return 1;
  562|      0|      }
  563|      0|    }
  564|       |
  565|       |    /* parse in the flag used by the controlled compound words */
  566|    608|    if (line.compare(0, 8, "CHECKNUM", 8) == 0) {
  ------------------
  |  Branch (566:9): [True: 0, False: 608]
  ------------------
  567|      0|      checknum = 1;
  568|      0|    }
  569|       |
  570|       |    /* parse in the extra word characters */
  571|    608|    if (line.compare(0, 9, "WORDCHARS", 9) == 0) {
  ------------------
  |  Branch (571:9): [True: 6, False: 602]
  ------------------
  572|      6|      if (!parse_array(line, wordchars, wordchars_utf16,
  ------------------
  |  Branch (572:11): [True: 0, False: 6]
  ------------------
  573|      6|                       utf8, afflst->getlinenum())) {
  574|      0|        finishFileMgr(afflst);
  575|      0|        return 1;
  576|      0|      }
  577|      6|    }
  578|       |
  579|       |    /* parse in the ignored characters (for example, Arabic optional diacretics
  580|       |     * charachters */
  581|    608|    if (line.compare(0, 6, "IGNORE", 6) == 0) {
  ------------------
  |  Branch (581:9): [True: 4, False: 604]
  ------------------
  582|      4|      if (!parse_array(line, ignorechars, ignorechars_utf16,
  ------------------
  |  Branch (582:11): [True: 0, False: 4]
  ------------------
  583|      4|                       utf8, afflst->getlinenum())) {
  584|      0|        finishFileMgr(afflst);
  585|      0|        return 1;
  586|      0|      }
  587|      4|    }
  588|       |
  589|       |    /* parse in the input conversion table */
  590|    608|    if (line.compare(0, 5, "ICONV", 5) == 0) {
  ------------------
  |  Branch (590:9): [True: 2, False: 606]
  ------------------
  591|      2|      if (!parse_convtable(line, afflst, &iconvtable, "ICONV")) {
  ------------------
  |  Branch (591:11): [True: 0, False: 2]
  ------------------
  592|      0|        finishFileMgr(afflst);
  593|      0|        return 1;
  594|      0|      }
  595|      2|    }
  596|       |
  597|       |    /* parse in the output conversion table */
  598|    608|    if (line.compare(0, 5, "OCONV", 5) == 0) {
  ------------------
  |  Branch (598:9): [True: 2, False: 606]
  ------------------
  599|      2|      if (!parse_convtable(line, afflst, &oconvtable, "OCONV")) {
  ------------------
  |  Branch (599:11): [True: 0, False: 2]
  ------------------
  600|      0|        finishFileMgr(afflst);
  601|      0|        return 1;
  602|      0|      }
  603|      2|    }
  604|       |
  605|       |    /* parse in the phonetic translation table */
  606|    608|    if (line.compare(0, 5, "PHONE", 5) == 0) {
  ------------------
  |  Branch (606:9): [True: 2, False: 606]
  ------------------
  607|      2|      if (!parse_phonetable(line, afflst)) {
  ------------------
  |  Branch (607:11): [True: 0, False: 2]
  ------------------
  608|      0|        finishFileMgr(afflst);
  609|      0|        return 1;
  610|      0|      }
  611|      2|    }
  612|       |
  613|       |    /* parse in the checkcompoundpattern table */
  614|    608|    if (line.compare(0, 20, "CHECKCOMPOUNDPATTERN", 20) == 0) {
  ------------------
  |  Branch (614:9): [True: 2, False: 606]
  ------------------
  615|      2|      if (!parse_checkcpdtable(line, afflst)) {
  ------------------
  |  Branch (615:11): [True: 0, False: 2]
  ------------------
  616|      0|        finishFileMgr(afflst);
  617|      0|        return 1;
  618|      0|      }
  619|      2|    }
  620|       |
  621|       |    /* parse in the defcompound table */
  622|    608|    if (line.compare(0, 12, "COMPOUNDRULE", 12) == 0) {
  ------------------
  |  Branch (622:9): [True: 0, False: 608]
  ------------------
  623|      0|      if (!parse_defcpdtable(line, afflst)) {
  ------------------
  |  Branch (623:11): [True: 0, False: 0]
  ------------------
  624|      0|        finishFileMgr(afflst);
  625|      0|        return 1;
  626|      0|      }
  627|      0|    }
  628|       |
  629|       |    /* parse in the related character map table */
  630|    608|    if (line.compare(0, 3, "MAP", 3) == 0) {
  ------------------
  |  Branch (630:9): [True: 2, False: 606]
  ------------------
  631|      2|      if (!parse_maptable(line, afflst)) {
  ------------------
  |  Branch (631:11): [True: 0, False: 2]
  ------------------
  632|      0|        finishFileMgr(afflst);
  633|      0|        return 1;
  634|      0|      }
  635|      2|    }
  636|       |
  637|       |    /* parse in the word breakpoints table */
  638|    608|    if (line.compare(0, 5, "BREAK", 5) == 0) {
  ------------------
  |  Branch (638:9): [True: 4, False: 604]
  ------------------
  639|      4|      if (!parse_breaktable(line, afflst)) {
  ------------------
  |  Branch (639:11): [True: 0, False: 4]
  ------------------
  640|      0|        finishFileMgr(afflst);
  641|      0|        return 1;
  642|      0|      }
  643|      4|    }
  644|       |
  645|       |    /* parse in the language for language specific codes */
  646|    608|    if (line.compare(0, 4, "LANG", 4) == 0) {
  ------------------
  |  Branch (646:9): [True: 2, False: 606]
  ------------------
  647|      2|      if (!parse_string(line, lang, afflst->getlinenum())) {
  ------------------
  |  Branch (647:11): [True: 0, False: 2]
  ------------------
  648|      0|        finishFileMgr(afflst);
  649|      0|        return 1;
  650|      0|      }
  651|      2|      langnum = get_lang_num(lang);
  652|      2|    }
  653|       |
  654|    608|    if (line.compare(0, 7, "VERSION", 7) == 0) {
  ------------------
  |  Branch (654:9): [True: 0, False: 608]
  ------------------
  655|      0|      size_t startpos = line.find_first_not_of(" \t", 7);
  656|      0|      if (startpos != std::string::npos) {
  ------------------
  |  Branch (656:11): [True: 0, False: 0]
  ------------------
  657|      0|          version = line.substr(startpos);
  658|      0|      }
  659|      0|    }
  660|       |
  661|    608|    if (line.compare(0, 12, "MAXNGRAMSUGS", 12) == 0) {
  ------------------
  |  Branch (661:9): [True: 4, False: 604]
  ------------------
  662|      4|      if (!parse_num(line, &maxngramsugs, afflst)) {
  ------------------
  |  Branch (662:11): [True: 0, False: 4]
  ------------------
  663|      0|        finishFileMgr(afflst);
  664|      0|        return 1;
  665|      0|      }
  666|      4|    }
  667|       |
  668|    608|    if (line.compare(0, 11, "ONLYMAXDIFF", 11) == 0)
  ------------------
  |  Branch (668:9): [True: 0, False: 608]
  ------------------
  669|      0|      onlymaxdiff = 1;
  670|       |
  671|    608|    if (line.compare(0, 7, "MAXDIFF", 7) == 0) {
  ------------------
  |  Branch (671:9): [True: 0, False: 608]
  ------------------
  672|      0|      if (!parse_num(line, &maxdiff, afflst)) {
  ------------------
  |  Branch (672:11): [True: 0, False: 0]
  ------------------
  673|      0|        finishFileMgr(afflst);
  674|      0|        return 1;
  675|      0|      }
  676|      0|    }
  677|       |
  678|    608|    if (line.compare(0, 10, "MAXCPDSUGS", 10) == 0) {
  ------------------
  |  Branch (678:9): [True: 0, False: 608]
  ------------------
  679|      0|      if (!parse_num(line, &maxcpdsugs, afflst)) {
  ------------------
  |  Branch (679:11): [True: 0, False: 0]
  ------------------
  680|      0|        finishFileMgr(afflst);
  681|      0|        return 1;
  682|      0|      }
  683|      0|    }
  684|       |
  685|    608|    if (line.compare(0, 11, "NOSPLITSUGS", 11) == 0) {
  ------------------
  |  Branch (685:9): [True: 0, False: 608]
  ------------------
  686|      0|      nosplitsugs = 1;
  687|      0|    }
  688|       |
  689|    608|    if (line.compare(0, 9, "FULLSTRIP", 9) == 0) {
  ------------------
  |  Branch (689:9): [True: 0, False: 608]
  ------------------
  690|      0|      fullstrip = 1;
  691|      0|    }
  692|       |
  693|    608|    if (line.compare(0, 12, "SUGSWITHDOTS", 12) == 0) {
  ------------------
  |  Branch (693:9): [True: 0, False: 608]
  ------------------
  694|      0|      sugswithdots = 1;
  695|      0|    }
  696|       |
  697|       |    /* parse in the flag used by forbidden words */
  698|    608|    if (line.compare(0, 8, "KEEPCASE", 8) == 0) {
  ------------------
  |  Branch (698:9): [True: 2, False: 606]
  ------------------
  699|      2|      if (!parse_flag(line, &keepcase, afflst)) {
  ------------------
  |  Branch (699:11): [True: 0, False: 2]
  ------------------
  700|      0|        finishFileMgr(afflst);
  701|      0|        return 1;
  702|      0|      }
  703|      2|    }
  704|       |
  705|       |    /* parse in the flag used by `forceucase' */
  706|    608|    if (line.compare(0, 10, "FORCEUCASE", 10) == 0) {
  ------------------
  |  Branch (706:9): [True: 0, False: 608]
  ------------------
  707|      0|      if (!parse_flag(line, &forceucase, afflst)) {
  ------------------
  |  Branch (707:11): [True: 0, False: 0]
  ------------------
  708|      0|        finishFileMgr(afflst);
  709|      0|        return 1;
  710|      0|      }
  711|      0|    }
  712|       |
  713|       |    /* parse in the flag used by `warn' */
  714|    608|    if (line.compare(0, 4, "WARN", 4) == 0) {
  ------------------
  |  Branch (714:9): [True: 2, False: 606]
  ------------------
  715|      2|      if (!parse_flag(line, &warn, afflst)) {
  ------------------
  |  Branch (715:11): [True: 0, False: 2]
  ------------------
  716|      0|        finishFileMgr(afflst);
  717|      0|        return 1;
  718|      0|      }
  719|      2|    }
  720|       |
  721|    608|    if (line.compare(0, 10, "FORBIDWARN", 10) == 0) {
  ------------------
  |  Branch (721:9): [True: 0, False: 608]
  ------------------
  722|      0|      forbidwarn = 1;
  723|      0|    }
  724|       |
  725|       |    /* parse in the flag used by the affix generator */
  726|    608|    if (line.compare(0, 11, "SUBSTANDARD", 11) == 0) {
  ------------------
  |  Branch (726:9): [True: 0, False: 608]
  ------------------
  727|      0|      if (!parse_flag(line, &substandard, afflst)) {
  ------------------
  |  Branch (727:11): [True: 0, False: 0]
  ------------------
  728|      0|        finishFileMgr(afflst);
  729|      0|        return 1;
  730|      0|      }
  731|      0|    }
  732|       |
  733|    608|    if (line.compare(0, 11, "CHECKSHARPS", 11) == 0) {
  ------------------
  |  Branch (733:9): [True: 0, False: 608]
  ------------------
  734|      0|      checksharps = 1;
  735|      0|    }
  736|       |
  737|       |    /* parse this affix: P - prefix, S - suffix */
  738|       |    // affix type
  739|    608|    char ft = ' ';
  740|    608|    if (line.compare(0, 3, "PFX", 3) == 0)
  ------------------
  |  Branch (740:9): [True: 12, False: 596]
  ------------------
  741|     12|      ft = complexprefixes ? 'S' : 'P';
  ------------------
  |  Branch (741:12): [True: 4, False: 8]
  ------------------
  742|    608|    if (line.compare(0, 3, "SFX", 3) == 0)
  ------------------
  |  Branch (742:9): [True: 14, False: 594]
  ------------------
  743|     14|      ft = complexprefixes ? 'P' : 'S';
  ------------------
  |  Branch (743:12): [True: 0, False: 14]
  ------------------
  744|    608|    if (ft != ' ') {
  ------------------
  |  Branch (744:9): [True: 26, False: 582]
  ------------------
  745|     26|      if (dupflags_ini) {
  ------------------
  |  Branch (745:11): [True: 18, False: 8]
  ------------------
  746|     18|        memset(dupflags, 0, sizeof(dupflags));
  747|     18|        dupflags_ini = 0;
  748|     18|      }
  749|     26|      if (!parse_affix(line, ft, afflst, dupflags, affix_rules)) {
  ------------------
  |  Branch (749:11): [True: 0, False: 26]
  ------------------
  750|      0|        finishFileMgr(afflst);
  751|      0|        return 1;
  752|      0|      }
  753|     26|    }
  754|    608|  }
  755|       |
  756|     38|  finishFileMgr(afflst);
  757|       |  // affix trees are sorted now
  758|       |
  759|       |  // now we can speed up performance greatly taking advantage of the
  760|       |  // relationship between the affixes and the idea of "subsets".
  761|       |
  762|       |  // View each prefix as a potential leading subset of another and view
  763|       |  // each suffix (reversed) as a potential trailing subset of another.
  764|       |
  765|       |  // To illustrate this relationship if we know the prefix "ab" is found in the
  766|       |  // word to examine, only prefixes that "ab" is a leading subset of need be
  767|       |  // examined.
  768|       |  // Furthermore is "ab" is not present then none of the prefixes that "ab" is
  769|       |  // is a subset need be examined.
  770|       |  // The same argument goes for suffix string that are reversed.
  771|       |
  772|       |  // Then to top this off why not examine the first char of the word to quickly
  773|       |  // limit the set of prefixes to examine (i.e. the prefixes to examine must
  774|       |  // be leading supersets of the first character of the word (if they exist)
  775|       |
  776|       |  // To take advantage of this "subset" relationship, we need to add two links
  777|       |  // from entry.  One to take next if the current prefix is found (call it
  778|       |  // nexteq)
  779|       |  // and one to take next if the current prefix is not found (call it nextne).
  780|       |
  781|       |  // Since we have built ordered lists, all that remains is to properly
  782|       |  // initialize
  783|       |  // the nextne and nexteq pointers that relate them
  784|       |
  785|     38|  process_pfx_order();
  786|     38|  process_sfx_order();
  787|       |
  788|     38|  return 0;
  789|     38|}
_ZN8AffixMgr13build_pfxtreeEP8PfxEntry:
  795|      8|int AffixMgr::build_pfxtree(PfxEntry* pfxptr) {
  796|      8|  PfxEntry* ptr;
  797|      8|  PfxEntry* pptr;
  798|      8|  PfxEntry* ep = pfxptr;
  799|       |
  800|       |  // get the right starting points
  801|      8|  const char* key = ep->getKey();
  802|      8|  const auto flg = (unsigned char)(ep->getFlag() & 0x00FF);
  803|       |
  804|       |  // first index by flag which must exist
  805|      8|  ptr = pFlag[flg];
  806|      8|  ep->setFlgNxt(ptr);
  807|      8|  pFlag[flg] = ep;
  808|       |
  809|       |  // handle the special case of null affix string
  810|      8|  if (*key == '\0') {
  ------------------
  |  Branch (810:7): [True: 2, False: 6]
  ------------------
  811|       |    // always inset them at head of list at element 0
  812|      2|    ptr = pStart[0];
  813|      2|    ep->setNext(ptr);
  814|      2|    pStart[0] = ep;
  815|      2|    return 0;
  816|      2|  }
  817|       |
  818|       |  // now handle the normal case
  819|      6|  ep->setNextEQ(nullptr);
  820|      6|  ep->setNextNE(nullptr);
  821|       |
  822|      6|  unsigned char sp = *((const unsigned char*)key);
  823|      6|  ptr = pStart[sp];
  824|       |
  825|       |  // handle the first insert
  826|      6|  if (!ptr) {
  ------------------
  |  Branch (826:7): [True: 4, False: 2]
  ------------------
  827|      4|    pStart[sp] = ep;
  828|      4|    return 0;
  829|      4|  }
  830|       |
  831|       |  // otherwise use binary tree insertion so that a sorted
  832|       |  // list can easily be generated later
  833|      2|  pptr = nullptr;
  834|      2|  for (;;) {
  835|      2|    pptr = ptr;
  836|      2|    if (strcmp(ep->getKey(), ptr->getKey()) <= 0) {
  ------------------
  |  Branch (836:9): [True: 0, False: 2]
  ------------------
  837|      0|      ptr = ptr->getNextEQ();
  838|      0|      if (!ptr) {
  ------------------
  |  Branch (838:11): [True: 0, False: 0]
  ------------------
  839|      0|        pptr->setNextEQ(ep);
  840|      0|        break;
  841|      0|      }
  842|      2|    } else {
  843|      2|      ptr = ptr->getNextNE();
  844|      2|      if (!ptr) {
  ------------------
  |  Branch (844:11): [True: 2, False: 0]
  ------------------
  845|      2|        pptr->setNextNE(ep);
  846|      2|        break;
  847|      2|      }
  848|      2|    }
  849|      2|  }
  850|      2|  return 0;
  851|      6|}
_ZN8AffixMgr13build_sfxtreeEP8SfxEntry:
  856|     34|int AffixMgr::build_sfxtree(SfxEntry* sfxptr) {
  857|       |
  858|     34|  sfxptr->initReverseWord();
  859|       |
  860|     34|  SfxEntry* ptr;
  861|     34|  SfxEntry* pptr;
  862|     34|  SfxEntry* ep = sfxptr;
  863|       |
  864|       |  /* get the right starting point */
  865|     34|  const char* key = ep->getKey();
  866|     34|  const auto flg = (unsigned char)(ep->getFlag() & 0x00FF);
  867|       |
  868|       |  // first index by flag which must exist
  869|     34|  ptr = sFlag[flg];
  870|     34|  ep->setFlgNxt(ptr);
  871|     34|  sFlag[flg] = ep;
  872|       |
  873|       |  // next index by affix string
  874|       |
  875|       |  // handle the special case of null affix string
  876|     34|  if (*key == '\0') {
  ------------------
  |  Branch (876:7): [True: 0, False: 34]
  ------------------
  877|       |    // always inset them at head of list at element 0
  878|      0|    ptr = sStart[0];
  879|      0|    ep->setNext(ptr);
  880|      0|    sStart[0] = ep;
  881|      0|    return 0;
  882|      0|  }
  883|       |
  884|       |  // now handle the normal case
  885|     34|  ep->setNextEQ(nullptr);
  886|     34|  ep->setNextNE(nullptr);
  887|       |
  888|     34|  unsigned char sp = *((const unsigned char*)key);
  889|     34|  ptr = sStart[sp];
  890|       |
  891|       |  // handle the first insert
  892|     34|  if (!ptr) {
  ------------------
  |  Branch (892:7): [True: 22, False: 12]
  ------------------
  893|     22|    sStart[sp] = ep;
  894|     22|    return 0;
  895|     22|  }
  896|       |
  897|       |  // otherwise use binary tree insertion so that a sorted
  898|       |  // list can easily be generated later
  899|     12|  pptr = nullptr;
  900|     20|  for (;;) {
  901|     20|    pptr = ptr;
  902|     20|    if (strcmp(ep->getKey(), ptr->getKey()) <= 0) {
  ------------------
  |  Branch (902:9): [True: 18, False: 2]
  ------------------
  903|     18|      ptr = ptr->getNextEQ();
  904|     18|      if (!ptr) {
  ------------------
  |  Branch (904:11): [True: 10, False: 8]
  ------------------
  905|     10|        pptr->setNextEQ(ep);
  906|     10|        break;
  907|     10|      }
  908|     18|    } else {
  909|      2|      ptr = ptr->getNextNE();
  910|      2|      if (!ptr) {
  ------------------
  |  Branch (910:11): [True: 2, False: 0]
  ------------------
  911|      2|        pptr->setNextNE(ep);
  912|      2|        break;
  913|      2|      }
  914|      2|    }
  915|     20|  }
  916|     12|  return 0;
  917|     34|}
_ZN8AffixMgr24process_pfx_tree_to_listEv:
  937|     38|int AffixMgr::process_pfx_tree_to_list() {
  938|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (938:19): [True: 9.69k, False: 38]
  ------------------
  939|  9.69k|    pStart[i] = process_pfx_in_order(pStart[i], nullptr);
  940|  9.69k|  }
  941|     38|  return 0;
  942|     38|}
_ZN8AffixMgr20process_pfx_in_orderEP8PfxEntryS1_:
  944|  9.69k|PfxEntry* AffixMgr::process_pfx_in_order(PfxEntry* ptr, PfxEntry* nptr) {
  945|  9.69k|  return link_in_order(ptr, nptr);
  946|  9.69k|}
_ZN8AffixMgr24process_sfx_tree_to_listEv:
  949|     38|int AffixMgr::process_sfx_tree_to_list() {
  950|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (950:19): [True: 9.69k, False: 38]
  ------------------
  951|  9.69k|    sStart[i] = process_sfx_in_order(sStart[i], nullptr);
  952|  9.69k|  }
  953|     38|  return 0;
  954|     38|}
_ZN8AffixMgr20process_sfx_in_orderEP8SfxEntryS1_:
  956|  9.69k|SfxEntry* AffixMgr::process_sfx_in_order(SfxEntry* ptr, SfxEntry* nptr) {
  957|  9.69k|  return link_in_order(ptr, nptr);
  958|  9.69k|}
_ZN8AffixMgr17process_pfx_orderEv:
  962|     38|int AffixMgr::process_pfx_order() {
  963|     38|  PfxEntry* ptr;
  964|       |
  965|       |  // loop through each prefix list starting point
  966|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (966:19): [True: 9.69k, False: 38]
  ------------------
  967|  9.69k|    ptr = pStart[i];
  968|       |
  969|       |    // look through the remainder of the list
  970|       |    //  and find next entry with affix that
  971|       |    // the current one is not a subset of
  972|       |    // mark that as destination for NextNE
  973|       |    // use next in list that you are a subset
  974|       |    // of as NextEQ
  975|       |
  976|  9.69k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (976:12): [True: 6, False: 9.69k]
  ------------------
  977|      6|      PfxEntry* nptr = ptr->getNext();
  978|      8|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (978:14): [True: 2, False: 6]
  ------------------
  979|      2|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (979:13): [True: 0, False: 2]
  ------------------
  980|      0|          break;
  981|      2|      }
  982|      6|      ptr->setNextNE(nptr);
  983|      6|      ptr->setNextEQ(nullptr);
  984|      6|      if ((ptr->getNext()) &&
  ------------------
  |  Branch (984:11): [True: 2, False: 4]
  ------------------
  985|      2|          isSubset(ptr->getKey(), (ptr->getNext())->getKey()))
  ------------------
  |  Branch (985:11): [True: 2, False: 0]
  ------------------
  986|      2|        ptr->setNextEQ(ptr->getNext());
  987|      6|    }
  988|       |
  989|       |    // now clean up by adding smart search termination strings:
  990|       |    // if you are already a superset of the previous prefix
  991|       |    // but not a subset of the next, search can end here
  992|       |    // so set NextNE properly
  993|       |
  994|  9.69k|    ptr = pStart[i];
  995|  9.69k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (995:12): [True: 6, False: 9.69k]
  ------------------
  996|      6|      PfxEntry* nptr = ptr->getNext();
  997|      6|      PfxEntry* mptr = nullptr;
  998|      8|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (998:14): [True: 2, False: 6]
  ------------------
  999|      2|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (999:13): [True: 0, False: 2]
  ------------------
 1000|      0|          break;
 1001|      2|        mptr = nptr;
 1002|      2|      }
 1003|      6|      if (mptr)
  ------------------
  |  Branch (1003:11): [True: 2, False: 4]
  ------------------
 1004|      2|        mptr->setNextNE(nullptr);
 1005|      6|    }
 1006|  9.69k|  }
 1007|     38|  return 0;
 1008|     38|}
_ZN8AffixMgr17process_sfx_orderEv:
 1012|     38|int AffixMgr::process_sfx_order() {
 1013|     38|  SfxEntry* ptr;
 1014|       |
 1015|       |  // loop through each prefix list starting point
 1016|  9.72k|  for (int i = 1; i < SETSIZE; i++) {
  ------------------
  |  |   61|  9.72k|#define SETSIZE 256
  ------------------
  |  Branch (1016:19): [True: 9.69k, False: 38]
  ------------------
 1017|  9.69k|    ptr = sStart[i];
 1018|       |
 1019|       |    // look through the remainder of the list
 1020|       |    //  and find next entry with affix that
 1021|       |    // the current one is not a subset of
 1022|       |    // mark that as destination for NextNE
 1023|       |    // use next in list that you are a subset
 1024|       |    // of as NextEQ
 1025|       |
 1026|  9.72k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (1026:12): [True: 34, False: 9.69k]
  ------------------
 1027|     34|      SfxEntry* nptr = ptr->getNext();
 1028|     52|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (1028:14): [True: 20, False: 32]
  ------------------
 1029|     20|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (1029:13): [True: 2, False: 18]
  ------------------
 1030|      2|          break;
 1031|     20|      }
 1032|     34|      ptr->setNextNE(nptr);
 1033|     34|      ptr->setNextEQ(nullptr);
 1034|     34|      if ((ptr->getNext()) &&
  ------------------
  |  Branch (1034:11): [True: 12, False: 22]
  ------------------
 1035|     12|          isSubset(ptr->getKey(), (ptr->getNext())->getKey()))
  ------------------
  |  Branch (1035:11): [True: 10, False: 2]
  ------------------
 1036|     10|        ptr->setNextEQ(ptr->getNext());
 1037|     34|    }
 1038|       |
 1039|       |    // now clean up by adding smart search termination strings:
 1040|       |    // if you are already a superset of the previous suffix
 1041|       |    // but not a subset of the next, search can end here
 1042|       |    // so set NextNE properly
 1043|       |
 1044|  9.69k|    ptr = sStart[i];
 1045|  9.72k|    for (; ptr != nullptr; ptr = ptr->getNext()) {
  ------------------
  |  Branch (1045:12): [True: 34, False: 9.69k]
  ------------------
 1046|     34|      SfxEntry* nptr = ptr->getNext();
 1047|     34|      SfxEntry* mptr = nullptr;
 1048|     52|      for (; nptr != nullptr; nptr = nptr->getNext()) {
  ------------------
  |  Branch (1048:14): [True: 20, False: 32]
  ------------------
 1049|     20|        if (!isSubset(ptr->getKey(), nptr->getKey()))
  ------------------
  |  Branch (1049:13): [True: 2, False: 18]
  ------------------
 1050|      2|          break;
 1051|     18|        mptr = nptr;
 1052|     18|      }
 1053|     34|      if (mptr)
  ------------------
  |  Branch (1053:11): [True: 10, False: 24]
  ------------------
 1054|     10|        mptr->setNextNE(nullptr);
 1055|     34|    }
 1056|  9.69k|  }
 1057|     38|  return 0;
 1058|     38|}
_ZN8AffixMgr7condlenERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1071|      8|int AffixMgr::condlen(const std::string& s) {
 1072|      8|  int l = 0;
 1073|      8|  bool group = false;
 1074|      8|  size_t i = 0;
 1075|     42|  while (i < s.size()) {
  ------------------
  |  Branch (1075:10): [True: 34, False: 8]
  ------------------
 1076|     34|    if (s[i] == '[') {
  ------------------
  |  Branch (1076:9): [True: 4, False: 30]
  ------------------
 1077|      4|      group = true;
 1078|      4|      ++l;
 1079|      4|      ++i;
 1080|     30|    } else if (s[i] == ']') {
  ------------------
  |  Branch (1080:16): [True: 4, False: 26]
  ------------------
 1081|      4|      group = false;
 1082|      4|      ++i;
 1083|     26|    } else if (group) {
  ------------------
  |  Branch (1083:16): [True: 18, False: 8]
  ------------------
 1084|     18|      ++i;
 1085|     18|    } else {
 1086|      8|      ++l;
 1087|      8|      i = utf8 ? utf8_next(s, i) : i + 1;
  ------------------
  |  Branch (1087:11): [True: 8, False: 0]
  ------------------
 1088|      8|    }
 1089|     34|  }
 1090|      8|  return l;
 1091|      8|}
_ZN8AffixMgr8encodeitER8AffEntryRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
 1093|     42|int AffixMgr::encodeit(AffEntry& entry, const std::string& cs) {
 1094|     42|  if (cs.compare(".") != 0) {
  ------------------
  |  Branch (1094:7): [True: 8, False: 34]
  ------------------
 1095|      8|    int n = condlen(cs);
 1096|      8|    if (n > std::numeric_limits<unsigned char>::max()) {
  ------------------
  |  Branch (1096:9): [True: 0, False: 8]
  ------------------
 1097|      0|      HUNSPELL_WARNING(stderr, "error: condition length %d is over max limit\n", n);
 1098|      0|      return 1;
 1099|      0|    }
 1100|      8|    entry.numconds = (unsigned char)n;
 1101|      8|    const size_t cslen = cs.size();
 1102|      8|    const size_t short_part = std::min<size_t>(MAXCONDLEN, cslen);
  ------------------
  |  |   93|      8|#define MAXCONDLEN 20
  ------------------
 1103|      8|    memcpy(entry.c.conds, cs.data(), short_part);
 1104|      8|    if (short_part < MAXCONDLEN) {
  ------------------
  |  |   93|      8|#define MAXCONDLEN 20
  ------------------
  |  Branch (1104:9): [True: 8, False: 0]
  ------------------
 1105|       |      //blank out the remaining space
 1106|      8|      memset(entry.c.conds + short_part, 0, MAXCONDLEN - short_part);
  ------------------
  |  |   93|      8|#define MAXCONDLEN 20
  ------------------
 1107|      8|    } else if (cs[MAXCONDLEN]) {
  ------------------
  |  |   93|      0|#define MAXCONDLEN 20
  ------------------
  |  Branch (1107:16): [True: 0, False: 0]
  ------------------
 1108|       |      //there is more conditions than fit in fixed space, so its
 1109|       |      //a long condition
 1110|      0|      entry.opts |= aeLONGCOND;
  ------------------
  |  |   69|      0|#define aeLONGCOND (1 << 4)
  ------------------
 1111|      0|      size_t remaining = cs.size() - MAXCONDLEN_1;
  ------------------
  |  |   94|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   93|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
 1112|      0|      entry.c.l.conds2 = new char[1 + remaining];
 1113|      0|      memcpy(entry.c.l.conds2, cs.data() + MAXCONDLEN_1, remaining);
  ------------------
  |  |   94|      0|#define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char*))
  |  |  ------------------
  |  |  |  |   93|      0|#define MAXCONDLEN 20
  |  |  ------------------
  ------------------
 1114|      0|      entry.c.l.conds2[remaining] = 0;
 1115|      0|    }
 1116|     34|  } else {
 1117|     34|    entry.numconds = 0;
 1118|     34|    entry.c.conds[0] = '\0';
 1119|     34|  }
 1120|     42|  return 0;
 1121|     42|}
_ZN8AffixMgr12prefix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmcR12AffixScratchtt:
 1139|   648M|                                      const FLAG avoidflag) {
 1140|   648M|  struct hentry* rv = nullptr;
 1141|       |
 1142|   648M|  pfx = nullptr;
 1143|   648M|  pfxappnd = nullptr;
 1144|   648M|  sfxappnd = nullptr;
 1145|   648M|  sfxextra = 0;
 1146|       |
 1147|   648M|  TraceCtx* t = trace_on(scratch.trace);
 1148|   648M|  int candidates = 0;
 1149|       |
 1150|       |  // first handle the special case of 0 length prefixes
 1151|   648M|  PfxEntry* pe = pStart[0];
 1152|   649M|  while (pe) {
  ------------------
  |  Branch (1152:10): [True: 1.61M, False: 648M]
  ------------------
 1153|  1.61M|    if (
 1154|       |        // fogemorpheme
 1155|  1.61M|        ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   75|  1.61M|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1155:10): [True: 0, False: 1.61M]
  ------------------
 1156|  1.61M|         !(pe->getCont() &&
  ------------------
  |  Branch (1156:12): [True: 1.61M, False: 0]
  ------------------
 1157|  1.61M|           (TESTAFF(pe->getCont(), onlyincompound, pe->getContLen())))) &&
  ------------------
  |  |  102|  1.61M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1157:12): [True: 0, False: 1.61M]
  ------------------
 1158|       |        // permit prefixes in compounds
 1159|  1.61M|        ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   77|  1.61M|#define IN_CPD_END 2
  ------------------
  |  Branch (1159:10): [True: 1.61M, False: 0]
  ------------------
 1160|      0|         (pe->getCont() &&
  ------------------
  |  Branch (1160:11): [True: 0, False: 0]
  ------------------
 1161|  1.61M|          (TESTAFF(pe->getCont(), compoundpermitflag, pe->getContLen()))))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1161:11): [True: 0, False: 0]
  ------------------
 1162|       |      // check prefix
 1163|  1.61M|      ++candidates;
 1164|  1.61M|      rv = pe->checkword(word, start, len, in_compound, needflag, scratch);
 1165|       |      // Skip a stem with the avoid flag and keep scanning the other prefixes.
 1166|  1.61M|      if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |   99|  1.61M|#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 (1166:11): [True: 0, False: 1.61M]
  |  Branch (1166:17): [True: 0, False: 0]
  ------------------
 1167|      0|        trace_avoidflag(t, avoidflag, rv);
 1168|      0|        rv = nullptr;
 1169|      0|      }
 1170|  1.61M|      if (rv) {
  ------------------
  |  Branch (1170:11): [True: 0, False: 1.61M]
  ------------------
 1171|      0|        pfx = pe;  // BUG: pfx not stateless
 1172|      0|        return rv;
 1173|      0|      }
 1174|  1.61M|    }
 1175|  1.61M|    pe = pe->getNext();
 1176|  1.61M|  }
 1177|       |
 1178|       |  // now handle the general case
 1179|   648M|  unsigned char sp = word[start];
 1180|   648M|  PfxEntry* pptr = pStart[sp];
 1181|       |
 1182|   648M|  while (pptr) {
  ------------------
  |  Branch (1182:10): [True: 73.8k, False: 648M]
  ------------------
 1183|  73.8k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1183:9): [True: 42.1k, False: 31.7k]
  ------------------
 1184|  42.1k|      if (
 1185|       |          // fogemorpheme
 1186|  42.1k|          ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   75|  42.1k|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1186:12): [True: 0, False: 42.1k]
  ------------------
 1187|  42.1k|           !(pptr->getCont() &&
  ------------------
  |  Branch (1187:14): [True: 34.7k, False: 7.36k]
  ------------------
 1188|  34.7k|             (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen())))) &&
  ------------------
  |  |  102|  34.7k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1188:14): [True: 0, False: 34.7k]
  ------------------
 1189|       |          // permit prefixes in compounds
 1190|  42.1k|          ((in_compound != IN_CPD_END) ||
  ------------------
  |  |   77|  42.1k|#define IN_CPD_END 2
  ------------------
  |  Branch (1190:12): [True: 42.1k, False: 0]
  ------------------
 1191|      0|           (pptr->getCont() && (TESTAFF(pptr->getCont(), compoundpermitflag,
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1191:13): [True: 0, False: 0]
  |  Branch (1191:32): [True: 0, False: 0]
  ------------------
 1192|  42.1k|                                        pptr->getContLen()))))) {
 1193|       |        // check prefix
 1194|  42.1k|        ++candidates;
 1195|  42.1k|        rv = pptr->checkword(word, start, len, in_compound, needflag, scratch);
 1196|  42.1k|        if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |   99|  42.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 (1196:13): [True: 0, False: 42.1k]
  |  Branch (1196:19): [True: 0, False: 0]
  ------------------
 1197|      0|          trace_avoidflag(t, avoidflag, rv);
 1198|      0|          rv = nullptr;
 1199|      0|        }
 1200|  42.1k|        if (rv) {
  ------------------
  |  Branch (1200:13): [True: 0, False: 42.1k]
  ------------------
 1201|      0|          pfx = pptr;  // BUG: pfx not stateless
 1202|      0|          return rv;
 1203|      0|        }
 1204|  42.1k|      }
 1205|  42.1k|      pptr = pptr->getNextEQ();
 1206|  42.1k|    } else {
 1207|  31.7k|      pptr = pptr->getNextNE();
 1208|  31.7k|    }
 1209|  73.8k|  }
 1210|       |
 1211|       |  // a pass that had nothing to try says so, which is different from a pass that
 1212|       |  // did not run
 1213|   648M|  if (t && candidates == 0)
  ------------------
  |  Branch (1213:7): [True: 0, False: 648M]
  |  Branch (1213:12): [True: 0, False: 0]
  ------------------
 1214|      0|    trace(*t, "pfx \"%s\" candidates=0", word.substr(start, len).c_str());
 1215|       |
 1216|   648M|  return nullptr;
 1217|   648M|}
_ZN8AffixMgr19prefix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmcR12AffixScratcht:
 1225|  19.2M|                                             const FLAG needflag) {
 1226|  19.2M|  struct hentry* rv = nullptr;
 1227|       |
 1228|  19.2M|  pfx = nullptr;
 1229|  19.2M|  sfxappnd = nullptr;
 1230|  19.2M|  sfxextra = 0;
 1231|       |
 1232|       |  // first handle the special case of 0 length prefixes
 1233|  19.2M|  PfxEntry* pe = pStart[0];
 1234|       |
 1235|  20.8M|  while (pe) {
  ------------------
  |  Branch (1235:10): [True: 1.61M, False: 19.2M]
  ------------------
 1236|  1.61M|    rv = pe->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1237|  1.61M|    if (rv)
  ------------------
  |  Branch (1237:9): [True: 0, False: 1.61M]
  ------------------
 1238|      0|      return rv;
 1239|  1.61M|    pe = pe->getNext();
 1240|  1.61M|  }
 1241|       |
 1242|       |  // now handle the general case
 1243|  19.2M|  unsigned char sp = word[start];
 1244|  19.2M|  PfxEntry* pptr = pStart[sp];
 1245|       |
 1246|  19.3M|  while (pptr) {
  ------------------
  |  Branch (1246:10): [True: 66.4k, False: 19.2M]
  ------------------
 1247|  66.4k|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1247:9): [True: 34.7k, False: 31.7k]
  ------------------
 1248|  34.7k|      rv = pptr->check_twosfx(word, start, len, in_compound, needflag, scratch);
 1249|  34.7k|      if (rv) {
  ------------------
  |  Branch (1249:11): [True: 0, False: 34.7k]
  ------------------
 1250|      0|        pfx = pptr;
 1251|      0|        return rv;
 1252|      0|      }
 1253|  34.7k|      pptr = pptr->getNextEQ();
 1254|  34.7k|    } else {
 1255|  31.7k|      pptr = pptr->getNextNE();
 1256|  31.7k|    }
 1257|  66.4k|  }
 1258|       |
 1259|  19.2M|  return nullptr;
 1260|  19.2M|}
_ZN8AffixMgr18prefix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmcR12AffixScratcht:
 1268|  14.1k|                                         const FLAG needflag) {
 1269|       |
 1270|       |  // many prefixes can analyse a word the same way
 1271|  14.1k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  118|  14.1k|#define MSEP_REC '\n'
  ------------------
 1272|       |
 1273|  14.1k|  pfx = nullptr;
 1274|  14.1k|  sfxappnd = nullptr;
 1275|  14.1k|  sfxextra = 0;
 1276|       |
 1277|       |  // first handle the special case of 0 length prefixes
 1278|  14.1k|  PfxEntry* pe = pStart[0];
 1279|  14.9k|  while (pe) {
  ------------------
  |  Branch (1279:10): [True: 759, False: 14.1k]
  ------------------
 1280|    759|    std::string st = pe->check_morph(word, start, len, in_compound, needflag, scratch);
 1281|    759|    if (!st.empty()) {
  ------------------
  |  Branch (1281:9): [True: 0, False: 759]
  ------------------
 1282|      0|      result.append(st);
 1283|      0|    }
 1284|    759|    pe = pe->getNext();
 1285|    759|  }
 1286|       |
 1287|       |  // now handle the general case
 1288|  14.1k|  unsigned char sp = word[start];
 1289|  14.1k|  PfxEntry* pptr = pStart[sp];
 1290|       |
 1291|  14.1k|  while (pptr) {
  ------------------
  |  Branch (1291:10): [True: 0, False: 14.1k]
  ------------------
 1292|      0|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1292:9): [True: 0, False: 0]
  ------------------
 1293|      0|      std::string st = pptr->check_morph(word, start, len, in_compound, needflag, scratch);
 1294|      0|      if (!st.empty()) {
  ------------------
  |  Branch (1294:11): [True: 0, False: 0]
  ------------------
 1295|       |        // fogemorpheme
 1296|      0|        if ((in_compound != IN_CPD_NOT) ||
  ------------------
  |  |   75|      0|#define IN_CPD_NOT 0
  ------------------
  |  Branch (1296:13): [True: 0, False: 0]
  ------------------
 1297|      0|            !((pptr->getCont() && (TESTAFF(pptr->getCont(), onlyincompound,
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1297:16): [True: 0, False: 0]
  |  Branch (1297:35): [True: 0, False: 0]
  ------------------
 1298|      0|                                           pptr->getContLen()))))) {
 1299|      0|          result.append(st);
 1300|      0|          pfx = pptr;
 1301|      0|        }
 1302|      0|      }
 1303|      0|      pptr = pptr->getNextEQ();
 1304|      0|    } else {
 1305|      0|      pptr = pptr->getNextNE();
 1306|      0|    }
 1307|      0|  }
 1308|       |
 1309|  14.1k|  return result.join();
 1310|  14.1k|}
_ZN8AffixMgr25prefix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmcR12AffixScratcht:
 1318|  4.44k|                                                const FLAG needflag) {
 1319|       |  // every prefix crosses with every pair of suffixes
 1320|  4.44k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  118|  4.44k|#define MSEP_REC '\n'
  ------------------
 1321|       |
 1322|  4.44k|  pfx = nullptr;
 1323|  4.44k|  sfxappnd = nullptr;
 1324|  4.44k|  sfxextra = 0;
 1325|       |
 1326|       |  // first handle the special case of 0 length prefixes
 1327|  4.44k|  PfxEntry* pe = pStart[0];
 1328|  5.20k|  while (pe) {
  ------------------
  |  Branch (1328:10): [True: 759, False: 4.44k]
  ------------------
 1329|    759|    std::string st = pe->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1330|    759|    if (!st.empty()) {
  ------------------
  |  Branch (1330:9): [True: 0, False: 759]
  ------------------
 1331|      0|      result.append(st);
 1332|      0|    }
 1333|    759|    pe = pe->getNext();
 1334|    759|  }
 1335|       |
 1336|       |  // now handle the general case
 1337|  4.44k|  unsigned char sp = word[start];
 1338|  4.44k|  PfxEntry* pptr = pStart[sp];
 1339|       |
 1340|  4.44k|  while (pptr) {
  ------------------
  |  Branch (1340:10): [True: 0, False: 4.44k]
  ------------------
 1341|      0|    if (isSubset(pptr->getKey(), word.c_str() + start)) {
  ------------------
  |  Branch (1341:9): [True: 0, False: 0]
  ------------------
 1342|      0|      std::string st = pptr->check_twosfx_morph(word, start, len, in_compound, needflag, scratch);
 1343|      0|      if (!st.empty()) {
  ------------------
  |  Branch (1343:11): [True: 0, False: 0]
  ------------------
 1344|      0|        result.append(st);
 1345|      0|        pfx = pptr;
 1346|      0|      }
 1347|      0|      pptr = pptr->getNextEQ();
 1348|      0|    } else {
 1349|      0|      pptr = pptr->getNextNE();
 1350|      0|    }
 1351|      0|  }
 1352|       |
 1353|  4.44k|  return result.join();
 1354|  4.44k|}
_ZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1702|    698|int AffixMgr::get_syllable(const std::string& word) {
 1703|    698|  if (cpdmaxsyllable == 0)
  ------------------
  |  Branch (1703:7): [True: 0, False: 698]
  ------------------
 1704|      0|    return 0;
 1705|       |
 1706|    698|  int num = 0;
 1707|       |
 1708|    698|  if (!utf8) {
  ------------------
  |  Branch (1708:7): [True: 0, False: 698]
  ------------------
 1709|      0|    num = (int)std::count_if(word.begin(), word.end(),
 1710|      0|          [&](char c) {
 1711|      0|            return std::binary_search(cpdvowels.begin(), cpdvowels.end(), c);
 1712|      0|          });
 1713|    698|  } else if (!cpdvowels_utf16.empty()) {
  ------------------
  |  Branch (1713:14): [True: 698, False: 0]
  ------------------
 1714|    698|    std::vector<w_char> w;
 1715|    698|    u8_u16(w, word);
 1716|    698|    num = (int)std::count_if(w.begin(), w.end(),
 1717|    698|          [&](w_char wc) {
 1718|    698|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1719|    698|          });
 1720|    698|  }
 1721|       |
 1722|    698|  return num;
 1723|    698|}
_ZN8AffixMgr10setcminmaxEPmS0_PKcm:
 1725|  27.2M|void AffixMgr::setcminmax(size_t* cmin, size_t* cmax, const char* word, size_t len) {
 1726|  27.2M|  if (utf8) {
  ------------------
  |  Branch (1726:7): [True: 1.91M, False: 25.3M]
  ------------------
 1727|  1.91M|    int i;
 1728|  5.70M|    for (*cmin = 0, i = 0; (i < cpdmin) && *cmin < len; i++) {
  ------------------
  |  Branch (1728:28): [True: 3.81M, False: 1.88M]
  |  Branch (1728:44): [True: 3.79M, False: 27.5k]
  ------------------
 1729|  4.23M|      for ((*cmin)++; *cmin < len && is_utf8_cont(word[*cmin]); (*cmin)++)
  ------------------
  |  Branch (1729:23): [True: 4.18M, False: 48.0k]
  |  Branch (1729:38): [True: 439k, False: 3.74M]
  ------------------
 1730|   439k|        ;
 1731|  3.79M|    }
 1732|  3.81M|    for (*cmax = len, i = 0; (i < (cpdmin - 1)) && *cmax > 0; i++) {
  ------------------
  |  Branch (1732:30): [True: 1.91M, False: 1.90M]
  |  Branch (1732:52): [True: 1.90M, False: 3.41k]
  ------------------
 1733|  2.84M|      for ((*cmax)--; *cmax > 0 && is_utf8_cont(word[*cmax]); (*cmax)--)
  ------------------
  |  Branch (1733:23): [True: 2.82M, False: 24.1k]
  |  Branch (1733:36): [True: 942k, False: 1.88M]
  ------------------
 1734|   942k|        ;
 1735|  1.90M|    }
 1736|  25.3M|  } else {
 1737|  25.3M|    *cmin = cpdmin;
 1738|  25.3M|    *cmax = len - cpdmin + 1;
 1739|  25.3M|  }
 1740|  27.2M|}
_ZN8AffixMgr14compound_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEsissPP6hentrySB_ccPiR12AffixScratch:
 1754|  27.2M|                                        AffixScratch& scratch) {
 1755|  27.2M|  int oldnumsyllable, oldnumsyllable2;
 1756|  27.2M|  short oldwordnum, oldwordnum2;
 1757|  27.2M|  hentry *rv = nullptr, *rv_first;
 1758|  27.2M|  std::string st;
 1759|  27.2M|  char ch = '\0', affixed;
 1760|  27.2M|  size_t cmin, cmax;
 1761|  27.2M|  int striple = 0, checkedstriple = 0;
 1762|  27.2M|  size_t soldi = 0, oldcmin = 0, oldcmax = 0, oldlen = 0;
 1763|  27.2M|  hentry** oldwords = words;
 1764|  27.2M|  size_t scpd = 0, len = word.size();
 1765|       |
 1766|  27.2M|  TraceCtx* t = trace_on(scratch.trace);
 1767|       |
 1768|       |  // protect subsequent words[wnum + 1] reads and any recursion
 1769|  27.2M|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (1769:7): [True: 0, False: 27.2M]
  ------------------
 1770|      0|    return nullptr;
 1771|       |
 1772|  27.2M|  int checked_prefix;
 1773|       |
 1774|       |  // add a time limit to handle possible
 1775|       |  // combinatorical explosion of the overlapping words
 1776|       |
 1777|  27.2M|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  27.2M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1778|  27.2M|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  27.2M|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 1779|       |
 1780|       |  // get the current time
 1781|  27.2M|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 1782|       |
 1783|  27.2M|  if (wnum == 0) {
  ------------------
  |  Branch (1783:7): [True: 27.2M, False: 231]
  ------------------
 1784|       |      // set the start time
 1785|  27.2M|      clock_time_start = clock_now;
 1786|  27.2M|      timelimit_exceeded = false;
 1787|  27.2M|  }
 1788|    231|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  109|    231|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1788:12): [True: 0, False: 231]
  ------------------
 1789|      0|      timelimit_exceeded = true;
 1790|       |
 1791|  27.2M|  setcminmax(&cmin, &cmax, word.c_str(), len);
 1792|       |
 1793|       |  // with SIMPLIFIEDTRIPLE a second part that starts at a doubled letter is one letter longer
 1794|       |  // than the surface shows, so the split can go one letter past cmax
 1795|  27.2M|  size_t cmaxtriple = simplifiedtriple ? (utf8 ? utf8_next(word, cmax) : cmax + 1) : cmax;
  ------------------
  |  Branch (1795:23): [True: 0, False: 27.2M]
  |  Branch (1795:43): [True: 0, False: 0]
  ------------------
 1796|       |
 1797|  27.2M|  st.assign(word);
 1798|       |
 1799|   619M|  for (size_t i = cmin; i < cmaxtriple; ++i) {
  ------------------
  |  Branch (1799:25): [True: 593M, False: 25.8M]
  ------------------
 1800|       |    // go to end of the UTF-8 character
 1801|   593M|    if (utf8) {
  ------------------
  |  Branch (1801:9): [True: 46.5M, False: 547M]
  ------------------
 1802|  54.6M|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (1802:14): [True: 8.06M, False: 46.5M]
  ------------------
 1803|  8.06M|        ;
 1804|  46.5M|      if (i >= cmaxtriple)
  ------------------
  |  Branch (1804:11): [True: 167k, False: 46.4M]
  ------------------
 1805|   167k|        return nullptr;
 1806|  46.5M|    }
 1807|   593M|    if (i >= cmax && !(i > 2 && word[i - 1] == word[i - 2]))
  ------------------
  |  Branch (1807:9): [True: 0, False: 593M]
  |  Branch (1807:24): [True: 0, False: 0]
  |  Branch (1807:33): [True: 0, False: 0]
  ------------------
 1808|      0|      break;
 1809|       |
 1810|   593M|    words = oldwords;
 1811|   593M|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (1811:23): [True: 0, False: 593M]
  ------------------
 1812|       |
 1813|   593M|    do {  // onlycpdrule loop
 1814|       |
 1815|   593M|      oldnumsyllable = numsyllable;
 1816|   593M|      oldwordnum = wordnum;
 1817|   593M|      checked_prefix = 0;
 1818|       |
 1819|   593M|      do {  // simplified checkcompoundpattern loop
 1820|       |
 1821|   593M|        if (timelimit_exceeded ||
  ------------------
  |  Branch (1821:13): [True: 0, False: 593M]
  |  Branch (1821:13): [True: 0, False: 593M]
  ------------------
 1822|   593M|            std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  109|   593M|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (1822:13): [True: 0, False: 593M]
  ------------------
 1823|      0|          if (t && !timelimit_exceeded)
  ------------------
  |  Branch (1823:15): [True: 0, False: 0]
  |  Branch (1823:20): [True: 0, False: 0]
  ------------------
 1824|      0|            trace(*t, "test timelimit -> fail, the compound search stops here and gives up");
 1825|      0|          timelimit_exceeded = true;
 1826|      0|          return nullptr;
 1827|      0|        }
 1828|       |
 1829|   593M|        if (scpd > 0) {
  ------------------
  |  Branch (1829:13): [True: 0, False: 593M]
  ------------------
 1830|      0|          for (; scpd <= checkcpdtable.size() &&
  ------------------
  |  Branch (1830:18): [True: 0, False: 0]
  ------------------
 1831|      0|                 (checkcpdtable[scpd - 1].pattern3.empty() ||
  ------------------
  |  Branch (1831:19): [True: 0, False: 0]
  ------------------
 1832|      0|                  i > word.size() ||
  ------------------
  |  Branch (1832:19): [True: 0, False: 0]
  ------------------
 1833|      0|                  word.compare(i, checkcpdtable[scpd - 1].pattern3.size(), checkcpdtable[scpd - 1].pattern3) != 0);
  ------------------
  |  Branch (1833:19): [True: 0, False: 0]
  ------------------
 1834|      0|               scpd++)
 1835|      0|            ;
 1836|       |
 1837|      0|          if (scpd > checkcpdtable.size())
  ------------------
  |  Branch (1837:15): [True: 0, False: 0]
  ------------------
 1838|      0|            break;  // break simplified checkcompoundpattern loop
 1839|      0|          st.replace(i, std::string::npos, checkcpdtable[scpd - 1].pattern);
 1840|      0|          soldi = i;
 1841|      0|          i += checkcpdtable[scpd - 1].pattern.size();
 1842|      0|          st.replace(i, std::string::npos, checkcpdtable[scpd - 1].pattern2);
 1843|      0|          st.replace(i + checkcpdtable[scpd - 1].pattern2.size(), std::string::npos,
 1844|      0|                 word.substr(soldi + checkcpdtable[scpd - 1].pattern3.size()));
 1845|       |
 1846|      0|          oldlen = len;
 1847|      0|          len += checkcpdtable[scpd - 1].pattern.size() +
 1848|      0|                 checkcpdtable[scpd - 1].pattern2.size() -
 1849|      0|                 checkcpdtable[scpd - 1].pattern3.size();
 1850|      0|          oldcmin = cmin;
 1851|      0|          oldcmax = cmax;
 1852|      0|          setcminmax(&cmin, &cmax, st.c_str(), len);
 1853|       |
 1854|      0|          cmax = len - cpdmin + 1;
 1855|      0|        }
 1856|       |
 1857|   593M|        if (i >= st.size())
  ------------------
  |  Branch (1857:13): [True: 1.23M, False: 592M]
  ------------------
 1858|  1.23M|          return nullptr;
 1859|       |
 1860|   592M|        ch = st[i];
 1861|   592M|        if (t) {
  ------------------
  |  Branch (1861:13): [True: 0, False: 592M]
  ------------------
 1862|       |          // a non-zero scpd means this split is the retry that one CHECKCOMPOUNDPATTERN entry asks
 1863|       |          // for, with the text at the join replaced by the two sides of that entry
 1864|      0|          if (scpd != 0)
  ------------------
  |  Branch (1864:15): [True: 0, False: 0]
  ------------------
 1865|      0|            trace(*t, "split at=%d left=\"%s\" right=\"%s\" cpdpattern=%d", (int)i,
 1866|      0|                  st.substr(0, i).c_str(), st.substr(i).c_str(), (int)scpd);
 1867|      0|          else
 1868|      0|            trace(*t, "split at=%d left=\"%s\" right=\"%s\"", (int)i,
 1869|      0|                  st.substr(0, i).c_str(), st.substr(i).c_str());
 1870|      0|        }
 1871|       |        // everything this split point tries belongs to the split
 1872|   592M|        TraceScope split_depth(t);
 1873|   592M|        st[i] = '\0';
 1874|       |
 1875|   592M|        sfx = nullptr;
 1876|   592M|        pfx = nullptr;
 1877|       |
 1878|       |        // FIRST WORD
 1879|       |
 1880|   592M|        affixed = 1;
 1881|   592M|        rv = lookup(st.c_str(), i);  // perhaps without prefix
 1882|   592M|        if (t) {
  ------------------
  |  Branch (1882:13): [True: 0, False: 592M]
  ------------------
 1883|      0|          if (rv)
  ------------------
  |  Branch (1883:15): [True: 0, False: 0]
  ------------------
 1884|      0|            trace(*t, "first \"%s\" -> entry \"%s\" flags=%s", st.c_str(),
 1885|      0|                  rv->word, trace_flags(this, rv->astr, rv->alen).c_str());
 1886|      0|          else
 1887|      0|            trace(*t, "first \"%s\" -> miss", st.c_str());
 1888|      0|        }
 1889|       |
 1890|       |        // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 1891|       |        // compound words, overriding the effect of COMPOUNDPERMITFLAG
 1892|   592M|        if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (1892:13): [True: 3.05M, False: 589M]
  |  Branch (1892:21): [True: 81.0k, False: 2.97M]
  ------------------
 1893|  81.0k|                TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule) {
  ------------------
  |  |  102|   592M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 81.0k]
  |  |  ------------------
  ------------------
  |  Branch (1893:68): [True: 0, False: 0]
  ------------------
 1894|      0|            bool would_continue = !onlycpdrule && simplifiedcpd;
  ------------------
  |  Branch (1894:35): [True: 0, False: 0]
  |  Branch (1894:51): [True: 0, False: 0]
  ------------------
 1895|      0|            if (!scpd && would_continue) {
  ------------------
  |  Branch (1895:17): [True: 0, False: 0]
  |  Branch (1895:26): [True: 0, False: 0]
  ------------------
 1896|       |                // given the while conditions that continue jumps to, this situation
 1897|       |                // never ends
 1898|      0|                HUNSPELL_WARNING(stderr, "break infinite loop\n");
 1899|      0|                break;
 1900|      0|            }
 1901|       |
 1902|      0|            if (scpd > 0 && would_continue) {
  ------------------
  |  Branch (1902:17): [True: 0, False: 0]
  |  Branch (1902:29): [True: 0, False: 0]
  ------------------
 1903|       |                // undo this pattern's rewrite and move to the next pattern, as the end of the loop
 1904|       |                // does
 1905|      0|                i = soldi;
 1906|      0|                len = oldlen;
 1907|      0|                cmin = oldcmin;
 1908|      0|                cmax = oldcmax;
 1909|      0|                scpd++;
 1910|      0|            }
 1911|      0|            continue;
 1912|      0|        }
 1913|       |
 1914|       |        // search homonym with compound flag
 1915|   595M|        while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1915:16): [True: 3.05M, False: 592M]
  |  Branch (1915:24): [True: 3.05M, False: 423]
  ------------------
 1916|  3.05M|               ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |  102|   990k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 990k]
  |  |  ------------------
  ------------------
  |  Branch (1916:18): [True: 990k, False: 2.06M]
  ------------------
 1917|  3.05M|                !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (1917:20): [True: 3.05M, False: 0]
  |  Branch (1917:36): [True: 3.05M, False: 0]
  |  Branch (1917:46): [True: 3.05M, False: 0]
  ------------------
 1918|  3.05M|                   TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|  3.05M|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 332, False: 3.05M]
  |  |  ------------------
  ------------------
 1919|  3.05M|                  (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (1919:20): [True: 0, False: 3.05M]
  |  Branch (1919:37): [True: 0, False: 0]
  |  Branch (1919:49): [True: 0, False: 0]
  ------------------
 1920|      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]
  |  |  ------------------
  ------------------
 1921|  3.05M|                  (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (1921:20): [True: 0, False: 3.05M]
  |  Branch (1921:38): [True: 0, False: 0]
  |  Branch (1921:49): [True: 0, False: 0]
  |  Branch (1921:59): [True: 0, False: 0]
  ------------------
 1922|      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]
  |  |  ------------------
  ------------------
 1923|  3.05M|                  (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (1923:20): [True: 0, False: 3.05M]
  |  Branch (1923:44): [True: 0, False: 0]
  ------------------
 1924|      0|                   ((!words && !wordnum &&
  ------------------
  |  Branch (1924:22): [True: 0, False: 0]
  |  Branch (1924:32): [True: 0, False: 0]
  ------------------
 1925|      0|                     defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (1925:22): [True: 0, False: 0]
  ------------------
 1926|      0|                    (words &&
  ------------------
  |  Branch (1926:22): [True: 0, False: 0]
  ------------------
 1927|      0|                     defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))) ||
  ------------------
  |  Branch (1927:22): [True: 0, False: 0]
  ------------------
 1928|    332|                (scpd != 0 && checkcpdtable[scpd - 1].cond != FLAG_NULL &&
  ------------------
  |  |   99|    332|#define FLAG_NULL 0x00
  ------------------
  |  Branch (1928:18): [True: 0, False: 332]
  |  Branch (1928:31): [True: 0, False: 0]
  ------------------
 1929|  3.05M|                 !TESTAFF(rv->astr, checkcpdtable[scpd - 1].cond, rv->alen)))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (1929:18): [True: 0, False: 0]
  ------------------
 1930|  3.05M|          rv = rv->next_homonym;
 1931|  3.05M|        }
 1932|       |
 1933|   592M|        if (rv)
  ------------------
  |  Branch (1933:13): [True: 755, False: 592M]
  ------------------
 1934|    755|          affixed = 0;
 1935|       |
 1936|   592M|        if (!rv) {
  ------------------
  |  Branch (1936:13): [True: 592M, False: 755]
  ------------------
 1937|   592M|          if (onlycpdrule)
  ------------------
  |  Branch (1937:15): [True: 0, False: 592M]
  ------------------
 1938|      0|            break;
 1939|   592M|          if (compoundflag &&
  ------------------
  |  Branch (1939:15): [True: 592M, False: 0]
  ------------------
 1940|   592M|              !(rv = prefix_check(st, 0, i,
  ------------------
  |  Branch (1940:15): [True: 592M, False: 0]
  ------------------
 1941|   592M|                                  hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   78|   152k|#define IN_CPD_OTHER 3
  ------------------
                                                hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN,
  ------------------
  |  |   76|  1.18G|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1941:35): [True: 152k, False: 592M]
  ------------------
 1942|   592M|                                  scratch, compoundflag))) {
 1943|   592M|            if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   99|   592M|#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|   152k|#define IN_CPD_OTHER 3
  ------------------
                          if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   76|  1.18G|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (1943:18): [True: 0, False: 592M]
  |  Branch (1943:93): [True: 152k, False: 592M]
  ------------------
 1944|   592M|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (1944:19): [True: 0, False: 592M]
  |  Branch (1944:43): [True: 0, False: 0]
  ------------------
 1945|      0|                !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (1945:17): [True: 0, False: 0]
  |  Branch (1945:33): [True: 0, False: 0]
  ------------------
 1946|      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 (1946:19): [True: 0, False: 0]
  ------------------
 1947|      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 (1947:19): [True: 0, False: 0]
  ------------------
 1948|      0|              rv = nullptr;
 1949|       |              // the suffix is dropped with the word it built
 1950|      0|              sfx = nullptr;
 1951|      0|            }
 1952|   592M|          }
 1953|       |
 1954|   592M|          if (rv ||
  ------------------
  |  Branch (1954:15): [True: 0, False: 592M]
  ------------------
 1955|   592M|              (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (1955:17): [True: 592M, False: 153k]
  |  Branch (1955:35): [True: 0, False: 592M]
  ------------------
 1956|      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 (1956:18): [True: 0, False: 0]
  |  Branch (1956:94): [True: 0, False: 0]
  ------------------
 1957|      0|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (1957:19): [True: 0, False: 0]
  |  Branch (1957:43): [True: 0, False: 0]
  ------------------
 1958|      0|                                                                    compoundbegin))) ||  // twofold suffixes + compound
 1959|      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 (1959:18): [True: 0, False: 0]
  |  Branch (1959:47): [True: 0, False: 0]
  ------------------
 1960|   592M|               ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (1960:17): [True: 1.00k, False: 592M]
  |  Branch (1960:34): [True: 0, False: 1.00k]
  ------------------
 1961|      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 (1961:18): [True: 0, False: 0]
  |  Branch (1961:95): [True: 0, False: 0]
  ------------------
 1962|      0|                 (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (1962:19): [True: 0, False: 0]
  |  Branch (1962:43): [True: 0, False: 0]
  ------------------
 1963|      0|                                                                    compoundmiddle))) ||  // twofold suffixes + compound
 1964|      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 (1964:18): [True: 0, False: 0]
  |  Branch (1964:47): [True: 0, False: 0]
  ------------------
 1965|      0|            checked_prefix = 1;
 1966|       |          // else check forbiddenwords and needaffix
 1967|   592M|        } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|    794|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 397]
  |  |  ------------------
  ------------------
  |  Branch (1967:20): [True: 397, False: 358]
  |  Branch (1967:20): [True: 0, False: 755]
  ------------------
 1968|    397|                                TESTAFF(rv->astr, needaffix, rv->alen) ||
  ------------------
  |  |  102|    794|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 397]
  |  |  ------------------
  ------------------
 1969|    397|                                TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|    794|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 397]
  |  |  ------------------
  ------------------
 1970|    397|                                (is_sug && nosuggest &&
  ------------------
  |  Branch (1970:34): [True: 0, False: 397]
  |  Branch (1970:44): [True: 0, False: 0]
  ------------------
 1971|      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]
  |  |  ------------------
  ------------------
 1972|      0|          st[i] = ch;
 1973|       |          // continue;
 1974|      0|          break;
 1975|      0|        }
 1976|       |
 1977|       |        // check non_compound flag in suffix and prefix
 1978|   592M|        if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (1978:13): [True: 755, False: 592M]
  |  Branch (1978:21): [True: 332, False: 423]
  ------------------
 1979|    332|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1979:15): [True: 0, False: 332]
  |  Branch (1979:22): [True: 0, False: 0]
  ------------------
 1980|      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]
  |  |  ------------------
  ------------------
 1981|    332|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1981:15): [True: 0, False: 332]
  |  Branch (1981:22): [True: 0, False: 0]
  ------------------
 1982|      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]
  |  |  ------------------
  ------------------
 1983|    332|                      sfx->getContLen())))) {
 1984|      0|          rv = nullptr;
 1985|      0|        }
 1986|       |
 1987|       |        // check compoundend flag in suffix and prefix
 1988|   592M|        if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (1988:13): [True: 755, False: 592M]
  |  Branch (1988:21): [True: 755, False: 0]
  |  Branch (1988:40): [True: 0, False: 755]
  |  Branch (1988:55): [True: 0, False: 0]
  ------------------
 1989|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1989:15): [True: 0, False: 0]
  |  Branch (1989:22): [True: 0, False: 0]
  ------------------
 1990|      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]
  |  |  ------------------
  ------------------
 1991|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (1991:15): [True: 0, False: 0]
  |  Branch (1991:22): [True: 0, False: 0]
  ------------------
 1992|      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]
  |  |  ------------------
  ------------------
 1993|      0|          rv = nullptr;
 1994|      0|        }
 1995|       |
 1996|       |        // check compoundmiddle flag in suffix and prefix
 1997|   592M|        if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (1997:13): [True: 755, False: 592M]
  |  Branch (1997:21): [True: 755, False: 0]
  |  Branch (1997:40): [True: 332, False: 423]
  |  Branch (1997:58): [True: 0, False: 332]
  ------------------
 1998|      0|            !hu_mov_rule &&
  ------------------
  |  Branch (1998:13): [True: 0, False: 0]
  ------------------
 1999|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (1999:15): [True: 0, False: 0]
  |  Branch (1999:22): [True: 0, False: 0]
  ------------------
 2000|      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]
  |  |  ------------------
  ------------------
 2001|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2001:15): [True: 0, False: 0]
  |  Branch (2001:22): [True: 0, False: 0]
  ------------------
 2002|      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]
  |  |  ------------------
  ------------------
 2003|      0|          rv = nullptr;
 2004|      0|        }
 2005|       |
 2006|       |        // check forbiddenwords
 2007|   592M|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2007:13): [True: 755, False: 592M]
  |  Branch (2007:13): [True: 0, False: 592M]
  |  Branch (2007:21): [True: 397, False: 358]
  ------------------
 2008|    397|            (TESTAFF(rv->astr, forbiddenword, rv->alen) ||
  ------------------
  |  |  102|    794|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 397]
  |  |  ------------------
  ------------------
 2009|    397|             TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) ||
  ------------------
  |  |  102|    794|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 397]
  |  |  ------------------
  ------------------
 2010|    397|             (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 (2010:15): [True: 0, False: 397]
  |  Branch (2010:25): [True: 0, False: 0]
  ------------------
 2011|      0|          return nullptr;
 2012|      0|        }
 2013|       |
 2014|       |        // increment word number, if the second root has a compoundroot flag
 2015|   592M|        if ((rv) && compoundroot &&
  ------------------
  |  Branch (2015:13): [True: 755, False: 592M]
  |  Branch (2015:21): [True: 0, False: 755]
  ------------------
 2016|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2016:13): [True: 0, False: 0]
  ------------------
 2017|      0|          wordnum++;
 2018|      0|        }
 2019|       |
 2020|       |        // first word is acceptable in compound words?
 2021|   592M|        if (((rv) &&
  ------------------
  |  Branch (2021:13): [True: 397, False: 592M]
  |  Branch (2021:14): [True: 755, False: 592M]
  ------------------
 2022|    755|             (checked_prefix || (words && words[wnum]) ||
  ------------------
  |  Branch (2022:15): [True: 0, False: 755]
  |  Branch (2022:34): [True: 0, False: 755]
  |  Branch (2022:43): [True: 0, False: 0]
  ------------------
 2023|    755|              (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|    755|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 397, False: 358]
  |  |  ------------------
  ------------------
  |  Branch (2023:16): [True: 755, False: 0]
  ------------------
 2024|    358|              ((oldwordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (2024:16): [True: 0, False: 358]
  |  Branch (2024:37): [True: 0, False: 0]
  ------------------
 2025|      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]
  |  |  ------------------
  ------------------
 2026|    358|              ((oldwordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (2026:16): [True: 0, False: 358]
  |  Branch (2026:36): [True: 0, False: 0]
  ------------------
 2027|      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]
  |  |  ------------------
  ------------------
 2028|       |
 2029|       |              // LANG_hu section: spec. Hungarian rule
 2030|    358|              || ((langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (2030:19): [True: 358, False: 0]
  |  Branch (2030:43): [True: 358, False: 0]
  ------------------
 2031|    358|                  (TESTAFF(
  ------------------
  |  |  102|    716|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 358]
  |  |  ------------------
  ------------------
 2032|    358|                       rv->astr, 'F',
 2033|    358|                       rv->alen) ||  // XXX hardwired Hungarian dictionary codes
 2034|    358|                   TESTAFF(rv->astr, 'G', rv->alen) ||
  ------------------
  |  |  102|    716|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 358]
  |  |  ------------------
  ------------------
 2035|    358|                   TESTAFF(rv->astr, 'H', rv->alen)))
  ------------------
  |  |  102|    358|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 358]
  |  |  ------------------
  ------------------
 2036|       |              // END of LANG_hu section
 2037|    755|              ) &&
 2038|    397|             (
 2039|       |                 // test CHECKCOMPOUNDPATTERN conditions
 2040|    397|                 scpd == 0 || checkcpdtable[scpd - 1].cond == FLAG_NULL ||
  ------------------
  |  |   99|    397|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2040:18): [True: 397, False: 0]
  |  Branch (2040:31): [True: 0, False: 0]
  ------------------
 2041|      0|                 join_side_has_flag(rv, checkcpdtable[scpd - 1].cond, pfx, sfx)) &&
  ------------------
  |  Branch (2041:18): [True: 0, False: 0]
  ------------------
 2042|    397|             !((checkcompoundtriple && scpd == 0 &&
  ------------------
  |  Branch (2042:17): [True: 0, False: 397]
  |  Branch (2042:40): [True: 0, False: 0]
  ------------------
 2043|      0|                !words && i < word.size() && // test triple letters
  ------------------
  |  Branch (2043:17): [True: 0, False: 0]
  |  Branch (2043:27): [True: 0, False: 0]
  ------------------
 2044|      0|                (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (2044:17): [True: 0, False: 0]
  ------------------
 2045|      0|                (((i > 1) && (word[i - 1] == word[i - 2])) ||
  ------------------
  |  Branch (2045:19): [True: 0, False: 0]
  |  Branch (2045:30): [True: 0, False: 0]
  ------------------
 2046|      0|                 ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (2046:18): [True: 0, False: 0]
  ------------------
 2047|      0|                 )) ||
 2048|    397|               (checkcompoundcase && scpd == 0 && !words && i < word.size() &&
  ------------------
  |  Branch (2048:17): [True: 0, False: 397]
  |  Branch (2048:38): [True: 0, False: 0]
  |  Branch (2048:51): [True: 0, False: 0]
  |  Branch (2048:61): [True: 0, False: 0]
  ------------------
 2049|      0|                cpdcase_check(word, i))))
  ------------------
  |  Branch (2049:17): [True: 0, False: 0]
  ------------------
 2050|       |            // LANG_hu section: spec. Hungarian rule
 2051|   592M|            || ((!rv) && (langnum == LANG_hu) && hu_mov_rule &&
  ------------------
  |  Branch (2051:17): [True: 592M, False: 358]
  |  Branch (2051:26): [True: 46.4M, False: 546M]
  |  Branch (2051:50): [True: 152k, False: 46.2M]
  ------------------
 2052|   152k|                (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (2052:17): [True: 0, False: 152k]
  ------------------
 2053|      0|                (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2053:18): [True: 0, False: 0]
  |  Branch (2053:25): [True: 0, False: 0]
  ------------------
 2054|      0|                 (  // XXX hardwired Hungarian dic. codes
 2055|      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]
  |  |  ------------------
  ------------------
 2056|      0|                             sfx->getContLen()) ||
 2057|      0|                     TESTAFF(
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2058|      0|                         sfx->getCont(), (unsigned short)'%',
 2059|    397|                         sfx->getContLen()))))) {  // first word is ok condition
 2060|       |
 2061|       |          // LANG_hu section: spec. Hungarian rule
 2062|    397|          if (langnum == LANG_hu) {
  ------------------
  |  Branch (2062:15): [True: 349, False: 48]
  ------------------
 2063|       |            // calculate syllable number of the word
 2064|    349|            numsyllable += get_syllable(st.substr(0, i));
 2065|       |            // + 1 word, if syllable number of the prefix > 1 (hungarian
 2066|       |            // convention)
 2067|    349|            if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2067:17): [True: 0, False: 349]
  |  Branch (2067:17): [True: 0, False: 349]
  |  Branch (2067:24): [True: 0, False: 0]
  ------------------
 2068|      0|              wordnum++;
 2069|    349|          }
 2070|       |          // END of LANG_hu section
 2071|       |
 2072|       |          // NEXT WORD(S)
 2073|    397|          rv_first = rv;
 2074|       |          // the affixes that built the first word, so its continuation classes stay reachable once
 2075|       |          // the second word has overwritten pfx and sfx
 2076|    397|          PfxEntry* rv_first_pfx = pfx;
 2077|    397|          SfxEntry* rv_first_sfx = sfx;
 2078|    397|          st[i] = ch;
 2079|       |
 2080|    397|          do {  // striple loop
 2081|       |
 2082|       |            // check simplifiedtriple
 2083|    397|            if (simplifiedtriple) {
  ------------------
  |  Branch (2083:17): [True: 0, False: 397]
  ------------------
 2084|      0|              if (striple) {
  ------------------
  |  Branch (2084:19): [True: 0, False: 0]
  ------------------
 2085|      0|                checkedstriple = 1;
 2086|      0|                i--;  // check "fahrt" instead of "ahrt" in "Schiffahrt"
 2087|      0|              } else if (i > 2 && i <= word.size() && word[i - 1] == word[i - 2]) {
  ------------------
  |  Branch (2087:26): [True: 0, False: 0]
  |  Branch (2087:35): [True: 0, False: 0]
  |  Branch (2087:55): [True: 0, False: 0]
  ------------------
 2088|      0|                striple = 1;
 2089|       |                // past cmax the surface split is too short, so only the form with the letter
 2090|       |                // put back is tried
 2091|      0|                if (i >= cmax) {
  ------------------
  |  Branch (2091:21): [True: 0, False: 0]
  ------------------
 2092|      0|                  checkedstriple = 1;
 2093|      0|                  i--;
 2094|      0|                }
 2095|      0|              }
 2096|      0|            }
 2097|       |
 2098|    397|            rv = lookup(st.c_str() + i, st.size() - i);  // perhaps without prefix
 2099|    397|            if (t) {
  ------------------
  |  Branch (2099:17): [True: 0, False: 397]
  ------------------
 2100|      0|              if (rv)
  ------------------
  |  Branch (2100:19): [True: 0, False: 0]
  ------------------
 2101|      0|                trace(*t, "second \"%s\" -> entry \"%s\" flags=%s", st.c_str() + i,
 2102|      0|                      rv->word, trace_flags(this, rv->astr, rv->alen).c_str());
 2103|      0|              else
 2104|      0|                trace(*t, "second \"%s\" -> miss", st.c_str() + i);
 2105|      0|            }
 2106|       |
 2107|       |            // search homonym with compound flag
 2108|    397|            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 (2108:20): [True: 0, False: 397]
  |  Branch (2108:30): [True: 0, False: 0]
  ------------------
 2109|      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 (2109:32): [True: 0, False: 0]
  |  Branch (2109:48): [True: 0, False: 0]
  ------------------
 2110|      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 (2110:32): [True: 0, False: 0]
  |  Branch (2110:47): [True: 0, False: 0]
  ------------------
 2111|      0|                              (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))) ||
  ------------------
  |  Branch (2111:32): [True: 0, False: 0]
  |  Branch (2111:56): [True: 0, False: 0]
  |  Branch (2111:65): [True: 0, False: 0]
  ------------------
 2112|      0|                            (scpd != 0 && checkcpdtable[scpd - 1].cond2 != FLAG_NULL &&
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2112:30): [True: 0, False: 0]
  |  Branch (2112:43): [True: 0, False: 0]
  ------------------
 2113|      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 (2113:30): [True: 0, False: 0]
  ------------------
 2114|      0|              rv = rv->next_homonym;
 2115|      0|            }
 2116|       |
 2117|       |            // check FORCEUCASE
 2118|    397|            if (rv && forceucase &&
  ------------------
  |  Branch (2118:17): [True: 0, False: 397]
  |  Branch (2118:23): [True: 0, False: 0]
  ------------------
 2119|      0|                (TESTAFF(rv->astr, forceucase, rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2119:17): [True: 0, False: 0]
  ------------------
 2120|      0|                !(info && *info & SPELL_ORIGCAP))
  ------------------
  |  |   86|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  |  Branch (2120:19): [True: 0, False: 0]
  |  Branch (2120:27): [True: 0, False: 0]
  ------------------
 2121|      0|              rv = nullptr;
 2122|       |
 2123|    397|            if (rv && words && words[wnum + 1])
  ------------------
  |  Branch (2123:17): [True: 0, False: 397]
  |  Branch (2123:23): [True: 0, False: 0]
  |  Branch (2123:32): [True: 0, False: 0]
  ------------------
 2124|      0|              return rv_first;
 2125|       |
 2126|    397|            oldnumsyllable2 = numsyllable;
 2127|    397|            oldwordnum2 = wordnum;
 2128|       |
 2129|       |            // LANG_hu section: spec. Hungarian rule, XXX hardwired dictionary
 2130|       |            // code
 2131|    397|            if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (2131:17): [True: 0, False: 397]
  |  Branch (2131:17): [True: 0, False: 397]
  |  Branch (2131:25): [True: 0, False: 0]
  ------------------
 2132|      0|                (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2132:17): [True: 0, False: 0]
  ------------------
 2133|      0|                !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2133:17): [True: 0, False: 0]
  ------------------
 2134|      0|              numsyllable--;
 2135|      0|            }
 2136|       |            // END of LANG_hu section
 2137|       |
 2138|       |            // increment word number, if the second root has a compoundroot flag
 2139|    397|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2139:17): [True: 0, False: 397]
  |  Branch (2139:25): [True: 0, False: 0]
  ------------------
 2140|      0|                (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2140:17): [True: 0, False: 0]
  ------------------
 2141|      0|              wordnum++;
 2142|      0|            }
 2143|       |
 2144|       |            // check forbiddenwords
 2145|    397|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2145:17): [True: 0, False: 397]
  |  Branch (2145:17): [True: 0, False: 397]
  |  Branch (2145:25): [True: 0, False: 0]
  ------------------
 2146|      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]
  |  |  ------------------
  ------------------
 2147|      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]
  |  |  ------------------
  ------------------
 2148|      0|                 (is_sug && nosuggest &&
  ------------------
  |  Branch (2148:19): [True: 0, False: 0]
  |  Branch (2148:29): [True: 0, False: 0]
  ------------------
 2149|      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]
  |  |  ------------------
  ------------------
 2150|      0|              return nullptr;
 2151|       |
 2152|       |            // second word is acceptable, as a root?
 2153|       |            // hungarian conventions: compounding is acceptable,
 2154|       |            // when compound forms consist of 2 words, or if more,
 2155|       |            // then the syllable number of root words must be 6, or lesser.
 2156|       |
 2157|    397|            if ((rv) &&
  ------------------
  |  Branch (2157:17): [True: 0, False: 397]
  |  Branch (2157:17): [True: 0, False: 397]
  ------------------
 2158|      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 (2158:19): [True: 0, False: 0]
  ------------------
 2159|      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 (2159:19): [True: 0, False: 0]
  ------------------
 2160|      0|                (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2160:19): [True: 0, False: 0]
  |  Branch (2160:41): [True: 0, False: 0]
  ------------------
 2161|      0|                 ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (2161:19): [True: 0, False: 0]
  ------------------
 2162|      0|                  (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (2162:19): [True: 0, False: 0]
  ------------------
 2163|      0|                   cpdmaxsyllable))) &&
 2164|      0|                (
 2165|       |                    // test CHECKCOMPOUNDPATTERN
 2166|      0|                    checkcpdtable.empty() || scpd != 0 ||
  ------------------
  |  Branch (2166:21): [True: 0, False: 0]
  |  Branch (2166:46): [True: 0, False: 0]
  ------------------
 2167|      0|                    (i < word.size() && !cpdpat_check(word, i, rv_first, rv, 0, t, rv_first_pfx, rv_first_sfx, nullptr, nullptr))) &&
  ------------------
  |  Branch (2167:22): [True: 0, False: 0]
  |  Branch (2167:41): [True: 0, False: 0]
  ------------------
 2168|      0|                ((!checkcompounddup || (rv != rv_first)))
  ------------------
  |  Branch (2168:19): [True: 0, False: 0]
  |  Branch (2168:40): [True: 0, False: 0]
  ------------------
 2169|       |                // test CHECKCOMPOUNDPATTERN conditions
 2170|      0|                &&
 2171|      0|                (scpd == 0 || checkcpdtable[scpd - 1].cond2 == FLAG_NULL ||
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2171:18): [True: 0, False: 0]
  |  Branch (2171:31): [True: 0, False: 0]
  ------------------
 2172|      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]
  |  |  ------------------
  ------------------
 2173|       |              // forbid compound word, if it is a non-compound word with typical
 2174|       |              // fault
 2175|      0|              if ((checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2175:20): [True: 0, False: 0]
  |  Branch (2175:40): [True: 0, False: 0]
  ------------------
 2176|      0|                  cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2176:19): [True: 0, False: 0]
  ------------------
 2177|      0|                return nullptr;
 2178|      0|              return rv_first;
 2179|      0|            }
 2180|       |
 2181|    397|            numsyllable = oldnumsyllable2;
 2182|    397|            wordnum = oldwordnum2;
 2183|       |
 2184|       |            // perhaps second word has prefix or/and suffix
 2185|    397|            sfx = nullptr;
 2186|    397|            sfxflag = FLAG_NULL;
  ------------------
  |  |   99|    397|#define FLAG_NULL 0x00
  ------------------
 2187|       |            // the affixes that built the second word, kept because affix_check clears the members
 2188|    397|            PfxEntry* rv_second_pfx = nullptr;
 2189|    397|            SfxEntry* rv_second_sfx = nullptr;
 2190|    397|            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|    397|#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|    397|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2190:19): [True: 397, False: 0]
  |  Branch (2190:35): [True: 397, False: 0]
  |  Branch (2190:51): [True: 397, False: 0]
  ------------------
 2191|    397|                                                                   : nullptr;
 2192|    397|            if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (2192:17): [True: 397, False: 0]
  |  Branch (2192:24): [True: 0, False: 397]
  |  Branch (2192:39): [True: 0, False: 0]
  ------------------
 2193|      0|              sfx = nullptr;
 2194|      0|              pfx = nullptr;
 2195|      0|              if (i < word.size())
  ------------------
  |  Branch (2195:19): [True: 0, False: 0]
  ------------------
 2196|      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
  ------------------
 2197|      0|            }
 2198|       |
 2199|    397|            if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (2199:17): [True: 397, False: 0]
  |  Branch (2199:24): [True: 0, False: 397]
  |  Branch (2199:48): [True: 0, False: 0]
  ------------------
 2200|      0|              if (i < word.size())
  ------------------
  |  Branch (2200:19): [True: 0, False: 0]
  ------------------
 2201|      0|                rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2202|      0|              if (rv && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))
  ------------------
  |  Branch (2202:19): [True: 0, False: 0]
  |  Branch (2202:25): [True: 0, False: 0]
  ------------------
 2203|      0|                return rv_first;
 2204|      0|              rv = nullptr;
 2205|      0|            }
 2206|       |
 2207|       |            // test CHECKCOMPOUNDPATTERN conditions (allowed forms)
 2208|    397|            if (rv &&
  ------------------
  |  Branch (2208:17): [True: 0, False: 397]
  ------------------
 2209|      0|                !(scpd == 0 || checkcpdtable[scpd - 1].cond2 == FLAG_NULL ||
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
  |  Branch (2209:19): [True: 0, False: 0]
  |  Branch (2209:32): [True: 0, False: 0]
  ------------------
 2210|      0|                  join_side_has_flag(rv, checkcpdtable[scpd - 1].cond2, rv_second_pfx,
  ------------------
  |  Branch (2210:19): [True: 0, False: 0]
  ------------------
 2211|      0|                                     rv_second_sfx)))
 2212|      0|              rv = nullptr;
 2213|       |
 2214|       |            // test CHECKCOMPOUNDPATTERN conditions (forbidden compounds)
 2215|    397|            if (rv && !checkcpdtable.empty() && scpd == 0 &&
  ------------------
  |  Branch (2215:17): [True: 0, False: 397]
  |  Branch (2215:23): [True: 0, False: 0]
  |  Branch (2215:49): [True: 0, False: 0]
  ------------------
 2216|      0|                cpdpat_check(word, i, rv_first, rv, affixed, t, rv_first_pfx, rv_first_sfx, rv_second_pfx, rv_second_sfx))
  ------------------
  |  Branch (2216:17): [True: 0, False: 0]
  ------------------
 2217|      0|              rv = nullptr;
 2218|       |
 2219|       |            // check non_compound flag in suffix and prefix
 2220|    397|            if ((rv) && ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2220:17): [True: 0, False: 397]
  |  Branch (2220:27): [True: 0, False: 0]
  |  Branch (2220:34): [True: 0, False: 0]
  ------------------
 2221|      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]
  |  |  ------------------
  ------------------
 2222|      0|                                  pfx->getContLen())) ||
 2223|      0|                         (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2223:27): [True: 0, False: 0]
  |  Branch (2223:34): [True: 0, False: 0]
  ------------------
 2224|      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]
  |  |  ------------------
  ------------------
 2225|      0|                                  sfx->getContLen())))) {
 2226|      0|              rv = nullptr;
 2227|      0|            }
 2228|       |
 2229|       |            // check FORCEUCASE
 2230|    397|            if (rv && forceucase &&
  ------------------
  |  Branch (2230:17): [True: 0, False: 397]
  |  Branch (2230:23): [True: 0, False: 0]
  ------------------
 2231|      0|                (TESTAFF(rv->astr, forceucase, rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2231:17): [True: 0, False: 0]
  ------------------
 2232|      0|                !(info && *info & SPELL_ORIGCAP))
  ------------------
  |  |   86|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  |  Branch (2232:19): [True: 0, False: 0]
  |  Branch (2232:27): [True: 0, False: 0]
  ------------------
 2233|      0|              rv = nullptr;
 2234|       |
 2235|       |            // check forbiddenwords
 2236|    397|            if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2236:17): [True: 0, False: 397]
  |  Branch (2236:17): [True: 0, False: 397]
  |  Branch (2236:25): [True: 0, False: 0]
  ------------------
 2237|      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]
  |  |  ------------------
  ------------------
 2238|      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]
  |  |  ------------------
  ------------------
 2239|      0|                 (is_sug && nosuggest &&
  ------------------
  |  Branch (2239:19): [True: 0, False: 0]
  |  Branch (2239:29): [True: 0, False: 0]
  ------------------
 2240|      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]
  |  |  ------------------
  ------------------
 2241|      0|              return nullptr;
 2242|       |
 2243|       |            // pfxappnd = prefix of word+i, or NULL
 2244|       |            // calculate syllable number of prefix.
 2245|       |            // hungarian convention: when syllable number of prefix is more,
 2246|       |            // than 1, the prefix+word counts as two words.
 2247|       |
 2248|    397|            if (langnum == LANG_hu) {
  ------------------
  |  Branch (2248:17): [True: 349, False: 48]
  ------------------
 2249|    349|              if (i < word.size()) {
  ------------------
  |  Branch (2249:19): [True: 349, False: 0]
  ------------------
 2250|       |                // calculate syllable number of the word
 2251|    349|                numsyllable += get_syllable(word.substr(i));
 2252|    349|              }
 2253|       |
 2254|       |              // - affix syllable num.
 2255|       |              // XXX only second suffix (inflections, not derivations)
 2256|    349|              if (sfxappnd) {
  ------------------
  |  Branch (2256:19): [True: 0, False: 349]
  ------------------
 2257|      0|                std::string tmp(sfxappnd);
 2258|      0|                reverseword(tmp);
 2259|      0|                numsyllable -= get_syllable(tmp) + sfxextra;
 2260|    349|              } else {
 2261|    349|                numsyllable -= sfxextra;
 2262|    349|              }
 2263|       |
 2264|       |              // + 1 word, if syllable number of the prefix > 1 (hungarian
 2265|       |              // convention)
 2266|    349|              if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2266:19): [True: 0, False: 349]
  |  Branch (2266:19): [True: 0, False: 349]
  |  Branch (2266:26): [True: 0, False: 0]
  ------------------
 2267|      0|                wordnum++;
 2268|       |
 2269|       |              // increment syllable num, if last word has a SYLLABLENUM flag
 2270|       |              // and the suffix is beginning `s'
 2271|       |
 2272|    349|              if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2272:19): [True: 0, False: 349]
  ------------------
 2273|      0|                switch (sfxflag) {
  ------------------
  |  Branch (2273:25): [True: 0, False: 0]
  ------------------
 2274|      0|                  case 'c': {
  ------------------
  |  Branch (2274:19): [True: 0, False: 0]
  ------------------
 2275|      0|                    numsyllable += 2;
 2276|      0|                    break;
 2277|      0|                  }
 2278|      0|                  case 'J': {
  ------------------
  |  Branch (2278:19): [True: 0, False: 0]
  ------------------
 2279|      0|                    numsyllable += 1;
 2280|      0|                    break;
 2281|      0|                  }
 2282|      0|                  case 'I': {
  ------------------
  |  Branch (2282:19): [True: 0, False: 0]
  ------------------
 2283|      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 (2283:25): [True: 0, False: 0]
  |  Branch (2283:25): [True: 0, False: 0]
  ------------------
 2284|      0|                      numsyllable += 1;
 2285|      0|                    break;
 2286|      0|                  }
 2287|      0|                }
 2288|      0|              }
 2289|    349|            }
 2290|       |
 2291|       |            // increment word number, if the second word has a compoundroot flag
 2292|    397|            if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2292:17): [True: 0, False: 397]
  |  Branch (2292:25): [True: 0, False: 0]
  ------------------
 2293|      0|                (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2293:17): [True: 0, False: 0]
  ------------------
 2294|      0|              wordnum++;
 2295|      0|            }
 2296|       |            // second word is acceptable, as a word with prefix or/and suffix?
 2297|       |            // hungarian conventions: compounding is acceptable,
 2298|       |            // when compound forms consist 2 word, otherwise
 2299|       |            // the syllable number of root words is 6, or lesser.
 2300|    397|            if ((rv) &&
  ------------------
  |  Branch (2300:17): [True: 0, False: 397]
  ------------------
 2301|      0|                (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2301:19): [True: 0, False: 0]
  |  Branch (2301:41): [True: 0, False: 0]
  ------------------
 2302|      0|                 ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2302:19): [True: 0, False: 0]
  |  Branch (2302:44): [True: 0, False: 0]
  ------------------
 2303|      0|                ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2303:19): [True: 0, False: 0]
  |  Branch (2303:40): [True: 0, False: 0]
  ------------------
 2304|       |              // forbid compound word, if it is a non-compound word with typical
 2305|       |              // fault
 2306|      0|              if ((checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2306:20): [True: 0, False: 0]
  |  Branch (2306:40): [True: 0, False: 0]
  ------------------
 2307|      0|                  cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2307:19): [True: 0, False: 0]
  ------------------
 2308|      0|                return nullptr;
 2309|      0|              return rv_first;
 2310|      0|            }
 2311|       |
 2312|    397|            numsyllable = oldnumsyllable2;
 2313|    397|            wordnum = oldwordnum2;
 2314|       |
 2315|       |            // perhaps second word is a compound word (recursive call)
 2316|       |            // (only if SPELL_COMPOUND_2 is not set and maxwordnum is not exceeded)
 2317|    397|            if ((!info || !(*info & SPELL_COMPOUND_2)) && wordnum + 2 < maxwordnum && wnum + 1 < maxwordnum) {
  ------------------
  |  |   88|    397|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (2317:18): [True: 0, False: 397]
  |  Branch (2317:27): [True: 231, False: 166]
  |  Branch (2317:59): [True: 231, False: 0]
  |  Branch (2317:87): [True: 231, False: 0]
  ------------------
 2318|    231|              rv = compound_check(st.substr(i), wordnum + 1,
 2319|    231|                                  numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2320|    231|                                  is_sug, info, scratch);
 2321|       |
 2322|    231|              if (rv && !checkcpdtable.empty() && i < word.size() &&
  ------------------
  |  Branch (2322:19): [True: 0, False: 231]
  |  Branch (2322:25): [True: 0, False: 0]
  |  Branch (2322:51): [True: 0, False: 0]
  ------------------
 2323|      0|                  ((scpd == 0 &&
  ------------------
  |  Branch (2323:21): [True: 0, False: 0]
  ------------------
 2324|      0|                    cpdpat_check(word, i, rv_first, rv, affixed, t, rv_first_pfx, rv_first_sfx, nullptr, nullptr)) ||
  ------------------
  |  Branch (2324:21): [True: 0, False: 0]
  ------------------
 2325|      0|                   (scpd != 0 &&
  ------------------
  |  Branch (2325:21): [True: 0, False: 0]
  ------------------
 2326|      0|                    !cpdpat_check(word, i, rv_first, rv, affixed, t, rv_first_pfx, rv_first_sfx, nullptr, nullptr))))
  ------------------
  |  Branch (2326:21): [True: 0, False: 0]
  ------------------
 2327|      0|                rv = nullptr;
 2328|    231|            } else {
 2329|    166|              rv = nullptr;
 2330|    166|            }
 2331|    397|            if (rv) {
  ------------------
  |  Branch (2331:17): [True: 0, False: 397]
  ------------------
 2332|       |              // forbid compound word, if it is a non-compound word with typical
 2333|       |              // fault, or a dictionary word pair
 2334|       |
 2335|      0|              if (cpdwordpair_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2335:19): [True: 0, False: 0]
  ------------------
 2336|      0|                return nullptr;
 2337|       |
 2338|      0|              if (checkcompoundrep || forbiddenword) {
  ------------------
  |  Branch (2338:19): [True: 0, False: 0]
  |  Branch (2338:39): [True: 0, False: 0]
  ------------------
 2339|      0|                if (checkcompoundrep && cpdrep_check(word, len, scratch, timelimit_exceeded, clock_time_start))
  ------------------
  |  Branch (2339:21): [True: 0, False: 0]
  |  Branch (2339:41): [True: 0, False: 0]
  ------------------
 2340|      0|                  return nullptr;
 2341|       |
 2342|       |                // check first part
 2343|      0|                if (i < word.size() && i + rv->blen <= st.size() &&
  ------------------
  |  Branch (2343:21): [True: 0, False: 0]
  |  Branch (2343:40): [True: 0, False: 0]
  ------------------
 2344|      0|                    word.compare(i, rv->blen, rv->word, rv->blen) == 0) {
  ------------------
  |  Branch (2344:21): [True: 0, False: 0]
  ------------------
 2345|      0|                  char r = st[i + rv->blen];
 2346|      0|                  st[i + rv->blen] = '\0';
 2347|       |
 2348|      0|                  if ((checkcompoundrep && cpdrep_check(st, i + rv->blen, scratch, timelimit_exceeded, clock_time_start)) ||
  ------------------
  |  Branch (2348:24): [True: 0, False: 0]
  |  Branch (2348:44): [True: 0, False: 0]
  ------------------
 2349|      0|                      cpdwordpair_check(st, i + rv->blen, scratch, timelimit_exceeded, clock_time_start)) {
  ------------------
  |  Branch (2349:23): [True: 0, False: 0]
  ------------------
 2350|      0|                    st[ + i + rv->blen] = r;
 2351|      0|                    continue;
 2352|      0|                  }
 2353|       |
 2354|      0|                  if (forbiddenword) {
  ------------------
  |  Branch (2354:23): [True: 0, False: 0]
  ------------------
 2355|      0|                    struct hentry* rv2 = lookup(word.c_str(), word.size());
 2356|      0|                    if (!rv2 && len <= word.size())
  ------------------
  |  Branch (2356:25): [True: 0, False: 0]
  |  Branch (2356:33): [True: 0, False: 0]
  ------------------
 2357|      0|                      rv2 = affix_check(word, 0, len, scratch);
 2358|      0|                    if (rv2 && rv2->astr &&
  ------------------
  |  Branch (2358:25): [True: 0, False: 0]
  |  Branch (2358:32): [True: 0, False: 0]
  ------------------
 2359|      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]
  |  |  ------------------
  ------------------
 2360|      0|                        (strncmp(rv2->word, st.c_str(), i + rv->blen) == 0)) {
  ------------------
  |  Branch (2360:25): [True: 0, False: 0]
  ------------------
 2361|      0|                      return nullptr;
 2362|      0|                    }
 2363|      0|                  }
 2364|      0|                  st[i + rv->blen] = r;
 2365|      0|                }
 2366|      0|              }
 2367|      0|              return rv_first;
 2368|      0|            }
 2369|    397|          } while (striple && !checkedstriple);  // end of striple loop
  ------------------
  |  Branch (2369:20): [True: 0, False: 397]
  |  Branch (2369:31): [True: 0, False: 0]
  ------------------
 2370|       |
 2371|    397|          if (checkedstriple) {
  ------------------
  |  Branch (2371:15): [True: 0, False: 397]
  ------------------
 2372|      0|            i++;
 2373|      0|            checkedstriple = 0;
 2374|      0|            striple = 0;
 2375|      0|          }
 2376|       |
 2377|    397|        }  // first word is ok condition
 2378|       |
 2379|   592M|        if (soldi != 0) {
  ------------------
  |  Branch (2379:13): [True: 0, False: 592M]
  ------------------
 2380|      0|          i = soldi;
 2381|      0|          len = oldlen;
 2382|      0|          cmin = oldcmin;
 2383|      0|          cmax = oldcmax;
 2384|      0|        }
 2385|   592M|        scpd++;
 2386|       |
 2387|   592M|      } while (!onlycpdrule && simplifiedcpd &&
  ------------------
  |  Branch (2387:16): [True: 592M, False: 0]
  |  Branch (2387:32): [True: 0, False: 592M]
  ------------------
 2388|      0|               scpd <= checkcpdtable.size());  // end of simplifiedcpd loop
  ------------------
  |  Branch (2388:16): [True: 0, False: 0]
  ------------------
 2389|       |
 2390|   592M|      scpd = 0;
 2391|   592M|      wordnum = oldwordnum;
 2392|   592M|      numsyllable = oldnumsyllable;
 2393|       |
 2394|   592M|      if (soldi != 0) {
  ------------------
  |  Branch (2394:11): [True: 0, False: 592M]
  ------------------
 2395|      0|        i = soldi;
 2396|      0|        st.assign(word);  // XXX add more optim.
 2397|      0|        soldi = 0;
 2398|      0|        len = oldlen;
 2399|      0|        cmin = oldcmin;
 2400|      0|        cmax = oldcmax;
 2401|      0|      } else
 2402|   592M|        st[i] = ch;
 2403|       |
 2404|   592M|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2404:14): [True: 0, False: 592M]
  |  Branch (2404:38): [True: 0, False: 0]
  ------------------
 2405|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2405:14): [True: 0, False: 0]
  ------------------
 2406|   593M|  }
 2407|       |
 2408|  25.8M|  return nullptr;
 2409|  27.2M|}
_ZN8AffixMgr20compound_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEsissPP6hentrySB_cRS6_PS7_R12AffixScratch:
 2423|  2.34k|                                   AffixScratch& scratch) {
 2424|  2.34k|  int oldnumsyllable, oldnumsyllable2;
 2425|  2.34k|  short oldwordnum, oldwordnum2;
 2426|  2.34k|  hentry *rv = nullptr, *rv_first;
 2427|  2.34k|  std::string st, presult;
 2428|  2.34k|  char ch, affixed = 0;
 2429|  2.34k|  int checked_prefix, ok = 0;
 2430|  2.34k|  size_t cmin, cmax;
 2431|  2.34k|  hentry** oldwords = words;
 2432|  2.34k|  size_t len = word.size();
 2433|       |
 2434|       |  // protect subsequent words[wnum + 1] reads and any recursion
 2435|  2.34k|  if (wnum + 1 >= maxwordnum)
  ------------------
  |  Branch (2435:7): [True: 0, False: 2.34k]
  ------------------
 2436|      0|    return 0;
 2437|       |
 2438|       |  // add a time limit to handle possible
 2439|       |  // combinatorical explosion of the overlapping words
 2440|       |
 2441|  2.34k|  HUNSPELL_THREAD_LOCAL std::chrono::steady_clock::time_point clock_time_start;
  ------------------
  |  |   60|  2.34k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2442|  2.34k|  HUNSPELL_THREAD_LOCAL bool timelimit_exceeded;
  ------------------
  |  |   60|  2.34k|#  define HUNSPELL_THREAD_LOCAL thread_local
  ------------------
 2443|       |
 2444|       |  // get the current time
 2445|  2.34k|  std::chrono::steady_clock::time_point clock_now = std::chrono::steady_clock::now();
 2446|       |
 2447|  2.34k|  if (wnum == 0) {
  ------------------
  |  Branch (2447:7): [True: 2.34k, False: 0]
  ------------------
 2448|       |      // set the start time
 2449|  2.34k|      clock_time_start = clock_now;
 2450|  2.34k|      timelimit_exceeded = false;
 2451|  2.34k|  }
 2452|      0|  else if (clock_now - clock_time_start > TIMELIMIT_MS)
  ------------------
  |  |  109|      0|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2452:12): [True: 0, False: 0]
  ------------------
 2453|      0|      timelimit_exceeded = true;
 2454|       |
 2455|  2.34k|  setcminmax(&cmin, &cmax, word.c_str(), len);
 2456|       |
 2457|  2.34k|  st.assign(word);
 2458|       |
 2459|  35.2k|  for (size_t i = cmin; i < cmax; ++i) {
  ------------------
  |  Branch (2459:25): [True: 33.1k, False: 2.09k]
  ------------------
 2460|       |    // go to end of the UTF-8 character
 2461|  33.1k|    if (utf8) {
  ------------------
  |  Branch (2461:9): [True: 9.42k, False: 23.7k]
  ------------------
 2462|  11.0k|      for (; is_utf8_cont(st[i]); i++)
  ------------------
  |  Branch (2462:14): [True: 1.60k, False: 9.42k]
  ------------------
 2463|  1.60k|        ;
 2464|  9.42k|      if (i >= cmax)
  ------------------
  |  Branch (2464:11): [True: 61, False: 9.36k]
  ------------------
 2465|     61|        return 0;
 2466|  9.42k|    }
 2467|       |
 2468|  33.0k|    words = oldwords;
 2469|  33.0k|    int onlycpdrule = (words) ? 1 : 0;
  ------------------
  |  Branch (2469:23): [True: 0, False: 33.0k]
  ------------------
 2470|       |
 2471|  33.0k|    do {  // onlycpdrule loop
 2472|       |
 2473|  33.0k|      if (timelimit_exceeded ||
  ------------------
  |  Branch (2473:11): [True: 0, False: 33.0k]
  |  Branch (2473:11): [True: 0, False: 33.0k]
  ------------------
 2474|  33.0k|          std::chrono::steady_clock::now() - clock_time_start > TIMELIMIT_MS) {
  ------------------
  |  |  109|  33.0k|#define TIMELIMIT_MS std::chrono::milliseconds(50)
  ------------------
  |  Branch (2474:11): [True: 0, False: 33.0k]
  ------------------
 2475|      0|        timelimit_exceeded = true;
 2476|      0|        return 0;
 2477|      0|      }
 2478|       |
 2479|  33.0k|      if (result.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|  33.0k|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (2479:11): [True: 0, False: 33.0k]
  ------------------
 2480|      0|        return 0;
 2481|       |
 2482|  33.0k|      oldnumsyllable = numsyllable;
 2483|  33.0k|      oldwordnum = wordnum;
 2484|  33.0k|      checked_prefix = 0;
 2485|       |
 2486|  33.0k|      if (i >= st.size())
  ------------------
  |  Branch (2486:11): [True: 195, False: 32.8k]
  ------------------
 2487|    195|        return 0;
 2488|       |
 2489|  32.8k|      ch = st[i];
 2490|  32.8k|      st[i] = '\0';
 2491|  32.8k|      sfx = nullptr;
 2492|       |
 2493|       |      // FIRST WORD
 2494|       |
 2495|  32.8k|      affixed = 1;
 2496|       |
 2497|  32.8k|      presult.clear();
 2498|  32.8k|      if (partresult)
  ------------------
  |  Branch (2498:11): [True: 0, False: 32.8k]
  ------------------
 2499|      0|        presult.append(*partresult);
 2500|       |
 2501|  32.8k|      rv = lookup(st.c_str(), i);  // perhaps without prefix
 2502|       |
 2503|       |      // forbid dictionary stems with COMPOUNDFORBIDFLAG in
 2504|       |      // compound words, overriding the effect of COMPOUNDPERMITFLAG
 2505|  32.8k|      if ((rv) && compoundforbidflag &&
  ------------------
  |  Branch (2505:11): [True: 261, False: 32.6k]
  |  Branch (2505:19): [True: 165, False: 96]
  ------------------
 2506|    165|              TESTAFF(rv->astr, compoundforbidflag, rv->alen) && !hu_mov_rule) {
  ------------------
  |  |  102|  33.0k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 165]
  |  |  ------------------
  ------------------
  |  Branch (2506:66): [True: 0, False: 0]
  ------------------
 2507|      0|        st[i] = ch;
 2508|      0|        continue;
 2509|      0|      }
 2510|       |
 2511|       |      // search homonym with compound flag
 2512|  33.1k|      while ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2512:14): [True: 261, False: 32.8k]
  |  Branch (2512:22): [True: 261, False: 0]
  ------------------
 2513|    261|             ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) ||
  ------------------
  |  |  102|     32|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 32]
  |  |  ------------------
  ------------------
  |  Branch (2513:16): [True: 32, False: 229]
  ------------------
 2514|    261|              !((compoundflag && !words && !onlycpdrule &&
  ------------------
  |  Branch (2514:18): [True: 261, False: 0]
  |  Branch (2514:34): [True: 261, False: 0]
  |  Branch (2514:44): [True: 261, False: 0]
  ------------------
 2515|    261|                 TESTAFF(rv->astr, compoundflag, rv->alen)) ||
  ------------------
  |  |  102|    261|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 261]
  |  |  ------------------
  ------------------
 2516|    261|                (compoundbegin && !wordnum && !onlycpdrule &&
  ------------------
  |  Branch (2516:18): [True: 0, False: 261]
  |  Branch (2516:35): [True: 0, False: 0]
  |  Branch (2516:47): [True: 0, False: 0]
  ------------------
 2517|      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]
  |  |  ------------------
  ------------------
 2518|    261|                (compoundmiddle && wordnum && !words && !onlycpdrule &&
  ------------------
  |  Branch (2518:18): [True: 0, False: 261]
  |  Branch (2518:36): [True: 0, False: 0]
  |  Branch (2518:47): [True: 0, False: 0]
  |  Branch (2518:57): [True: 0, False: 0]
  ------------------
 2519|      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]
  |  |  ------------------
  ------------------
 2520|    261|                (!defcpdtable.empty() && onlycpdrule &&
  ------------------
  |  Branch (2520:18): [True: 0, False: 261]
  |  Branch (2520:42): [True: 0, False: 0]
  ------------------
 2521|      0|                 ((!words && !wordnum &&
  ------------------
  |  Branch (2521:20): [True: 0, False: 0]
  |  Branch (2521:30): [True: 0, False: 0]
  ------------------
 2522|      0|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0)) ||
  ------------------
  |  Branch (2522:20): [True: 0, False: 0]
  ------------------
 2523|      0|                  (words &&
  ------------------
  |  Branch (2523:20): [True: 0, False: 0]
  ------------------
 2524|    261|                   defcpd_check(&words, wnum, maxwordnum, rv, rwords, 0))))))) {
  ------------------
  |  Branch (2524:20): [True: 0, False: 0]
  ------------------
 2525|    261|        rv = rv->next_homonym;
 2526|    261|      }
 2527|       |
 2528|       |
 2529|  32.8k|      if (rv)
  ------------------
  |  Branch (2529:11): [True: 0, False: 32.8k]
  ------------------
 2530|      0|        affixed = 0;
 2531|       |
 2532|  32.8k|      if (rv) {
  ------------------
  |  Branch (2532:11): [True: 0, False: 32.8k]
  ------------------
 2533|      0|        presult.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2534|      0|        presult.append(MORPH_PART);
  ------------------
  |  |  112|      0|#define MORPH_PART "pa:"
  ------------------
 2535|      0|        presult.append(st, 0, i);
 2536|      0|        if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |   99|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2536:13): [True: 0, False: 0]
  ------------------
 2537|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2538|      0|          presult.append(MORPH_STEM);
  ------------------
  |  |   99|      0|#define MORPH_STEM "st:"
  ------------------
 2539|      0|          presult.append(st, 0, i);
 2540|      0|        }
 2541|      0|        if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2541:13): [True: 0, False: 0]
  ------------------
 2542|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2543|      0|          presult.append(HENTRY_DATA2(rv));
 2544|      0|        }
 2545|      0|      }
 2546|       |
 2547|  32.8k|      if (!rv) {
  ------------------
  |  Branch (2547:11): [True: 32.8k, False: 0]
  ------------------
 2548|  32.8k|        if (compoundflag &&
  ------------------
  |  Branch (2548:13): [True: 32.8k, False: 0]
  ------------------
 2549|  32.8k|            !(rv =
  ------------------
  |  Branch (2549:13): [True: 32.8k, False: 0]
  ------------------
 2550|  32.8k|                  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|  65.7k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2550:42): [True: 0, False: 32.8k]
  ------------------
 2551|  32.8k|                               scratch, compoundflag))) {
 2552|  32.8k|          if (((rv = suffix_check(st, 0, i, 0, nullptr, scratch, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) ||
  ------------------
  |  |   99|  32.8k|#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|  65.7k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2552:16): [True: 0, False: 32.8k]
  |  Branch (2552:91): [True: 0, False: 32.8k]
  ------------------
 2553|  32.8k|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch, compoundflag)))) &&
  ------------------
  |  Branch (2553:17): [True: 0, False: 32.8k]
  |  Branch (2553:41): [True: 0, False: 0]
  ------------------
 2554|      0|              !hu_mov_rule && sfx->getCont() &&
  ------------------
  |  Branch (2554:15): [True: 0, False: 0]
  |  Branch (2554:31): [True: 0, False: 0]
  ------------------
 2555|      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 (2555:17): [True: 0, False: 0]
  ------------------
 2556|      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 (2556:17): [True: 0, False: 0]
  ------------------
 2557|      0|            rv = nullptr;
 2558|      0|          }
 2559|  32.8k|        }
 2560|       |
 2561|  32.8k|        if (rv ||
  ------------------
  |  Branch (2561:13): [True: 0, False: 32.8k]
  ------------------
 2562|  32.8k|            (((wordnum == 0) && compoundbegin &&
  ------------------
  |  Branch (2562:15): [True: 32.8k, False: 0]
  |  Branch (2562:33): [True: 0, False: 32.8k]
  ------------------
 2563|      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 (2563:16): [True: 0, False: 0]
  |  Branch (2563:92): [True: 0, False: 0]
  ------------------
 2564|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2564:17): [True: 0, False: 0]
  |  Branch (2564:41): [True: 0, False: 0]
  ------------------
 2565|      0|                                                                  compoundbegin))) ||  // twofold suffix+compound
 2566|      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 (2566:16): [True: 0, False: 0]
  |  Branch (2566:45): [True: 0, False: 0]
  ------------------
 2567|  32.8k|             ((wordnum > 0) && compoundmiddle &&
  ------------------
  |  Branch (2567:15): [True: 0, False: 32.8k]
  |  Branch (2567:32): [True: 0, False: 0]
  ------------------
 2568|      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 (2568:16): [True: 0, False: 0]
  |  Branch (2568:93): [True: 0, False: 0]
  ------------------
 2569|      0|               (compoundmoresuffixes && (rv = suffix_check_twosfx(st, 0, i, 0, nullptr, scratch,
  ------------------
  |  Branch (2569:17): [True: 0, False: 0]
  |  Branch (2569:41): [True: 0, False: 0]
  ------------------
 2570|      0|                                                                  compoundmiddle))) ||  // twofold suffix+compound
 2571|      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 (2571:16): [True: 0, False: 0]
  |  Branch (2571:45): [True: 0, False: 0]
  ------------------
 2572|      0|          std::string p;
 2573|      0|          if (compoundflag)
  ------------------
  |  Branch (2573:15): [True: 0, False: 0]
  ------------------
 2574|      0|            p = affix_check_morph(st, 0, i, scratch, compoundflag);
 2575|      0|          if (p.empty()) {
  ------------------
  |  Branch (2575:15): [True: 0, False: 0]
  ------------------
 2576|      0|            if ((wordnum == 0) && compoundbegin) {
  ------------------
  |  Branch (2576:17): [True: 0, False: 0]
  |  Branch (2576:35): [True: 0, False: 0]
  ------------------
 2577|      0|              p = affix_check_morph(st, 0, i, scratch, compoundbegin);
 2578|      0|            } else if ((wordnum > 0) && compoundmiddle) {
  ------------------
  |  Branch (2578:24): [True: 0, False: 0]
  |  Branch (2578:41): [True: 0, False: 0]
  ------------------
 2579|      0|              p = affix_check_morph(st, 0, i, scratch, compoundmiddle);
 2580|      0|            }
 2581|      0|          }
 2582|      0|          presult.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2583|      0|          presult.append(MORPH_PART);
  ------------------
  |  |  112|      0|#define MORPH_PART "pa:"
  ------------------
 2584|      0|          presult.append(st, 0, i);
 2585|      0|          if (!p.empty()) {
  ------------------
  |  Branch (2585:15): [True: 0, False: 0]
  ------------------
 2586|      0|            line_uniq_app(p, MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 2587|      0|            if (!p.empty() && p[0] != MSEP_FLD)
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
  |  Branch (2587:17): [True: 0, False: 0]
  |  Branch (2587:31): [True: 0, False: 0]
  ------------------
 2588|      0|              presult.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2589|      0|            presult.append(p);
 2590|      0|          }
 2591|      0|          checked_prefix = 1;
 2592|      0|        }
 2593|       |        // else check forbiddenwords
 2594|  32.8k|      } 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 (2594:18): [True: 0, False: 0]
  |  Branch (2594:18): [True: 0, False: 0]
  ------------------
 2595|      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]
  |  |  ------------------
  ------------------
 2596|      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]
  |  |  ------------------
  ------------------
 2597|      0|        st[i] = ch;
 2598|      0|        continue;
 2599|      0|      }
 2600|       |
 2601|       |      // check non_compound flag in suffix and prefix
 2602|  32.8k|      if ((rv) && !hu_mov_rule &&
  ------------------
  |  Branch (2602:11): [True: 0, False: 32.8k]
  |  Branch (2602:19): [True: 0, False: 0]
  ------------------
 2603|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2603:13): [True: 0, False: 0]
  |  Branch (2603:20): [True: 0, False: 0]
  ------------------
 2604|      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]
  |  |  ------------------
  ------------------
 2605|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2605:13): [True: 0, False: 0]
  |  Branch (2605:20): [True: 0, False: 0]
  ------------------
 2606|      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]
  |  |  ------------------
  ------------------
 2607|      0|        st[i] = ch;
 2608|      0|        continue;
 2609|      0|      }
 2610|       |
 2611|       |      // check compoundend flag in suffix and prefix
 2612|  32.8k|      if ((rv) && !checked_prefix && compoundend && !hu_mov_rule &&
  ------------------
  |  Branch (2612:11): [True: 0, False: 32.8k]
  |  Branch (2612:19): [True: 0, False: 0]
  |  Branch (2612:38): [True: 0, False: 0]
  |  Branch (2612:53): [True: 0, False: 0]
  ------------------
 2613|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2613:13): [True: 0, False: 0]
  |  Branch (2613:20): [True: 0, False: 0]
  ------------------
 2614|      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]
  |  |  ------------------
  ------------------
 2615|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2615:13): [True: 0, False: 0]
  |  Branch (2615:20): [True: 0, False: 0]
  ------------------
 2616|      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]
  |  |  ------------------
  ------------------
 2617|      0|        st[i] = ch;
 2618|      0|        continue;
 2619|      0|      }
 2620|       |
 2621|       |      // check compoundmiddle flag in suffix and prefix
 2622|  32.8k|      if ((rv) && !checked_prefix && (wordnum == 0) && compoundmiddle &&
  ------------------
  |  Branch (2622:11): [True: 0, False: 32.8k]
  |  Branch (2622:19): [True: 0, False: 0]
  |  Branch (2622:38): [True: 0, False: 0]
  |  Branch (2622:56): [True: 0, False: 0]
  ------------------
 2623|      0|          !hu_mov_rule &&
  ------------------
  |  Branch (2623:11): [True: 0, False: 0]
  ------------------
 2624|      0|          ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2624:13): [True: 0, False: 0]
  |  Branch (2624:20): [True: 0, False: 0]
  ------------------
 2625|      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]
  |  |  ------------------
  ------------------
 2626|      0|           (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2626:13): [True: 0, False: 0]
  |  Branch (2626:20): [True: 0, False: 0]
  ------------------
 2627|      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]
  |  |  ------------------
  ------------------
 2628|      0|        rv = nullptr;
 2629|      0|      }
 2630|       |
 2631|       |      // check forbiddenwords
 2632|  32.8k|      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 (2632:11): [True: 0, False: 32.8k]
  |  Branch (2632:11): [True: 0, False: 32.8k]
  |  Branch (2632:19): [True: 0, False: 0]
  ------------------
 2633|      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]
  |  |  ------------------
  ------------------
 2634|      0|        st[i] = ch;
 2635|      0|        continue;
 2636|      0|      }
 2637|       |
 2638|       |      // increment word number, if the second root has a compoundroot flag
 2639|  32.8k|      if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2639:11): [True: 0, False: 32.8k]
  |  Branch (2639:19): [True: 0, False: 0]
  ------------------
 2640|      0|          (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2640:11): [True: 0, False: 0]
  ------------------
 2641|      0|        wordnum++;
 2642|      0|      }
 2643|       |
 2644|       |      // first word is acceptable in compound words?
 2645|  32.8k|      if (((rv) &&
  ------------------
  |  Branch (2645:11): [True: 0, False: 32.8k]
  |  Branch (2645:12): [True: 0, False: 32.8k]
  ------------------
 2646|      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 (2646:13): [True: 0, False: 0]
  |  Branch (2646:32): [True: 0, False: 0]
  |  Branch (2646:41): [True: 0, False: 0]
  |  Branch (2646:58): [True: 0, False: 0]
  ------------------
 2647|      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 (2647:14): [True: 0, False: 0]
  |  Branch (2647:35): [True: 0, False: 0]
  ------------------
 2648|      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 (2648:14): [True: 0, False: 0]
  |  Branch (2648:34): [True: 0, False: 0]
  ------------------
 2649|       |            // LANG_hu section: spec. Hungarian rule
 2650|      0|            || ((langnum == LANG_hu) &&  // hu_mov_rule
  ------------------
  |  Branch (2650:17): [True: 0, False: 0]
  ------------------
 2651|      0|                hu_mov_rule &&
  ------------------
  |  Branch (2651:17): [True: 0, False: 0]
  ------------------
 2652|      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]
  |  |  ------------------
  ------------------
 2653|       |            // END of LANG_hu section
 2654|      0|            ) &&
 2655|      0|           !((checkcompoundtriple && !words &&  // test triple letters
  ------------------
  |  Branch (2655:15): [True: 0, False: 0]
  |  Branch (2655:38): [True: 0, False: 0]
  ------------------
 2656|      0|              (word[i - 1] == word[i]) &&
  ------------------
  |  Branch (2656:15): [True: 0, False: 0]
  ------------------
 2657|      0|              (((i > 1) && (word[i - 1] == word[i - 2])) || ((word[i - 1] == word[i + 1]))  // may be word[i+1] == '\0'
  ------------------
  |  Branch (2657:17): [True: 0, False: 0]
  |  Branch (2657:28): [True: 0, False: 0]
  |  Branch (2657:61): [True: 0, False: 0]
  ------------------
 2658|      0|               )) ||
 2659|      0|             (
 2660|       |                 // test CHECKCOMPOUNDPATTERN
 2661|      0|                 !checkcpdtable.empty() && !words && cpdpat_check(word, i, rv, nullptr, affixed, nullptr, nullptr, nullptr, nullptr, nullptr)) ||
  ------------------
  |  Branch (2661:18): [True: 0, False: 0]
  |  Branch (2661:44): [True: 0, False: 0]
  |  Branch (2661:54): [True: 0, False: 0]
  ------------------
 2662|      0|             (checkcompoundcase && !words && cpdcase_check(word, i))))
  ------------------
  |  Branch (2662:15): [True: 0, False: 0]
  |  Branch (2662:36): [True: 0, False: 0]
  |  Branch (2662:46): [True: 0, False: 0]
  ------------------
 2663|       |          // LANG_hu section: spec. Hungarian rule
 2664|  32.8k|          || ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st, 0, i, scratch)) &&
  ------------------
  |  Branch (2664:15): [True: 32.8k, False: 0]
  |  Branch (2664:24): [True: 9.36k, False: 23.5k]
  |  Branch (2664:48): [True: 0, False: 9.36k]
  |  Branch (2664:63): [True: 0, False: 0]
  ------------------
 2665|      0|              (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2665:16): [True: 0, False: 0]
  |  Branch (2665:23): [True: 0, False: 0]
  ------------------
 2666|      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]
  |  |  ------------------
  ------------------
 2667|      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]
  |  |  ------------------
  ------------------
 2668|       |          // END of LANG_hu section
 2669|  32.8k|      ) {
 2670|       |        // LANG_hu section: spec. Hungarian rule
 2671|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2671:13): [True: 0, False: 0]
  ------------------
 2672|       |          // calculate syllable number of the word
 2673|      0|          numsyllable += get_syllable(st.substr(0, i));
 2674|       |
 2675|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2676|       |          // convention)
 2677|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2677:15): [True: 0, False: 0]
  |  Branch (2677:15): [True: 0, False: 0]
  |  Branch (2677:22): [True: 0, False: 0]
  ------------------
 2678|      0|            wordnum++;
 2679|      0|        }
 2680|       |        // END of LANG_hu section
 2681|       |
 2682|       |        // NEXT WORD(S)
 2683|      0|        rv_first = rv;
 2684|      0|        rv = lookup(word.c_str() + i, word.size() - i);  // perhaps without prefix
 2685|       |
 2686|       |        // search homonym with compound flag
 2687|      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 (2687:16): [True: 0, False: 0]
  |  Branch (2687:26): [True: 0, False: 0]
  ------------------
 2688|      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 (2688:28): [True: 0, False: 0]
  |  Branch (2688:44): [True: 0, False: 0]
  ------------------
 2689|      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 (2689:28): [True: 0, False: 0]
  |  Branch (2689:43): [True: 0, False: 0]
  ------------------
 2690|      0|                          (!defcpdtable.empty() && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1))))) {
  ------------------
  |  Branch (2690:28): [True: 0, False: 0]
  |  Branch (2690:52): [True: 0, False: 0]
  |  Branch (2690:61): [True: 0, False: 0]
  ------------------
 2691|      0|          rv = rv->next_homonym;
 2692|      0|        }
 2693|       |
 2694|      0|        if (rv && words && words[wnum + 1]) {
  ------------------
  |  Branch (2694:13): [True: 0, False: 0]
  |  Branch (2694:19): [True: 0, False: 0]
  |  Branch (2694:28): [True: 0, False: 0]
  ------------------
 2695|      0|          result.append(presult);
 2696|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2697|      0|          result.append(MORPH_PART);
  ------------------
  |  |  112|      0|#define MORPH_PART "pa:"
  ------------------
 2698|      0|          result.append(word, i, word.size());
 2699|      0|          if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (2699:15): [True: 0, False: 0]
  |  Branch (2699:34): [True: 0, False: 0]
  ------------------
 2700|      0|            result.append(HENTRY_DATA2(rv));
 2701|      0|          if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |   99|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2701:15): [True: 0, False: 0]
  ------------------
 2702|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2703|      0|            result.append(MORPH_STEM);
  ------------------
  |  |   99|      0|#define MORPH_STEM "st:"
  ------------------
 2704|      0|            result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2705|      0|          }
 2706|       |          // store the pointer of the hash entry
 2707|      0|          if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2707:15): [True: 0, False: 0]
  |  Branch (2707:35): [True: 0, False: 0]
  ------------------
 2708|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2709|      0|            result.append(HENTRY_DATA2(rv));
 2710|      0|          }
 2711|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 2712|      0|          return 0;
 2713|      0|        }
 2714|       |
 2715|      0|        oldnumsyllable2 = numsyllable;
 2716|      0|        oldwordnum2 = wordnum;
 2717|       |
 2718|       |        // LANG_hu section: spec. Hungarian rule
 2719|      0|        if ((rv) && (langnum == LANG_hu) &&
  ------------------
  |  Branch (2719:13): [True: 0, False: 0]
  |  Branch (2719:13): [True: 0, False: 0]
  |  Branch (2719:21): [True: 0, False: 0]
  ------------------
 2720|      0|            (TESTAFF(rv->astr, 'I', rv->alen)) &&
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2720:13): [True: 0, False: 0]
  ------------------
 2721|      0|            !(TESTAFF(rv->astr, 'J', rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2721:13): [True: 0, False: 0]
  ------------------
 2722|      0|          numsyllable--;
 2723|      0|        }
 2724|       |        // END of LANG_hu section
 2725|       |        // increment word number, if the second root has a compoundroot flag
 2726|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2726:13): [True: 0, False: 0]
  |  Branch (2726:21): [True: 0, False: 0]
  ------------------
 2727|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2727:13): [True: 0, False: 0]
  ------------------
 2728|      0|          wordnum++;
 2729|      0|        }
 2730|       |
 2731|       |        // check forbiddenwords
 2732|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2732:13): [True: 0, False: 0]
  |  Branch (2732:13): [True: 0, False: 0]
  |  Branch (2732:21): [True: 0, False: 0]
  ------------------
 2733|      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]
  |  |  ------------------
  ------------------
 2734|      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]
  |  |  ------------------
  ------------------
 2735|      0|          st[i] = ch;
 2736|      0|          wordnum = oldwordnum;
 2737|      0|          numsyllable = oldnumsyllable;
 2738|      0|          continue;
 2739|      0|        }
 2740|       |
 2741|       |        // second word is acceptable, as a root?
 2742|       |        // hungarian conventions: compounding is acceptable,
 2743|       |        // when compound forms consist of 2 words, or if more,
 2744|       |        // then the syllable number of root words must be 6, or lesser.
 2745|      0|        if ((rv) &&
  ------------------
  |  Branch (2745:13): [True: 0, False: 0]
  |  Branch (2745:13): [True: 0, False: 0]
  ------------------
 2746|      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 (2746:15): [True: 0, False: 0]
  ------------------
 2747|      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 (2747:15): [True: 0, False: 0]
  ------------------
 2748|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2748:15): [True: 0, False: 0]
  |  Branch (2748:37): [True: 0, False: 0]
  ------------------
 2749|      0|             ((cpdmaxsyllable != 0) &&
  ------------------
  |  Branch (2749:15): [True: 0, False: 0]
  ------------------
 2750|      0|              (numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
  |  Branch (2750:15): [True: 0, False: 0]
  ------------------
 2751|      0|               cpdmaxsyllable))) &&
 2752|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2752:15): [True: 0, False: 0]
  |  Branch (2752:36): [True: 0, False: 0]
  ------------------
 2753|       |          // bad compound word
 2754|      0|          result.append(presult);
 2755|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2756|      0|          result.append(MORPH_PART);
  ------------------
  |  |  112|      0|#define MORPH_PART "pa:"
  ------------------
 2757|      0|          result.append(word, i, word.size());
 2758|       |
 2759|      0|          if (HENTRY_DATA(rv)) {
  ------------------
  |  Branch (2759:15): [True: 0, False: 0]
  ------------------
 2760|      0|            if (complexprefixes)
  ------------------
  |  Branch (2760:17): [True: 0, False: 0]
  ------------------
 2761|      0|              result.append(HENTRY_DATA2(rv));
 2762|      0|            if (!HENTRY_FIND(rv, MORPH_STEM)) {
  ------------------
  |  |   99|      0|#define MORPH_STEM "st:"
  ------------------
  |  Branch (2762:17): [True: 0, False: 0]
  ------------------
 2763|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2764|      0|              result.append(MORPH_STEM);
  ------------------
  |  |   99|      0|#define MORPH_STEM "st:"
  ------------------
 2765|      0|              result.append(HENTRY_WORD(rv));
  ------------------
  |  |   54|      0|#define HENTRY_WORD(h) &(h->word[0])
  ------------------
 2766|      0|            }
 2767|       |            // store the pointer of the hash entry
 2768|      0|            if (!complexprefixes) {
  ------------------
  |  Branch (2768:17): [True: 0, False: 0]
  ------------------
 2769|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2770|      0|              result.append(HENTRY_DATA2(rv));
 2771|      0|            }
 2772|      0|          }
 2773|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 2774|      0|          ok = 1;
 2775|      0|        }
 2776|       |
 2777|      0|        numsyllable = oldnumsyllable2;
 2778|      0|        wordnum = oldwordnum2;
 2779|       |
 2780|       |        // perhaps second word has prefix or/and suffix
 2781|      0|        sfx = nullptr;
 2782|      0|        sfxflag = FLAG_NULL;
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
 2783|       |
 2784|      0|        if (compoundflag && !onlycpdrule)
  ------------------
  |  Branch (2784:13): [True: 0, False: 0]
  |  Branch (2784:29): [True: 0, False: 0]
  ------------------
 2785|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundflag);
 2786|      0|        else
 2787|      0|          rv = nullptr;
 2788|       |
 2789|      0|        if (!rv && compoundend && !onlycpdrule) {
  ------------------
  |  Branch (2789:13): [True: 0, False: 0]
  |  Branch (2789:20): [True: 0, False: 0]
  |  Branch (2789:35): [True: 0, False: 0]
  ------------------
 2790|      0|          sfx = nullptr;
 2791|      0|          pfx = nullptr;
 2792|      0|          rv = affix_check(word, i, word.size() - i, scratch, compoundend, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2793|      0|        }
 2794|       |
 2795|      0|        if (!rv && !defcpdtable.empty() && words) {
  ------------------
  |  Branch (2795:13): [True: 0, False: 0]
  |  Branch (2795:20): [True: 0, False: 0]
  |  Branch (2795:44): [True: 0, False: 0]
  ------------------
 2796|      0|          rv = affix_check(word, i, word.size() - i, scratch, 0, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2797|      0|          if (rv && words && defcpd_check(&words, wnum + 1, maxwordnum, rv, nullptr, 1)) {
  ------------------
  |  Branch (2797:15): [True: 0, False: 0]
  |  Branch (2797:21): [True: 0, False: 0]
  |  Branch (2797:30): [True: 0, False: 0]
  ------------------
 2798|      0|            std::string m;
 2799|      0|            if (compoundflag)
  ------------------
  |  Branch (2799:17): [True: 0, False: 0]
  ------------------
 2800|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag);
 2801|      0|            if (m.empty() && compoundend) {
  ------------------
  |  Branch (2801:17): [True: 0, False: 0]
  |  Branch (2801:30): [True: 0, False: 0]
  ------------------
 2802|      0|              m = affix_check_morph(word, i, word.size() - i, scratch, compoundend);
 2803|      0|            }
 2804|      0|            result.append(presult);
 2805|      0|            if (!m.empty()) {
  ------------------
  |  Branch (2805:17): [True: 0, False: 0]
  ------------------
 2806|      0|              result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2807|      0|              result.append(MORPH_PART);
  ------------------
  |  |  112|      0|#define MORPH_PART "pa:"
  ------------------
 2808|      0|              result.append(word, i, word.size());
 2809|      0|              line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 2810|      0|              result.append(m);
 2811|      0|            }
 2812|      0|            result.push_back(MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 2813|      0|            ok = 1;
 2814|      0|          }
 2815|      0|        }
 2816|       |
 2817|       |        // check non_compound flag in suffix and prefix
 2818|      0|        if ((rv) &&
  ------------------
  |  Branch (2818:13): [True: 0, False: 0]
  ------------------
 2819|      0|            ((pfx && pfx->getCont() &&
  ------------------
  |  Branch (2819:15): [True: 0, False: 0]
  |  Branch (2819:22): [True: 0, False: 0]
  ------------------
 2820|      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]
  |  |  ------------------
  ------------------
 2821|      0|             (sfx && sfx->getCont() &&
  ------------------
  |  Branch (2821:15): [True: 0, False: 0]
  |  Branch (2821:22): [True: 0, False: 0]
  ------------------
 2822|      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]
  |  |  ------------------
  ------------------
 2823|      0|                      sfx->getContLen())))) {
 2824|      0|          rv = nullptr;
 2825|      0|        }
 2826|       |
 2827|       |        // check forbiddenwords
 2828|      0|        if ((rv) && (rv->astr) &&
  ------------------
  |  Branch (2828:13): [True: 0, False: 0]
  |  Branch (2828:13): [True: 0, False: 0]
  |  Branch (2828:21): [True: 0, False: 0]
  ------------------
 2829|      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]
  |  |  ------------------
  ------------------
 2830|      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]
  |  |  ------------------
  ------------------
 2831|      0|            (!TESTAFF(rv->astr, needaffix, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2831:13): [True: 0, False: 0]
  ------------------
 2832|      0|          st[i] = ch;
 2833|      0|          wordnum = oldwordnum;
 2834|      0|          numsyllable = oldnumsyllable;
 2835|      0|          continue;
 2836|      0|        }
 2837|       |
 2838|      0|        if (langnum == LANG_hu) {
  ------------------
  |  Branch (2838:13): [True: 0, False: 0]
  ------------------
 2839|       |          // calculate syllable number of the word
 2840|      0|          numsyllable += get_syllable(word.c_str() + i);
 2841|       |
 2842|       |          // - affix syllable num.
 2843|       |          // XXX only second suffix (inflections, not derivations)
 2844|      0|          if (sfxappnd) {
  ------------------
  |  Branch (2844:15): [True: 0, False: 0]
  ------------------
 2845|      0|            std::string tmp(sfxappnd);
 2846|      0|            reverseword(tmp);
 2847|      0|            numsyllable -= get_syllable(tmp) + sfxextra;
 2848|      0|          } else {
 2849|      0|            numsyllable -= sfxextra;
 2850|      0|          }
 2851|       |
 2852|       |          // + 1 word, if syllable number of the prefix > 1 (hungarian
 2853|       |          // convention)
 2854|      0|          if (pfx && (get_syllable(pfx->getKey()) > 1))
  ------------------
  |  Branch (2854:15): [True: 0, False: 0]
  |  Branch (2854:15): [True: 0, False: 0]
  |  Branch (2854:22): [True: 0, False: 0]
  ------------------
 2855|      0|            wordnum++;
 2856|       |
 2857|       |          // increment syllable num, if last word has a SYLLABLENUM flag
 2858|       |          // and the suffix is beginning `s'
 2859|       |
 2860|      0|          if (!cpdsyllablenum.empty()) {
  ------------------
  |  Branch (2860:15): [True: 0, False: 0]
  ------------------
 2861|      0|            switch (sfxflag) {
  ------------------
  |  Branch (2861:21): [True: 0, False: 0]
  ------------------
 2862|      0|              case 'c': {
  ------------------
  |  Branch (2862:15): [True: 0, False: 0]
  ------------------
 2863|      0|                numsyllable += 2;
 2864|      0|                break;
 2865|      0|              }
 2866|      0|              case 'J': {
  ------------------
  |  Branch (2866:15): [True: 0, False: 0]
  ------------------
 2867|      0|                numsyllable += 1;
 2868|      0|                break;
 2869|      0|              }
 2870|      0|              case 'I': {
  ------------------
  |  Branch (2870:15): [True: 0, False: 0]
  ------------------
 2871|      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 (2871:21): [True: 0, False: 0]
  |  Branch (2871:21): [True: 0, False: 0]
  ------------------
 2872|      0|                  numsyllable += 1;
 2873|      0|                break;
 2874|      0|              }
 2875|      0|            }
 2876|      0|          }
 2877|      0|        }
 2878|       |
 2879|       |        // increment word number, if the second word has a compoundroot flag
 2880|      0|        if ((rv) && (compoundroot) &&
  ------------------
  |  Branch (2880:13): [True: 0, False: 0]
  |  Branch (2880:21): [True: 0, False: 0]
  ------------------
 2881|      0|            (TESTAFF(rv->astr, compoundroot, rv->alen))) {
  ------------------
  |  |  102|      0|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  ------------------
  |  Branch (2881:13): [True: 0, False: 0]
  ------------------
 2882|      0|          wordnum++;
 2883|      0|        }
 2884|       |        // second word is acceptable, as a word with prefix or/and suffix?
 2885|       |        // hungarian conventions: compounding is acceptable,
 2886|       |        // when compound forms consist 2 word, otherwise
 2887|       |        // the syllable number of root words is 6, or lesser.
 2888|      0|        if ((rv) &&
  ------------------
  |  Branch (2888:13): [True: 0, False: 0]
  ------------------
 2889|      0|            (((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
  ------------------
  |  Branch (2889:15): [True: 0, False: 0]
  |  Branch (2889:37): [True: 0, False: 0]
  ------------------
 2890|      0|             ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable))) &&
  ------------------
  |  Branch (2890:15): [True: 0, False: 0]
  |  Branch (2890:40): [True: 0, False: 0]
  ------------------
 2891|      0|            ((!checkcompounddup || (rv != rv_first)))) {
  ------------------
  |  Branch (2891:15): [True: 0, False: 0]
  |  Branch (2891:36): [True: 0, False: 0]
  ------------------
 2892|      0|          std::string m;
 2893|      0|          if (compoundflag)
  ------------------
  |  Branch (2893:15): [True: 0, False: 0]
  ------------------
 2894|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundflag, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2895|      0|          if (m.empty() && compoundend) {
  ------------------
  |  Branch (2895:15): [True: 0, False: 0]
  |  Branch (2895:28): [True: 0, False: 0]
  ------------------
 2896|      0|            m = affix_check_morph(word, i, word.size() - i, scratch, compoundend, IN_CPD_END);
  ------------------
  |  |   77|      0|#define IN_CPD_END 2
  ------------------
 2897|      0|          }
 2898|      0|          result.append(presult);
 2899|      0|          if (!m.empty()) {
  ------------------
  |  Branch (2899:15): [True: 0, False: 0]
  ------------------
 2900|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2901|      0|            result.append(MORPH_PART);
  ------------------
  |  |  112|      0|#define MORPH_PART "pa:"
  ------------------
 2902|      0|            result.append(word, i, word.size());
 2903|      0|            line_uniq_app(m, MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 2904|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 2905|      0|            result.append(m);
 2906|      0|          }
 2907|      0|          result.push_back(MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 2908|      0|          ok = 1;
 2909|      0|        }
 2910|       |
 2911|      0|        numsyllable = oldnumsyllable2;
 2912|      0|        wordnum = oldwordnum2;
 2913|       |
 2914|       |        // perhaps second word is a compound word (recursive call)
 2915|      0|        if ((wordnum + 2 < maxwordnum) && (wnum + 1 < maxwordnum) && (ok == 0)) {
  ------------------
  |  Branch (2915:13): [True: 0, False: 0]
  |  Branch (2915:43): [True: 0, False: 0]
  |  Branch (2915:70): [True: 0, False: 0]
  ------------------
 2916|      0|          compound_check_morph(word.substr(i), wordnum + 1,
 2917|      0|                               numsyllable, maxwordnum, wnum + 1, words, rwords, 0,
 2918|      0|                               result, &presult, scratch);
 2919|      0|        } else {
 2920|      0|          rv = nullptr;
 2921|      0|        }
 2922|      0|      }
 2923|  32.8k|      st[i] = ch;
 2924|  32.8k|      wordnum = oldwordnum;
 2925|  32.8k|      numsyllable = oldnumsyllable;
 2926|       |
 2927|  32.8k|    } while (!defcpdtable.empty() && oldwordnum == 0 &&
  ------------------
  |  Branch (2927:14): [True: 0, False: 32.8k]
  |  Branch (2927:38): [True: 0, False: 0]
  ------------------
 2928|      0|             onlycpdrule++ < 1);  // end of onlycpd loop
  ------------------
  |  Branch (2928:14): [True: 0, False: 0]
  ------------------
 2929|  33.0k|  }
 2930|  2.09k|  return 0;
 2931|  2.34k|}
_ZNK8AffixMgr12circumfix_okEP8PfxEntryP8SfxEntryPK8TraceCtx:
 2947|  47.7k|bool AffixMgr::circumfix_ok(PfxEntry* pfx, SfxEntry* sfx, const TraceCtx* t) const {
 2948|  47.7k|  if (!circumfix)
  ------------------
  |  Branch (2948:7): [True: 47.7k, False: 0]
  ------------------
 2949|  47.7k|    return true;
 2950|      0|  bool in_prefix = pfx && pfx->getCont() &&
  ------------------
  |  Branch (2950:20): [True: 0, False: 0]
  |  Branch (2950:27): [True: 0, False: 0]
  ------------------
 2951|      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]
  |  |  ------------------
  ------------------
 2952|      0|  bool in_suffix = sfx->getCont() &&
  ------------------
  |  Branch (2952:20): [True: 0, False: 0]
  ------------------
 2953|      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]
  |  |  ------------------
  ------------------
 2954|      0|  if (t)
  ------------------
  |  Branch (2954:7): [True: 0, False: 0]
  ------------------
 2955|      0|    trace_circumfix(*t, this, circumfix, pfx, sfx, in_prefix, in_suffix);
 2956|      0|  return in_prefix == in_suffix;
 2957|  47.7k|}
_ZNK8AffixMgr17suffix_applicableEP8PfxEntryP8SfxEntrytcPK8TraceCtx:
 2977|   252k|                                 const TraceCtx* t) const {
 2978|       |  // suffixes are only allowed at the beginning of a compound when they are signed with the
 2979|       |  // compoundpermitflag flag
 2980|   252k|  if (in_compound == IN_CPD_BEGIN &&
  ------------------
  |  |   76|   505k|#define IN_CPD_BEGIN 1
  ------------------
  |  Branch (2980:7): [True: 205k, False: 47.7k]
  ------------------
 2981|   205k|      !(sfx->getCont() && compoundpermitflag &&
  ------------------
  |  Branch (2981:9): [True: 205k, False: 0]
  |  Branch (2981:27): [True: 0, False: 205k]
  ------------------
 2982|   205k|        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]
  |  |  ------------------
  ------------------
 2983|   205k|    if (t)
  ------------------
  |  Branch (2983:9): [True: 0, False: 205k]
  ------------------
 2984|      0|      trace_test(*t, "compoundpermit", this, compoundpermitflag, "sfx-cont",
 2985|      0|                 sfx->getCont(), sfx->getContLen(),
 2986|      0|                 "fail, a suffix at the start of a compound needs this flag");
 2987|   205k|    return false;
 2988|   205k|  }
 2989|       |
 2990|  47.7k|  if (!circumfix_ok(pfx, sfx, t))
  ------------------
  |  Branch (2990:7): [True: 0, False: 47.7k]
  ------------------
 2991|      0|    return false;
 2992|       |
 2993|       |  // a fogemorpheme is only allowed inside a compound
 2994|  47.7k|  if (!in_compound && sfx->getCont() &&
  ------------------
  |  Branch (2994:7): [True: 47.7k, False: 0]
  |  Branch (2994:23): [True: 14.9k, False: 32.8k]
  ------------------
 2995|  14.9k|      TESTAFF(sfx->getCont(), onlyincompound, sfx->getContLen())) {
  ------------------
  |  |  102|  14.9k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 14.9k]
  |  |  ------------------
  ------------------
 2996|      0|    if (t)
  ------------------
  |  Branch (2996:9): [True: 0, False: 0]
  ------------------
 2997|      0|      trace_test(*t, "onlyincompound", this, onlyincompound, "sfx-cont",
 2998|      0|                 sfx->getCont(), sfx->getContLen(),
 2999|      0|                 "fail, this suffix is only allowed inside a compound");
 3000|      0|    return false;
 3001|      0|  }
 3002|       |
 3003|       |  // a needaffix suffix needs a further affix, so it is allowed either as a second suffix or
 3004|       |  // when a prefix is present that does not itself need one
 3005|  47.7k|  if (!cclass && sfx->getCont() &&
  ------------------
  |  Branch (3005:7): [True: 47.5k, False: 215]
  |  Branch (3005:18): [True: 14.8k, False: 32.7k]
  ------------------
 3006|  14.8k|      TESTAFF(sfx->getCont(), needaffix, sfx->getContLen()) &&
  ------------------
  |  |  102|  62.5k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 14.8k]
  |  |  ------------------
  ------------------
 3007|      0|      !(pfx && !(pfx->getCont() &&
  ------------------
  |  Branch (3007:9): [True: 0, False: 0]
  |  Branch (3007:18): [True: 0, False: 0]
  ------------------
 3008|      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]
  |  |  ------------------
  ------------------
 3009|      0|    if (t)
  ------------------
  |  Branch (3009:9): [True: 0, False: 0]
  ------------------
 3010|      0|      trace_test(*t, "needaffix", this, needaffix, "sfx-cont", sfx->getCont(),
 3011|      0|                 sfx->getContLen(),
 3012|      0|                 "fail, this suffix needs a further affix and has none");
 3013|      0|    return false;
 3014|      0|  }
 3015|       |
 3016|  47.7k|  return true;
 3017|  47.7k|}
_ZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmiP8PfxEntryR12AffixScratchttct:
 3029|   648M|                                      const FLAG avoidflag) {
 3030|   648M|  struct hentry* rv = nullptr;
 3031|       |
 3032|   648M|  TraceCtx* t = trace_on(scratch.trace);
 3033|   648M|  int candidates = 0;
 3034|       |  // a pass that had nothing to try says so, which is different from a pass that
 3035|       |  // did not run
 3036|   648M|  auto report_empty_pass = [t, &word, start, len, sfxopts, &candidates]() {
 3037|   648M|    if (t && candidates == 0)
 3038|   648M|      trace(*t, "sfx \"%s\" candidates=0%s", word.substr(start, len).c_str(),
 3039|   648M|            (sfxopts & aeXPRODUCT) != 0 ? " xprod=Y" : "");
 3040|   648M|  };
 3041|       |  // a rule the suffix conditions turned away never reaches checkword, so name
 3042|       |  // the rule here and run the conditions again to say which of them refused it
 3043|   648M|  auto report_refused = [this, t, ppfx, cclass, in_compound,
 3044|   648M|                         &candidates](SfxEntry* se) {
 3045|   648M|    if (!t)
 3046|   648M|      return;
 3047|   648M|    ++candidates;
 3048|   648M|    trace_affix(*t, "sfx", this, *se);
 3049|   648M|    TraceScope trace_depth(t);
 3050|   648M|    (void)suffix_applicable(ppfx, se, cclass, in_compound, t);
 3051|   648M|  };
 3052|       |
 3053|       |  // first handle the special case of 0 length suffixes
 3054|   648M|  SfxEntry* se = sStart[0];
 3055|       |
 3056|   648M|  while (se) {
  ------------------
  |  Branch (3056:10): [True: 0, False: 648M]
  ------------------
 3057|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (3057:9): [True: 0, False: 0]
  |  Branch (3057:20): [True: 0, False: 0]
  ------------------
 3058|      0|      if (suffix_applicable(ppfx, se, cclass, in_compound, nullptr)) {
  ------------------
  |  Branch (3058:11): [True: 0, False: 0]
  ------------------
 3059|      0|        ++candidates;
 3060|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx,
 3061|      0|                           (FLAG)cclass, needflag,
 3062|      0|                           (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (3062:29): [True: 0, False: 0]
  ------------------
 3063|      0|                           scratch);
 3064|       |        // Skip a stem with the avoid flag and keep scanning the other suffixes.
 3065|      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 (3065:13): [True: 0, False: 0]
  |  Branch (3065:19): [True: 0, False: 0]
  ------------------
 3066|      0|          trace_avoidflag(t, avoidflag, rv);
 3067|      0|          rv = nullptr;
 3068|      0|        }
 3069|      0|        if (rv) {
  ------------------
  |  Branch (3069:13): [True: 0, False: 0]
  ------------------
 3070|      0|          sfx = se;  // BUG: sfx not stateless
 3071|      0|          return rv;
 3072|      0|        }
 3073|      0|      } else {
 3074|      0|        report_refused(se);
 3075|      0|      }
 3076|      0|    }
 3077|      0|    se = se->getNext();
 3078|      0|  }
 3079|       |
 3080|       |  // now handle the general case
 3081|   648M|  if (len == 0) {
  ------------------
  |  Branch (3081:7): [True: 47.9k, False: 648M]
  ------------------
 3082|  47.9k|    report_empty_pass();
 3083|  47.9k|    return nullptr;  // FULLSTRIP
 3084|  47.9k|  }
 3085|   648M|  unsigned char sp = word[start + len - 1];
 3086|   648M|  SfxEntry* sptr = sStart[sp];
 3087|       |
 3088|   648M|  while (sptr) {
  ------------------
  |  Branch (3088:10): [True: 279k, False: 648M]
  ------------------
 3089|   279k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3089:9): [True: 252k, False: 26.6k]
  ------------------
 3090|   252k|      if (!suffix_applicable(ppfx, sptr, cclass, in_compound, nullptr))
  ------------------
  |  Branch (3090:11): [True: 205k, False: 47.7k]
  ------------------
 3091|   205k|        report_refused(sptr);
 3092|  47.7k|      else if (in_compound != IN_CPD_END || ppfx ||
  ------------------
  |  |   77|  95.5k|#define IN_CPD_END 2
  ------------------
  |  Branch (3092:16): [True: 47.7k, False: 0]
  |  Branch (3092:45): [True: 0, False: 0]
  ------------------
 3093|      0|               !(sptr->getCont() &&
  ------------------
  |  Branch (3093:18): [True: 0, False: 0]
  ------------------
 3094|  47.7k|                 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]
  |  |  ------------------
  ------------------
 3095|  47.7k|        ++candidates;
 3096|  47.7k|        rv = sptr->checkword(word, start, len, sfxopts, ppfx,
 3097|  47.7k|                             cclass, needflag,
 3098|  47.7k|                             (in_compound ? 0 : onlyincompound),
  ------------------
  |  Branch (3098:31): [True: 0, False: 47.7k]
  ------------------
 3099|  47.7k|                             scratch);
 3100|  47.7k|        if (rv && avoidflag != FLAG_NULL && TESTAFF(rv->astr, avoidflag, rv->alen)) {
  ------------------
  |  |   99|  47.7k|#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 (3100:13): [True: 0, False: 47.7k]
  |  Branch (3100:19): [True: 0, False: 0]
  ------------------
 3101|      0|          trace_avoidflag(t, avoidflag, rv);
 3102|      0|          rv = nullptr;
 3103|      0|        }
 3104|  47.7k|        if (rv) {
  ------------------
  |  Branch (3104:13): [True: 0, False: 47.7k]
  ------------------
 3105|      0|          sfx = sptr;                 // BUG: sfx not stateless
 3106|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 3107|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (3107:15): [True: 0, False: 0]
  ------------------
 3108|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 3109|       |          // LANG_hu section: spec. Hungarian rule
 3110|      0|          else if (langnum == LANG_hu && sptr->getKeyLen() &&
  ------------------
  |  Branch (3110:20): [True: 0, False: 0]
  |  Branch (3110:42): [True: 0, False: 0]
  ------------------
 3111|      0|                   sptr->getKey()[0] == 'i' && sptr->getKey()[1] != 'y' &&
  ------------------
  |  Branch (3111:20): [True: 0, False: 0]
  |  Branch (3111:48): [True: 0, False: 0]
  ------------------
 3112|      0|                   sptr->getKey()[1] != 't') {
  ------------------
  |  Branch (3112:20): [True: 0, False: 0]
  ------------------
 3113|      0|            sfxextra = 1;
 3114|      0|          }
 3115|       |          // END of LANG_hu section
 3116|      0|          return rv;
 3117|      0|        }
 3118|  47.7k|      }
 3119|   252k|      sptr = sptr->getNextEQ();
 3120|   252k|    } else {
 3121|  26.6k|      sptr = sptr->getNextNE();
 3122|  26.6k|    }
 3123|   279k|  }
 3124|       |
 3125|   648M|  report_empty_pass();
 3126|       |
 3127|   648M|  return nullptr;
 3128|   648M|}
_ZN8AffixMgr19suffix_check_twosfxERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmiP8PfxEntryR12AffixScratcht:
 3137|  19.2M|                                             const FLAG needflag) {
 3138|  19.2M|  struct hentry* rv = nullptr;
 3139|       |
 3140|       |  // first handle the special case of 0 length suffixes
 3141|  19.2M|  SfxEntry* se = sStart[0];
 3142|  19.2M|  while (se) {
  ------------------
  |  Branch (3142:10): [True: 0, False: 19.2M]
  ------------------
 3143|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (3143:9): [True: 0, False: 0]
  ------------------
 3144|      0|      rv = se->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 3145|      0|      if (rv)
  ------------------
  |  Branch (3145:11): [True: 0, False: 0]
  ------------------
 3146|      0|        return rv;
 3147|      0|    }
 3148|      0|    se = se->getNext();
 3149|      0|  }
 3150|       |
 3151|       |  // now handle the general case
 3152|  19.2M|  if (len == 0)
  ------------------
  |  Branch (3152:7): [True: 14.9k, False: 19.2M]
  ------------------
 3153|  14.9k|    return nullptr;  // FULLSTRIP
 3154|  19.2M|  unsigned char sp = word[start + len - 1];
 3155|  19.2M|  SfxEntry* sptr = sStart[sp];
 3156|       |
 3157|  19.3M|  while (sptr) {
  ------------------
  |  Branch (3157:10): [True: 62.2k, False: 19.2M]
  ------------------
 3158|  62.2k|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3158:9): [True: 42.2k, False: 19.9k]
  ------------------
 3159|  42.2k|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (3159:11): [True: 27.4k, False: 14.8k]
  ------------------
 3160|  27.4k|        rv = sptr->check_twosfx(word, start, len, sfxopts, ppfx, needflag, scratch);
 3161|  27.4k|        if (rv) {
  ------------------
  |  Branch (3161:13): [True: 0, False: 27.4k]
  ------------------
 3162|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 3163|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (3163:15): [True: 0, False: 0]
  ------------------
 3164|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 3165|      0|          return rv;
 3166|      0|        }
 3167|  27.4k|      }
 3168|  42.2k|      sptr = sptr->getNextEQ();
 3169|  42.2k|    } else {
 3170|  19.9k|      sptr = sptr->getNextNE();
 3171|  19.9k|    }
 3172|  62.2k|  }
 3173|       |
 3174|  19.2M|  return nullptr;
 3175|  19.2M|}
_ZN8AffixMgr25suffix_check_twosfx_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmiP8PfxEntryR12AffixScratcht:
 3184|  4.44k|                                                const FLAG needflag) {
 3185|  4.44k|  std::string result2;
 3186|  4.44k|  std::string result3;
 3187|       |  // the second suffix runs the whole suffix table again for every first suffix
 3188|  4.44k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  118|  4.44k|#define MSEP_REC '\n'
  ------------------
 3189|       |
 3190|       |  // first handle the special case of 0 length suffixes
 3191|  4.44k|  SfxEntry* se = sStart[0];
 3192|  4.44k|  while (se) {
  ------------------
  |  Branch (3192:10): [True: 0, False: 4.44k]
  ------------------
 3193|      0|    if (contclasses[se->getFlag()]) {
  ------------------
  |  Branch (3193:9): [True: 0, False: 0]
  ------------------
 3194|      0|      std::string st = se->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 3195|      0|      if (!st.empty()) {
  ------------------
  |  Branch (3195:11): [True: 0, False: 0]
  ------------------
 3196|      0|        std::string analysis;
 3197|      0|        if (ppfx) {
  ------------------
  |  Branch (3197:13): [True: 0, False: 0]
  ------------------
 3198|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3198:15): [True: 0, False: 0]
  ------------------
 3199|      0|            analysis.append(ppfx->getMorph());
 3200|      0|            analysis.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 3201|      0|          } else
 3202|      0|            debugflag(analysis, ppfx->getFlag());
 3203|      0|        }
 3204|      0|        analysis.append(st);
 3205|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (3205:13): [True: 0, False: 0]
  ------------------
 3206|      0|          analysis.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 3207|      0|          analysis.append(se->getMorph());
 3208|      0|        } else
 3209|      0|          debugflag(analysis, se->getFlag());
 3210|      0|        result.append(analysis);
 3211|      0|      }
 3212|      0|    }
 3213|      0|    se = se->getNext();
 3214|      0|  }
 3215|       |
 3216|       |  // now handle the general case
 3217|  4.44k|  if (len == 0)
  ------------------
  |  Branch (3217:7): [True: 0, False: 4.44k]
  ------------------
 3218|      0|    return { };  // FULLSTRIP
 3219|  4.44k|  unsigned char sp = word[start + len - 1];
 3220|  4.44k|  SfxEntry* sptr = sStart[sp];
 3221|       |
 3222|  4.44k|  while (sptr) {
  ------------------
  |  Branch (3222:10): [True: 0, False: 4.44k]
  ------------------
 3223|      0|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3223:9): [True: 0, False: 0]
  ------------------
 3224|      0|      if (contclasses[sptr->getFlag()]) {
  ------------------
  |  Branch (3224:11): [True: 0, False: 0]
  ------------------
 3225|      0|        std::string st = sptr->check_twosfx_morph(word, start, len, sfxopts, ppfx, needflag, scratch);
 3226|      0|        if (!st.empty()) {
  ------------------
  |  Branch (3226:13): [True: 0, False: 0]
  ------------------
 3227|      0|          sfxflag = sptr->getFlag();  // BUG: sfxflag not stateless
 3228|      0|          if (!sptr->getCont())
  ------------------
  |  Branch (3228:15): [True: 0, False: 0]
  ------------------
 3229|      0|            sfxappnd = sptr->getKey();  // BUG: sfxappnd not stateless
 3230|      0|          result2.assign(st);
 3231|       |
 3232|      0|          result3.clear();
 3233|       |
 3234|      0|          if (sptr->getMorph()) {
  ------------------
  |  Branch (3234:15): [True: 0, False: 0]
  ------------------
 3235|      0|            result3.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 3236|      0|            result3.append(sptr->getMorph());
 3237|      0|          } else
 3238|      0|            debugflag(result3, sptr->getFlag());
 3239|      0|          strlinecat(result2, result3);
 3240|      0|          result.append(result2);
 3241|      0|        }
 3242|      0|      }
 3243|      0|      sptr = sptr->getNextEQ();
 3244|      0|    } else {
 3245|      0|      sptr = sptr->getNextNE();
 3246|      0|    }
 3247|      0|  }
 3248|       |
 3249|  4.44k|  return result.join();
 3250|  4.44k|}
_ZN8AffixMgr18suffix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmiP8PfxEntryR12AffixScratchttc:
 3260|  14.1k|                                         char in_compound) {
 3261|  14.1k|  std::string result;
 3262|       |
 3263|  14.1k|  struct hentry* rv = nullptr;
 3264|       |
 3265|       |  // first handle the special case of 0 length suffixes
 3266|  14.1k|  SfxEntry* se = sStart[0];
 3267|  14.1k|  while (se) {
  ------------------
  |  Branch (3267:10): [True: 0, False: 14.1k]
  ------------------
 3268|      0|    if (!cclass || se->getCont()) {
  ------------------
  |  Branch (3268:9): [True: 0, False: 0]
  |  Branch (3268:20): [True: 0, False: 0]
  ------------------
 3269|      0|      if (suffix_applicable(ppfx, se, cclass, in_compound, nullptr))
  ------------------
  |  Branch (3269:11): [True: 0, False: 0]
  ------------------
 3270|      0|        rv = se->checkword(word, start, len, sfxopts, ppfx, cclass,
 3271|      0|                           needflag, FLAG_NULL, scratch);
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
 3272|      0|      while (rv) {
  ------------------
  |  Branch (3272:14): [True: 0, False: 0]
  ------------------
 3273|      0|        if (ppfx) {
  ------------------
  |  Branch (3273:13): [True: 0, False: 0]
  ------------------
 3274|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3274:15): [True: 0, False: 0]
  ------------------
 3275|      0|            result.append(ppfx->getMorph());
 3276|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 3277|      0|          } else
 3278|      0|            debugflag(result, ppfx->getFlag());
 3279|      0|        }
 3280|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3280:13): [True: 0, False: 0]
  |  Branch (3280:32): [True: 0, False: 0]
  ------------------
 3281|      0|          result.append(HENTRY_DATA2(rv));
 3282|      0|        append_morph_stem(result, rv, complexprefixes);
 3283|       |
 3284|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3284:13): [True: 0, False: 0]
  |  Branch (3284:33): [True: 0, False: 0]
  ------------------
 3285|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 3286|      0|          result.append(HENTRY_DATA2(rv));
 3287|      0|        }
 3288|      0|        if (se->getMorph()) {
  ------------------
  |  Branch (3288:13): [True: 0, False: 0]
  ------------------
 3289|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 3290|      0|          result.append(se->getMorph());
 3291|      0|        } else
 3292|      0|          debugflag(result, se->getFlag());
 3293|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 3294|      0|        rv = se->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3295|      0|      }
 3296|      0|    }
 3297|      0|    se = se->getNext();
 3298|      0|  }
 3299|       |
 3300|       |  // now handle the general case
 3301|  14.1k|  if (len == 0)
  ------------------
  |  Branch (3301:7): [True: 0, False: 14.1k]
  ------------------
 3302|      0|    return { };  // FULLSTRIP
 3303|  14.1k|  unsigned char sp = word[start + len - 1];
 3304|  14.1k|  SfxEntry* sptr = sStart[sp];
 3305|       |
 3306|  14.1k|  while (sptr) {
  ------------------
  |  Branch (3306:10): [True: 0, False: 14.1k]
  ------------------
 3307|      0|    if (isRevSubset(sptr->getKey(), word.c_str() + start + len - 1, len)) {
  ------------------
  |  Branch (3307:9): [True: 0, False: 0]
  ------------------
 3308|      0|      if (suffix_applicable(ppfx, sptr, cclass, in_compound, nullptr))
  ------------------
  |  Branch (3308:11): [True: 0, False: 0]
  ------------------
 3309|      0|        rv = sptr->checkword(word, start, len, sfxopts, ppfx, cclass,
 3310|      0|                             needflag, FLAG_NULL, scratch);
  ------------------
  |  |   99|      0|#define FLAG_NULL 0x00
  ------------------
 3311|      0|      while (rv) {
  ------------------
  |  Branch (3311:14): [True: 0, False: 0]
  ------------------
 3312|      0|        if (ppfx) {
  ------------------
  |  Branch (3312:13): [True: 0, False: 0]
  ------------------
 3313|      0|          if (ppfx->getMorph()) {
  ------------------
  |  Branch (3313:15): [True: 0, False: 0]
  ------------------
 3314|      0|            result.append(ppfx->getMorph());
 3315|      0|            result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 3316|      0|          } else
 3317|      0|            debugflag(result, ppfx->getFlag());
 3318|      0|        }
 3319|      0|        if (complexprefixes && HENTRY_DATA(rv))
  ------------------
  |  Branch (3319:13): [True: 0, False: 0]
  |  Branch (3319:32): [True: 0, False: 0]
  ------------------
 3320|      0|          result.append(HENTRY_DATA2(rv));
 3321|      0|        append_morph_stem(result, rv, complexprefixes);
 3322|       |
 3323|      0|        if (!complexprefixes && HENTRY_DATA(rv)) {
  ------------------
  |  Branch (3323:13): [True: 0, False: 0]
  |  Branch (3323:33): [True: 0, False: 0]
  ------------------
 3324|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 3325|      0|          result.append(HENTRY_DATA2(rv));
 3326|      0|        }
 3327|       |
 3328|      0|        if (sptr->getMorph()) {
  ------------------
  |  Branch (3328:13): [True: 0, False: 0]
  ------------------
 3329|      0|          result.push_back(MSEP_FLD);
  ------------------
  |  |  117|      0|#define MSEP_FLD ' '
  ------------------
 3330|      0|          result.append(sptr->getMorph());
 3331|      0|        } else
 3332|      0|          debugflag(result, sptr->getFlag());
 3333|      0|        result.push_back(MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 3334|      0|        rv = sptr->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag);
 3335|      0|      }
 3336|      0|      sptr = sptr->getNextEQ();
 3337|      0|    } else {
 3338|      0|      sptr = sptr->getNextNE();
 3339|      0|    }
 3340|      0|  }
 3341|       |
 3342|  14.1k|  return result;
 3343|  14.1k|}
_ZN8AffixMgr11affix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmR12AffixScratchtctPP8PfxEntryPP8SfxEntry:
 3378|  21.3M|                                     SfxEntry** found_sfx) {
 3379|       |
 3380|  21.3M|  TraceCtx* t = trace_on(scratch.trace);
 3381|       |  // the affixes that built the word are reported before the members holding them are cleared
 3382|  21.3M|  auto report_form = [this, t, &word, start, len, found_pfx, found_sfx](const struct hentry* rv) {
 3383|  21.3M|    if (!rv)
 3384|  21.3M|      return;
 3385|  21.3M|    if (t)
 3386|  21.3M|      trace_form(*t, this, word.substr(start, len), rv->word, pfx, sfx);
 3387|  21.3M|    if (found_pfx)
 3388|  21.3M|      *found_pfx = pfx;
 3389|  21.3M|    if (found_sfx)
 3390|  21.3M|      *found_sfx = sfx;
 3391|  21.3M|  };
 3392|       |
 3393|       |  // check all prefixes (also crossed with suffixes if allowed)
 3394|  21.3M|  struct hentry* rv = prefix_check(word, start, len, in_compound, scratch, needflag, avoidflag);
 3395|  21.3M|  if (rv) {
  ------------------
  |  Branch (3395:7): [True: 0, False: 21.3M]
  ------------------
 3396|      0|    report_form(rv);
 3397|      0|    return rv;
 3398|      0|  }
 3399|       |
 3400|       |  // if still not found check all suffixes
 3401|  21.3M|  rv = suffix_check(word, start, len, 0, nullptr, scratch, FLAG_NULL, needflag, in_compound, avoidflag);
  ------------------
  |  |   99|  21.3M|#define FLAG_NULL 0x00
  ------------------
 3402|       |
 3403|  21.3M|  if (havecontclass) {
  ------------------
  |  Branch (3403:7): [True: 7.03M, False: 14.3M]
  ------------------
 3404|  7.03M|    if (rv)
  ------------------
  |  Branch (3404:9): [True: 0, False: 7.03M]
  ------------------
 3405|      0|      report_form(rv);
 3406|       |
 3407|  7.03M|    sfx = nullptr;
 3408|  7.03M|    pfx = nullptr;
 3409|       |
 3410|  7.03M|    if (rv)
  ------------------
  |  Branch (3410:9): [True: 0, False: 7.03M]
  ------------------
 3411|      0|      return rv;
 3412|       |    // if still not found check all two-level suffixes
 3413|  7.03M|    rv = suffix_check_twosfx(word, start, len, 0, nullptr, scratch, needflag);
 3414|       |
 3415|  7.03M|    if (rv) {
  ------------------
  |  Branch (3415:9): [True: 0, False: 7.03M]
  ------------------
 3416|      0|      report_form(rv);
 3417|      0|      return rv;
 3418|      0|    }
 3419|       |    // if still not found check all two-level suffixes
 3420|  7.03M|    rv = prefix_check_twosfx(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   75|  7.03M|#define IN_CPD_NOT 0
  ------------------
 3421|  7.03M|  }
 3422|       |
 3423|  21.3M|  report_form(rv);
 3424|       |
 3425|  21.3M|  return rv;
 3426|  21.3M|}
_ZN8AffixMgr17affix_check_morphERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmR12AffixScratchtc:
 3434|  14.1k|                                  char in_compound) {
 3435|       |  // the four checks below overlap
 3436|  14.1k|  DistinctRecords result(MSEP_REC);
  ------------------
  |  |  118|  14.1k|#define MSEP_REC '\n'
  ------------------
 3437|       |
 3438|       |  // check all prefixes (also crossed with suffixes if allowed)
 3439|  14.1k|  std::string st = prefix_check_morph(word, start, len, in_compound, scratch);
 3440|  14.1k|  if (!st.empty()) {
  ------------------
  |  Branch (3440:7): [True: 0, False: 14.1k]
  ------------------
 3441|      0|    result.append(st);
 3442|      0|  }
 3443|       |
 3444|       |  // if still not found check all suffixes
 3445|  14.1k|  st = suffix_check_morph(word, start, len, 0, nullptr, scratch, '\0', needflag, in_compound);
 3446|  14.1k|  if (!st.empty()) {
  ------------------
  |  Branch (3446:7): [True: 0, False: 14.1k]
  ------------------
 3447|      0|    result.append(st);
 3448|      0|  }
 3449|       |
 3450|  14.1k|  if (havecontclass) {
  ------------------
  |  Branch (3450:7): [True: 4.44k, False: 9.74k]
  ------------------
 3451|  4.44k|    sfx = nullptr;
 3452|  4.44k|    pfx = nullptr;
 3453|       |    // if still not found check all two-level suffixes
 3454|  4.44k|    st = suffix_check_twosfx_morph(word, start, len, 0, nullptr, scratch, needflag);
 3455|  4.44k|    if (!st.empty()) {
  ------------------
  |  Branch (3455:9): [True: 0, False: 4.44k]
  ------------------
 3456|      0|      result.append(st);
 3457|      0|    }
 3458|       |
 3459|       |    // if still not found check all two-level suffixes
 3460|  4.44k|    st = prefix_check_twosfx_morph(word, start, len, IN_CPD_NOT, scratch, needflag);
  ------------------
  |  |   75|  4.44k|#define IN_CPD_NOT 0
  ------------------
 3461|  4.44k|    if (!st.empty()) {
  ------------------
  |  Branch (3461:9): [True: 0, False: 4.44k]
  ------------------
 3462|      0|      result.append(st);
 3463|      0|    }
 3464|  4.44k|  }
 3465|       |
 3466|  14.1k|  return result.join();
 3467|  14.1k|}
_ZN8AffixMgr15expand_rootwordEP9guesswordiPKciPKttS3_mS3_:
 3663|   856k|                              const char* phon) {
 3664|   856k|  int nh = 0;
 3665|       |  // first add root word to list
 3666|   856k|  if ((nh < maxn) &&
  ------------------
  |  Branch (3666:7): [True: 856k, False: 0]
  ------------------
 3667|   856k|      !(al && ((needaffix && TESTAFF(ap, needaffix, al)) ||
  ------------------
  |  |  102|  4.77k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 2.38k, False: 2.38k]
  |  |  ------------------
  ------------------
  |  Branch (3667:9): [True: 99.5k, False: 756k]
  |  Branch (3667:17): [True: 4.77k, False: 94.7k]
  ------------------
 3668|   853k|               (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 (3668:17): [True: 0, False: 97.1k]
  ------------------
 3669|   853k|    wlst[nh].word = mystrdup(ts);
 3670|   853k|    wlst[nh].allow = false;
 3671|   853k|    wlst[nh].orig = nullptr;
 3672|   853k|    nh++;
 3673|       |    // add special phonetic version
 3674|   853k|    if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3674:9): [True: 920, False: 853k]
  |  Branch (3674:17): [True: 920, False: 0]
  ------------------
 3675|    920|      wlst[nh].word = mystrdup(phon);
 3676|    920|      wlst[nh].allow = false;
 3677|    920|      wlst[nh].orig = mystrdup(ts);
 3678|    920|      nh++;
 3679|    920|    }
 3680|   853k|  }
 3681|       |
 3682|       |  // handle suffixes
 3683|   968k|  for (int i = 0; i < al; i++) {
  ------------------
  |  Branch (3683:19): [True: 112k, False: 856k]
  ------------------
 3684|   112k|    const auto c = (unsigned char)(ap[i] & 0x00FF);
 3685|   112k|    SfxEntry* sptr = sFlag[c];
 3686|   178k|    while (sptr) {
  ------------------
  |  Branch (3686:12): [True: 66.3k, False: 112k]
  ------------------
 3687|  66.3k|      if ((sptr->getFlag() == ap[i]) &&
  ------------------
  |  Branch (3687:11): [True: 66.3k, False: 0]
  ------------------
 3688|  66.3k|          (!sptr->getKeyLen() ||
  ------------------
  |  Branch (3688:12): [True: 0, False: 66.3k]
  ------------------
 3689|  66.3k|           ((badl > sptr->getKeyLen()) &&
  ------------------
  |  Branch (3689:13): [True: 36.8k, False: 29.5k]
  ------------------
 3690|  36.8k|            (strcmp(sptr->getAffix(), bad + badl - sptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3690:13): [True: 31, False: 36.8k]
  ------------------
 3691|       |          // check needaffix flag
 3692|     31|          !(sptr->getCont() &&
  ------------------
  |  Branch (3692:13): [True: 11, False: 20]
  ------------------
 3693|     11|            ((needaffix &&
  ------------------
  |  Branch (3693:15): [True: 7, False: 4]
  ------------------
 3694|      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]
  |  |  ------------------
  ------------------
 3695|     11|             (circumfix &&
  ------------------
  |  Branch (3695:15): [True: 0, False: 11]
  ------------------
 3696|      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]
  |  |  ------------------
  ------------------
 3697|     11|             (onlyincompound &&
  ------------------
  |  Branch (3697:15): [True: 0, False: 11]
  ------------------
 3698|     31|              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]
  |  |  ------------------
  ------------------
 3699|     31|        std::string newword = sptr->add(ts, wl);
 3700|     31|        if (!newword.empty()) {
  ------------------
  |  Branch (3700:13): [True: 31, False: 0]
  ------------------
 3701|     31|          if (nh < maxn) {
  ------------------
  |  Branch (3701:15): [True: 31, False: 0]
  ------------------
 3702|     31|            wlst[nh].word = mystrdup(newword.c_str());
 3703|     31|            wlst[nh].allow = sptr->allowCross();
 3704|     31|            wlst[nh].orig = nullptr;
 3705|     31|            nh++;
 3706|       |            // add special phonetic version
 3707|     31|            if (phon && (nh < maxn)) {
  ------------------
  |  Branch (3707:17): [True: 0, False: 31]
  |  Branch (3707:25): [True: 0, False: 0]
  ------------------
 3708|      0|              std::string prefix(phon);
 3709|      0|              std::string key(sptr->getKey());
 3710|      0|              reverseword(key);
 3711|      0|              prefix.append(key);
 3712|      0|              wlst[nh].word = mystrdup(prefix.c_str());
 3713|      0|              wlst[nh].allow = false;
 3714|      0|              wlst[nh].orig = mystrdup(newword.c_str());
 3715|      0|              nh++;
 3716|      0|            }
 3717|     31|          }
 3718|     31|        }
 3719|     31|      }
 3720|  66.3k|      sptr = sptr->getFlgNxt();
 3721|  66.3k|    }
 3722|   112k|  }
 3723|       |
 3724|   856k|  int n = nh;
 3725|       |
 3726|       |  // handle cross products of prefixes and suffixes
 3727|   857k|  for (int j = 1; j < n; j++)
  ------------------
  |  Branch (3727:19): [True: 944, False: 856k]
  ------------------
 3728|    944|    if (wlst[j].allow) {
  ------------------
  |  Branch (3728:9): [True: 24, False: 920]
  ------------------
 3729|     72|      for (int k = 0; k < al; k++) {
  ------------------
  |  Branch (3729:23): [True: 48, False: 24]
  ------------------
 3730|     48|        const auto c = (unsigned char)(ap[k] & 0x00FF);
 3731|     48|        PfxEntry* cptr = pFlag[c];
 3732|     48|        while (cptr) {
  ------------------
  |  Branch (3732:16): [True: 0, False: 48]
  ------------------
 3733|      0|          if ((cptr->getFlag() == ap[k]) && cptr->allowCross() &&
  ------------------
  |  Branch (3733:15): [True: 0, False: 0]
  |  Branch (3733:45): [True: 0, False: 0]
  ------------------
 3734|      0|              (!cptr->getKeyLen() ||
  ------------------
  |  Branch (3734:16): [True: 0, False: 0]
  ------------------
 3735|      0|               ((badl > cptr->getKeyLen()) &&
  ------------------
  |  Branch (3735:17): [True: 0, False: 0]
  ------------------
 3736|      0|                (strncmp(cptr->getKey(), bad, cptr->getKeyLen()) == 0)))) {
  ------------------
  |  Branch (3736:17): [True: 0, False: 0]
  ------------------
 3737|      0|            size_t l1 = strlen(wlst[j].word);
 3738|      0|            std::string newword = cptr->add(wlst[j].word, l1);
 3739|      0|            if (!newword.empty()) {
  ------------------
  |  Branch (3739:17): [True: 0, False: 0]
  ------------------
 3740|      0|              if (nh < maxn) {
  ------------------
  |  Branch (3740:19): [True: 0, False: 0]
  ------------------
 3741|      0|                wlst[nh].word = mystrdup(newword.c_str());
 3742|      0|                wlst[nh].allow = cptr->allowCross();
 3743|      0|                wlst[nh].orig = nullptr;
 3744|      0|                nh++;
 3745|      0|              }
 3746|      0|            }
 3747|      0|          }
 3748|      0|          cptr = cptr->getFlgNxt();
 3749|      0|        }
 3750|     48|      }
 3751|     24|    }
 3752|       |
 3753|       |  // now handle pure prefixes
 3754|   968k|  for (int m = 0; m < al; m++) {
  ------------------
  |  Branch (3754:19): [True: 112k, False: 856k]
  ------------------
 3755|   112k|    const auto c = (unsigned char)(ap[m] & 0x00FF);
 3756|   112k|    PfxEntry* ptr = pFlag[c];
 3757|   113k|    while (ptr) {
  ------------------
  |  Branch (3757:12): [True: 924, False: 112k]
  ------------------
 3758|    924|      if ((ptr->getFlag() == ap[m]) &&
  ------------------
  |  Branch (3758:11): [True: 924, False: 0]
  ------------------
 3759|    924|          (!ptr->getKeyLen() ||
  ------------------
  |  Branch (3759:12): [True: 0, False: 924]
  ------------------
 3760|    924|           ((badl > ptr->getKeyLen()) &&
  ------------------
  |  Branch (3760:13): [True: 924, False: 0]
  ------------------
 3761|    924|            (strncmp(ptr->getKey(), bad, ptr->getKeyLen()) == 0))) &&
  ------------------
  |  Branch (3761:13): [True: 5, False: 919]
  ------------------
 3762|       |          // check needaffix flag
 3763|      5|          !(ptr->getCont() &&
  ------------------
  |  Branch (3763:13): [True: 0, False: 5]
  ------------------
 3764|      0|            ((needaffix &&
  ------------------
  |  Branch (3764:15): [True: 0, False: 0]
  ------------------
 3765|      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]
  |  |  ------------------
  ------------------
 3766|      0|             (circumfix &&
  ------------------
  |  Branch (3766:15): [True: 0, False: 0]
  ------------------
 3767|      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]
  |  |  ------------------
  ------------------
 3768|      0|             (onlyincompound &&
  ------------------
  |  Branch (3768:15): [True: 0, False: 0]
  ------------------
 3769|      5|              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]
  |  |  ------------------
  ------------------
 3770|      5|        std::string newword = ptr->add(ts, wl);
 3771|      5|        if (!newword.empty()) {
  ------------------
  |  Branch (3771:13): [True: 5, False: 0]
  ------------------
 3772|      5|          if (nh < maxn) {
  ------------------
  |  Branch (3772:15): [True: 5, False: 0]
  ------------------
 3773|      5|            wlst[nh].word = mystrdup(newword.c_str());
 3774|      5|            wlst[nh].allow = ptr->allowCross();
 3775|      5|            wlst[nh].orig = nullptr;
 3776|      5|            nh++;
 3777|      5|          }
 3778|      5|        }
 3779|      5|      }
 3780|    924|      ptr = ptr->getFlgNxt();
 3781|    924|    }
 3782|   112k|  }
 3783|       |
 3784|   856k|  return nh;
 3785|   856k|}
_ZNK8AffixMgr12get_reptableEv:
 3788|   413k|const std::vector<replentry>& AffixMgr::get_reptable() const {
 3789|   413k|  return pHMgr->get_reptable();
 3790|   413k|}
_ZNK8AffixMgr14get_iconvtableEv:
 3793|  19.0M|RepList* AffixMgr::get_iconvtable() const {
 3794|  19.0M|  if (!iconvtable)
  ------------------
  |  Branch (3794:7): [True: 18.5M, False: 509k]
  ------------------
 3795|  18.5M|    return nullptr;
 3796|   509k|  return iconvtable;
 3797|  19.0M|}
_ZNK8AffixMgr14get_oconvtableEv:
 3800|   108k|RepList* AffixMgr::get_oconvtable() const {
 3801|   108k|  if (!oconvtable)
  ------------------
  |  Branch (3801:7): [True: 102k, False: 5.82k]
  ------------------
 3802|   102k|    return nullptr;
 3803|  5.82k|  return oconvtable;
 3804|   108k|}
_ZNK8AffixMgr14get_phonetableEv:
 3807|  66.4k|struct phonetable* AffixMgr::get_phonetable() const {
 3808|  66.4k|  if (!phone)
  ------------------
  |  Branch (3808:7): [True: 62.6k, False: 3.80k]
  ------------------
 3809|  62.6k|    return nullptr;
 3810|  3.80k|  return phone;
 3811|  66.4k|}
_ZNK8AffixMgr12get_maptableEv:
 3814|   413k|const std::vector<mapentry>& AffixMgr::get_maptable() const {
 3815|   413k|  return maptable;
 3816|   413k|}
_ZNK8AffixMgr14get_breaktableEv:
 3819|     38|const std::vector<std::string>& AffixMgr::get_breaktable() const {
 3820|     38|  return breaktable;
 3821|     38|}
_ZN8AffixMgr12get_encodingEv:
 3824|     78|const std::string& AffixMgr::get_encoding() {
 3825|     78|  if (encoding.empty())
  ------------------
  |  Branch (3825:7): [True: 20, False: 58]
  ------------------
 3826|     20|    encoding = SPELL_ENCODING;
  ------------------
  |  |   95|     20|#define SPELL_ENCODING "ISO8859-1"
  ------------------
 3827|     78|  return encoding;
 3828|     78|}
_ZNK8AffixMgr11get_langnumEv:
 3831|     76|int AffixMgr::get_langnum() const {
 3832|     76|  return langnum;
 3833|     76|}
_ZNK8AffixMgr19get_complexprefixesEv:
 3836|     76|int AffixMgr::get_complexprefixes() const {
 3837|     76|  return complexprefixes;
 3838|     76|}
_ZNK8AffixMgr13get_fullstripEv:
 3841|  8.80k|int AffixMgr::get_fullstrip() const {
 3842|  8.80k|  return fullstrip;
 3843|  8.80k|}
_ZNK8AffixMgr12get_keepcaseEv:
 3845|   108k|FLAG AffixMgr::get_keepcase() const {
 3846|   108k|  return keepcase;
 3847|   108k|}
_ZNK8AffixMgr14get_forceucaseEv:
 3849|  21.5k|FLAG AffixMgr::get_forceucase() const {
 3850|  21.5k|  return forceucase;
 3851|  21.5k|}
_ZNK8AffixMgr8get_warnEv:
 3853|   163k|FLAG AffixMgr::get_warn() const {
 3854|   163k|  return warn;
 3855|   163k|}
_ZNK8AffixMgr14get_forbidwarnEv:
 3857|      6|int AffixMgr::get_forbidwarn() const {
 3858|      6|  return forbidwarn;
 3859|      6|}
_ZNK8AffixMgr15get_checksharpsEv:
 3861|   841k|int AffixMgr::get_checksharps() const {
 3862|   841k|  return checksharps;
 3863|   841k|}
_ZNK8AffixMgr10get_ignoreEv:
 3870|  40.4M|const char* AffixMgr::get_ignore() const {
 3871|  40.4M|  if (ignorechars.empty())
  ------------------
  |  Branch (3871:7): [True: 36.3M, False: 4.08M]
  ------------------
 3872|  36.3M|    return nullptr;
 3873|  4.08M|  return ignorechars.c_str();
 3874|  40.4M|}
_ZNK8AffixMgr16get_ignore_utf16Ev:
 3877|   864k|const std::vector<w_char>& AffixMgr::get_ignore_utf16() const {
 3878|   864k|  return ignorechars_utf16;
 3879|   864k|}
_ZN8AffixMgr14get_key_stringEv:
 3882|     38|const std::string& AffixMgr::get_key_string() {
 3883|     38|  if (keystring.empty())
  ------------------
  |  Branch (3883:7): [True: 38, False: 0]
  ------------------
 3884|     38|    keystring = SPELL_KEYSTRING;
  ------------------
  |  |   96|     38|#define SPELL_KEYSTRING "qwertyuiop|asdfghjkl|zxcvbnm"
  ------------------
 3885|     38|  return keystring;
 3886|     38|}
_ZNK8AffixMgr14get_try_stringEv:
 3889|     38|const std::string& AffixMgr::get_try_string() const {
 3890|     38|  return trystring;
 3891|     38|}
_ZNK8AffixMgr12get_compoundEv:
 3903|  86.5M|int AffixMgr::get_compound() const {
 3904|  86.5M|  return compoundflag || compoundbegin || !defcpdtable.empty();
  ------------------
  |  Branch (3904:10): [True: 21.7M, False: 64.8M]
  |  Branch (3904:26): [True: 0, False: 64.8M]
  |  Branch (3904:43): [True: 0, False: 64.8M]
  ------------------
 3905|  86.5M|}
_ZNK8AffixMgr16get_compoundflagEv:
 3908|  66.6k|FLAG AffixMgr::get_compoundflag() const {
 3909|  66.6k|  return compoundflag;
 3910|  66.6k|}
_ZNK8AffixMgr17get_forbiddenwordEv:
 3913|   176k|FLAG AffixMgr::get_forbiddenword() const {
 3914|   176k|  return forbiddenword;
 3915|   176k|}
_ZNK8AffixMgr13get_nosuggestEv:
 3918|  66.5k|FLAG AffixMgr::get_nosuggest() const {
 3919|  66.5k|  return nosuggest;
 3920|  66.5k|}
_ZNK8AffixMgr18get_nongramsuggestEv:
 3923|  66.4k|FLAG AffixMgr::get_nongramsuggest() const {
 3924|  66.4k|  return nongramsuggest;
 3925|  66.4k|}
_ZNK8AffixMgr15get_substandardEv:
 3928|    167|FLAG AffixMgr::get_substandard() const {
 3929|    167|  return substandard;
 3930|    167|}
_ZNK8AffixMgr13get_needaffixEv:
 3933|  4.86k|FLAG AffixMgr::get_needaffix() const {
 3934|  4.86k|  return needaffix;
 3935|  4.86k|}
_ZNK8AffixMgr18get_onlyincompoundEv:
 3943|  70.8k|FLAG AffixMgr::get_onlyincompound() const {
 3944|  70.8k|  return onlyincompound;
 3945|  70.8k|}
_ZN8AffixMgr6lookupEPKcm:
 3953|   627M|struct hentry* AffixMgr::lookup(const char* word, size_t len) {
 3954|   627M|  struct hentry* he = nullptr;
 3955|  1.25G|  for (size_t i = 0; i < alldic.size() && !he; ++i) {
  ------------------
  |  Branch (3955:22): [True: 627M, False: 627M]
  |  Branch (3955:43): [True: 627M, False: 0]
  ------------------
 3956|   627M|    he = alldic[i]->lookup(word, len);
 3957|   627M|  }
 3958|   627M|  return he;
 3959|   627M|}
_ZNK8AffixMgr14have_contclassEv:
 3962|  34.3M|int AffixMgr::have_contclass() const {
 3963|  34.3M|  return havecontclass;
 3964|  34.3M|}
_ZNK8AffixMgr8get_utf8Ev:
 3967|     76|int AffixMgr::get_utf8() const {
 3968|     76|  return utf8;
 3969|     76|}
_ZNK8AffixMgr16get_maxngramsugsEv:
 3971|  74.6k|int AffixMgr::get_maxngramsugs() const {
 3972|  74.6k|  return maxngramsugs;
 3973|  74.6k|}
_ZNK8AffixMgr14get_maxcpdsugsEv:
 3975|     38|int AffixMgr::get_maxcpdsugs() const {
 3976|     38|  return maxcpdsugs;
 3977|     38|}
_ZNK8AffixMgr11get_maxdiffEv:
 3979|  50.8k|int AffixMgr::get_maxdiff() const {
 3980|  50.8k|  return maxdiff;
 3981|  50.8k|}
_ZNK8AffixMgr15get_onlymaxdiffEv:
 3983|  7.88k|int AffixMgr::get_onlymaxdiff() const {
 3984|  7.88k|  return onlymaxdiff;
 3985|  7.88k|}
_ZNK8AffixMgr15get_nosplitsugsEv:
 3988|     38|int AffixMgr::get_nosplitsugs() const {
 3989|     38|  return nosplitsugs;
 3990|     38|}
_ZNK8AffixMgr16get_sugswithdotsEv:
 3993|  3.80k|int AffixMgr::get_sugswithdots() const {
 3994|  3.80k|  return sugswithdots;
 3995|  3.80k|}
_ZN8AffixMgr10parse_flagERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPtP7FileMgr:
 3998|     22|bool AffixMgr::parse_flag(const std::string& line, unsigned short* out, FileMgr* af) {
 3999|     22|  if (*out != FLAG_NULL && !(*out >= DEFAULTFLAGS)) {
  ------------------
  |  |   99|     44|#define FLAG_NULL 0x00
  ------------------
                if (*out != FLAG_NULL && !(*out >= DEFAULTFLAGS)) {
  ------------------
  |  |  122|      2|#define DEFAULTFLAGS 65510
  ------------------
  |  Branch (3999:7): [True: 2, False: 20]
  |  Branch (3999:28): [True: 0, False: 2]
  ------------------
 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|     22|  std::string s;
 4007|     22|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (4007:7): [True: 0, False: 22]
  ------------------
 4008|      0|    return false;
 4009|     22|  *out = pHMgr->decode_flag(s);
 4010|     22|  return true;
 4011|     22|}
_ZN8AffixMgr9parse_numERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiP7FileMgr:
 4014|     10|bool AffixMgr::parse_num(const std::string& line, int* out, FileMgr* af) {
 4015|     10|  if (*out != -1) {
  ------------------
  |  Branch (4015:7): [True: 0, False: 10]
  ------------------
 4016|      0|    HUNSPELL_WARNING(
 4017|      0|        stderr,
 4018|      0|        "error: line %d: multiple definitions of an affix file parameter\n",
 4019|      0|        af->getlinenum());
 4020|      0|    return false;
 4021|      0|  }
 4022|     10|  std::string s;
 4023|     10|  if (!parse_string(line, s, af->getlinenum()))
  ------------------
  |  Branch (4023:7): [True: 0, False: 10]
  ------------------
 4024|      0|    return false;
 4025|     10|  *out = atoi(s.c_str());
 4026|     10|  return true;
 4027|     10|}
_ZN8AffixMgr17parse_cpdsyllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4030|      2|bool AffixMgr::parse_cpdsyllable(const std::string& line, FileMgr* af) {
 4031|      2|  int i = 0;
 4032|      2|  int np = 0;
 4033|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4034|      8|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4034:10): [True: 6, False: 2]
  ------------------
 4035|      6|    switch (i) {
 4036|      2|      case 0: {
  ------------------
  |  Branch (4036:7): [True: 2, False: 4]
  ------------------
 4037|      2|        np++;
 4038|      2|        break;
 4039|      0|      }
 4040|      2|      case 1: {
  ------------------
  |  Branch (4040:7): [True: 2, False: 4]
  ------------------
 4041|      2|        cpdmaxsyllable = atoi(std::string(start_piece, iter).c_str());
 4042|      2|        np++;
 4043|      2|        break;
 4044|      0|      }
 4045|      2|      case 2: {
  ------------------
  |  Branch (4045:7): [True: 2, False: 4]
  ------------------
 4046|      2|        if (!utf8) {
  ------------------
  |  Branch (4046:13): [True: 0, False: 2]
  ------------------
 4047|      0|          cpdvowels.assign(start_piece, iter);
 4048|      0|          std::sort(cpdvowels.begin(), cpdvowels.end());
 4049|      2|        } else {
 4050|      2|          std::string piece(start_piece, iter);
 4051|      2|          u8_u16(cpdvowels_utf16, piece);
 4052|      2|          std::sort(cpdvowels_utf16.begin(), cpdvowels_utf16.end());
 4053|      2|        }
 4054|      2|        np++;
 4055|      2|        break;
 4056|      0|      }
 4057|      0|      default:
  ------------------
  |  Branch (4057:7): [True: 0, False: 6]
  ------------------
 4058|      0|        break;
 4059|      6|    }
 4060|      6|    ++i;
 4061|      6|    start_piece = mystrsep(line, iter);
 4062|      6|  }
 4063|      2|  if (np < 2) {
  ------------------
  |  Branch (4063:7): [True: 0, False: 2]
  ------------------
 4064|      0|    HUNSPELL_WARNING(stderr,
 4065|      0|                     "error: line %d: missing compoundsyllable information\n",
 4066|      0|                     af->getlinenum());
 4067|      0|    return false;
 4068|      0|  }
 4069|      2|  if (np == 2)
  ------------------
  |  Branch (4069:7): [True: 0, False: 2]
  ------------------
 4070|      0|    cpdvowels = "AEIOUaeiou";
 4071|      2|  return true;
 4072|      2|}
_ZN8AffixMgr15parse_convtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgrPP7RepListS8_:
 4077|      4|                              const std::string& keyword) {
 4078|      4|  if (*rl) {
  ------------------
  |  Branch (4078:7): [True: 0, False: 4]
  ------------------
 4079|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4080|      0|                     af->getlinenum());
 4081|      0|    return false;
 4082|      0|  }
 4083|      4|  int i = 0;
 4084|      4|  int np = 0;
 4085|      4|  int numrl = 0;
 4086|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4087|     18|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4087:10): [True: 14, False: 4]
  ------------------
 4088|     14|    switch (i) {
 4089|      4|      case 0: {
  ------------------
  |  Branch (4089:7): [True: 4, False: 10]
  ------------------
 4090|      4|        np++;
 4091|      4|        break;
 4092|      0|      }
 4093|      4|      case 1: {
  ------------------
  |  Branch (4093:7): [True: 4, False: 10]
  ------------------
 4094|      4|        numrl = atoi(std::string(start_piece, iter).c_str());
 4095|      4|        if (numrl < 1) {
  ------------------
  |  Branch (4095:13): [True: 0, False: 4]
  ------------------
 4096|      0|          HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n",
 4097|      0|                           af->getlinenum());
 4098|      0|          return false;
 4099|      0|        }
 4100|      4|        *rl = new RepList(numrl);
 4101|      4|        if (!*rl)
  ------------------
  |  Branch (4101:13): [True: 0, False: 4]
  ------------------
 4102|      0|          return false;
 4103|      4|        np++;
 4104|      4|        break;
 4105|      4|      }
 4106|      6|      default:
  ------------------
  |  Branch (4106:7): [True: 6, False: 8]
  ------------------
 4107|      6|        break;
 4108|     14|    }
 4109|     14|    ++i;
 4110|     14|    start_piece = mystrsep(line, iter);
 4111|     14|  }
 4112|      4|  if (np != 2) {
  ------------------
  |  Branch (4112:7): [True: 0, False: 4]
  ------------------
 4113|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4114|      0|                     af->getlinenum());
 4115|      0|    return false;
 4116|      0|  }
 4117|       |
 4118|       |  /* now parse the num lines to read in the remainder of the table */
 4119|     26|  for (int j = 0; j < numrl; j++) {
  ------------------
  |  Branch (4119:19): [True: 22, False: 4]
  ------------------
 4120|     22|    std::string nl;
 4121|     22|    if (!af->getline(nl))
  ------------------
  |  Branch (4121:9): [True: 0, False: 22]
  ------------------
 4122|      0|      return false;
 4123|     22|    mychomp(nl);
 4124|     22|    i = 0;
 4125|     22|    std::string pattern;
 4126|     22|    std::string pattern2;
 4127|     22|    iter = nl.begin();
 4128|     22|    start_piece = mystrsep(nl, iter);
 4129|    130|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4129:12): [True: 108, False: 22]
  ------------------
 4130|    108|      {
 4131|    108|        switch (i) {
 4132|     22|          case 0: {
  ------------------
  |  Branch (4132:11): [True: 22, False: 86]
  ------------------
 4133|     22|            if (nl.compare(start_piece - nl.begin(), keyword.size(), keyword, 0, keyword.size()) != 0) {
  ------------------
  |  Branch (4133:17): [True: 0, False: 22]
  ------------------
 4134|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4135|      0|                               af->getlinenum());
 4136|      0|              delete *rl;
 4137|      0|              *rl = nullptr;
 4138|      0|              return false;
 4139|      0|            }
 4140|     22|            break;
 4141|     22|          }
 4142|     22|          case 1: {
  ------------------
  |  Branch (4142:11): [True: 22, False: 86]
  ------------------
 4143|     22|            pattern.assign(start_piece, iter);
 4144|     22|            break;
 4145|     22|          }
 4146|     22|          case 2: {
  ------------------
  |  Branch (4146:11): [True: 22, False: 86]
  ------------------
 4147|     22|            pattern2.assign(start_piece, iter);
 4148|     22|            break;
 4149|     22|          }
 4150|     42|          default:
  ------------------
  |  Branch (4150:11): [True: 42, False: 66]
  ------------------
 4151|     42|            break;
 4152|    108|        }
 4153|    108|        ++i;
 4154|    108|      }
 4155|      0|      start_piece = mystrsep(nl, iter);
 4156|    108|    }
 4157|     22|    if (pattern.empty() || pattern2.empty()) {
  ------------------
  |  Branch (4157:9): [True: 0, False: 22]
  |  Branch (4157:28): [True: 0, False: 22]
  ------------------
 4158|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4159|      0|                       af->getlinenum());
 4160|      0|      return false;
 4161|      0|    }
 4162|       |
 4163|     22|    (*rl)->add(pattern, pattern2);
 4164|     22|  }
 4165|      4|  return true;
 4166|      4|}
_ZN8AffixMgr16parse_phonetableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4169|      2|bool AffixMgr::parse_phonetable(const std::string& line, FileMgr* af) {
 4170|      2|  if (phone) {
  ------------------
  |  Branch (4170:7): [True: 0, False: 2]
  ------------------
 4171|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4172|      0|                     af->getlinenum());
 4173|      0|    return false;
 4174|      0|  }
 4175|      2|  std::unique_ptr<phonetable> new_phone;
 4176|      2|  int num = -1;
 4177|      2|  int i = 0;
 4178|      2|  int np = 0;
 4179|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4180|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4180:10): [True: 4, False: 2]
  ------------------
 4181|      4|    switch (i) {
 4182|      2|      case 0: {
  ------------------
  |  Branch (4182:7): [True: 2, False: 2]
  ------------------
 4183|      2|        np++;
 4184|      2|        break;
 4185|      0|      }
 4186|      2|      case 1: {
  ------------------
  |  Branch (4186:7): [True: 2, False: 2]
  ------------------
 4187|      2|        num = atoi(std::string(start_piece, iter).c_str());
 4188|      2|        if (num < 1) {
  ------------------
  |  Branch (4188:13): [True: 0, False: 2]
  ------------------
 4189|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4190|      0|                           af->getlinenum());
 4191|      0|          return false;
 4192|      0|        }
 4193|      2|        new_phone = std::make_unique<phonetable>();
 4194|      2|        new_phone->utf8 = (char)utf8;
 4195|      2|        np++;
 4196|      2|        break;
 4197|      2|      }
 4198|      0|      default:
  ------------------
  |  Branch (4198:7): [True: 0, False: 4]
  ------------------
 4199|      0|        break;
 4200|      4|    }
 4201|      4|    ++i;
 4202|      4|    start_piece = mystrsep(line, iter);
 4203|      4|  }
 4204|      2|  if (np != 2) {
  ------------------
  |  Branch (4204:7): [True: 0, False: 2]
  ------------------
 4205|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4206|      0|                     af->getlinenum());
 4207|      0|    return false;
 4208|      0|  }
 4209|       |
 4210|       |  /* now parse the phone->num lines to read in the remainder of the table */
 4211|    212|  for (int j = 0; j < num; ++j) {
  ------------------
  |  Branch (4211:19): [True: 210, False: 2]
  ------------------
 4212|    210|    std::string nl;
 4213|    210|    if (!af->getline(nl))
  ------------------
  |  Branch (4213:9): [True: 0, False: 210]
  ------------------
 4214|      0|      return false;
 4215|    210|    mychomp(nl);
 4216|    210|    i = 0;
 4217|    210|    const size_t old_size = new_phone->rules.size();
 4218|    210|    iter = nl.begin();
 4219|    210|    start_piece = mystrsep(nl, iter);
 4220|    840|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4220:12): [True: 630, False: 210]
  ------------------
 4221|    630|      {
 4222|    630|        switch (i) {
 4223|    210|          case 0: {
  ------------------
  |  Branch (4223:11): [True: 210, False: 420]
  ------------------
 4224|    210|            if (nl.compare(start_piece - nl.begin(), 5, "PHONE", 5) != 0) {
  ------------------
  |  Branch (4224:17): [True: 0, False: 210]
  ------------------
 4225|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4226|      0|                               af->getlinenum());
 4227|      0|              return false;
 4228|      0|            }
 4229|    210|            break;
 4230|    210|          }
 4231|    210|          case 1: {
  ------------------
  |  Branch (4231:11): [True: 210, False: 420]
  ------------------
 4232|    210|            new_phone->rules.emplace_back(start_piece, iter);
 4233|    210|            break;
 4234|    210|          }
 4235|    210|          case 2: {
  ------------------
  |  Branch (4235:11): [True: 210, False: 420]
  ------------------
 4236|    210|            new_phone->rules.emplace_back(start_piece, iter);
 4237|    210|            mystrrep(new_phone->rules.back(), "_", "");
 4238|    210|            break;
 4239|    210|          }
 4240|      0|          default:
  ------------------
  |  Branch (4240:11): [True: 0, False: 630]
  ------------------
 4241|      0|            break;
 4242|    630|        }
 4243|    630|        ++i;
 4244|    630|      }
 4245|      0|      start_piece = mystrsep(nl, iter);
 4246|    630|    }
 4247|    210|    if (new_phone->rules.size() != old_size + 2) {
  ------------------
  |  Branch (4247:9): [True: 0, False: 210]
  ------------------
 4248|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4249|      0|                       af->getlinenum());
 4250|      0|      return false;
 4251|      0|    }
 4252|    210|  }
 4253|      2|  new_phone->rules.emplace_back("");
 4254|      2|  new_phone->rules.emplace_back("");
 4255|      2|  init_phonet_hash(*new_phone);
 4256|      2|  phone = new_phone.release();
 4257|      2|  return true;
 4258|      2|}
_ZN8AffixMgr19parse_checkcpdtableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4261|      2|bool AffixMgr::parse_checkcpdtable(const std::string& line, FileMgr* af) {
 4262|      2|  if (parsedcheckcpd) {
  ------------------
  |  Branch (4262:7): [True: 0, False: 2]
  ------------------
 4263|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4264|      0|                     af->getlinenum());
 4265|      0|    return false;
 4266|      0|  }
 4267|      2|  parsedcheckcpd = true;
 4268|      2|  int numcheckcpd = -1;
 4269|      2|  int i = 0;
 4270|      2|  int np = 0;
 4271|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4272|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4272:10): [True: 4, False: 2]
  ------------------
 4273|      4|    switch (i) {
 4274|      2|      case 0: {
  ------------------
  |  Branch (4274:7): [True: 2, False: 2]
  ------------------
 4275|      2|        np++;
 4276|      2|        break;
 4277|      0|      }
 4278|      2|      case 1: {
  ------------------
  |  Branch (4278:7): [True: 2, False: 2]
  ------------------
 4279|      2|        numcheckcpd = atoi(std::string(start_piece, iter).c_str());
 4280|      2|        if (numcheckcpd < 1) {
  ------------------
  |  Branch (4280:13): [True: 0, False: 2]
  ------------------
 4281|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4282|      0|                           af->getlinenum());
 4283|      0|          return false;
 4284|      0|        }
 4285|      2|        checkcpdtable.reserve(std::min(numcheckcpd, 16384));
 4286|      2|        np++;
 4287|      2|        break;
 4288|      2|      }
 4289|      0|      default:
  ------------------
  |  Branch (4289:7): [True: 0, False: 4]
  ------------------
 4290|      0|        break;
 4291|      4|    }
 4292|      4|    ++i;
 4293|      4|    start_piece = mystrsep(line, iter);
 4294|      4|  }
 4295|      2|  if (np != 2) {
  ------------------
  |  Branch (4295:7): [True: 0, False: 2]
  ------------------
 4296|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4297|      0|                     af->getlinenum());
 4298|      0|    return false;
 4299|      0|  }
 4300|       |
 4301|       |  /* now parse the numcheckcpd lines to read in the remainder of the table */
 4302|      6|  for (int j = 0; j < numcheckcpd; ++j) {
  ------------------
  |  Branch (4302:19): [True: 4, False: 2]
  ------------------
 4303|      4|    std::string nl;
 4304|      4|    if (!af->getline(nl))
  ------------------
  |  Branch (4304:9): [True: 0, False: 4]
  ------------------
 4305|      0|      return false;
 4306|      4|    mychomp(nl);
 4307|      4|    i = 0;
 4308|      4|    checkcpdtable.emplace_back();
 4309|      4|    iter = nl.begin();
 4310|      4|    start_piece = mystrsep(nl, iter);
 4311|     16|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4311:12): [True: 12, False: 4]
  ------------------
 4312|     12|      switch (i) {
 4313|      4|        case 0: {
  ------------------
  |  Branch (4313:9): [True: 4, False: 8]
  ------------------
 4314|      4|          if (nl.compare(start_piece - nl.begin(), 20, "CHECKCOMPOUNDPATTERN", 20) != 0) {
  ------------------
  |  Branch (4314:15): [True: 0, False: 4]
  ------------------
 4315|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4316|      0|                             af->getlinenum());
 4317|      0|            checkcpdtable.clear();
 4318|      0|            return false;
 4319|      0|          }
 4320|      4|          break;
 4321|      4|        }
 4322|      4|        case 1: {
  ------------------
  |  Branch (4322:9): [True: 4, False: 8]
  ------------------
 4323|      4|          checkcpdtable.back().pattern.assign(start_piece, iter);
 4324|      4|          size_t slash_pos = checkcpdtable.back().pattern.find('/');
 4325|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4325:15): [True: 0, False: 4]
  ------------------
 4326|      0|            std::string chunk(checkcpdtable.back().pattern, slash_pos + 1);
 4327|      0|            checkcpdtable.back().pattern.resize(slash_pos);
 4328|      0|            checkcpdtable.back().cond = pHMgr->decode_flag(chunk);
 4329|      0|          }
 4330|      4|          break;
 4331|      4|        }
 4332|      4|        case 2: {
  ------------------
  |  Branch (4332:9): [True: 4, False: 8]
  ------------------
 4333|      4|          checkcpdtable.back().pattern2.assign(start_piece, iter);
 4334|      4|          size_t slash_pos = checkcpdtable.back().pattern2.find('/');
 4335|      4|          if (slash_pos != std::string::npos) {
  ------------------
  |  Branch (4335:15): [True: 0, False: 4]
  ------------------
 4336|      0|            std::string chunk(checkcpdtable.back().pattern2, slash_pos + 1);
 4337|      0|            checkcpdtable.back().pattern2.resize(slash_pos);
 4338|      0|            checkcpdtable.back().cond2 = pHMgr->decode_flag(chunk);
 4339|      0|          }
 4340|      4|          break;
 4341|      4|        }
 4342|      0|        case 3: {
  ------------------
  |  Branch (4342:9): [True: 0, False: 12]
  ------------------
 4343|      0|          checkcpdtable.back().pattern3.assign(start_piece, iter);
 4344|      0|          simplifiedcpd = 1;
 4345|      0|          break;
 4346|      4|        }
 4347|      0|        default:
  ------------------
  |  Branch (4347:9): [True: 0, False: 12]
  ------------------
 4348|      0|          break;
 4349|     12|      }
 4350|     12|      i++;
 4351|     12|      start_piece = mystrsep(nl, iter);
 4352|     12|    }
 4353|      4|  }
 4354|      2|  return true;
 4355|      2|}
_ZN8AffixMgr14parse_maptableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4459|      2|bool AffixMgr::parse_maptable(const std::string& line, FileMgr* af) {
 4460|      2|  if (parsedmaptable) {
  ------------------
  |  Branch (4460:7): [True: 0, False: 2]
  ------------------
 4461|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4462|      0|                     af->getlinenum());
 4463|      0|    return false;
 4464|      0|  }
 4465|      2|  parsedmaptable = true;
 4466|      2|  int nummap = -1;
 4467|      2|  int i = 0;
 4468|      2|  int np = 0;
 4469|      2|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4470|      6|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4470:10): [True: 4, False: 2]
  ------------------
 4471|      4|    switch (i) {
 4472|      2|      case 0: {
  ------------------
  |  Branch (4472:7): [True: 2, False: 2]
  ------------------
 4473|      2|        np++;
 4474|      2|        break;
 4475|      0|      }
 4476|      2|      case 1: {
  ------------------
  |  Branch (4476:7): [True: 2, False: 2]
  ------------------
 4477|      2|        nummap = atoi(std::string(start_piece, iter).c_str());
 4478|      2|        if (nummap < 1) {
  ------------------
  |  Branch (4478:13): [True: 0, False: 2]
  ------------------
 4479|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4480|      0|                           af->getlinenum());
 4481|      0|          return false;
 4482|      0|        }
 4483|      2|        maptable.reserve(std::min(nummap, 16384));
 4484|      2|        np++;
 4485|      2|        break;
 4486|      2|      }
 4487|      0|      default:
  ------------------
  |  Branch (4487:7): [True: 0, False: 4]
  ------------------
 4488|      0|        break;
 4489|      4|    }
 4490|      4|    ++i;
 4491|      4|    start_piece = mystrsep(line, iter);
 4492|      4|  }
 4493|      2|  if (np != 2) {
  ------------------
  |  Branch (4493:7): [True: 0, False: 2]
  ------------------
 4494|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4495|      0|                     af->getlinenum());
 4496|      0|    return false;
 4497|      0|  }
 4498|       |
 4499|       |  /* now parse the nummap lines to read in the remainder of the table */
 4500|      8|  for (int j = 0; j < nummap; ++j) {
  ------------------
  |  Branch (4500:19): [True: 6, False: 2]
  ------------------
 4501|      6|    std::string nl;
 4502|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4502:9): [True: 0, False: 6]
  ------------------
 4503|      0|      return false;
 4504|      6|    mychomp(nl);
 4505|      6|    i = 0;
 4506|      6|    maptable.emplace_back();
 4507|      6|    iter = nl.begin();
 4508|      6|    start_piece = mystrsep(nl, iter);
 4509|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4509:12): [True: 12, False: 6]
  ------------------
 4510|     12|      switch (i) {
 4511|      6|        case 0: {
  ------------------
  |  Branch (4511:9): [True: 6, False: 6]
  ------------------
 4512|      6|          if (nl.compare(start_piece - nl.begin(), 3, "MAP", 3) != 0) {
  ------------------
  |  Branch (4512:15): [True: 0, False: 6]
  ------------------
 4513|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4514|      0|                             af->getlinenum());
 4515|      0|            nummap = 0;
 4516|      0|            return false;
 4517|      0|          }
 4518|      6|          break;
 4519|      6|        }
 4520|      6|        case 1: {
  ------------------
  |  Branch (4520:9): [True: 6, False: 6]
  ------------------
 4521|     22|          for (auto k = start_piece; k != iter; ++k) {
  ------------------
  |  Branch (4521:38): [True: 16, False: 6]
  ------------------
 4522|     16|            auto chb = k, che = k + 1;
 4523|     16|            if (*k == '(') {
  ------------------
  |  Branch (4523:17): [True: 2, False: 14]
  ------------------
 4524|      2|              auto parpos = std::find(k, iter, ')');
 4525|      2|              if (parpos != iter) {
  ------------------
  |  Branch (4525:19): [True: 2, False: 0]
  ------------------
 4526|      2|                chb = k + 1;
 4527|      2|                che = parpos;
 4528|      2|                k = parpos;
 4529|      2|              }
 4530|     14|            } else {
 4531|     14|              if (utf8 && (*k & 0xc0) == 0xc0) {
  ------------------
  |  Branch (4531:19): [True: 14, False: 0]
  |  Branch (4531:27): [True: 10, False: 4]
  ------------------
 4532|     10|                ++k;
 4533|     20|                while (k != iter && is_utf8_cont(*k))
  ------------------
  |  Branch (4533:24): [True: 18, False: 2]
  |  Branch (4533:37): [True: 10, False: 8]
  ------------------
 4534|     10|                    ++k;
 4535|     10|                che = k;
 4536|     10|                --k;
 4537|     10|              }
 4538|     14|            }
 4539|     16|            if (chb == che) {
  ------------------
  |  Branch (4539:17): [True: 0, False: 16]
  ------------------
 4540|      0|              HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4541|      0|                              af->getlinenum());
 4542|      0|            }
 4543|       |
 4544|     16|            maptable.back().emplace_back(chb, che);
 4545|     16|          }
 4546|      6|          break;
 4547|      6|        }
 4548|      0|        default:
  ------------------
  |  Branch (4548:9): [True: 0, False: 12]
  ------------------
 4549|      0|          break;
 4550|     12|      }
 4551|     12|      ++i;
 4552|     12|      start_piece = mystrsep(nl, iter);
 4553|     12|    }
 4554|      6|    if (maptable.back().empty()) {
  ------------------
  |  Branch (4554:9): [True: 0, False: 6]
  ------------------
 4555|      0|      HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4556|      0|                       af->getlinenum());
 4557|      0|      return false;
 4558|      0|    }
 4559|      6|  }
 4560|      2|  return true;
 4561|      2|}
_ZN8AffixMgr16parse_breaktableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEP7FileMgr:
 4564|      4|bool AffixMgr::parse_breaktable(const std::string& line, FileMgr* af) {
 4565|      4|  if (parsedbreaktable) {
  ------------------
  |  Branch (4565:7): [True: 0, False: 4]
  ------------------
 4566|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n",
 4567|      0|                     af->getlinenum());
 4568|      0|    return false;
 4569|      0|  }
 4570|      4|  parsedbreaktable = true;
 4571|      4|  int numbreak = -1;
 4572|      4|  int i = 0;
 4573|      4|  int np = 0;
 4574|      4|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4575|     12|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4575:10): [True: 8, False: 4]
  ------------------
 4576|      8|    switch (i) {
 4577|      4|      case 0: {
  ------------------
  |  Branch (4577:7): [True: 4, False: 4]
  ------------------
 4578|      4|        np++;
 4579|      4|        break;
 4580|      0|      }
 4581|      4|      case 1: {
  ------------------
  |  Branch (4581:7): [True: 4, False: 4]
  ------------------
 4582|      4|        numbreak = atoi(std::string(start_piece, iter).c_str());
 4583|      4|        if (numbreak < 0) {
  ------------------
  |  Branch (4583:13): [True: 0, False: 4]
  ------------------
 4584|      0|          HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n",
 4585|      0|                           af->getlinenum());
 4586|      0|          return false;
 4587|      0|        }
 4588|      4|        if (numbreak == 0)
  ------------------
  |  Branch (4588:13): [True: 0, False: 4]
  ------------------
 4589|      0|          return true;
 4590|      4|        breaktable.reserve(std::min(numbreak, 16384));
 4591|      4|        np++;
 4592|      4|        break;
 4593|      4|      }
 4594|      0|      default:
  ------------------
  |  Branch (4594:7): [True: 0, False: 8]
  ------------------
 4595|      0|        break;
 4596|      8|    }
 4597|      8|    ++i;
 4598|      8|    start_piece = mystrsep(line, iter);
 4599|      8|  }
 4600|      4|  if (np != 2) {
  ------------------
  |  Branch (4600:7): [True: 0, False: 4]
  ------------------
 4601|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n",
 4602|      0|                     af->getlinenum());
 4603|      0|    return false;
 4604|      0|  }
 4605|       |
 4606|       |  /* now parse the numbreak lines to read in the remainder of the table */
 4607|     10|  for (int j = 0; j < numbreak; ++j) {
  ------------------
  |  Branch (4607:19): [True: 6, False: 4]
  ------------------
 4608|      6|    std::string nl;
 4609|      6|    if (!af->getline(nl))
  ------------------
  |  Branch (4609:9): [True: 0, False: 6]
  ------------------
 4610|      0|      return false;
 4611|      6|    mychomp(nl);
 4612|      6|    i = 0;
 4613|      6|    iter = nl.begin();
 4614|      6|    start_piece = mystrsep(nl, iter);
 4615|     18|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4615:12): [True: 12, False: 6]
  ------------------
 4616|     12|      switch (i) {
 4617|      6|        case 0: {
  ------------------
  |  Branch (4617:9): [True: 6, False: 6]
  ------------------
 4618|      6|          if (nl.compare(start_piece - nl.begin(), 5, "BREAK", 5) != 0) {
  ------------------
  |  Branch (4618:15): [True: 0, False: 6]
  ------------------
 4619|      0|            HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4620|      0|                             af->getlinenum());
 4621|      0|            numbreak = 0;
 4622|      0|            return false;
 4623|      0|          }
 4624|      6|          break;
 4625|      6|        }
 4626|      6|        case 1: {
  ------------------
  |  Branch (4626:9): [True: 6, False: 6]
  ------------------
 4627|      6|          breaktable.emplace_back(start_piece, iter);
 4628|      6|          break;
 4629|      6|        }
 4630|      0|        default:
  ------------------
  |  Branch (4630:9): [True: 0, False: 12]
  ------------------
 4631|      0|          break;
 4632|     12|      }
 4633|     12|      ++i;
 4634|     12|      start_piece = mystrsep(nl, iter);
 4635|     12|    }
 4636|      6|  }
 4637|       |
 4638|      4|  if (breaktable.size() != static_cast<size_t>(numbreak)) {
  ------------------
  |  Branch (4638:7): [True: 0, False: 4]
  ------------------
 4639|      0|    HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n",
 4640|      0|                     af->getlinenum());
 4641|      0|    return false;
 4642|      0|  }
 4643|       |
 4644|      4|  return true;
 4645|      4|}
_ZN8AffixMgr17reverse_conditionERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 4647|     38|void AffixMgr::reverse_condition(std::string& piece) {
 4648|     38|  if (piece.empty())
  ------------------
  |  Branch (4648:7): [True: 0, False: 38]
  ------------------
 4649|      0|      return;
 4650|       |
 4651|     38|  int neg = 0;
 4652|       |  // iterate backwards; k wraps to npos (SIZE_MAX) when decremented past 0
 4653|     92|  for (size_t k = piece.size() - 1; k != std::string::npos; --k) {
  ------------------
  |  Branch (4653:37): [True: 54, False: 38]
  ------------------
 4654|     54|    switch (piece[k]) {
 4655|      2|      case '[': {
  ------------------
  |  Branch (4655:7): [True: 2, False: 52]
  ------------------
 4656|      2|        if (neg)
  ------------------
  |  Branch (4656:13): [True: 0, False: 2]
  ------------------
 4657|      0|          piece[k + 1] = '[';
 4658|      2|        else
 4659|      2|          piece[k] = ']';
 4660|      2|        break;
 4661|      0|      }
 4662|      2|      case ']': {
  ------------------
  |  Branch (4662:7): [True: 2, False: 52]
  ------------------
 4663|      2|        piece[k] = '[';
 4664|      2|        if (neg)
  ------------------
  |  Branch (4664:13): [True: 0, False: 2]
  ------------------
 4665|      0|          piece[k + 1] = '^';
 4666|      2|        neg = 0;
 4667|      2|        break;
 4668|      0|      }
 4669|      0|      case '^': {
  ------------------
  |  Branch (4669:7): [True: 0, False: 54]
  ------------------
 4670|      0|        if (piece[k + 1] == ']')
  ------------------
  |  Branch (4670:13): [True: 0, False: 0]
  ------------------
 4671|      0|          neg = 1;
 4672|      0|        else if (neg)
  ------------------
  |  Branch (4672:18): [True: 0, False: 0]
  ------------------
 4673|      0|          piece[k + 1] = piece[k];
 4674|      0|        break;
 4675|      0|      }
 4676|     50|      default: {
  ------------------
  |  Branch (4676:7): [True: 50, False: 4]
  ------------------
 4677|     50|        if (neg)
  ------------------
  |  Branch (4677:13): [True: 0, False: 50]
  ------------------
 4678|      0|          piece[k + 1] = piece[k];
 4679|     50|      }
 4680|     54|    }
 4681|     54|  }
 4682|     38|}
_ZN8AffixMgr11parse_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEcP7FileMgrPcRNS0_13unordered_setIS6_NS0_4hashIS6_EENS0_8equal_toIS6_EENS4_IS6_EEEE:
 4737|     26|                          std::unordered_set<std::string>& affix_rules) {
 4738|     26|  int numents = 0;  // number of AffEntry structures to parse
 4739|       |
 4740|     26|  unsigned short aflag = 0;  // affix char identifier
 4741|       |
 4742|     26|  char ff = 0;
 4743|     26|  char xprod = 0;
 4744|     26|  int headerline = af->getlinenum();
 4745|     26|  entries_container affentries(at, this);
 4746|       |
 4747|     26|  int i = 0;
 4748|       |
 4749|       |// checking lines with bad syntax
 4750|       |#ifdef DEBUG
 4751|       |  int basefieldnum = 0;
 4752|       |#endif
 4753|       |
 4754|       |  // split affix header line into pieces
 4755|       |
 4756|     26|  int np = 0;
 4757|     26|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 4758|    130|  while (start_piece != line.end()) {
  ------------------
  |  Branch (4758:10): [True: 104, False: 26]
  ------------------
 4759|    104|    switch (i) {
 4760|       |      // piece 1 - is type of affix
 4761|     26|      case 0: {
  ------------------
  |  Branch (4761:7): [True: 26, False: 78]
  ------------------
 4762|     26|        np++;
 4763|     26|        break;
 4764|      0|      }
 4765|       |
 4766|       |      // piece 2 - is affix char
 4767|     26|      case 1: {
  ------------------
  |  Branch (4767:7): [True: 26, False: 78]
  ------------------
 4768|     26|        np++;
 4769|     26|        aflag = pHMgr->decode_flag(std::string(start_piece, iter));
 4770|     26|        if (((at == 'S') && (dupflags[aflag] & dupSFX)) ||
  ------------------
  |  |   91|     18|#define dupSFX (1 << 0)
  ------------------
  |  Branch (4770:14): [True: 18, False: 8]
  |  Branch (4770:29): [True: 0, False: 18]
  ------------------
 4771|     26|            ((at == 'P') && (dupflags[aflag] & dupPFX))) {
  ------------------
  |  |   92|      8|#define dupPFX (1 << 1)
  ------------------
  |  Branch (4771:14): [True: 8, False: 18]
  |  Branch (4771:29): [True: 0, False: 8]
  ------------------
 4772|      0|          HUNSPELL_WARNING(
 4773|      0|              stderr,
 4774|      0|              "error: line %d: multiple definitions of an affix flag\n",
 4775|      0|              af->getlinenum());
 4776|      0|        }
 4777|     26|        dupflags[aflag] = static_cast<char>(dupflags[aflag] + ((at == 'S') ? dupSFX : dupPFX));
  ------------------
  |  |   91|     18|#define dupSFX (1 << 0)
  ------------------
                      dupflags[aflag] = static_cast<char>(dupflags[aflag] + ((at == 'S') ? dupSFX : dupPFX));
  ------------------
  |  |   92|      8|#define dupPFX (1 << 1)
  ------------------
  |  Branch (4777:64): [True: 18, False: 8]
  ------------------
 4778|     26|        break;
 4779|      0|      }
 4780|       |      // piece 3 - is cross product indicator
 4781|     26|      case 2: {
  ------------------
  |  Branch (4781:7): [True: 26, False: 78]
  ------------------
 4782|     26|        np++;
 4783|     26|        xprod = *start_piece;
 4784|     26|        if (xprod == 'Y')
  ------------------
  |  Branch (4784:13): [True: 26, False: 0]
  ------------------
 4785|     26|          ff = aeXPRODUCT;
  ------------------
  |  |   65|     26|#define aeXPRODUCT (1 << 0)
  ------------------
 4786|     26|        break;
 4787|      0|      }
 4788|       |
 4789|       |      // piece 4 - is number of affentries
 4790|     26|      case 3: {
  ------------------
  |  Branch (4790:7): [True: 26, False: 78]
  ------------------
 4791|     26|        np++;
 4792|     26|        numents = atoi(std::string(start_piece, iter).c_str());
 4793|     26|        if ((numents <= 0) || ((std::numeric_limits<size_t>::max() /
  ------------------
  |  Branch (4793:13): [True: 0, False: 26]
  |  Branch (4793:31): [True: 0, False: 26]
  ------------------
 4794|     26|                                sizeof(AffEntry)) < static_cast<size_t>(numents))) {
 4795|      0|          std::string err = pHMgr->encode_flag(aflag);
 4796|      0|          HUNSPELL_WARNING(stderr, "error: line %d: affix %s: bad entry number\n",
 4797|      0|                           af->getlinenum(), err.c_str());
 4798|      0|          return false;
 4799|      0|        }
 4800|       |
 4801|     26|        char opts = ff;
 4802|     26|        if (utf8)
  ------------------
  |  Branch (4802:13): [True: 6, False: 20]
  ------------------
 4803|      6|          opts |= aeUTF8;
  ------------------
  |  |   66|      6|#define aeUTF8 (1 << 1)
  ------------------
 4804|     26|        if (pHMgr->is_aliasf())
  ------------------
  |  Branch (4804:13): [True: 4, False: 22]
  ------------------
 4805|      4|          opts |= aeALIASF;
  ------------------
  |  |   67|      4|#define aeALIASF (1 << 2)
  ------------------
 4806|     26|        if (pHMgr->is_aliasm())
  ------------------
  |  Branch (4806:13): [True: 0, False: 26]
  ------------------
 4807|      0|          opts |= aeALIASM;
  ------------------
  |  |   68|      0|#define aeALIASM (1 << 3)
  ------------------
 4808|     26|        affentries.initialize(numents, opts, aflag);
 4809|     26|      }
 4810|       |
 4811|     26|      default:
  ------------------
  |  Branch (4811:7): [True: 0, False: 104]
  ------------------
 4812|     26|        break;
 4813|    104|    }
 4814|    104|    ++i;
 4815|    104|    start_piece = mystrsep(line, iter);
 4816|    104|  }
 4817|       |  // check to make sure we parsed enough pieces
 4818|     26|  if (np != 4) {
  ------------------
  |  Branch (4818:7): [True: 0, False: 26]
  ------------------
 4819|      0|    std::string err = pHMgr->encode_flag(aflag);
 4820|      0|    HUNSPELL_WARNING(stderr, "error: line %d: affix %s: missing data\n",
 4821|      0|                     af->getlinenum(), err.c_str());
 4822|      0|    return false;
 4823|      0|  }
 4824|       |
 4825|       |  // now parse numents affentries for this affix
 4826|     26|  AffEntry* entry = affentries.first_entry();
 4827|       |  // the text of each rule line from its strip field to the end
 4828|     26|  std::vector<std::string> rules;
 4829|     68|  for (int ent = 0; ent < numents; ++ent) {
  ------------------
  |  Branch (4829:21): [True: 42, False: 26]
  ------------------
 4830|     42|    std::string nl;
 4831|     42|    if (!af->getline(nl))
  ------------------
  |  Branch (4831:9): [True: 0, False: 42]
  ------------------
 4832|      0|      return false;
 4833|     42|    mychomp(nl);
 4834|     42|    int ruleline = af->getlinenum();
 4835|       |
 4836|     42|    iter = nl.begin();
 4837|     42|    i = 0;
 4838|     42|    np = 0;
 4839|       |
 4840|       |    // split line into pieces
 4841|     42|    start_piece = mystrsep(nl, iter);
 4842|    258|    while (start_piece != nl.end()) {
  ------------------
  |  Branch (4842:12): [True: 216, False: 42]
  ------------------
 4843|    216|      switch (i) {
 4844|       |        // piece 1 - is type
 4845|     42|        case 0: {
  ------------------
  |  Branch (4845:9): [True: 42, False: 174]
  ------------------
 4846|     42|          np++;
 4847|     42|          if (ent != 0)
  ------------------
  |  Branch (4847:15): [True: 16, False: 26]
  ------------------
 4848|     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)
  ------------------
 4849|     42|          break;
 4850|      0|        }
 4851|       |
 4852|       |        // piece 2 - is affix char
 4853|     42|        case 1: {
  ------------------
  |  Branch (4853:9): [True: 42, False: 174]
  ------------------
 4854|     42|          np++;
 4855|     42|          std::string chunk(start_piece, iter);
 4856|     42|          if (pHMgr->decode_flag(chunk) != aflag) {
  ------------------
  |  Branch (4856:15): [True: 0, False: 42]
  ------------------
 4857|      0|            std::string err = pHMgr->encode_flag(aflag);
 4858|      0|            HUNSPELL_WARNING(stderr,
 4859|      0|                             "error: line %d: affix %s is corrupt\n",
 4860|      0|                             af->getlinenum(), err.c_str());
 4861|      0|            return false;
 4862|      0|          }
 4863|       |
 4864|     42|          if (ent != 0) {
  ------------------
  |  Branch (4864:15): [True: 16, False: 26]
  ------------------
 4865|     16|            AffEntry* start_entry = affentries.first_entry();
 4866|     16|            entry->aflag = start_entry->aflag;
 4867|     16|          }
 4868|     42|          break;
 4869|     42|        }
 4870|       |
 4871|       |        // piece 3 - is string to strip or 0 for null
 4872|     42|        case 2: {
  ------------------
  |  Branch (4872:9): [True: 42, False: 174]
  ------------------
 4873|     42|          np++;
 4874|     42|          rules.emplace_back(start_piece, nl.cend());
 4875|     42|          entry->strip = std::string(start_piece, iter);
 4876|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4876:15): [True: 4, False: 38]
  ------------------
 4877|      4|            if (utf8)
  ------------------
  |  Branch (4877:17): [True: 0, False: 4]
  ------------------
 4878|      0|              reverseword_utf(entry->strip);
 4879|      4|            else
 4880|      4|              reverseword(entry->strip);
 4881|      4|          }
 4882|     42|          if (entry->strip.compare("0") == 0) {
  ------------------
  |  Branch (4882:15): [True: 36, False: 6]
  ------------------
 4883|     36|            entry->strip.clear();
 4884|     36|          }
 4885|     42|          break;
 4886|     42|        }
 4887|       |
 4888|       |        // piece 4 - is affix string or 0 for null
 4889|     42|        case 3: {
  ------------------
  |  Branch (4889:9): [True: 42, False: 174]
  ------------------
 4890|     42|          entry->morphcode = nullptr;
 4891|     42|          entry->contclass = nullptr;
 4892|     42|          entry->contclasslen = 0;
 4893|     42|          np++;
 4894|     42|          std::string::const_iterator dash = std::find(start_piece, iter, '/');
 4895|     42|          if (dash != iter) {
  ------------------
  |  Branch (4895:15): [True: 18, False: 24]
  ------------------
 4896|     18|            entry->appnd = std::string(start_piece, dash);
 4897|     18|            std::string dash_str(dash + 1, iter);
 4898|       |
 4899|     18|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4899:17): [True: 2, False: 16]
  |  Branch (4899:41): [True: 0, False: 2]
  ------------------
 4900|      0|              if (utf8) {
  ------------------
  |  Branch (4900:19): [True: 0, False: 0]
  ------------------
 4901|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4902|      0|              } else {
 4903|      0|                remove_ignored_chars(entry->appnd, ignorechars);
 4904|      0|              }
 4905|      0|            }
 4906|       |
 4907|     18|            if (complexprefixes) {
  ------------------
  |  Branch (4907:17): [True: 2, False: 16]
  ------------------
 4908|      2|              if (utf8)
  ------------------
  |  Branch (4908:19): [True: 0, False: 2]
  ------------------
 4909|      0|                reverseword_utf(entry->appnd);
 4910|      2|              else
 4911|      2|                reverseword(entry->appnd);
 4912|      2|            }
 4913|       |
 4914|     18|            size_t len;
 4915|     18|            if (pHMgr->is_aliasf()) {
  ------------------
  |  Branch (4915:17): [True: 2, False: 16]
  ------------------
 4916|      2|              int index = atoi(dash_str.c_str());
 4917|      2|              len = pHMgr->get_aliasf(index, &(entry->contclass), af);
 4918|      2|              if (!len)
  ------------------
  |  Branch (4918:19): [True: 0, False: 2]
  ------------------
 4919|      0|                HUNSPELL_WARNING(stderr,
 4920|      0|                                 "error: bad affix flag alias: \"%s\"\n",
 4921|      0|                                 dash_str.c_str());
 4922|     16|            } else {
 4923|     16|              len = pHMgr->decode_flags(&(entry->contclass), dash_str, af);
 4924|     16|              std::sort(entry->contclass, entry->contclass + len);
 4925|     16|            }
 4926|     18|            if (len > std::numeric_limits<unsigned short>::max()) {
  ------------------
  |  Branch (4926:17): [True: 0, False: 18]
  ------------------
 4927|      0|              HUNSPELL_WARNING(stderr, "error: line %d: continuation class of %zu flags is over max limit\n",
 4928|      0|                               af->getlinenum(), len);
 4929|      0|              return false;
 4930|      0|            }
 4931|     18|            entry->contclasslen = (unsigned short)len;
 4932|       |
 4933|     18|            havecontclass = 1;
 4934|     44|            for (unsigned short _i = 0; _i < entry->contclasslen; _i++) {
  ------------------
  |  Branch (4934:41): [True: 26, False: 18]
  ------------------
 4935|     26|              contclasses[(entry->contclass)[_i]] = true;
 4936|     26|            }
 4937|     24|          } else {
 4938|     24|            entry->appnd = std::string(start_piece, iter);
 4939|       |
 4940|     24|            if (!ignorechars.empty() && !has_no_ignored_chars(entry->appnd, ignorechars)) {
  ------------------
  |  Branch (4940:17): [True: 2, False: 22]
  |  Branch (4940:41): [True: 2, False: 0]
  ------------------
 4941|      2|              if (utf8) {
  ------------------
  |  Branch (4941:19): [True: 0, False: 2]
  ------------------
 4942|      0|                remove_ignored_chars_utf(entry->appnd, ignorechars_utf16);
 4943|      2|              } else {
 4944|      2|                remove_ignored_chars(entry->appnd, ignorechars);
 4945|      2|              }
 4946|      2|            }
 4947|       |
 4948|     24|            if (complexprefixes) {
  ------------------
  |  Branch (4948:17): [True: 2, False: 22]
  ------------------
 4949|      2|              if (utf8)
  ------------------
  |  Branch (4949:19): [True: 0, False: 2]
  ------------------
 4950|      0|                reverseword_utf(entry->appnd);
 4951|      2|              else
 4952|      2|                reverseword(entry->appnd);
 4953|      2|            }
 4954|     24|          }
 4955|       |
 4956|     42|          if (entry->appnd.compare("0") == 0) {
  ------------------
  |  Branch (4956:15): [True: 2, False: 40]
  ------------------
 4957|      2|            entry->appnd.clear();
 4958|      2|          }
 4959|     42|          break;
 4960|     42|        }
 4961|       |
 4962|       |        // piece 5 - is the conditions descriptions
 4963|     42|        case 4: {
  ------------------
  |  Branch (4963:9): [True: 42, False: 174]
  ------------------
 4964|     42|          std::string chunk(start_piece, iter);
 4965|     42|          np++;
 4966|     42|          if (complexprefixes) {
  ------------------
  |  Branch (4966:15): [True: 4, False: 38]
  ------------------
 4967|      4|            if (utf8)
  ------------------
  |  Branch (4967:17): [True: 0, False: 4]
  ------------------
 4968|      0|              reverseword_utf(chunk);
 4969|      4|            else
 4970|      4|              reverseword(chunk);
 4971|      4|            reverse_condition(chunk);
 4972|      4|          }
 4973|     42|          if (!entry->strip.empty() && chunk != "." &&
  ------------------
  |  Branch (4973:15): [True: 6, False: 36]
  |  Branch (4973:40): [True: 6, False: 0]
  ------------------
 4974|      6|              redundant_condition(at, entry->strip, chunk,
  ------------------
  |  Branch (4974:15): [True: 6, False: 0]
  ------------------
 4975|      6|                                  af->getlinenum())) {
 4976|      6|            chunk = ".";
 4977|      6|            entry->opts |= aeREDUNDANTCOND;
  ------------------
  |  |   72|      6|#define aeREDUNDANTCOND (1 << 5)
  ------------------
 4978|      6|          }
 4979|     42|          if (at == 'S') {
  ------------------
  |  Branch (4979:15): [True: 34, False: 8]
  ------------------
 4980|     34|            reverseword(chunk);
 4981|     34|            reverse_condition(chunk);
 4982|     34|          }
 4983|     42|          if (encodeit(*entry, chunk))
  ------------------
  |  Branch (4983:15): [True: 0, False: 42]
  ------------------
 4984|      0|            return false;
 4985|     42|          break;
 4986|     42|        }
 4987|       |
 4988|     42|        case 5: {
  ------------------
  |  Branch (4988:9): [True: 6, False: 210]
  ------------------
 4989|      6|          std::string chunk(start_piece, iter);
 4990|      6|          np++;
 4991|      6|          if (pHMgr->is_aliasm()) {
  ------------------
  |  Branch (4991:15): [True: 0, False: 6]
  ------------------
 4992|      0|            int index = atoi(chunk.c_str());
 4993|      0|            entry->morphcode = pHMgr->get_aliasm(index);
 4994|      6|          } else {
 4995|      6|            if (complexprefixes) {  // XXX - fix me for morph. gen.
  ------------------
  |  Branch (4995:17): [True: 0, False: 6]
  ------------------
 4996|      0|              if (utf8)
  ------------------
  |  Branch (4996:19): [True: 0, False: 0]
  ------------------
 4997|      0|                reverseword_utf(chunk);
 4998|      0|              else
 4999|      0|                reverseword(chunk);
 5000|      0|            }
 5001|       |            // add the remaining of the line
 5002|      6|            std::string::const_iterator end = nl.end();
 5003|      6|            if (iter != end) {
  ------------------
  |  Branch (5003:17): [True: 0, False: 6]
  ------------------
 5004|      0|              chunk.append(iter, end);
 5005|      0|            }
 5006|      6|            entry->morphcode = mystrdup(chunk.c_str());
 5007|      6|          }
 5008|      6|          break;
 5009|     42|        }
 5010|      0|        default:
  ------------------
  |  Branch (5010:9): [True: 0, False: 216]
  ------------------
 5011|      0|          break;
 5012|    216|      }
 5013|    216|      i++;
 5014|    216|      start_piece = mystrsep(nl, iter);
 5015|    216|    }
 5016|       |    // check to make sure we parsed enough pieces
 5017|     42|    if (np < 4) {
  ------------------
  |  Branch (5017:9): [True: 0, False: 42]
  ------------------
 5018|      0|      std::string err = pHMgr->encode_flag(aflag);
 5019|      0|      HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n",
 5020|      0|                       af->getlinenum(), err.c_str());
 5021|      0|      return false;
 5022|      0|    }
 5023|       |
 5024|     42|    entry->line = ruleline;
 5025|     42|    entry->headerline = headerline;
 5026|     42|    entry->xprod = xprod;
 5027|       |
 5028|       |#ifdef DEBUG
 5029|       |    // detect unnecessary fields, excepting comments
 5030|       |    if (basefieldnum) {
 5031|       |      int fieldnum =
 5032|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 5033|       |      if (fieldnum != basefieldnum)
 5034|       |        HUNSPELL_WARNING(stderr, "warning: line %d: bad field number\n",
 5035|       |                         af->getlinenum());
 5036|       |    } else {
 5037|       |      basefieldnum =
 5038|       |          !(entry->morphcode) ? 5 : ((*(entry->morphcode) == '#') ? 5 : 6);
 5039|       |    }
 5040|       |#endif
 5041|     42|  }
 5042|       |
 5043|       |  // now create SfxEntry or PfxEntry objects and use links to
 5044|       |  // build an ordered (sorted by affix string) list
 5045|     26|  auto start = affentries.begin(), end = affentries.end();
 5046|     26|  auto rule = rules.begin();
 5047|     68|  for (auto affentry = start; affentry != end; ++affentry, ++rule) {
  ------------------
  |  Branch (5047:31): [True: 42, False: 26]
  ------------------
 5048|       |    // a rule repeated for the same affix gives only the same matches again
 5049|     42|    if (!affix_rules.insert(std::string{at, xprod} + std::to_string(aflag) + ' ' + *rule).second) {
  ------------------
  |  Branch (5049:9): [True: 0, False: 42]
  ------------------
 5050|      0|      delete *affentry;
 5051|      0|      continue;
 5052|      0|    }
 5053|     42|    if (at == 'P') {
  ------------------
  |  Branch (5053:9): [True: 8, False: 34]
  ------------------
 5054|      8|      build_pfxtree(static_cast<PfxEntry*>(*affentry));
 5055|     34|    } else {
 5056|     34|      build_sfxtree(static_cast<SfxEntry*>(*affentry));
 5057|     34|    }
 5058|     42|  }
 5059|       |
 5060|       |  //contents belong to AffixMgr now
 5061|     26|  affentries.release();
 5062|       |
 5063|     26|  return true;
 5064|     26|}
_ZN8AffixMgr19redundant_conditionEcRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_i:
 5069|      6|                                  int linenum) {
 5070|       |  // both strings come from one affix file line, which is read into a buffer of BUFSIZE + 50 bytes,
 5071|       |  // so each length fits an int
 5072|      6|  int stripl = static_cast<int>(strip.size()), condl = static_cast<int>(cond.size()), i, j, neg, in;
 5073|      6|  if (ft == 'P') {  // prefix
  ------------------
  |  Branch (5073:7): [True: 0, False: 6]
  ------------------
 5074|      0|    if (strip.compare(0, condl, cond) == 0)
  ------------------
  |  Branch (5074:9): [True: 0, False: 0]
  ------------------
 5075|      0|      return 1;
 5076|      0|    if (utf8) {
  ------------------
  |  Branch (5076:9): [True: 0, False: 0]
  ------------------
 5077|      0|    } else {
 5078|      0|      for (i = 0, j = 0; (i < stripl) && (j < condl); i++, j++) {
  ------------------
  |  Branch (5078:26): [True: 0, False: 0]
  |  Branch (5078:42): [True: 0, False: 0]
  ------------------
 5079|      0|        if (cond[j] != '[') {
  ------------------
  |  Branch (5079:13): [True: 0, False: 0]
  ------------------
 5080|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (5080:15): [True: 0, False: 0]
  ------------------
 5081|      0|            HUNSPELL_WARNING(stderr,
 5082|      0|                             "warning: line %d: incompatible stripping "
 5083|      0|                             "characters and condition\n",
 5084|      0|                             linenum);
 5085|      0|            return 0;
 5086|      0|          }
 5087|      0|        } else {
 5088|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (5088:17): [True: 0, False: 0]
  ------------------
 5089|      0|          in = 0;
 5090|      0|          do {
 5091|      0|            j++;
 5092|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (5092:17): [True: 0, False: 0]
  ------------------
 5093|      0|              in = 1;
 5094|      0|          } while ((j < (condl - 1)) && (cond[j] != ']'));
  ------------------
  |  Branch (5094:20): [True: 0, False: 0]
  |  Branch (5094:41): [True: 0, False: 0]
  ------------------
 5095|      0|          if (j == (condl - 1) && (cond[j] != ']')) {
  ------------------
  |  Branch (5095:15): [True: 0, False: 0]
  |  Branch (5095:35): [True: 0, False: 0]
  ------------------
 5096|      0|            HUNSPELL_WARNING(stderr,
 5097|      0|                             "error: line %d: missing ] in condition:\n%s\n",
 5098|      0|                             linenum, cond.c_str());
 5099|      0|            return 0;
 5100|      0|          }
 5101|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (5101:16): [True: 0, False: 0]
  |  Branch (5101:24): [True: 0, False: 0]
  |  Branch (5101:33): [True: 0, False: 0]
  |  Branch (5101:40): [True: 0, False: 0]
  ------------------
 5102|      0|            HUNSPELL_WARNING(stderr,
 5103|      0|                             "warning: line %d: incompatible stripping "
 5104|      0|                             "characters and condition\n",
 5105|      0|                             linenum);
 5106|      0|            return 0;
 5107|      0|          }
 5108|      0|        }
 5109|      0|      }
 5110|      0|      if (j >= condl)
  ------------------
  |  Branch (5110:11): [True: 0, False: 0]
  ------------------
 5111|      0|        return 1;
 5112|      0|    }
 5113|      6|  } else {  // suffix
 5114|      6|    if ((stripl >= condl) && strip.compare(stripl - condl, std::string::npos, cond) == 0)
  ------------------
  |  Branch (5114:9): [True: 6, False: 0]
  |  Branch (5114:30): [True: 6, False: 0]
  ------------------
 5115|      6|      return 1;
 5116|      0|    if (utf8) {
  ------------------
  |  Branch (5116:9): [True: 0, False: 0]
  ------------------
 5117|      0|    } else {
 5118|      0|      for (i = stripl - 1, j = condl - 1; (i >= 0) && (j >= 0); i--, j--) {
  ------------------
  |  Branch (5118:43): [True: 0, False: 0]
  |  Branch (5118:55): [True: 0, False: 0]
  ------------------
 5119|      0|        if (cond[j] != ']') {
  ------------------
  |  Branch (5119:13): [True: 0, False: 0]
  ------------------
 5120|      0|          if (cond[j] != strip[i]) {
  ------------------
  |  Branch (5120:15): [True: 0, False: 0]
  ------------------
 5121|      0|            HUNSPELL_WARNING(stderr,
 5122|      0|                             "warning: line %d: incompatible stripping "
 5123|      0|                             "characters and condition\n",
 5124|      0|                             linenum);
 5125|      0|            return 0;
 5126|      0|          }
 5127|      0|        } else if (j > 0) {
  ------------------
  |  Branch (5127:20): [True: 0, False: 0]
  ------------------
 5128|      0|          in = 0;
 5129|      0|          do {
 5130|      0|            j--;
 5131|      0|            if (strip[i] == cond[j])
  ------------------
  |  Branch (5131:17): [True: 0, False: 0]
  ------------------
 5132|      0|              in = 1;
 5133|      0|          } while ((j > 0) && (cond[j] != '['));
  ------------------
  |  Branch (5133:20): [True: 0, False: 0]
  |  Branch (5133:31): [True: 0, False: 0]
  ------------------
 5134|      0|          if ((j == 0) && (cond[j] != '[')) {
  ------------------
  |  Branch (5134:15): [True: 0, False: 0]
  |  Branch (5134:27): [True: 0, False: 0]
  ------------------
 5135|      0|            HUNSPELL_WARNING(stderr,
 5136|      0|                             "error: line: %d: missing ] in condition:\n%s\n",
 5137|      0|                             linenum, cond.c_str());
 5138|      0|            return 0;
 5139|      0|          }
 5140|      0|          neg = (cond[j + 1] == '^') ? 1 : 0;
  ------------------
  |  Branch (5140:17): [True: 0, False: 0]
  ------------------
 5141|      0|          if ((!neg && !in) || (neg && in)) {
  ------------------
  |  Branch (5141:16): [True: 0, False: 0]
  |  Branch (5141:24): [True: 0, False: 0]
  |  Branch (5141:33): [True: 0, False: 0]
  |  Branch (5141:40): [True: 0, False: 0]
  ------------------
 5142|      0|            HUNSPELL_WARNING(stderr,
 5143|      0|                             "warning: line %d: incompatible stripping "
 5144|      0|                             "characters and condition\n",
 5145|      0|                             linenum);
 5146|      0|            return 0;
 5147|      0|          }
 5148|      0|        }
 5149|      0|      }
 5150|      0|      if (j < 0)
  ------------------
  |  Branch (5150:11): [True: 0, False: 0]
  ------------------
 5151|      0|        return 1;
 5152|      0|    }
 5153|      0|  }
 5154|      0|  return 0;
 5155|      6|}
_ZN8AffixMgr8isSubsetEPKcS1_:
 1124|   140k|inline int AffixMgr::isSubset(const char* s1, const char* s2) {
 1125|   211k|  while (((*s1 == *s2) || (*s1 == '.')) && (*s1 != '\0') && (*s2 != '\0')) {
  ------------------
  |  Branch (1125:11): [True: 140k, False: 70.5k]
  |  Branch (1125:27): [True: 0, False: 70.5k]
  |  Branch (1125:44): [True: 71.0k, False: 69.8k]
  |  Branch (1125:61): [True: 71.0k, False: 0]
  ------------------
 1126|  71.0k|    s1++;
 1127|  71.0k|    s2++;
 1128|  71.0k|  }
 1129|   140k|  return (*s1 == '\0');
 1130|   140k|}
affixmgr.cxx:_ZN12_GLOBAL__N_115DistinctRecordsC2Ec:
   97|  37.2k|    explicit DistinctRecords(char breakchar) : sep(breakchar) {}
affixmgr.cxx:_ZNK12_GLOBAL__N_115DistinctRecords4joinEv:
  117|  37.2k|    std::string join() const {
  118|  37.2k|      std::string text;
  119|  37.2k|      for (const std::string& record : records) {
  ------------------
  |  Branch (119:38): [True: 0, False: 37.2k]
  ------------------
  120|      0|        text.append(record);
  121|      0|        text.push_back(sep);
  122|      0|      }
  123|  37.2k|      return text;
  124|  37.2k|    }
affixmgr.cxx:_ZZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmiP8PfxEntryR12AffixScratchttctENK3$_1clEP8SfxEntry:
 3044|   205k|                         &candidates](SfxEntry* se) {
 3045|   205k|    if (!t)
  ------------------
  |  Branch (3045:9): [True: 205k, False: 0]
  ------------------
 3046|   205k|      return;
 3047|      0|    ++candidates;
 3048|      0|    trace_affix(*t, "sfx", this, *se);
 3049|      0|    TraceScope trace_depth(t);
 3050|      0|    (void)suffix_applicable(ppfx, se, cclass, in_compound, t);
 3051|      0|  };
affixmgr.cxx:_ZZN8AffixMgr12suffix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmiP8PfxEntryR12AffixScratchttctENK3$_0clEv:
 3036|   648M|  auto report_empty_pass = [t, &word, start, len, sfxopts, &candidates]() {
 3037|   648M|    if (t && candidates == 0)
  ------------------
  |  Branch (3037:9): [True: 0, False: 648M]
  |  Branch (3037:14): [True: 0, False: 0]
  ------------------
 3038|      0|      trace(*t, "sfx \"%s\" candidates=0%s", word.substr(start, len).c_str(),
 3039|      0|            (sfxopts & aeXPRODUCT) != 0 ? " xprod=Y" : "");
  ------------------
  |  |   65|      0|#define aeXPRODUCT (1 << 0)
  ------------------
  |  Branch (3039:13): [True: 0, False: 0]
  ------------------
 3040|   648M|  };
_ZN8AffixMgr11isRevSubsetEPKcS1_m:
 2936|   341k|                                 size_t len) {
 2937|   684k|  while ((len > 0) && (*s1 != '\0') && ((*s1 == *end_of_s2) || (*s1 == '.'))) {
  ------------------
  |  Branch (2937:10): [True: 678k, False: 5.98k]
  |  Branch (2937:23): [True: 387k, False: 290k]
  |  Branch (2937:41): [True: 342k, False: 45.1k]
  |  Branch (2937:64): [True: 0, False: 45.1k]
  ------------------
 2938|   342k|    s1++;
 2939|   342k|    end_of_s2--;
 2940|   342k|    len--;
 2941|   342k|  }
 2942|   341k|  return (*s1 == '\0');
 2943|   341k|}
affixmgr.cxx:_ZZN8AffixMgr11affix_checkERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmmR12AffixScratchtctPP8PfxEntryPP8SfxEntryENK3$_0clEPK6hentry:
 3382|  21.3M|  auto report_form = [this, t, &word, start, len, found_pfx, found_sfx](const struct hentry* rv) {
 3383|  21.3M|    if (!rv)
  ------------------
  |  Branch (3383:9): [True: 21.3M, False: 0]
  ------------------
 3384|  21.3M|      return;
 3385|      0|    if (t)
  ------------------
  |  Branch (3385:9): [True: 0, False: 0]
  ------------------
 3386|      0|      trace_form(*t, this, word.substr(start, len), rv->word, pfx, sfx);
 3387|      0|    if (found_pfx)
  ------------------
  |  Branch (3387:9): [True: 0, False: 0]
  ------------------
 3388|      0|      *found_pfx = pfx;
 3389|      0|    if (found_sfx)
  ------------------
  |  Branch (3389:9): [True: 0, False: 0]
  ------------------
 3390|      0|      *found_sfx = sfx;
 3391|      0|  };
affixmgr.cxx:_ZN12_GLOBAL__N_18mystrdupEPKc:
 3644|   855k|  char* mystrdup(const char* s) {
 3645|   855k|    char* d = nullptr;
 3646|   855k|    if (s) {
  ------------------
  |  Branch (3646:9): [True: 855k, False: 0]
  ------------------
 3647|   855k|      size_t sl = strlen(s) + 1;
 3648|   855k|      d = new char[sl];
 3649|   855k|      memcpy(d, s, sl);
 3650|   855k|    }
 3651|   855k|    return d;
 3652|   855k|  }
_ZN17entries_containerC2EcP8AffixMgr:
 4690|     26|    : m_mgr(mgr)
 4691|     26|    , m_at(at) {
 4692|     26|  }
_ZN17entries_container10initializeEict:
 4697|     26|                  char opts, unsigned short aflag) {
 4698|     26|    entries.reserve(std::min(numents, 16384));
 4699|       |
 4700|     26|    if (m_at == 'P') {
  ------------------
  |  Branch (4700:9): [True: 8, False: 18]
  ------------------
 4701|      8|      entries.push_back(new PfxEntry(m_mgr));
 4702|     18|    } else {
 4703|     18|      entries.push_back(new SfxEntry(m_mgr));
 4704|     18|    }
 4705|       |
 4706|     26|    entries.back()->opts = opts;
 4707|     26|    entries.back()->aflag = aflag;
 4708|     26|  }
_ZN17entries_container11first_entryEv:
 4721|     42|  AffEntry* first_entry() { return entries.empty() ? nullptr : entries[0]; }
  ------------------
  |  Branch (4721:36): [True: 0, False: 42]
  ------------------
_ZN17entries_container9add_entryEc:
 4710|     16|  AffEntry* add_entry(char opts) {
 4711|     16|    if (m_at == 'P') {
  ------------------
  |  Branch (4711:9): [True: 0, False: 16]
  ------------------
 4712|      0|      entries.push_back(new PfxEntry(m_mgr));
 4713|     16|    } else {
 4714|     16|      entries.push_back(new SfxEntry(m_mgr));
 4715|     16|    }
 4716|     16|    AffEntry* ret = entries.back();
 4717|     16|    ret->opts = entries[0]->opts & opts;
 4718|     16|    return ret;
 4719|     16|  }
_ZN17entries_container5beginEv:
 4729|     26|  std::vector<AffEntry*>::iterator begin() { return entries.begin(); }
_ZN17entries_container3endEv:
 4730|     26|  std::vector<AffEntry*>::iterator end() { return entries.end(); }
_ZN17entries_container7releaseEv:
 4693|     26|  void release() {
 4694|     26|    entries.clear();
 4695|     26|  }
_ZN17entries_containerD2Ev:
 4723|     26|  ~entries_container() {
 4724|     26|    for (auto& entry : entries) {
  ------------------
  |  Branch (4724:22): [True: 0, False: 26]
  ------------------
 4725|      0|      delete entry;
 4726|      0|    }
 4727|     26|  }
affixmgr.cxx:_ZN12_GLOBAL__N_113link_in_orderI8PfxEntryEEPT_S3_S3_:
  921|  9.69k|  template <typename T> T* link_in_order(T* ptr, T* nptr) {
  922|  9.69k|    std::vector<T*> path;
  923|  9.69k|    while (ptr || !path.empty()) {
  ------------------
  |  Branch (923:12): [True: 4, False: 9.69k]
  |  Branch (923:19): [True: 2, False: 9.69k]
  ------------------
  924|     12|      for (; ptr; ptr = ptr->getNextNE())
  ------------------
  |  Branch (924:14): [True: 6, False: 6]
  ------------------
  925|      6|        path.push_back(ptr);
  926|      6|      ptr = path.back();
  927|      6|      path.pop_back();
  928|      6|      ptr->setNext(nptr);
  929|      6|      nptr = ptr;
  930|      6|      ptr = ptr->getNextEQ();
  931|      6|    }
  932|  9.69k|    return nptr;
  933|  9.69k|  }
affixmgr.cxx:_ZN12_GLOBAL__N_113link_in_orderI8SfxEntryEEPT_S3_S3_:
  921|  9.69k|  template <typename T> T* link_in_order(T* ptr, T* nptr) {
  922|  9.69k|    std::vector<T*> path;
  923|  9.72k|    while (ptr || !path.empty()) {
  ------------------
  |  Branch (923:12): [True: 32, False: 9.69k]
  |  Branch (923:19): [True: 2, False: 9.69k]
  ------------------
  924|     68|      for (; ptr; ptr = ptr->getNextNE())
  ------------------
  |  Branch (924:14): [True: 34, False: 34]
  ------------------
  925|     34|        path.push_back(ptr);
  926|     34|      ptr = path.back();
  927|     34|      path.pop_back();
  928|     34|      ptr->setNext(nptr);
  929|     34|      nptr = ptr;
  930|     34|      ptr = ptr->getNextEQ();
  931|     34|    }
  932|  9.69k|    return nptr;
  933|  9.69k|  }
affixmgr.cxx:_ZZN8AffixMgr12get_syllableERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEENK3$_1clE6w_char:
 1717|  4.04k|          [&](w_char wc) {
 1718|  4.04k|            return std::binary_search(cpdvowels_utf16.begin(), cpdvowels_utf16.end(), wc);
 1719|  4.04k|          });

_ZN9guesswordC2Ev:
  121|  5.08M|    : word(nullptr)
  122|  5.08M|    , allow(false)
  123|  5.08M|    , orig(nullptr)
  124|  5.08M|  {
  125|  5.08M|  }
_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.65M|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:
  107|    114|{
  108|       |#if defined(_WIN32) && defined(_MSC_VER)
  109|       |#define WIN32_LONG_PATH_PREFIX "\\\\?\\"
  110|       |  if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
  111|       |    int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
  112|       |    wchar_t* buff = new wchar_t[len];
  113|       |    wchar_t* buff2 = new wchar_t[len];
  114|       |    MultiByteToWideChar(CP_UTF8, 0, path, -1, buff, len);
  115|       |    if (_wfullpath(buff2, buff, len) != NULL) {
  116|       |      stream.open(buff2, mode);
  117|       |    }
  118|       |    delete [] buff;
  119|       |    delete [] buff2;
  120|       |  }
  121|       |  else
  122|       |#endif
  123|    114|  stream.open(path, mode);
  124|    114|}
_Z6u16_u8RNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEE:
  131|  25.4M|std::string& u16_u8(std::string& dest, const std::vector<w_char>& src) {
  132|  25.4M|  dest.clear();
  133|  25.4M|  dest.reserve(src.size());
  134|   704M|  for (const w_char& wc : src) {
  ------------------
  |  Branch (134:25): [True: 704M, False: 25.4M]
  ------------------
  135|   704M|    uint16_t cp = (static_cast<uint16_t>(wc.h) << 8) | wc.l;
  136|   704M|    if (cp < 0x80) {
  ------------------
  |  Branch (136:9): [True: 637M, False: 66.4M]
  ------------------
  137|   637M|      dest.push_back(static_cast<char>(cp));
  138|   637M|    } else if (cp < 0x800) {
  ------------------
  |  Branch (138:16): [True: 2.18M, False: 64.2M]
  ------------------
  139|  2.18M|      dest.push_back(static_cast<char>(0xc0 | (cp >> 6)));
  140|  2.18M|      dest.push_back(static_cast<char>(0x80 | (cp & 0x3f)));
  141|  64.2M|    } else {
  142|  64.2M|      dest.push_back(static_cast<char>(0xe0 | (cp >> 12)));
  143|  64.2M|      dest.push_back(static_cast<char>(0x80 | ((cp >> 6) & 0x3f)));
  144|  64.2M|      dest.push_back(static_cast<char>(0x80 | (cp & 0x3f)));
  145|  64.2M|    }
  146|   704M|  }
  147|  25.4M|  return dest;
  148|  25.4M|}
_Z6u8_u16RNSt3__16vectorI6w_charNS_9allocatorIS1_EEEERKNS_12basic_stringIcNS_11char_traitsIcEENS2_IcEEEEb:
  166|  6.17M|int u8_u16(std::vector<w_char>& dest, const std::string& src, bool only_convert_first_letter) {
  167|       |  // faster to oversize initially, assign to elements and resize to what's used
  168|       |  // than to reserve and push_back
  169|  6.17M|  dest.resize(only_convert_first_letter ? 1 : src.size());
  ------------------
  |  Branch (169:15): [True: 0, False: 6.17M]
  ------------------
  170|  6.17M|  auto out = dest.begin();
  171|  6.17M|  auto p = src.begin(), end = src.end();
  172|       |
  173|  53.3M|  while (p < end) {
  ------------------
  |  Branch (173:10): [True: 47.7M, False: 5.59M]
  ------------------
  174|  47.7M|    uint8_t b0 = static_cast<uint8_t>(*p);
  175|  47.7M|    uint16_t cp;
  176|       |
  177|  47.7M|    if (b0 < 0x80) {
  ------------------
  |  Branch (177:9): [True: 43.6M, False: 4.07M]
  ------------------
  178|       |      // 1-byte ASCII
  179|  43.6M|      cp = b0;
  180|  43.6M|    } else if (b0 < 0xc0) {
  ------------------
  |  Branch (180:16): [True: 310k, False: 3.76M]
  ------------------
  181|       |      // continuation byte at lead position
  182|   310k|      HUNSPELL_WARNING(stderr,
  183|   310k|                       "UTF-8 encoding error. Unexpected continuation bytes "
  184|   310k|                       "in %ld. character position\n%s\n",
  185|   310k|                       static_cast<long>(std::distance(src.begin(), p)),
  186|   310k|                       src.c_str());
  187|   310k|      cp = 0xfffd;
  188|  3.76M|    } else if (b0 < 0xe0) {
  ------------------
  |  Branch (188:16): [True: 828k, False: 2.93M]
  ------------------
  189|       |      // 2-byte sequence: 110xxxxx 10yyyyyy
  190|   828k|      if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (190:11): [True: 741k, False: 86.8k]
  |  Branch (190:11): [True: 174k, False: 654k]
  |  Branch (190:26): [True: 174k, False: 567k]
  ------------------
  191|   174k|        cp = ((b0 & 0x1f) << 6) | (static_cast<uint8_t>(p[1]) & 0x3f);
  192|   174k|        ++p;  // step past lead; loop bottom steps past cont
  193|   654k|      } else {
  194|   654k|        warn_missing_cont(src, p);
  195|   654k|        cp = 0xfffd;
  196|   654k|      }
  197|  2.93M|    } else if (b0 < 0xf0) {
  ------------------
  |  Branch (197:16): [True: 2.34M, False: 583k]
  ------------------
  198|       |      // 3-byte sequence: 1110xxxx 10yyyyyy 10zzzzzz
  199|  2.34M|      if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (199:11): [True: 2.32M, False: 23.1k]
  |  Branch (199:11): [True: 2.25M, False: 95.6k]
  |  Branch (199:26): [True: 2.25M, False: 72.4k]
  ------------------
  200|  2.25M|        uint8_t b1 = static_cast<uint8_t>(p[1]);
  201|  2.25M|        ++p;  // step past lead
  202|  2.25M|        if (p + 1 < end && is_utf8_cont(p[1])) {
  ------------------
  |  Branch (202:13): [True: 2.24M, False: 3.59k]
  |  Branch (202:13): [True: 2.24M, False: 8.40k]
  |  Branch (202:28): [True: 2.24M, False: 4.81k]
  ------------------
  203|  2.24M|          cp = ((b0 & 0x0f) << 12) | ((b1 & 0x3f) << 6) | (static_cast<uint8_t>(p[1]) & 0x3f);
  204|  2.24M|          ++p;  // step past first cont; loop bottom steps past second cont
  205|  2.24M|        } else {
  206|  8.40k|          warn_missing_cont(src, p);
  207|  8.40k|          cp = 0xfffd;
  208|  8.40k|        }
  209|  2.25M|      } else {
  210|  95.6k|        warn_missing_cont(src, p);
  211|  95.6k|        cp = 0xfffd;
  212|  95.6k|      }
  213|  2.34M|    } else {
  214|       |      // 4+ byte lead: codepoint >= U+10000, can't fit in w_char
  215|   583k|      HUNSPELL_WARNING(stderr,
  216|   583k|                       "This UTF-8 encoding can't convert to UTF-16:\n%s\n",
  217|   583k|                       src.c_str());
  218|   583k|      out->h = 0xff;
  219|   583k|      out->l = 0xfd;
  220|   583k|      ++out;
  221|   583k|      dest.resize(out - dest.begin());
  222|   583k|      return -1;
  223|   583k|    }
  224|       |
  225|  47.1M|    out->h = static_cast<unsigned char>(cp >> 8);
  226|  47.1M|    out->l = static_cast<unsigned char>(cp);
  227|  47.1M|    ++out;
  228|  47.1M|    if (only_convert_first_letter)
  ------------------
  |  Branch (228:9): [True: 0, False: 47.1M]
  ------------------
  229|      0|      break;
  230|  47.1M|    ++p;  // consume lead byte
  231|  47.1M|  }
  232|       |
  233|  5.59M|  int size = static_cast<int>(out - dest.begin());
  234|  5.59M|  dest.resize(size);
  235|  5.59M|  return size;
  236|  6.17M|}
_Z8mystrsepRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_11__wrap_iterIPKcEE:
  251|  1.80k|                                     std::string::const_iterator& start) {
  252|  1.80k|  auto end = str.end();
  253|       |
  254|  1.80k|  const std::string blanks(" \t");
  255|  1.80k|  is_any_of op(blanks);
  256|       |  // don't use isspace() here, the string can be in some random charset
  257|       |  // that's way different than the locale's
  258|  1.80k|  auto sp = start;
  259|  5.87k|  while (sp != end && op(*sp))
  ------------------
  |  Branch (259:10): [True: 5.43k, False: 442]
  |  Branch (259:23): [True: 4.07k, False: 1.35k]
  ------------------
  260|  4.07k|      ++sp;
  261|       |
  262|  1.80k|  auto dp = sp;
  263|  6.69k|  while (dp != end && !op(*dp))
  ------------------
  |  Branch (263:10): [True: 5.81k, False: 882]
  |  Branch (263:23): [True: 4.89k, False: 918]
  ------------------
  264|  4.89k|      ++dp;
  265|       |
  266|  1.80k|  start = dp;
  267|  1.80k|  return sp;
  268|  1.80k|}
_Z7mychompRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  271|  1.99k|void mychomp(std::string& s) {
  272|  1.99k|  size_t k = s.size();
  273|  1.99k|  size_t newsize = k;
  274|  1.99k|  if ((k > 0) && ((s[k - 1] == '\r') || (s[k - 1] == '\n')))
  ------------------
  |  Branch (274:7): [True: 1.80k, False: 190]
  |  Branch (274:19): [True: 0, False: 1.80k]
  |  Branch (274:41): [True: 0, False: 1.80k]
  ------------------
  275|      0|    --newsize;
  276|  1.99k|  if ((k > 1) && (s[k - 2] == '\r'))
  ------------------
  |  Branch (276:7): [True: 1.60k, False: 384]
  |  Branch (276:18): [True: 0, False: 1.60k]
  ------------------
  277|      0|    --newsize;
  278|  1.99k|  s.resize(newsize);
  279|  1.99k|}
_Z8line_tokRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEc:
  282|   229k|std::vector<std::string> line_tok(const std::string& text, char breakchar) {
  283|   229k|  std::vector<std::string> ret;
  284|   229k|  if (text.empty()) {
  ------------------
  |  Branch (284:7): [True: 11.6k, False: 218k]
  ------------------
  285|  11.6k|    return ret;
  286|  11.6k|  }
  287|       |
  288|   218k|  std::stringstream ss(text);
  289|   218k|  std::string tok;
  290|   437k|  while(std::getline(ss, tok, breakchar)) {
  ------------------
  |  Branch (290:9): [True: 219k, False: 218k]
  ------------------
  291|   219k|    if (!tok.empty()) {
  ------------------
  |  Branch (291:9): [True: 219k, False: 130]
  ------------------
  292|   219k|      ret.push_back(tok);
  293|   219k|    }
  294|   219k|  }
  295|       |
  296|   218k|  return ret;
  297|   229k|}
_Z9line_uniqRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEc:
  309|  14.1k|{
  310|  14.1k|  std::vector<std::string> lines = line_tok(text, breakchar);
  311|  14.1k|  text.clear();
  312|  14.1k|  if (lines.empty()) {
  ------------------
  |  Branch (312:7): [True: 11.6k, False: 2.52k]
  ------------------
  313|  11.6k|    return;
  314|  11.6k|  }
  315|       |
  316|  2.52k|  drop_repeated_lines(lines);
  317|       |
  318|  2.52k|  text = lines[0];
  319|  2.54k|  for (size_t i = 1; i < lines.size(); ++i) {
  ------------------
  |  Branch (319:22): [True: 20, False: 2.52k]
  ------------------
  320|     20|    text.push_back(breakchar);
  321|     20|    text.append(lines[i]);
  322|     20|  }
  323|  2.52k|}
_Z21append_compound_partsRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_:
  374|   213k|size_t append_compound_parts(const std::string& desc, std::string& result) {
  375|       |  // find by offset, a search from a bare pointer remeasures the rest of desc on every step
  376|   213k|  size_t part = desc.find(MORPH_PART);
  ------------------
  |  |  112|   213k|#define MORPH_PART "pa:"
  ------------------
  377|   213k|  if (part == std::string::npos)
  ------------------
  |  Branch (377:7): [True: 213k, False: 0]
  ------------------
  378|   213k|    return 0;
  379|      0|  static const char separators[] = {' ', '\t', '\n', '\0'};
  380|      0|  size_t nextpart = desc.find(MORPH_PART, part + 1);
  ------------------
  |  |  112|      0|#define MORPH_PART "pa:"
  ------------------
  381|      0|  while (nextpart != std::string::npos) {
  ------------------
  |  Branch (381:10): [True: 0, False: 0]
  ------------------
  382|      0|    const auto field = desc.begin() + part + MORPH_TAG_LEN;
  ------------------
  |  |  115|      0|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |   99|      0|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
  383|      0|    const auto end = desc.begin() + nextpart;
  384|      0|    result.append(field, std::find_first_of(field, end, std::begin(separators),
  385|      0|                                            std::end(separators)));
  386|      0|    part = nextpart;
  387|      0|    nextpart = desc.find(MORPH_PART, part + 1);
  ------------------
  |  |  112|      0|#define MORPH_PART "pa:"
  ------------------
  388|      0|  }
  389|      0|  return part;
  390|   213k|}
_Z10copy_fieldRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_S8_:
  394|   214k|                const std::string& var) {
  395|   214k|  if (morph.empty())
  ------------------
  |  Branch (395:7): [True: 0, False: 214k]
  ------------------
  396|      0|    return false;
  397|   214k|  size_t pos = morph.find(var);
  398|   214k|  if (pos == std::string::npos)
  ------------------
  |  Branch (398:7): [True: 10, False: 214k]
  ------------------
  399|     10|    return false;
  400|   214k|  pos += MORPH_TAG_LEN;
  ------------------
  |  |  115|   214k|#define MORPH_TAG_LEN strlen(MORPH_STEM)
  |  |  ------------------
  |  |  |  |   99|   214k|#define MORPH_STEM "st:"
  |  |  ------------------
  ------------------
  401|       |  // copy the field value up to the next whitespace, without first
  402|       |  // making a throwaway copy of the whole remaining tail of the string
  403|   214k|  size_t end = morph.find_first_of(" \t\n", pos);
  404|   214k|  dest.assign(morph, pos, end == std::string::npos ? std::string::npos : end - pos);
  ------------------
  |  Branch (404:27): [True: 197k, False: 17.7k]
  ------------------
  405|       |
  406|   214k|  return true;
  407|   214k|}
_Z8mystrrepRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_S8_:
  411|  1.05M|                      const std::string& replace) {
  412|  1.05M|  size_t pos = 0;
  413|  1.11M|  while ((pos = str.find(search, pos)) != std::string::npos) {
  ------------------
  |  Branch (413:10): [True: 62.2k, False: 1.05M]
  ------------------
  414|  62.2k|    str.replace(pos, search.length(), replace);
  415|  62.2k|    pos += replace.length();
  416|  62.2k|  }
  417|  1.05M|  return str;
  418|  1.05M|}
_Z11reversewordRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  421|  1.00M|size_t reverseword(std::string& word) {
  422|  1.00M|  std::reverse(word.begin(), word.end());
  423|  1.00M|  return word.size();
  424|  1.00M|}
_Z8uniqlistRNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEE:
  501|  7.88k|void uniqlist(std::vector<std::string>& list) {
  502|  7.88k|  if (list.size() < 2)
  ------------------
  |  Branch (502:7): [True: 7.86k, False: 19]
  ------------------
  503|  7.86k|    return;
  504|       |
  505|     19|  std::vector<std::string> ret;
  506|     19|  ret.push_back(list[0]);
  507|       |
  508|     38|  for (size_t i = 1; i < list.size(); ++i) {
  ------------------
  |  Branch (508:22): [True: 19, False: 19]
  ------------------
  509|     19|    if (std::find(ret.begin(), ret.end(), list[i]) == ret.end())
  ------------------
  |  Branch (509:9): [True: 19, False: 0]
  ------------------
  510|     19|        ret.push_back(list[i]);
  511|     19|  }
  512|       |
  513|     19|  list.swap(ret);
  514|     19|}
_Z9upper_utf6w_chari:
  533|  4.68M|w_char upper_utf(w_char u, int langnum) {
  534|       |
  535|  4.68M|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  536|       |
  537|       |//with these optimizations, msvc can optimize this function to one jmp instruction
  538|       |//but g++ remains in five instructions
  539|       |//maybe use inline asm for g++?
  540|       |
  541|       |#if (__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)) && defined __cpp_lib_bit_cast && __cpp_lib_bit_cast >= 201806L
  542|       |  return std::bit_cast<w_char>(unicodetoupper((unsigned short)u, langnum));
  543|       |#else
  544|  4.68M|  const auto us = unicodetoupper((unsigned short)u, langnum);
  545|  4.68M|  memcpy(&u, &us, sizeof(unsigned short));
  546|  4.68M|  return u;
  547|  4.68M|#endif
  548|       |
  549|       |#else
  550|       |  const auto us = unicodetoupper((unsigned short)u, langnum);
  551|       |  u.h = (unsigned char)(us >> 8);
  552|       |  u.l = (unsigned char)(us & 0xff);
  553|       |  return u;
  554|       |#endif
  555|  4.68M|}
_Z9lower_utf6w_chari:
  557|  9.89M|w_char lower_utf(w_char u, int langnum) {
  558|       |
  559|  9.89M|#if defined(_WIN32) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__))  || defined(__LITTLE_ENDIAN__)
  560|       |
  561|       |//with these optimizations, msvc can optimize this function to one jmp instruction
  562|       |//but g++ remains in five instructions
  563|       |//maybe use inline asm for g++?
  564|       |
  565|       |#if (__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)) && defined __cpp_lib_bit_cast && __cpp_lib_bit_cast >= 201806L
  566|       |  return std::bit_cast<w_char>(unicodetolower((unsigned short)u, langnum));
  567|       |#else
  568|  9.89M|  const auto us = unicodetolower((unsigned short)u, langnum);
  569|  9.89M|  memcpy(&u, &us, sizeof(unsigned short));
  570|  9.89M|  return u;
  571|  9.89M|#endif
  572|       |
  573|       |#else
  574|       |  const auto us = unicodetolower((unsigned short)u, langnum);
  575|       |  u.h = (unsigned char)(us >> 8);
  576|       |  u.l = (unsigned char)(us & 0xff);
  577|       |  return u;
  578|       |#endif
  579|  9.89M|}
_Z8mkallcapRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  582|   291k|std::string& mkallcap(std::string& s, const struct cs_info* csconv) {
  583|  5.95M|  for (char& aI : s) {
  ------------------
  |  Branch (583:17): [True: 5.95M, False: 291k]
  ------------------
  584|  5.95M|    aI = cupper(csconv, static_cast<unsigned char>(aI));
  585|  5.95M|  }
  586|   291k|  return s;
  587|   291k|}
_Z10mkallsmallRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  590|  3.12M|std::string& mkallsmall(std::string& s, const struct cs_info* csconv) {
  591|  32.9M|  for (char& aI : s) {
  ------------------
  |  Branch (591:17): [True: 32.9M, False: 3.12M]
  ------------------
  592|  32.9M|    aI = clower(csconv, static_cast<unsigned char>(aI));
  593|  32.9M|  }
  594|  3.12M|  return s;
  595|  3.12M|}
_Z14mkallsmall_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  597|  1.64M|std::vector<w_char>& mkallsmall_utf(std::vector<w_char>& u, int langnum) {
  598|  9.74M|  for (auto& i : u) {
  ------------------
  |  Branch (598:16): [True: 9.74M, False: 1.64M]
  ------------------
  599|  9.74M|    i = lower_utf(i, langnum);
  600|  9.74M|  }
  601|  1.64M|  return u;
  602|  1.64M|}
_Z12mkallcap_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  604|   170k|std::vector<w_char>& mkallcap_utf(std::vector<w_char>& u, int langnum) {
  605|  2.13M|  for (auto& i : u) {
  ------------------
  |  Branch (605:16): [True: 2.13M, False: 170k]
  ------------------
  606|  2.13M|    i = upper_utf(i, langnum);
  607|  2.13M|  }
  608|   170k|  return u;
  609|   170k|}
_Z9mkinitcapRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  611|  2.11M|std::string& mkinitcap(std::string& s, const struct cs_info* csconv) {
  612|  2.11M|  if (!s.empty()) {
  ------------------
  |  Branch (612:7): [True: 2.11M, False: 195]
  ------------------
  613|  2.11M|    s[0] = cupper(csconv, static_cast<unsigned char>(s[0]));
  614|  2.11M|  }
  615|  2.11M|  return s;
  616|  2.11M|}
_Z13mkinitcap_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  618|   422k|std::vector<w_char>& mkinitcap_utf(std::vector<w_char>& u, int langnum) {
  619|   422k|  if (!u.empty()) {
  ------------------
  |  Branch (619:7): [True: 422k, False: 0]
  ------------------
  620|   422k|    u[0] = upper_utf(u[0], langnum);
  621|   422k|  }
  622|   422k|  return u;
  623|   422k|}
_Z11mkinitsmallRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
  625|   267k|std::string& mkinitsmall(std::string& s, const struct cs_info* csconv) {
  626|   267k|  if (!s.empty()) {
  ------------------
  |  Branch (626:7): [True: 267k, False: 0]
  ------------------
  627|   267k|    s[0] = clower(csconv, static_cast<unsigned char>(s[0]));
  628|   267k|  }
  629|   267k|  return s;
  630|   267k|}
_Z15mkinitsmall_utfRNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
  632|  37.8k|std::vector<w_char>& mkinitsmall_utf(std::vector<w_char>& u, int langnum) {
  633|  37.8k|  if (!u.empty()) {
  ------------------
  |  Branch (633:7): [True: 37.8k, False: 0]
  ------------------
  634|  37.8k|    u[0] = lower_utf(u[0], langnum);
  635|  37.8k|  }
  636|  37.8k|  return u;
  637|  37.8k|}
_Z14get_current_csRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 2295|  2.28k|const struct cs_info* get_current_cs(const std::string& es) {
 2296|  2.28k|  char* normalized_encoding = new char[es.size() + 1];
 2297|  2.28k|  toAsciiLowerAndRemoveNonAlphanumeric(es.c_str(), normalized_encoding);
 2298|       |
 2299|  2.28k|  const struct cs_info* ccs = nullptr;
 2300|  2.28k|  for (const auto& encd : encds) {
  ------------------
  |  Branch (2300:25): [True: 2.28k, False: 0]
  ------------------
 2301|  2.28k|    if (strcmp(normalized_encoding, encd.enc_name) == 0) {
  ------------------
  |  Branch (2301:9): [True: 2.28k, False: 0]
  ------------------
 2302|  2.28k|      ccs = encd.cs_table;
 2303|  2.28k|      break;
 2304|  2.28k|    }
 2305|  2.28k|  }
 2306|       |
 2307|  2.28k|  delete[] normalized_encoding;
 2308|       |
 2309|  2.28k|  if (!ccs) {
  ------------------
  |  Branch (2309:7): [True: 0, False: 2.28k]
  ------------------
 2310|      0|    HUNSPELL_WARNING(stderr,
 2311|      0|                     "error: unknown encoding %s: using %s as fallback\n", es.c_str(),
 2312|      0|                     encds[0].enc_name);
 2313|      0|    ccs = encds[0].cs_table;
 2314|      0|  }
 2315|       |
 2316|  2.28k|  return ccs;
 2317|  2.28k|}
_Z12get_lang_numRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
 2364|      4|int get_lang_num(const std::string& lang) {
 2365|     72|  for (const auto& i : lang2enc) {
  ------------------
  |  Branch (2365:22): [True: 72, False: 0]
  ------------------
 2366|     72|    if (strcmp(lang.c_str(), i.lang) == 0) {
  ------------------
  |  Branch (2366:9): [True: 4, False: 68]
  ------------------
 2367|      4|      return i.num;
 2368|      4|    }
 2369|     72|  }
 2370|      0|  return LANG_xx;
 2371|      4|}
_Z14unicodetoupperti:
 2373|  35.5M|unsigned short unicodetoupper(unsigned short c, int langnum) {
 2374|       |  // In Azeri and Turkish, I and i dictinct letters:
 2375|       |  // There are a dotless lower case i pair of upper `I',
 2376|       |  // and an upper I with dot pair of lower `i'.
 2377|  35.5M|  if (c == 0x0069 && ((langnum == LANG_az) || (langnum == LANG_tr) || (langnum == LANG_crh)))
  ------------------
  |  Branch (2377:7): [True: 406k, False: 35.1M]
  |  Branch (2377:23): [True: 0, False: 406k]
  |  Branch (2377:47): [True: 0, False: 406k]
  |  Branch (2377:71): [True: 0, False: 406k]
  ------------------
 2378|      0|    return 0x0130;
 2379|       |#ifdef OPENOFFICEORG
 2380|       |  return static_cast<unsigned short>(u_toupper(c));
 2381|       |#else
 2382|       |#ifdef MOZILLA_CLIENT
 2383|       |  return moz_hunspell_ToUpperCase((char16_t)c);
 2384|       |#else
 2385|  35.5M|  unsigned short up = utf_pages[utf_page_index[c >> 8]][c & 0xFF].cupper;
 2386|  35.5M|  return up ? up : c;
  ------------------
  |  Branch (2386:10): [True: 4.42M, False: 31.1M]
  ------------------
 2387|  35.5M|#endif
 2388|  35.5M|#endif
 2389|  35.5M|}
_Z14unicodetolowerti:
 2391|  42.1M|unsigned short unicodetolower(unsigned short c, int langnum) {
 2392|       |  // In Azeri and Turkish, I and i dictinct letters:
 2393|       |  // There are a dotless lower case i pair of upper `I',
 2394|       |  // and an upper I with dot pair of lower `i'.
 2395|  42.1M|  if (c == 0x0049 && ((langnum == LANG_az) || (langnum == LANG_tr) || (langnum == LANG_crh)))
  ------------------
  |  Branch (2395:7): [True: 101k, False: 42.0M]
  |  Branch (2395:23): [True: 0, False: 101k]
  |  Branch (2395:47): [True: 0, False: 101k]
  |  Branch (2395:71): [True: 0, False: 101k]
  ------------------
 2396|      0|    return 0x0131;
 2397|       |#ifdef OPENOFFICEORG
 2398|       |  return static_cast<unsigned short>(u_tolower(c));
 2399|       |#else
 2400|       |#ifdef MOZILLA_CLIENT
 2401|       |  return moz_hunspell_ToLowerCase((char16_t)c);
 2402|       |#else
 2403|  42.1M|  unsigned short lo = utf_pages[utf_page_index[c >> 8]][c & 0xFF].clower;
 2404|  42.1M|  return lo ? lo : c;
  ------------------
  |  Branch (2404:10): [True: 3.28M, False: 38.8M]
  ------------------
 2405|  42.1M|#endif
 2406|  42.1M|#endif
 2407|  42.1M|}
_Z11get_captypeRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK7cs_info:
 2423|  15.3M|int get_captype(const std::string& word, const cs_info* csconv) {
 2424|       |  // now determine the capitalization type of the first nl letters
 2425|  15.3M|  size_t ncap = 0;
 2426|  15.3M|  size_t nneutral = 0;
 2427|  15.3M|  size_t firstcap = 0;
 2428|  15.3M|  if (csconv == nullptr)
  ------------------
  |  Branch (2428:7): [True: 0, False: 15.3M]
  ------------------
 2429|      0|    return NOCAP;
  ------------------
  |  |   88|      0|#define NOCAP 0
  ------------------
 2430|   164M|  for (char q : word) {
  ------------------
  |  Branch (2430:15): [True: 164M, False: 15.3M]
  ------------------
 2431|   164M|    const auto nIndex = static_cast<unsigned char>(q);
 2432|   164M|    if (ccase(csconv, nIndex))
  ------------------
  |  Branch (2432:9): [True: 6.03M, False: 158M]
  ------------------
 2433|  6.03M|      ncap++;
 2434|   164M|    if (cupper(csconv, nIndex) == clower(csconv, nIndex))
  ------------------
  |  Branch (2434:9): [True: 133M, False: 30.5M]
  ------------------
 2435|   133M|      nneutral++;
 2436|   164M|  }
 2437|  15.3M|  if (ncap) {
  ------------------
  |  Branch (2437:7): [True: 2.30M, False: 13.0M]
  ------------------
 2438|  2.30M|    const auto nIndex = static_cast<unsigned char>(word[0]);
 2439|  2.30M|    firstcap = csconv[nIndex].ccase;
 2440|  2.30M|  }
 2441|       |
 2442|       |  // now finally set the captype
 2443|  15.3M|  if (ncap == 0) {
  ------------------
  |  Branch (2443:7): [True: 13.0M, False: 2.30M]
  ------------------
 2444|  13.0M|    return NOCAP;
  ------------------
  |  |   88|  13.0M|#define NOCAP 0
  ------------------
 2445|  13.0M|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (2445:14): [True: 971k, False: 1.33M]
  |  Branch (2445:29): [True: 423k, False: 548k]
  ------------------
 2446|   423k|    return INITCAP;
  ------------------
  |  |   89|   423k|#define INITCAP 1
  ------------------
 2447|  1.88M|  } else if ((ncap == word.size()) || ((ncap + nneutral) == word.size())) {
  ------------------
  |  Branch (2447:14): [True: 6.06k, False: 1.87M]
  |  Branch (2447:39): [True: 727k, False: 1.14M]
  ------------------
 2448|   733k|    return ALLCAP;
  ------------------
  |  |   90|   733k|#define ALLCAP 2
  ------------------
 2449|  1.14M|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (2449:14): [True: 814k, False: 332k]
  |  Branch (2449:28): [True: 272k, False: 541k]
  ------------------
 2450|   272k|    return HUHINITCAP;
  ------------------
  |  |   92|   272k|#define HUHINITCAP 4
  ------------------
 2451|   272k|  }
 2452|   874k|  return HUHCAP;
  ------------------
  |  |   91|   874k|#define HUHCAP 3
  ------------------
 2453|  15.3M|}
_Z16get_captype_utf8RKNSt3__16vectorI6w_charNS_9allocatorIS1_EEEEi:
 2455|  3.43M|int get_captype_utf8(const std::vector<w_char>& word, int langnum) {
 2456|       |  // now determine the capitalization type of the first nl letters
 2457|  3.43M|  size_t ncap = 0;
 2458|  3.43M|  size_t nneutral = 0;
 2459|  3.43M|  size_t firstcap = 0;
 2460|       |
 2461|  3.43M|  auto it = word.begin(), it_end = word.end();
 2462|  34.1M|  while (it != it_end) {
  ------------------
  |  Branch (2462:10): [True: 30.6M, False: 3.43M]
  ------------------
 2463|  30.6M|    const auto idx = (unsigned short)*it;
 2464|  30.6M|    const auto lwridx = unicodetolower(idx, langnum);
 2465|  30.6M|    if (idx != lwridx)
  ------------------
  |  Branch (2465:9): [True: 1.01M, False: 29.6M]
  ------------------
 2466|  1.01M|      ncap++;
 2467|  30.6M|    if (unicodetoupper(idx, langnum) == lwridx)
  ------------------
  |  Branch (2467:9): [True: 26.4M, False: 4.25M]
  ------------------
 2468|  26.4M|      nneutral++;
 2469|  30.6M|    ++it;
 2470|  30.6M|  }
 2471|  3.43M|  if (ncap) {
  ------------------
  |  Branch (2471:7): [True: 434k, False: 2.99M]
  ------------------
 2472|   434k|    const auto idx = (unsigned short)word[0];
 2473|   434k|    firstcap = (idx != unicodetolower(idx, langnum));
 2474|   434k|  }
 2475|       |
 2476|       |  // now finally set the captype
 2477|  3.43M|  if (ncap == 0) {
  ------------------
  |  Branch (2477:7): [True: 2.99M, False: 434k]
  ------------------
 2478|  2.99M|    return NOCAP;
  ------------------
  |  |   88|  2.99M|#define NOCAP 0
  ------------------
 2479|  2.99M|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (2479:14): [True: 303k, False: 130k]
  |  Branch (2479:29): [True: 113k, False: 189k]
  ------------------
 2480|   113k|    return INITCAP;
  ------------------
  |  |   89|   113k|#define INITCAP 1
  ------------------
 2481|   320k|  } else if ((ncap == word.size()) || ((ncap + nneutral) == word.size())) {
  ------------------
  |  Branch (2481:14): [True: 2.19k, False: 318k]
  |  Branch (2481:39): [True: 116k, False: 201k]
  ------------------
 2482|   118k|    return ALLCAP;
  ------------------
  |  |   90|   118k|#define ALLCAP 2
  ------------------
 2483|   201k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (2483:14): [True: 89.4k, False: 112k]
  |  Branch (2483:28): [True: 38.3k, False: 51.1k]
  ------------------
 2484|  38.3k|    return HUHINITCAP;
  ------------------
  |  |   92|  38.3k|#define HUHINITCAP 4
  ------------------
 2485|  38.3k|  }
 2486|   163k|  return HUHCAP;
  ------------------
  |  |   91|   163k|#define HUHCAP 3
  ------------------
 2487|  3.43M|}
_Z24remove_ignored_chars_utfRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEE:
 2491|   864k|                                const std::vector<w_char>& ignored_chars) {
 2492|   864k|  std::vector<w_char> w;
 2493|   864k|  std::vector<w_char> w2;
 2494|   864k|  u8_u16(w, word);
 2495|       |
 2496|   864k|  std::copy_if(w.begin(), w.end(), std::back_inserter(w2),
 2497|   864k|  [&ignored_chars](w_char wc) {
 2498|   864k|    return !std::binary_search(ignored_chars.begin(), ignored_chars.end(), wc);
 2499|   864k|  });
 2500|       |
 2501|   864k|  u16_u8(word, w2);
 2502|   864k|  return w2.size();
 2503|   864k|}
_Z20remove_ignored_charsRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKS5_:
 2507|  3.21M|                            const std::string& ignored_chars) {
 2508|  3.21M|  word.erase(
 2509|  3.21M|      std::remove_if(word.begin(), word.end(), is_any_of(ignored_chars)),
 2510|  3.21M|      word.end());
 2511|  3.21M|  return word.size();
 2512|  3.21M|}
_Z12parse_stringRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_i:
 2514|     90|bool parse_string(const std::string& line, std::string& out, int ln) {
 2515|     90|  if (!out.empty()) {
  ------------------
  |  Branch (2515:7): [True: 0, False: 90]
  ------------------
 2516|      0|    HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions\n", ln);
 2517|      0|    return false;
 2518|      0|  }
 2519|     90|  int i = 0;
 2520|     90|  int np = 0;
 2521|     90|  auto iter = line.begin(), start_piece = mystrsep(line, iter);
 2522|    270|  while (start_piece != line.end()) {
  ------------------
  |  Branch (2522:10): [True: 180, False: 90]
  ------------------
 2523|    180|    switch (i) {
 2524|     90|      case 0: {
  ------------------
  |  Branch (2524:7): [True: 90, False: 90]
  ------------------
 2525|     90|        np++;
 2526|     90|        break;
 2527|      0|      }
 2528|     90|      case 1: {
  ------------------
  |  Branch (2528:7): [True: 90, False: 90]
  ------------------
 2529|     90|        out.assign(start_piece, iter);
 2530|     90|        np++;
 2531|     90|        break;
 2532|      0|      }
 2533|      0|      default:
  ------------------
  |  Branch (2533:7): [True: 0, False: 180]
  ------------------
 2534|      0|        break;
 2535|    180|    }
 2536|    180|    ++i;
 2537|    180|     start_piece = mystrsep(line, iter);
 2538|    180|  }
 2539|     90|  if (np != 2) {
  ------------------
  |  Branch (2539:7): [True: 0, False: 90]
  ------------------
 2540|      0|    HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", ln);
 2541|      0|    return false;
 2542|      0|  }
 2543|     90|  return true;
 2544|     90|}
_Z11parse_arrayRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_RNS_6vectorI6w_charNS3_ISA_EEEEii:
 2550|     14|                 int ln) {
 2551|     14|  if (!parse_string(line, out, ln))
  ------------------
  |  Branch (2551:7): [True: 0, False: 14]
  ------------------
 2552|      0|    return false;
 2553|     14|  if (utf8) {
  ------------------
  |  Branch (2553:7): [True: 8, False: 6]
  ------------------
 2554|      8|    u8_u16(out_utf16, out);
 2555|      8|    std::sort(out_utf16.begin(), out_utf16.end());
 2556|      8|  }
 2557|     14|  return true;
 2558|     14|}
csutil.cxx:_ZL17warn_missing_contRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS_11__wrap_iterIPKcEE:
  150|   758k|static void warn_missing_cont(const std::string& src, std::string::const_iterator p) {
  151|       |  HUNSPELL_WARNING(stderr,
  152|   758k|                   "UTF-8 encoding error. Missing continuation byte in "
  153|   758k|                   "%ld. character position:\n%s\n",
  154|   758k|                   static_cast<long>(std::distance(src.begin(), p)),
  155|   758k|                   src.c_str());
  156|   758k|}
csutil.cxx:_ZN12_GLOBAL__N_19is_any_ofC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  241|  3.22M|  explicit is_any_of(const std::string& in) : chars(in) {}
csutil.cxx:_ZNK12_GLOBAL__N_19is_any_ofclEc:
  243|  35.7M|  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:
  300|  2.52k|static void drop_repeated_lines(std::vector<std::string>& lines) {
  301|  2.52k|  std::unordered_set<std::string> seen;
  302|  2.52k|  auto firstrepeat = std::remove_if(lines.begin(), lines.end(),
  303|  2.52k|                                    [&seen](const std::string& line) { return !seen.insert(line).second; });
  304|  2.52k|  lines.erase(firstrepeat, lines.end());
  305|  2.52k|}
csutil.cxx:_ZZL19drop_repeated_linesRNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEEEENK3$_0clERKS6_:
  303|  3.54k|                                    [&seen](const std::string& line) { return !seen.insert(line).second; });
csutil.cxx:_ZN12_GLOBAL__N_16cupperEPK7cs_infoi:
  517|   172M|unsigned char cupper(const struct cs_info* csconv, int nIndex) {
  518|   172M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (518:3): [True: 172M, False: 0]
  |  Branch (518:3): [True: 172M, False: 0]
  |  Branch (518:3): [True: 172M, False: 0]
  ------------------
  519|   172M|  return csconv[nIndex].cupper;
  520|   172M|}
csutil.cxx:_ZN12_GLOBAL__N_16clowerEPK7cs_infoi:
  522|   197M|unsigned char clower(const struct cs_info* csconv, int nIndex) {
  523|   197M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (523:3): [True: 197M, False: 0]
  |  Branch (523:3): [True: 197M, False: 0]
  |  Branch (523:3): [True: 197M, False: 0]
  ------------------
  524|   197M|  return csconv[nIndex].clower;
  525|   197M|}
csutil.cxx:_ZL36toAsciiLowerAndRemoveNonAlphanumericPKcPc:
 2275|  2.28k|                                                 char* pBuf) {
 2276|  20.6k|  while (*pName) {
  ------------------
  |  Branch (2276:10): [True: 18.3k, False: 2.28k]
  ------------------
 2277|       |    /* A-Z */
 2278|  18.3k|    if ((*pName >= 0x41) && (*pName <= 0x5A)) {
  ------------------
  |  Branch (2278:9): [True: 6.85k, False: 11.5k]
  |  Branch (2278:29): [True: 294, False: 6.55k]
  ------------------
 2279|    294|      *pBuf = (*pName) + 0x20; /* toAsciiLower */
 2280|    294|      pBuf++;
 2281|    294|    }
 2282|       |    /* a-z, 0-9 */
 2283|  18.0k|    else if (((*pName >= 0x61) && (*pName <= 0x7A)) ||
  ------------------
  |  Branch (2283:15): [True: 6.55k, False: 11.5k]
  |  Branch (2283:35): [True: 6.55k, False: 0]
  ------------------
 2284|  17.9k|             ((*pName >= 0x30) && (*pName <= 0x39))) {
  ------------------
  |  Branch (2284:15): [True: 11.4k, False: 98]
  |  Branch (2284:35): [True: 11.4k, False: 0]
  ------------------
 2285|  17.9k|      *pBuf = *pName;
 2286|  17.9k|      pBuf++;
 2287|  17.9k|    }
 2288|       |
 2289|  18.3k|    pName++;
 2290|  18.3k|  }
 2291|       |
 2292|  2.28k|  *pBuf = '\0';
 2293|  2.28k|}
csutil.cxx:_ZN12_GLOBAL__N_15ccaseEPK7cs_infoi:
  527|   164M|unsigned char ccase(const struct cs_info* csconv, int nIndex) {
  528|   164M|  assert(nIndex >= 0 && nIndex <= 255);
  ------------------
  |  Branch (528:3): [True: 164M, False: 0]
  |  Branch (528:3): [True: 164M, False: 0]
  |  Branch (528:3): [True: 164M, False: 0]
  ------------------
  529|   164M|  return csconv[nIndex].ccase;
  530|   164M|}
csutil.cxx:_ZZ24remove_ignored_chars_utfRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERKNS_6vectorI6w_charNS3_IS8_EEEEENK3$_0clES8_:
 2497|  8.49M|  [&ignored_chars](w_char wc) {
 2498|  8.49M|    return !std::binary_search(ignored_chars.begin(), ignored_chars.end(), wc);
 2499|  8.49M|  });

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

_ZN12HunspellImplC2EPKcS1_S1_:
  199|     38|  : m_trace(std::make_unique<TraceCtx>(nullptr, nullptr))
  200|     38|  , affixpath(affpath)
  201|     38|  , affixkey(key ? key : "") {
  ------------------
  |  Branch (201:14): [True: 0, False: 38]
  ------------------
  202|     38|  csconv = nullptr;
  203|     38|  utf8 = 0;
  204|     38|  complexprefixes = 0;
  205|       |
  206|       |  /* first set up the hash manager */
  207|     38|  m_HMgrs.push_back(std::make_unique<HashMgr>(dpath, affpath, key));
  208|       |
  209|       |  /* next set up the affix manager */
  210|       |  /* it needs access to the hash manager lookup methods */
  211|     38|  pAMgr = std::make_unique<AffixMgr>(affpath, m_HMgrs, key);
  212|       |
  213|       |  /* get the preferred try string and the dictionary */
  214|       |  /* encoding from the Affix Manager for that dictionary */
  215|     38|  std::string try_string = pAMgr->get_try_string();
  216|     38|  encoding = pAMgr->get_encoding();
  217|     38|  langnum = pAMgr->get_langnum();
  218|     38|  utf8 = pAMgr->get_utf8();
  219|     38|  if (!utf8)
  ------------------
  |  Branch (219:7): [True: 20, False: 18]
  ------------------
  220|     20|    csconv = get_current_cs(encoding);
  221|     38|  complexprefixes = pAMgr->get_complexprefixes();
  222|     38|  wordbreak = pAMgr->get_breaktable();
  223|       |
  224|       |  /* and finally set up the suggestion manager */
  225|     38|  pSMgr = std::make_unique<SuggestMgr>(try_string, MAXSUGGESTION, pAMgr.get());
  ------------------
  |  |   83|     38|#define MAXSUGGESTION 15
  ------------------
  226|     38|}
_ZN12HunspellImpl12clean_ignoreERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
  248|  40.4M|                                const std::string& src) {
  249|  40.4M|  dest.clear();
  250|  40.4M|  dest.assign(src);
  251|  40.4M|  const char* ignoredchars = pAMgr ? pAMgr->get_ignore() : nullptr;
  ------------------
  |  Branch (251:30): [True: 40.4M, False: 0]
  ------------------
  252|  40.4M|  if (ignoredchars != nullptr) {
  ------------------
  |  Branch (252:7): [True: 4.08M, False: 36.3M]
  ------------------
  253|  4.08M|    if (utf8) {
  ------------------
  |  Branch (253:9): [True: 864k, False: 3.21M]
  ------------------
  254|   864k|      const std::vector<w_char>& ignoredchars_utf16 =
  255|   864k|          pAMgr->get_ignore_utf16();
  256|   864k|      remove_ignored_chars_utf(dest, ignoredchars_utf16);
  257|  3.21M|    } else {
  258|  3.21M|      remove_ignored_chars(dest, ignoredchars);
  259|  3.21M|    }
  260|  4.08M|  }
  261|  40.4M|}
_ZN12HunspellImpl10cleanword2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEERKS6_PiPm:
  275|  19.0M|                         size_t* pabbrev) {
  276|  19.0M|  dest.clear();
  277|  19.0M|  dest_utf.clear();
  278|       |
  279|       |  // remove IGNORE characters from the string
  280|  19.0M|  std::string w2;
  281|  19.0M|  clean_ignore(w2, src);
  282|       |
  283|  19.0M|  const char* q = w2.c_str();
  284|  19.0M|  size_t nl = w2.size();
  285|       |
  286|       |  // first skip over any leading blanks
  287|  19.3M|  while (*q == ' ') {
  ------------------
  |  Branch (287:10): [True: 287k, False: 19.0M]
  ------------------
  288|   287k|    ++q;
  289|   287k|    nl--;
  290|   287k|  }
  291|       |
  292|       |  // now strip off any trailing periods (recording their presence)
  293|  19.0M|  *pabbrev = 0;
  294|       |
  295|  21.4M|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (295:10): [True: 21.1M, False: 305k]
  |  Branch (295:22): [True: 2.41M, False: 18.7M]
  ------------------
  296|  2.41M|    nl--;
  297|  2.41M|    (*pabbrev)++;
  298|  2.41M|  }
  299|       |
  300|       |  // if no characters are left it can't be capitalized
  301|  19.0M|  if (nl == 0) {
  ------------------
  |  Branch (301:7): [True: 305k, False: 18.7M]
  ------------------
  302|   305k|    *pcaptype = NOCAP;
  ------------------
  |  |   88|   305k|#define NOCAP 0
  ------------------
  303|   305k|    return 0;
  304|   305k|  }
  305|       |
  306|  18.7M|  dest.append(q, nl);
  307|  18.7M|  nl = dest.size();
  308|  18.7M|  if (utf8) {
  ------------------
  |  Branch (308:7): [True: 3.42M, False: 15.3M]
  ------------------
  309|  3.42M|    u8_u16(dest_utf, dest);
  310|  3.42M|    *pcaptype = get_captype_utf8(dest_utf, langnum);
  311|  15.3M|  } else {
  312|  15.3M|    *pcaptype = get_captype(dest, csconv);
  313|  15.3M|  }
  314|  18.7M|  return nl;
  315|  19.0M|}
_ZN12HunspellImpl9cleanwordERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_PiSA_:
  320|  7.15k|                        int* pabbrev) {
  321|  7.15k|  dest.clear();
  322|  7.15k|  const unsigned char* q = (const unsigned char*)src.c_str();
  323|  7.15k|  int firstcap = 0, nl = (int)src.size();
  324|       |
  325|       |  // first skip over any leading blanks
  326|  12.9k|  while (*q == ' ') {
  ------------------
  |  Branch (326:10): [True: 5.81k, False: 7.15k]
  ------------------
  327|  5.81k|    ++q;
  328|  5.81k|    nl--;
  329|  5.81k|  }
  330|       |
  331|       |  // now strip off any trailing periods (recording their presence)
  332|  7.15k|  *pabbrev = 0;
  333|       |
  334|  26.2k|  while ((nl > 0) && (*(q + nl - 1) == '.')) {
  ------------------
  |  Branch (334:10): [True: 25.9k, False: 247]
  |  Branch (334:22): [True: 19.0k, False: 6.90k]
  ------------------
  335|  19.0k|    nl--;
  336|  19.0k|    (*pabbrev)++;
  337|  19.0k|  }
  338|       |
  339|       |  // if no characters are left it can't be capitalized
  340|  7.15k|  if (nl <= 0) {
  ------------------
  |  Branch (340:7): [True: 247, False: 6.90k]
  ------------------
  341|    247|    *pcaptype = NOCAP;
  ------------------
  |  |   88|    247|#define NOCAP 0
  ------------------
  342|    247|    return;
  343|    247|  }
  344|       |
  345|       |  // now determine the capitalization type of the first nl letters
  346|  6.90k|  int ncap = 0;
  347|  6.90k|  int nneutral = 0;
  348|  6.90k|  int nc = 0;
  349|       |
  350|  6.90k|  if (!utf8) {
  ------------------
  |  Branch (350:7): [True: 3.67k, False: 3.22k]
  ------------------
  351|   579k|    while (nl > 0) {
  ------------------
  |  Branch (351:12): [True: 575k, False: 3.67k]
  ------------------
  352|   575k|      nc++;
  353|   575k|      if (csconv[(*q)].ccase)
  ------------------
  |  Branch (353:11): [True: 468k, False: 107k]
  ------------------
  354|   468k|        ncap++;
  355|   575k|      if (csconv[(*q)].cupper == csconv[(*q)].clower)
  ------------------
  |  Branch (355:11): [True: 89.8k, False: 485k]
  ------------------
  356|  89.8k|        nneutral++;
  357|   575k|      dest.push_back(*q++);
  358|   575k|      nl--;
  359|   575k|    }
  360|       |    // remember to terminate the destination string
  361|  3.67k|    firstcap = csconv[static_cast<unsigned char>(dest[0])].ccase;
  362|  3.67k|  } else {
  363|  3.22k|    std::vector<w_char> t;
  364|  3.22k|    u8_u16(t, src);
  365|   179k|    for (auto& wc : t) {
  ------------------
  |  Branch (365:19): [True: 179k, False: 3.22k]
  ------------------
  366|   179k|      const auto idx = (unsigned short)wc;
  367|   179k|      const auto low = unicodetolower(idx, langnum);
  368|   179k|      if (idx != low)
  ------------------
  |  Branch (368:11): [True: 116k, False: 63.0k]
  ------------------
  369|   116k|        ncap++;
  370|   179k|      if (unicodetoupper(idx, langnum) == low)
  ------------------
  |  Branch (370:11): [True: 59.7k, False: 119k]
  ------------------
  371|  59.7k|        nneutral++;
  372|   179k|    }
  373|  3.22k|    u16_u8(dest, t);
  374|  3.22k|    if (ncap) {
  ------------------
  |  Branch (374:9): [True: 1.84k, False: 1.38k]
  ------------------
  375|  1.84k|      const auto idx = (unsigned short)t[0];
  376|  1.84k|      firstcap = (idx != unicodetolower(idx, langnum));
  377|  1.84k|    }
  378|  3.22k|  }
  379|       |
  380|       |  // now finally set the captype
  381|  6.90k|  if (ncap == 0) {
  ------------------
  |  Branch (381:7): [True: 2.49k, False: 4.40k]
  ------------------
  382|  2.49k|    *pcaptype = NOCAP;
  ------------------
  |  |   88|  2.49k|#define NOCAP 0
  ------------------
  383|  4.40k|  } else if ((ncap == 1) && firstcap) {
  ------------------
  |  Branch (383:14): [True: 2.51k, False: 1.89k]
  |  Branch (383:29): [True: 2.21k, False: 296]
  ------------------
  384|  2.21k|    *pcaptype = INITCAP;
  ------------------
  |  |   89|  2.21k|#define INITCAP 1
  ------------------
  385|  2.21k|  } else if ((ncap == nc) || ((ncap + nneutral) == nc)) {
  ------------------
  |  Branch (385:14): [True: 90, False: 2.10k]
  |  Branch (385:30): [True: 270, False: 1.83k]
  ------------------
  386|    360|    *pcaptype = ALLCAP;
  ------------------
  |  |   90|    360|#define ALLCAP 2
  ------------------
  387|  1.83k|  } else if ((ncap > 1) && firstcap) {
  ------------------
  |  Branch (387:14): [True: 1.62k, False: 206]
  |  Branch (387:28): [True: 1.35k, False: 269]
  ------------------
  388|  1.35k|    *pcaptype = HUHINITCAP;
  ------------------
  |  |   92|  1.35k|#define HUHINITCAP 4
  ------------------
  389|  1.35k|  } else {
  390|    475|    *pcaptype = HUHCAP;
  ------------------
  |  |   91|    475|#define HUHCAP 3
  ------------------
  391|    475|  }
  392|  6.90k|}
_ZN12HunspellImpl8mkallcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  394|  2.68k|void HunspellImpl::mkallcap(std::string& u8) {
  395|  2.68k|  if (utf8) {
  ------------------
  |  Branch (395:7): [True: 1.67k, False: 1.00k]
  ------------------
  396|  1.67k|    std::vector<w_char> u16;
  397|  1.67k|    u8_u16(u16, u8);
  398|  1.67k|    ::mkallcap_utf(u16, langnum);
  399|  1.67k|    u16_u8(u8, u16);
  400|  1.67k|  } else {
  401|  1.00k|    ::mkallcap(u8, csconv);
  402|  1.00k|  }
  403|  2.68k|}
_ZN12HunspellImpl11mkallsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
  405|  2.46M|size_t HunspellImpl::mkallsmall2(std::string& u8, std::vector<w_char>& u16) {
  406|  2.46M|  if (utf8) {
  ------------------
  |  Branch (406:7): [True: 414k, False: 2.05M]
  ------------------
  407|   414k|    ::mkallsmall_utf(u16, langnum);
  408|   414k|    u16_u8(u8, u16);
  409|  2.05M|  } else {
  410|  2.05M|    ::mkallsmall(u8, csconv);
  411|  2.05M|  }
  412|  2.46M|  return u8.size();
  413|  2.46M|}
_ZN12HunspellImpl11is_keepcaseEPK6hentry:
  451|  56.9k|int HunspellImpl::is_keepcase(const hentry* rv) {
  452|  56.9k|  return pAMgr && rv->astr && pAMgr->get_keepcase() &&
  ------------------
  |  Branch (452:10): [True: 56.9k, False: 0]
  |  Branch (452:19): [True: 315, False: 56.5k]
  |  Branch (452:31): [True: 50, False: 265]
  ------------------
  453|     50|         TESTAFF(rv->astr, pAMgr->get_keepcase(), rv->alen);
  ------------------
  |  |  102|  56.9k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 45, False: 5]
  |  |  ------------------
  ------------------
  454|  56.9k|}
_ZN12HunspellImpl10insert_sugERNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEERKS7_:
  457|  19.5k|void HunspellImpl::insert_sug(std::vector<std::string>& slst, const std::string& word) {
  458|  19.5k|  slst.insert(slst.begin(), word);
  459|  19.5k|}
_ZN12HunspellImpl5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  463|  19.4M|                         std::chrono::steady_clock::time_point suggest_start) {
  464|       |  // something very broken if spell ends up calling itself with the same word
  465|  19.4M|  if (std::find(candidate_stack.begin(), candidate_stack.end(), word) != candidate_stack.end())
  ------------------
  |  Branch (465:7): [True: 0, False: 19.4M]
  ------------------
  466|      0|    return false;
  467|       |
  468|  19.4M|  if (candidate_stack.size() >= MAXBREAKDEPTH)
  ------------------
  |  |   87|  19.4M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (468:7): [True: 0, False: 19.4M]
  ------------------
  469|      0|    return false;
  470|       |
  471|  19.4M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  19.4M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (471:7): [True: 0, False: 19.4M]
  ------------------
  472|      0|    return false;
  473|       |
  474|  19.4M|  TraceCtx* t = active_trace();
  475|  19.4M|  if (t)
  ------------------
  |  Branch (475:7): [True: 0, False: 19.4M]
  ------------------
  476|      0|    trace(*t, "word \"%s\"", word.c_str());
  477|       |  // A word split on a BREAK pattern nests its parts a further level in.
  478|  19.4M|  TraceScope trace_depth(t);
  479|       |
  480|  19.4M|  candidate_stack.push_back(word);
  481|  19.4M|  bool r = spell_internal(word, candidate_stack, info, root, suggest_start);
  482|  19.4M|  candidate_stack.pop_back();
  483|       |
  484|  19.4M|  if (t)
  ------------------
  |  Branch (484:7): [True: 0, False: 19.4M]
  ------------------
  485|      0|    trace(*t, "result %s", r ? "correct" : "incorrect");
  ------------------
  |  Branch (485:28): [True: 0, False: 0]
  ------------------
  486|       |
  487|  19.4M|  if (r && root) {
  ------------------
  |  Branch (487:7): [True: 4.05M, False: 15.4M]
  |  Branch (487:12): [True: 0, False: 4.05M]
  ------------------
  488|       |    // output conversion
  489|      0|    RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (489:19): [True: 0, False: 0]
  ------------------
  490|      0|    if (rl) {
  ------------------
  |  Branch (490:9): [True: 0, False: 0]
  ------------------
  491|      0|      std::string wspace;
  492|      0|      if (rl->conv(*root, wspace)) {
  ------------------
  |  Branch (492:11): [True: 0, False: 0]
  ------------------
  493|      0|        *root = std::move(wspace);
  494|      0|      }
  495|      0|    }
  496|      0|  }
  497|  19.4M|  return r;
  498|  19.4M|}
_ZN12HunspellImpl14spell_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEEPiPS6_NS0_6chrono10time_pointINSF_12steady_clockENSF_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  502|  19.4M|                                  std::chrono::steady_clock::time_point suggest_start) {
  503|  19.4M|  struct hentry* rv = nullptr;
  504|       |
  505|  19.4M|  int info2 = 0;
  506|  19.4M|  if (!info)
  ------------------
  |  Branch (506:7): [True: 19.4M, False: 186]
  ------------------
  507|  19.4M|    info = &info2;
  508|    186|  else
  509|    186|    *info = 0;
  510|       |
  511|       |  // Hunspell supports XML input of the simplified API (see manual)
  512|  19.4M|  if (word == SPELL_XML)
  ------------------
  |  |   80|  19.4M|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (512:7): [True: 480k, False: 19.0M]
  ------------------
  513|   480k|    return true;
  514|  19.0M|  if (utf8) {
  ------------------
  |  Branch (514:7): [True: 3.47M, False: 15.5M]
  ------------------
  515|  3.47M|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   87|  3.47M|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  3.47M|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (515:9): [True: 3.89k, False: 3.46M]
  ------------------
  516|  3.89k|      return false;
  517|  15.5M|  } else {
  518|  15.5M|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  15.5M|#define MAXWORDLEN 100
  ------------------
  |  Branch (518:9): [True: 6.92k, False: 15.5M]
  ------------------
  519|  6.92k|      return false;
  520|  15.5M|  }
  521|  18.9M|  int captype = NOCAP;
  ------------------
  |  |   88|  18.9M|#define NOCAP 0
  ------------------
  522|  18.9M|  size_t abbv = 0;
  523|  18.9M|  size_t wl = 0;
  524|       |
  525|  18.9M|  std::string scw;
  526|  18.9M|  std::vector<w_char> sunicw;
  527|       |
  528|       |  // input conversion
  529|  18.9M|  RepList* rl = pAMgr ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (529:17): [True: 18.9M, False: 0]
  ------------------
  530|  18.9M|  {
  531|  18.9M|    std::string wspace;
  532|       |
  533|  18.9M|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (533:23): [True: 504k, False: 18.4M]
  ------------------
  534|  18.9M|    if (convstatus) {
  ------------------
  |  Branch (534:9): [True: 0, False: 18.9M]
  ------------------
  535|       |      // the input conversion can grow the word without limit, so hold the
  536|       |      // converted word to the same maximum length as the raw word
  537|      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 (537:11): [True: 0, False: 0]
  |  Branch (537:11): [True: 0, False: 0]
  ------------------
  538|      0|        return false;
  539|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
  540|      0|    } else
  541|  18.9M|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
  542|  18.9M|  }
  543|       |
  544|  18.9M|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
  545|  18.9M|    if (wl > 32768)
  ------------------
  |  Branch (545:9): [True: 0, False: 18.9M]
  ------------------
  546|      0|      return false;
  547|  18.9M|#endif
  548|       |
  549|       |#ifdef MOZILLA_CLIENT
  550|       |  // accept the abbreviated words without dots
  551|       |  // workaround for the incomplete tokenization of Mozilla
  552|       |  abbv = 1;
  553|       |#endif
  554|       |
  555|  18.9M|  if (wl == 0 || m_HMgrs.empty())
  ------------------
  |  Branch (555:7): [True: 305k, False: 18.6M]
  |  Branch (555:18): [True: 0, False: 18.6M]
  ------------------
  556|   305k|    return true;
  557|  18.6M|  if (root)
  ------------------
  |  Branch (557:7): [True: 0, False: 18.6M]
  ------------------
  558|      0|    root->clear();
  559|       |
  560|       |  // allow numbers with dots, dashes and commas (but forbid double separators:
  561|       |  // "..", "--" etc.). Besides the ASCII digits, accept the Arabic-Indic and
  562|       |  // Extended Arabic-Indic (Persian) digit ranges so those numbers are passed
  563|       |  // over the same way ASCII numbers are.
  564|  18.6M|  enum { NBEGIN, NNUM, NSEP };
  565|  18.6M|  int nstate = NBEGIN;
  566|  18.6M|  size_t i;
  567|  18.6M|  size_t n = utf8 ? sunicw.size() : wl;
  ------------------
  |  Branch (567:14): [True: 3.38M, False: 15.3M]
  ------------------
  568|       |
  569|  52.2M|  for (i = 0; (i < n); i++) {
  ------------------
  |  Branch (569:15): [True: 50.1M, False: 2.13M]
  ------------------
  570|  50.1M|    unsigned short c = utf8 ? static_cast<unsigned short>(sunicw[i]) : static_cast<unsigned char>(scw[i]);
  ------------------
  |  Branch (570:24): [True: 8.07M, False: 42.0M]
  ------------------
  571|  50.1M|    if ((c >= '0' && c <= '9') || (c >= 0x0660 && c <= 0x0669) ||  // Arabic-Indic digits
  ------------------
  |  Branch (571:10): [True: 40.7M, False: 9.44M]
  |  Branch (571:22): [True: 32.1M, False: 8.58M]
  |  Branch (571:36): [True: 297k, False: 17.7M]
  |  Branch (571:51): [True: 0, False: 297k]
  ------------------
  572|  32.1M|        (c >= 0x06F0 && c <= 0x06F9)) {                            // Extended Arabic-Indic (Persian) digits
  ------------------
  |  Branch (572:10): [True: 297k, False: 17.7M]
  |  Branch (572:25): [True: 0, False: 297k]
  ------------------
  573|  32.1M|      nstate = NNUM;
  574|  32.1M|    } else if ((c == ',') || (c == '.') || (c == '-')) {
  ------------------
  |  Branch (574:16): [True: 56.1k, False: 17.9M]
  |  Branch (574:30): [True: 1.80M, False: 16.1M]
  |  Branch (574:44): [True: 4.08M, False: 12.0M]
  ------------------
  575|  5.94M|      if ((nstate == NSEP) || (i == 0))
  ------------------
  |  Branch (575:11): [True: 175k, False: 5.77M]
  |  Branch (575:31): [True: 4.29M, False: 1.47M]
  ------------------
  576|  4.46M|        break;
  577|  1.47M|      nstate = NSEP;
  578|  1.47M|    } else
  579|  12.0M|      break;
  580|  50.1M|  }
  581|  18.6M|  if ((i == n) && (nstate == NNUM))
  ------------------
  |  Branch (581:7): [True: 2.13M, False: 16.5M]
  |  Branch (581:19): [True: 1.65M, False: 482k]
  ------------------
  582|  1.65M|    return true;
  583|       |
  584|  17.0M|  switch (captype) {
  ------------------
  |  Branch (584:11): [True: 17.0M, False: 0]
  ------------------
  585|  1.01M|    case HUHCAP:
  ------------------
  |  |   91|  1.01M|#define HUHCAP 3
  ------------------
  |  Branch (585:5): [True: 1.01M, False: 16.0M]
  ------------------
  586|       |    /* FALLTHROUGH */
  587|  1.31M|    case HUHINITCAP:
  ------------------
  |  |   92|  1.31M|#define HUHINITCAP 4
  ------------------
  |  Branch (587:5): [True: 292k, False: 16.7M]
  ------------------
  588|  1.31M|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   86|  1.31M|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  589|       |    /* FALLTHROUGH */
  590|  15.6M|    case NOCAP:
  ------------------
  |  |   88|  15.6M|#define NOCAP 0
  ------------------
  |  Branch (590:5): [True: 14.3M, False: 2.66M]
  ------------------
  591|  15.6M|      rv = checkword(scw, info, root, suggest_start);
  592|  15.6M|      if ((abbv) && !(rv)) {
  ------------------
  |  Branch (592:11): [True: 1.19M, False: 14.4M]
  |  Branch (592:21): [True: 1.16M, False: 27.9k]
  ------------------
  593|  1.16M|        std::string u8buffer(scw);
  594|  1.16M|        u8buffer.push_back('.');
  595|  1.16M|        rv = checkword(u8buffer, info, root, suggest_start);
  596|  1.16M|      }
  597|       |      // A stem with an inner capital, capitalised at the start of a sentence
  598|       |      // (uLinda written ULinda), is found by lowering only the first letter.
  599|  15.6M|      if (!rv && captype == HUHINITCAP) {
  ------------------
  |  |   92|  15.5M|#define HUHINITCAP 4
  ------------------
  |  Branch (599:11): [True: 15.5M, False: 106k]
  |  Branch (599:18): [True: 289k, False: 15.2M]
  ------------------
  600|   289k|        std::string u8buffer(scw);
  601|   289k|        std::vector<w_char> u16buffer(std::move(sunicw));
  602|   289k|        mkinitsmall2(u8buffer, u16buffer);
  603|   289k|        rv = checkword(u8buffer, info, root, suggest_start);
  604|   289k|        if (rv && is_keepcase(rv))
  ------------------
  |  Branch (604:13): [True: 1, False: 289k]
  |  Branch (604:19): [True: 0, False: 1]
  ------------------
  605|      0|          rv = nullptr;
  606|   289k|      }
  607|  15.6M|      break;
  608|   841k|    case ALLCAP: {
  ------------------
  |  |   90|   841k|#define ALLCAP 2
  ------------------
  |  Branch (608:5): [True: 841k, False: 16.1M]
  ------------------
  609|   841k|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   86|   841k|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  610|   841k|      rv = checkword(scw, info, root, suggest_start);
  611|   841k|      if (rv)
  ------------------
  |  Branch (611:11): [True: 364, False: 840k]
  ------------------
  612|    364|        break;
  613|   840k|      if (abbv) {
  ------------------
  |  Branch (613:11): [True: 93.3k, False: 747k]
  ------------------
  614|  93.3k|        std::string u8buffer(scw);
  615|  93.3k|        u8buffer.push_back('.');
  616|  93.3k|        rv = checkword(u8buffer, info, root, suggest_start);
  617|  93.3k|        if (rv)
  ------------------
  |  Branch (617:13): [True: 39, False: 93.3k]
  ------------------
  618|     39|          break;
  619|  93.3k|      }
  620|       |      // Spec. prefix handling for Catalan, French, Italian:
  621|       |      // prefixes separated by apostrophe (SANT'ELIA -> Sant'+Elia).
  622|   840k|      size_t apos = pAMgr ? scw.find('\'') : std::string::npos;
  ------------------
  |  Branch (622:21): [True: 840k, False: 0]
  ------------------
  623|   840k|      if (apos != std::string::npos) {
  ------------------
  |  Branch (623:11): [True: 163k, False: 676k]
  ------------------
  624|   163k|        mkallsmall2(scw, sunicw);
  625|       |        //conversion may result in string with different len to pre-mkallsmall2
  626|       |        //so re-scan
  627|   163k|        if (apos != std::string::npos && apos < scw.size() - 1) {
  ------------------
  |  Branch (627:13): [True: 163k, False: 0]
  |  Branch (627:42): [True: 144k, False: 19.5k]
  ------------------
  628|   144k|          std::string part1 = scw.substr(0, apos + 1), part2 = scw.substr(apos + 1);
  629|   144k|          if (utf8) {
  ------------------
  |  Branch (629:15): [True: 36.7k, False: 107k]
  ------------------
  630|  36.7k|            std::vector<w_char> part1u, part2u;
  631|  36.7k|            u8_u16(part1u, part1);
  632|  36.7k|            u8_u16(part2u, part2);
  633|  36.7k|            mkinitcap2(part2, part2u);
  634|  36.7k|            scw = part1 + part2;
  635|  36.7k|            sunicw = std::move(part1u);
  636|  36.7k|            sunicw.insert(sunicw.end(), part2u.begin(), part2u.end());
  637|  36.7k|            rv = checkword(scw, info, root, suggest_start);
  638|  36.7k|            if (rv)
  ------------------
  |  Branch (638:17): [True: 0, False: 36.7k]
  ------------------
  639|      0|              break;
  640|   107k|          } else {
  641|   107k|            mkinitcap2(part2, sunicw);
  642|   107k|            scw = part1 + part2;
  643|   107k|            rv = checkword(scw, info, root, suggest_start);
  644|   107k|            if (rv)
  ------------------
  |  Branch (644:17): [True: 0, False: 107k]
  ------------------
  645|      0|              break;
  646|   107k|          }
  647|   144k|          mkinitcap2(scw, sunicw);
  648|   144k|          rv = checkword(scw, info, root, suggest_start);
  649|   144k|          if (rv)
  ------------------
  |  Branch (649:15): [True: 1, False: 144k]
  ------------------
  650|      1|            break;
  651|   144k|        }
  652|   163k|      }
  653|   840k|      if (pAMgr && pAMgr->get_checksharps() && scw.find("SS") != std::string::npos) {
  ------------------
  |  Branch (653:11): [True: 840k, False: 0]
  |  Branch (653:20): [True: 0, False: 840k]
  |  Branch (653:48): [True: 0, False: 0]
  ------------------
  654|       |
  655|      0|        mkallsmall2(scw, sunicw);
  656|      0|        std::string u8buffer(scw);
  657|      0|        rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  658|      0|        if (!rv) {
  ------------------
  |  Branch (658:13): [True: 0, False: 0]
  ------------------
  659|      0|          mkinitcap2(scw, sunicw);
  660|      0|          rv = spellsharps(scw, 0, 0, 0, info, root, suggest_start);
  661|      0|        }
  662|      0|        if ((abbv) && !(rv)) {
  ------------------
  |  Branch (662:13): [True: 0, False: 0]
  |  Branch (662:23): [True: 0, False: 0]
  ------------------
  663|      0|          u8buffer.push_back('.');
  664|      0|          rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  665|      0|          if (!rv) {
  ------------------
  |  Branch (665:15): [True: 0, False: 0]
  ------------------
  666|      0|            u8buffer = std::string(scw);
  667|      0|            u8buffer.push_back('.');
  668|      0|            rv = spellsharps(u8buffer, 0, 0, 0, info, root, suggest_start);
  669|      0|          }
  670|      0|        }
  671|      0|        if (rv)
  ------------------
  |  Branch (671:13): [True: 0, False: 0]
  ------------------
  672|      0|          break;
  673|      0|      }
  674|   840k|    }
  675|       |      /* FALLTHROUGH */
  676|  1.35M|    case INITCAP: {
  ------------------
  |  |   89|  1.35M|#define INITCAP 1
  ------------------
  |  Branch (676:5): [True: 513k, False: 16.5M]
  ------------------
  677|       |      // handle special capitalization of dotted I
  678|  1.35M|      bool Idot = (utf8 && (unsigned char) scw[0] == 0xc4 && (unsigned char) scw[1] == 0xb0);
  ------------------
  |  Branch (678:20): [True: 213k, False: 1.14M]
  |  Branch (678:28): [True: 8, False: 213k]
  |  Branch (678:62): [True: 0, False: 8]
  ------------------
  679|  1.35M|      *info |= SPELL_ORIGCAP;
  ------------------
  |  |   86|  1.35M|#define SPELL_ORIGCAP (1 << 5)
  ------------------
  680|  1.35M|      if (captype == ALLCAP) {
  ------------------
  |  |   90|  1.35M|#define ALLCAP 2
  ------------------
  |  Branch (680:11): [True: 840k, False: 513k]
  ------------------
  681|   840k|          mkallsmall2(scw, sunicw);
  682|   840k|          mkinitcap2(scw, sunicw);
  683|   840k|          if (Idot)
  ------------------
  |  Branch (683:15): [True: 0, False: 840k]
  ------------------
  684|      0|             scw.replace(0, 1, "\xc4\xb0");
  685|   840k|      }
  686|  1.35M|      if (captype == INITCAP)
  ------------------
  |  |   89|  1.35M|#define INITCAP 1
  ------------------
  |  Branch (686:11): [True: 513k, False: 840k]
  ------------------
  687|   513k|        *info |= SPELL_INITCAP;
  ------------------
  |  |   85|   513k|#define SPELL_INITCAP (1 << 4)
  ------------------
  688|  1.35M|      rv = checkword(scw, info, root, suggest_start);
  689|  1.35M|      if (captype == INITCAP)
  ------------------
  |  |   89|  1.35M|#define INITCAP 1
  ------------------
  |  Branch (689:11): [True: 513k, False: 840k]
  ------------------
  690|   513k|        *info &= ~SPELL_INITCAP;
  ------------------
  |  |   85|   513k|#define SPELL_INITCAP (1 << 4)
  ------------------
  691|       |      // forbid bad capitalization
  692|       |      // (for example, ijs -> Ijs instead of IJs in Dutch)
  693|       |      // use explicit forms in dic: Ijs/F (F = FORBIDDENWORD flag)
  694|  1.35M|      if (*info & SPELL_FORBIDDEN) {
  ------------------
  |  |   82|  1.35M|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (694:11): [True: 0, False: 1.35M]
  ------------------
  695|      0|        rv = nullptr;
  696|      0|        break;
  697|      0|      }
  698|  1.35M|      if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   90|     11|#define ALLCAP 2
  ------------------
  |  Branch (698:11): [True: 16.1k, False: 1.33M]
  |  Branch (698:17): [True: 11, False: 16.1k]
  |  Branch (698:36): [True: 0, False: 11]
  ------------------
  699|      0|        rv = nullptr;
  700|  1.35M|      if (rv || (Idot && langnum != LANG_az && langnum != LANG_tr && langnum != LANG_crh))
  ------------------
  |  Branch (700:11): [True: 16.1k, False: 1.33M]
  |  Branch (700:18): [True: 0, False: 1.33M]
  |  Branch (700:26): [True: 0, False: 0]
  |  Branch (700:48): [True: 0, False: 0]
  |  Branch (700:70): [True: 0, False: 0]
  ------------------
  701|  16.1k|        break;
  702|       |
  703|  1.33M|      mkallsmall2(scw, sunicw);
  704|  1.33M|      std::string u8buffer(scw);
  705|  1.33M|      mkinitcap2(scw, sunicw);
  706|       |
  707|  1.33M|      rv = checkword(u8buffer, info, root, suggest_start);
  708|  1.33M|      if (abbv && !rv) {
  ------------------
  |  Branch (708:11): [True: 170k, False: 1.16M]
  |  Branch (708:19): [True: 156k, False: 14.3k]
  ------------------
  709|   156k|        u8buffer.push_back('.');
  710|   156k|        rv = checkword(u8buffer, info, root, suggest_start);
  711|   156k|        if (!rv) {
  ------------------
  |  Branch (711:13): [True: 156k, False: 0]
  ------------------
  712|   156k|          u8buffer = scw;
  713|   156k|          u8buffer.push_back('.');
  714|   156k|          if (captype == INITCAP)
  ------------------
  |  |   89|   156k|#define INITCAP 1
  ------------------
  |  Branch (714:15): [True: 62.7k, False: 93.3k]
  ------------------
  715|  62.7k|            *info |= SPELL_INITCAP;
  ------------------
  |  |   85|  62.7k|#define SPELL_INITCAP (1 << 4)
  ------------------
  716|   156k|          rv = checkword(u8buffer, info, root, suggest_start);
  717|   156k|          if (captype == INITCAP)
  ------------------
  |  |   89|   156k|#define INITCAP 1
  ------------------
  |  Branch (717:15): [True: 62.7k, False: 93.3k]
  ------------------
  718|  62.7k|            *info &= ~SPELL_INITCAP;
  ------------------
  |  |   85|  62.7k|#define SPELL_INITCAP (1 << 4)
  ------------------
  719|   156k|          if (rv && is_keepcase(rv) && (captype == ALLCAP))
  ------------------
  |  |   90|     30|#define ALLCAP 2
  ------------------
  |  Branch (719:15): [True: 30, False: 156k]
  |  Branch (719:21): [True: 30, False: 0]
  |  Branch (719:40): [True: 3, False: 27]
  ------------------
  720|      3|            rv = nullptr;
  721|   156k|          break;
  722|   156k|        }
  723|   156k|      }
  724|  1.18M|      if (rv && is_keepcase(rv) &&
  ------------------
  |  Branch (724:11): [True: 40.6k, False: 1.14M]
  |  Branch (724:17): [True: 4, False: 40.6k]
  ------------------
  725|      4|          ((captype == ALLCAP) ||
  ------------------
  |  |   90|      4|#define ALLCAP 2
  ------------------
  |  Branch (725:12): [True: 1, False: 3]
  ------------------
  726|       |           // if CHECKSHARPS: KEEPCASE words with \xDF  are allowed
  727|       |           // in INITCAP form, too.
  728|      3|           !(pAMgr->get_checksharps() &&
  ------------------
  |  Branch (728:14): [True: 0, False: 3]
  ------------------
  729|      0|             ((utf8 && u8buffer.find("\xC3\x9F") != std::string::npos) ||
  ------------------
  |  Branch (729:16): [True: 0, False: 0]
  |  Branch (729:24): [True: 0, False: 0]
  ------------------
  730|      0|              (!utf8 && u8buffer.find('\xDF') != std::string::npos)))))
  ------------------
  |  Branch (730:16): [True: 0, False: 0]
  |  Branch (730:25): [True: 0, False: 0]
  ------------------
  731|      4|        rv = nullptr;
  732|  1.18M|      break;
  733|  1.33M|    }
  734|  17.0M|  }
  735|       |
  736|  17.0M|  if (rv) {
  ------------------
  |  Branch (736:7): [True: 163k, False: 16.8M]
  ------------------
  737|   163k|    if (pAMgr && pAMgr->get_warn() && rv->astr &&
  ------------------
  |  Branch (737:9): [True: 163k, False: 0]
  |  Branch (737:9): [True: 6, False: 163k]
  |  Branch (737:18): [True: 16.6k, False: 147k]
  |  Branch (737:39): [True: 11, False: 16.6k]
  ------------------
  738|     11|        TESTAFF(rv->astr, pAMgr->get_warn(), rv->alen)) {
  ------------------
  |  |  102|     11|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 6, False: 5]
  |  |  ------------------
  ------------------
  739|      6|      *info |= SPELL_WARN;
  ------------------
  |  |   87|      6|#define SPELL_WARN (1 << 6)
  ------------------
  740|      6|      if (pAMgr->get_forbidwarn())
  ------------------
  |  Branch (740:11): [True: 0, False: 6]
  ------------------
  741|      0|        return false;
  742|      6|      return true;
  743|      6|    }
  744|   163k|    return true;
  745|   163k|  }
  746|       |
  747|       |  // recursive breaking at break points
  748|  16.8M|  if (!wordbreak.empty() && !(*info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   82|  16.8M|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (748:7): [True: 16.8M, False: 0]
  |  Branch (748:29): [True: 16.8M, False: 0]
  ------------------
  749|       |
  750|  16.8M|    int nbr = 0;
  751|  16.8M|    wl = scw.size();
  752|       |
  753|       |    // calculate break points for recursion limit
  754|  50.5M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (754:18): [True: 50.5M, False: 16.8M]
  ------------------
  755|  50.5M|      size_t pos = 0;
  756|  68.9M|      while ((pos = scw.find(j, pos)) != std::string::npos) {
  ------------------
  |  Branch (756:14): [True: 18.4M, False: 50.5M]
  ------------------
  757|  18.4M|        ++nbr;
  758|  18.4M|        pos += j.size();
  759|  18.4M|      }
  760|  50.5M|    }
  761|  16.8M|    if (nbr >= MAXBREAKDEPTH)
  ------------------
  |  |   87|  16.8M|#define MAXBREAKDEPTH 10
  ------------------
  |  Branch (761:9): [True: 7.32k, False: 16.8M]
  ------------------
  762|  7.32k|      return false;
  763|       |
  764|       |    // check boundary patterns (^begin and end$)
  765|  50.3M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (765:18): [True: 50.3M, False: 15.4M]
  ------------------
  766|  50.3M|      size_t plen = j.size();
  767|  50.3M|      if (plen == 1 || plen > wl)
  ------------------
  |  Branch (767:11): [True: 16.8M, False: 33.4M]
  |  Branch (767:24): [True: 4.59M, False: 28.8M]
  ------------------
  768|  21.4M|        continue;
  769|       |
  770|  28.8M|      if (j[0] == '^' && scw.compare(0, plen - 1, j, 1, plen - 1) == 0 &&
  ------------------
  |  Branch (770:11): [True: 14.5M, False: 14.3M]
  |  Branch (770:11): [True: 147k, False: 28.7M]
  |  Branch (770:26): [True: 1.36M, False: 13.1M]
  ------------------
  771|  1.36M|          spell(scw.substr(plen - 1), candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (771:11): [True: 147k, False: 1.21M]
  ------------------
  772|   147k|        *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|   147k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  773|   147k|        return true;
  774|   147k|      }
  775|       |
  776|  28.7M|      if (j[plen - 1] == '$' &&
  ------------------
  |  Branch (776:11): [True: 14.3M, False: 14.3M]
  ------------------
  777|  14.3M|          scw.compare(wl - plen + 1, plen - 1, j, 0, plen - 1) == 0) {
  ------------------
  |  Branch (777:11): [True: 5.21M, False: 9.14M]
  ------------------
  778|  5.21M|        std::string suffix(scw.substr(wl - plen + 1));
  779|  5.21M|        scw.resize(wl - plen + 1);
  780|  5.21M|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (780:13): [True: 1.22M, False: 3.99M]
  ------------------
  781|  1.22M|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|  1.22M|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  782|  1.22M|          return true;
  783|  1.22M|        }
  784|  3.99M|        scw.append(suffix);
  785|  3.99M|      }
  786|  28.7M|    }
  787|       |
  788|       |    // other patterns
  789|  46.2M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (789:18): [True: 46.2M, False: 15.4M]
  ------------------
  790|  46.2M|      size_t plen = j.size();
  791|  46.2M|      size_t found = scw.find(j);
  792|  46.2M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (792:11): [True: 43.5M, False: 2.77M]
  |  Branch (792:26): [True: 5.09M, False: 38.4M]
  ------------------
  793|  5.09M|        size_t found2 = scw.find(j, found + 1);
  794|       |        // try to break at the second occurance
  795|       |        // to recognize dictionary words with wordbreak
  796|  5.09M|        if (found2 > 0 && (found2 < wl - plen))
  ------------------
  |  Branch (796:13): [True: 5.09M, False: 0]
  |  Branch (796:27): [True: 1.94M, False: 3.15M]
  ------------------
  797|  1.94M|            found = found2;
  798|  5.09M|        std::string substring(scw.substr(found + plen));
  799|  5.09M|        if (!spell(substring, candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (799:13): [True: 3.69M, False: 1.40M]
  ------------------
  800|  3.69M|          continue;
  801|  1.40M|        std::string suffix(scw.substr(found));
  802|  1.40M|        scw.resize(found);
  803|       |        // examine 2 sides of the break point
  804|  1.40M|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (804:13): [True: 72.5k, False: 1.33M]
  ------------------
  805|  72.5k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|  72.5k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  806|  72.5k|          return true;
  807|  72.5k|        }
  808|  1.33M|        scw.append(suffix);
  809|       |
  810|       |        // LANG_hu: spec. dash rule
  811|  1.33M|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (811:13): [True: 359, False: 1.32M]
  |  Branch (811:35): [True: 359, False: 0]
  ------------------
  812|    359|          suffix = scw.substr(found + 1);
  813|    359|          scw.resize(found + 1);
  814|    359|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (814:15): [True: 0, False: 359]
  ------------------
  815|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  816|      0|            return true;  // check the first part with dash
  817|      0|          }
  818|    359|          scw.append(suffix);
  819|    359|        }
  820|       |        // end of LANG specific region
  821|  1.33M|      }
  822|  46.2M|    }
  823|       |
  824|       |    // other patterns (break at first break point)
  825|  46.1M|    for (auto& j : wordbreak) {
  ------------------
  |  Branch (825:18): [True: 46.1M, False: 15.4M]
  ------------------
  826|  46.1M|      size_t plen = j.size(), found = scw.find(j);
  827|  46.1M|      if ((found > 0) && (found < wl - plen)) {
  ------------------
  |  Branch (827:11): [True: 43.3M, False: 2.77M]
  |  Branch (827:26): [True: 4.99M, False: 38.3M]
  ------------------
  828|  4.99M|        if (!spell(scw.substr(found + plen), candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (828:13): [True: 3.85M, False: 1.13M]
  ------------------
  829|  3.85M|          continue;
  830|  1.13M|        std::string suffix(scw.substr(found));
  831|  1.13M|        scw.resize(found);
  832|       |        // examine 2 sides of the break point
  833|  1.13M|        if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (833:13): [True: 6.73k, False: 1.12M]
  ------------------
  834|  6.73k|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|  6.73k|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  835|  6.73k|          return true;
  836|  6.73k|        }
  837|  1.12M|        scw.append(suffix);
  838|       |
  839|       |        // LANG_hu: spec. dash rule
  840|  1.12M|        if (langnum == LANG_hu && j == "-") {
  ------------------
  |  Branch (840:13): [True: 186, False: 1.12M]
  |  Branch (840:35): [True: 186, False: 0]
  ------------------
  841|    186|          suffix = scw.substr(found + 1);
  842|    186|          scw.resize(found + 1);
  843|    186|          if (spell(scw, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (843:15): [True: 0, False: 186]
  ------------------
  844|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  845|      0|            return true;  // check the first part with dash
  846|      0|          }
  847|    186|          scw.append(suffix);
  848|    186|        }
  849|       |        // end of LANG specific region
  850|  1.12M|      }
  851|  46.1M|    }
  852|  15.4M|  }
  853|       |
  854|  15.4M|  return false;
  855|  16.8M|}
_ZN12HunspellImpl9checkwordERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_NS0_6chrono10time_pointINSB_12steady_clockENSB_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
  858|  21.3M|                                       std::chrono::steady_clock::time_point suggest_start) {
  859|       |  // check overall suggest time limit
  860|  21.3M|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  21.3M|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (860:7): [True: 0, False: 21.3M]
  ------------------
  861|      0|    return nullptr;
  862|       |
  863|  21.3M|  std::string word;
  864|       |
  865|       |  // remove IGNORE characters from the string
  866|  21.3M|  clean_ignore(word, w);
  867|       |
  868|  21.3M|  if (word.empty())
  ------------------
  |  Branch (868:7): [True: 5.85k, False: 21.3M]
  ------------------
  869|  5.85k|    return nullptr;
  870|       |
  871|       |  // word reversing wrapper for complex prefixes
  872|  21.3M|  if (complexprefixes) {
  ------------------
  |  Branch (872:7): [True: 991k, False: 20.3M]
  ------------------
  873|   991k|    if (utf8)
  ------------------
  |  Branch (873:9): [True: 0, False: 991k]
  ------------------
  874|      0|      reverseword_utf(word);
  875|   991k|    else
  876|   991k|      reverseword(word);
  877|   991k|  }
  878|       |
  879|  21.3M|  size_t len = word.size();
  880|       |
  881|       |  // look word in hash table
  882|  21.3M|  struct hentry* he = nullptr;
  883|  21.3M|  TraceCtx* t = active_trace();
  884|  42.7M|  for (size_t i = 0; (i < m_HMgrs.size()) && !he; ++i) {
  ------------------
  |  Branch (884:22): [True: 21.3M, False: 21.3M]
  |  Branch (884:46): [True: 21.3M, False: 0]
  ------------------
  885|  21.3M|    he = m_HMgrs[i]->lookup(word.c_str(), word.size());
  886|       |
  887|  21.3M|    if (t) {
  ------------------
  |  Branch (887:9): [True: 0, False: 21.3M]
  ------------------
  888|      0|      std::string dic;
  889|      0|      if (m_HMgrs.size() > 1)
  ------------------
  |  Branch (889:11): [True: 0, False: 0]
  ------------------
  890|      0|        dic = " dic=" + std::to_string(i);
  891|      0|      if (he)
  ------------------
  |  Branch (891:11): [True: 0, False: 0]
  ------------------
  892|      0|        trace(*t, "lookup \"%s\"%s -> entry \"%s\" flags=%s", word.c_str(),
  893|      0|              dic.c_str(), he->word,
  894|      0|              trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  895|      0|      else
  896|      0|        trace(*t, "lookup \"%s\"%s -> miss", word.c_str(), dic.c_str());
  897|      0|    }
  898|       |
  899|       |    // check forbidden and onlyincompound words
  900|  21.3M|    if ((he) && (he->astr) && (pAMgr) &&
  ------------------
  |  Branch (900:9): [True: 166k, False: 21.2M]
  |  Branch (900:9): [True: 0, False: 21.3M]
  |  Branch (900:17): [True: 3.54k, False: 162k]
  |  Branch (900:31): [True: 3.54k, False: 0]
  ------------------
  901|  3.54k|        TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) {
  ------------------
  |  |  102|  3.54k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 3.54k]
  |  |  ------------------
  ------------------
  902|      0|      if (t)
  ------------------
  |  Branch (902:11): [True: 0, False: 0]
  ------------------
  903|      0|        trace(*t, "test forbidden flag=%s in=dic have=%s"
  904|      0|                  " -> fail, the word is forbidden",
  905|      0|              pAMgr->encode_flag(pAMgr->get_forbiddenword()).c_str(),
  906|      0|              trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  907|      0|      if (info)
  ------------------
  |  Branch (907:11): [True: 0, False: 0]
  ------------------
  908|      0|        *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   82|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  909|       |      // LANG_hu section: set dash information for suggestions
  910|      0|      if (langnum == LANG_hu) {
  ------------------
  |  Branch (910:11): [True: 0, False: 0]
  ------------------
  911|      0|        if (pAMgr->get_compoundflag() &&
  ------------------
  |  Branch (911:13): [True: 0, False: 0]
  |  Branch (911:13): [True: 0, False: 0]
  ------------------
  912|      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]
  |  |  ------------------
  ------------------
  913|      0|          if (info)
  ------------------
  |  Branch (913:15): [True: 0, False: 0]
  ------------------
  914|      0|            *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
  915|      0|        }
  916|      0|      }
  917|      0|      return nullptr;
  918|      0|    }
  919|       |
  920|       |    // he = next not needaffix, onlyincompound homonym or onlyupcase word
  921|  21.3M|    const struct hentry* first_he = he;
  922|  21.3M|    while (he && (he->astr) && pAMgr &&
  ------------------
  |  Branch (922:12): [True: 166k, False: 21.2M]
  |  Branch (922:12): [True: 2.58k, False: 21.3M]
  |  Branch (922:18): [True: 3.54k, False: 162k]
  |  Branch (922:32): [True: 3.54k, False: 0]
  ------------------
  923|  3.54k|           ((pAMgr->get_needaffix() &&
  ------------------
  |  Branch (923:14): [True: 298, False: 3.24k]
  ------------------
  924|    298|             TESTAFF(he->astr, pAMgr->get_needaffix(), he->alen)) ||
  ------------------
  |  |  102|    298|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 0, False: 298]
  |  |  ------------------
  ------------------
  925|  3.54k|            (pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (925:14): [True: 0, False: 3.54k]
  ------------------
  926|      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]
  |  |  ------------------
  ------------------
  927|  3.54k|            (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   85|  3.54k|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (927:14): [True: 3.54k, False: 0]
  |  Branch (927:22): [True: 2.62k, False: 923]
  ------------------
  928|  2.62k|             TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen)))) {
  ------------------
  |  |  102|  2.62k|#define TESTAFF(a, b, c) (std::binary_search(a, a + c, b))
  |  |  ------------------
  |  |  |  Branch (102:26): [True: 2.58k, False: 38]
  |  |  ------------------
  ------------------
  929|  2.58k|      if (t) {
  ------------------
  |  Branch (929:11): [True: 0, False: 2.58k]
  ------------------
  930|       |        // Name the branch that fired, in the order the condition tests them.
  931|      0|        const char* reason = "onlyupcase";
  932|      0|        FLAG flag = ONLYUPCASEFLAG;
  ------------------
  |  |   98|      0|#define FLAG unsigned short
  ------------------
                      FLAG flag = ONLYUPCASEFLAG;
  ------------------
  |  |  124|      0|#define ONLYUPCASEFLAG 65511
  ------------------
  933|      0|        if (pAMgr->get_needaffix() &&
  ------------------
  |  Branch (933:13): [True: 0, False: 0]
  |  Branch (933:13): [True: 0, False: 0]
  ------------------
  934|      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]
  |  |  ------------------
  ------------------
  935|      0|          reason = "needaffix";
  936|      0|          flag = pAMgr->get_needaffix();
  937|      0|        } else if (pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (937:20): [True: 0, False: 0]
  |  Branch (937:20): [True: 0, False: 0]
  ------------------
  938|      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]
  |  |  ------------------
  ------------------
  939|      0|          reason = "onlyincompound";
  940|      0|          flag = pAMgr->get_onlyincompound();
  941|      0|        }
  942|      0|        trace(*t, "test %s flag=%s in=dic have=%s"
  943|      0|                  " -> fail, on to the next homonym",
  944|      0|              reason, trace_flag(pAMgr.get(), flag).c_str(),
  945|      0|              trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  946|      0|      }
  947|  2.58k|      he = he->next_homonym;
  948|  2.58k|    }
  949|       |
  950|       |    // Say which entry the walk left in hand, so the transcript does not end
  951|       |    // on a homonym that was passed over.
  952|  21.3M|    if (t && he != first_he) {
  ------------------
  |  Branch (952:9): [True: 0, False: 21.3M]
  |  Branch (952:14): [True: 0, False: 0]
  ------------------
  953|      0|      if (he)
  ------------------
  |  Branch (953:11): [True: 0, False: 0]
  ------------------
  954|      0|        trace(*t, "lookup \"%s\" -> entry \"%s\" flags=%s", word.c_str(),
  955|      0|              he->word, trace_flags(pAMgr.get(), he->astr, he->alen).c_str());
  956|      0|      else
  957|      0|        trace(*t, "lookup \"%s\" -> no more homonyms", word.c_str());
  958|      0|    }
  959|  21.3M|  }
  960|       |
  961|       |  // check with affixes
  962|  21.3M|  if (!he && pAMgr) {
  ------------------
  |  Branch (962:7): [True: 21.2M, False: 163k]
  |  Branch (962:14): [True: 21.2M, False: 0]
  ------------------
  963|       |    // try stripping off affixes
  964|  21.2M|    AffixScratch scratch;
  965|  21.2M|    scratch.trace = t;
  966|       |    // For an initial-capital query, make affix_check skip an all-uppercase-only
  967|       |    // stem and keep looking, so a valid mixed-case match behind it is found.
  968|  21.2M|    FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   98|  21.2M|#define FLAG unsigned short
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   85|  21.2M|#define SPELL_INITCAP (1 << 4)
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |  124|   561k|#define ONLYUPCASEFLAG 65511
  ------------------
                  FLAG avoidflag = (info && (*info & SPELL_INITCAP)) ? ONLYUPCASEFLAG : FLAG_NULL;
  ------------------
  |  |   99|  41.8M|#define FLAG_NULL 0x00
  ------------------
  |  Branch (968:23): [True: 21.2M, False: 0]
  |  Branch (968:31): [True: 561k, False: 20.6M]
  ------------------
  969|  21.2M|    he = pAMgr->affix_check(word, 0, len, scratch, 0, IN_CPD_NOT, avoidflag);
  ------------------
  |  |   75|  21.2M|#define IN_CPD_NOT 0
  ------------------
  970|       |
  971|       |    // check compound restriction and onlyupcase
  972|  21.2M|    if (he && he->astr &&
  ------------------
  |  Branch (972:9): [True: 0, False: 21.2M]
  |  Branch (972:9): [True: 0, False: 21.2M]
  |  Branch (972:15): [True: 0, False: 0]
  ------------------
  973|      0|        ((pAMgr->get_onlyincompound() &&
  ------------------
  |  Branch (973:11): [True: 0, False: 0]
  ------------------
  974|      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]
  |  |  ------------------
  ------------------
  975|      0|         (info && (*info & SPELL_INITCAP) &&
  ------------------
  |  |   85|      0|#define SPELL_INITCAP (1 << 4)
  ------------------
  |  Branch (975:11): [True: 0, False: 0]
  |  Branch (975:19): [True: 0, False: 0]
  ------------------
  976|      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]
  |  |  ------------------
  ------------------
  977|      0|      he = nullptr;
  978|      0|    }
  979|       |
  980|  21.2M|    if (he) {
  ------------------
  |  Branch (980:9): [True: 0, False: 21.2M]
  ------------------
  981|      0|      if ((he->astr) && (pAMgr) &&
  ------------------
  |  Branch (981:11): [True: 0, False: 0]
  |  Branch (981:11): [True: 0, False: 0]
  |  Branch (981:25): [True: 0, False: 0]
  ------------------
  982|      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]
  |  |  ------------------
  ------------------
  983|      0|        if (info)
  ------------------
  |  Branch (983:13): [True: 0, False: 0]
  ------------------
  984|      0|          *info |= SPELL_FORBIDDEN;
  ------------------
  |  |   82|      0|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  985|      0|        return nullptr;
  986|      0|      }
  987|      0|      if (root) {
  ------------------
  |  Branch (987:11): [True: 0, False: 0]
  ------------------
  988|      0|        root->assign(he->word);
  989|      0|        if (complexprefixes) {
  ------------------
  |  Branch (989:13): [True: 0, False: 0]
  ------------------
  990|      0|          if (utf8)
  ------------------
  |  Branch (990:15): [True: 0, False: 0]
  ------------------
  991|      0|            reverseword_utf(*root);
  992|      0|          else
  993|      0|            reverseword(*root);
  994|      0|        }
  995|      0|      }
  996|       |      // try check compound word
  997|  21.2M|    } else if (pAMgr->get_compound()) {
  ------------------
  |  Branch (997:16): [True: 5.46M, False: 15.7M]
  ------------------
  998|  5.46M|      struct hentry* rwords[100] = {};  // buffer for COMPOUND pattern checking
  999|       |
 1000|       |      // first allow only 2 words in the compound
 1001|  5.46M|      int setinfo = SPELL_COMPOUND_2;
  ------------------
  |  |   88|  5.46M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
 1002|  5.46M|      if (info)
  ------------------
  |  Branch (1002:11): [True: 5.46M, False: 0]
  ------------------
 1003|  5.46M|        setinfo |= *info;
 1004|  5.46M|      if (TraceCtx* t = trace_on(scratch.trace))
  ------------------
  |  Branch (1004:21): [True: 0, False: 5.46M]
  ------------------
 1005|      0|        trace(*t, "compound words=2");
 1006|  5.46M|      {
 1007|  5.46M|        TraceScope compound_depth(trace_on(scratch.trace));
 1008|  5.46M|        he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, &setinfo, scratch);
 1009|  5.46M|      }
 1010|  5.46M|      if (info)
  ------------------
  |  Branch (1010:11): [True: 5.46M, False: 0]
  ------------------
 1011|  5.46M|        *info = setinfo & ~SPELL_COMPOUND_2;
  ------------------
  |  |   88|  5.46M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
 1012|       |      // if not 2-word compoud word, try with 3 or more words
 1013|       |      // (only if original info didn't forbid it)
 1014|  5.46M|      if (!he && info && !(*info & SPELL_COMPOUND_2)) {
  ------------------
  |  |   88|  5.46M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
  |  Branch (1014:11): [True: 5.46M, False: 0]
  |  Branch (1014:18): [True: 5.46M, False: 0]
  |  Branch (1014:26): [True: 5.46M, False: 0]
  ------------------
 1015|  5.46M|        *info &= ~SPELL_COMPOUND_2;
  ------------------
  |  |   88|  5.46M|#define SPELL_COMPOUND_2 (1 << 7)  // permit only 2 dictionary words in the compound
  ------------------
 1016|  5.46M|        if (TraceCtx* t = trace_on(scratch.trace))
  ------------------
  |  Branch (1016:23): [True: 0, False: 5.46M]
  ------------------
 1017|      0|          trace(*t, "compound words=3+");
 1018|  5.46M|        {
 1019|  5.46M|          TraceScope compound_depth(trace_on(scratch.trace));
 1020|  5.46M|          he = pAMgr->compound_check(word, 0, 0, 100, 0, nullptr, (hentry**)&rwords, 0, 0, info, scratch);
 1021|  5.46M|        }
 1022|       |        // accept the compound with 3 or more words only if it is
 1023|       |        // - not a dictionary word with a typo and
 1024|       |        // - not two words written separately,
 1025|       |        // - or if it's an arbitrary number accepted by compound rules (e.g. 999%)
 1026|  5.46M|        if (he && !isdigit((unsigned char)word[0]))
  ------------------
  |  Branch (1026:13): [True: 0, False: 5.46M]
  |  Branch (1026:19): [True: 0, False: 0]
  ------------------
 1027|      0|        {
 1028|      0|          std::vector<std::string> slst;
 1029|      0|          bool simple;
 1030|      0|          {
 1031|       |            // the suggester runs its whole search here, so report what it
 1032|       |            // decided rather than every candidate it tried
 1033|      0|            TraceSuppress no_trace(scratch.trace);
 1034|      0|            simple = pSMgr->suggest(slst, word, nullptr, /*test_simplesug=*/true);
 1035|      0|          }
 1036|      0|          if (TraceCtx* t = trace_on(scratch.trace))
  ------------------
  |  Branch (1036:25): [True: 0, False: 0]
  ------------------
 1037|      0|            trace(*t, "test simplesug -> %s",
 1038|      0|                  simple ? "fail, a simpler form of this word exists"
  ------------------
  |  Branch (1038:19): [True: 0, False: 0]
  ------------------
 1039|      0|                         : "pass, no simpler form of this word exists");
 1040|      0|          if (simple)
  ------------------
  |  Branch (1040:15): [True: 0, False: 0]
  ------------------
 1041|      0|            he = nullptr;
 1042|      0|        }
 1043|  5.46M|      }
 1044|       |
 1045|       |      // LANG_hu section: `moving rule' with last dash
 1046|  5.46M|      if ((!he) && (langnum == LANG_hu) && (word[len - 1] == '-')) {
  ------------------
  |  Branch (1046:11): [True: 5.46M, False: 0]
  |  Branch (1046:20): [True: 40.8k, False: 5.42M]
  |  Branch (1046:44): [True: 16.5k, False: 24.2k]
  ------------------
 1047|  16.5k|        std::string dup(word, 0, len - 1);
 1048|  16.5k|        he = pAMgr->compound_check(dup, -5, 0, 100, 0, nullptr, (hentry**)&rwords, 1, 0, info, scratch);
 1049|  16.5k|      }
 1050|       |      // end of LANG specific region
 1051|  5.46M|      if (he) {
  ------------------
  |  Branch (1051:11): [True: 0, False: 5.46M]
  ------------------
 1052|      0|        if (root) {
  ------------------
  |  Branch (1052:13): [True: 0, False: 0]
  ------------------
 1053|      0|          root->assign(he->word);
 1054|      0|          if (complexprefixes) {
  ------------------
  |  Branch (1054:15): [True: 0, False: 0]
  ------------------
 1055|      0|            if (utf8)
  ------------------
  |  Branch (1055:17): [True: 0, False: 0]
  ------------------
 1056|      0|              reverseword_utf(*root);
 1057|      0|            else
 1058|      0|              reverseword(*root);
 1059|      0|          }
 1060|      0|        }
 1061|      0|        if (info)
  ------------------
  |  Branch (1061:13): [True: 0, False: 0]
  ------------------
 1062|      0|          *info |= SPELL_COMPOUND;
  ------------------
  |  |   81|      0|#define SPELL_COMPOUND (1 << 0)    // the result is a compound word
  ------------------
 1063|      0|      }
 1064|  5.46M|    }
 1065|  21.2M|  }
 1066|       |
 1067|  21.3M|  return he;
 1068|  21.3M|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEENS0_6chrono10time_pointINSD_12steady_clockENSD_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1076|  99.1k|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) {
 1077|       |
 1078|  99.1k|  if (suggest_candidate_stack.size() > MAX_CANDIDATE_STACK_DEPTH || // apply a fairly arbitrary depth limit
  ------------------
  |  | 1071|   198k|#define MAX_CANDIDATE_STACK_DEPTH 512
  ------------------
  |  Branch (1078:7): [True: 0, False: 99.1k]
  |  Branch (1078:7): [True: 0, False: 99.1k]
  ------------------
 1079|       |      // something very broken if suggest ends up calling itself with the same word
 1080|  99.1k|      std::find(suggest_candidate_stack.begin(), suggest_candidate_stack.end(), word) != suggest_candidate_stack.end()) {
  ------------------
  |  Branch (1080:7): [True: 0, False: 99.1k]
  ------------------
 1081|      0|    return { };
 1082|      0|  }
 1083|       |
 1084|  99.1k|  if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  99.1k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1084:7): [True: 0, False: 99.1k]
  ------------------
 1085|      0|    return { };
 1086|       |
 1087|  99.1k|  bool capwords;
 1088|  99.1k|  size_t abbv;
 1089|  99.1k|  int captype;
 1090|  99.1k|  std::vector<std::string> spell_candidate_stack;
 1091|  99.1k|  suggest_candidate_stack.push_back(word);
 1092|  99.1k|  std::vector<std::string> slst = suggest_internal(word, spell_candidate_stack, suggest_candidate_stack,
 1093|  99.1k|                                                   capwords, abbv, captype, suggest_start);
 1094|  99.1k|  suggest_candidate_stack.pop_back();
 1095|       |  // word reversing wrapper for complex prefixes
 1096|  99.1k|  if (complexprefixes) {
  ------------------
  |  Branch (1096:7): [True: 5.13k, False: 94.0k]
  ------------------
 1097|  5.13k|    for (auto& j : slst) {
  ------------------
  |  Branch (1097:18): [True: 2.64k, False: 5.13k]
  ------------------
 1098|  2.64k|      if (utf8)
  ------------------
  |  Branch (1098:11): [True: 0, False: 2.64k]
  ------------------
 1099|      0|        reverseword_utf(j);
 1100|  2.64k|      else
 1101|  2.64k|        reverseword(j);
 1102|  2.64k|    }
 1103|  5.13k|  }
 1104|       |
 1105|       |  // capitalize
 1106|  99.1k|  if (capwords) {
  ------------------
  |  Branch (1106:7): [True: 27.5k, False: 71.5k]
  ------------------
 1107|  27.5k|    for (auto& j : slst) {
  ------------------
  |  Branch (1107:18): [True: 20.6k, False: 27.5k]
  ------------------
 1108|  20.6k|      std::string capitalized(j);
 1109|  20.6k|      mkinitcap(capitalized);
 1110|  20.6k|      if (capitalized == word)
  ------------------
  |  Branch (1110:11): [True: 5, False: 20.6k]
  ------------------
 1111|      5|        continue;  // capitalizing would just reproduce the misspelled word
 1112|  20.6k|      j = std::move(capitalized);
 1113|  20.6k|    }
 1114|  27.5k|  }
 1115|       |
 1116|       |  // expand suggestions with dot(s)
 1117|  99.1k|  if (abbv && pAMgr && pAMgr->get_sugswithdots() && word.size() >= abbv) {
  ------------------
  |  Branch (1117:7): [True: 3.80k, False: 95.3k]
  |  Branch (1117:15): [True: 3.80k, False: 0]
  |  Branch (1117:24): [True: 0, False: 3.80k]
  |  Branch (1117:53): [True: 0, False: 0]
  ------------------
 1118|      0|    for (auto& j : slst) {
  ------------------
  |  Branch (1118:18): [True: 0, False: 0]
  ------------------
 1119|      0|      j.append(word.substr(word.size() - abbv));
 1120|      0|    }
 1121|      0|  }
 1122|       |
 1123|       |  // remove bad capitalized and forbidden forms
 1124|  99.1k|  if (pAMgr && (pAMgr->get_keepcase() || pAMgr->get_forbiddenword())) {
  ------------------
  |  Branch (1124:7): [True: 99.1k, False: 0]
  |  Branch (1124:17): [True: 5.15k, False: 94.0k]
  |  Branch (1124:42): [True: 94.0k, False: 0]
  ------------------
 1125|       |    // this check has a time limit of its own, so every suggestion the search found gets checked
 1126|  99.1k|    auto check_start = std::chrono::steady_clock::now();
 1127|  99.1k|    switch (captype) {
  ------------------
  |  Branch (1127:13): [True: 53.3k, False: 45.8k]
  ------------------
 1128|  12.1k|      case INITCAP:
  ------------------
  |  |   89|  12.1k|#define INITCAP 1
  ------------------
  |  Branch (1128:7): [True: 12.1k, False: 86.9k]
  ------------------
 1129|  21.3k|      case ALLCAP:
  ------------------
  |  |   90|  21.3k|#define ALLCAP 2
  ------------------
  |  Branch (1129:7): [True: 9.20k, False: 89.9k]
  ------------------
 1130|  37.9k|      case HUHCAP:
  ------------------
  |  |   91|  37.9k|#define HUHCAP 3
  ------------------
  |  Branch (1130:7): [True: 16.5k, False: 82.6k]
  ------------------
 1131|  53.3k|      case HUHINITCAP: {
  ------------------
  |  |   92|  53.3k|#define HUHINITCAP 4
  ------------------
  |  Branch (1131:7): [True: 15.3k, False: 83.7k]
  ------------------
 1132|  53.3k|        size_t l = 0;
 1133|  91.1k|        for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1133:28): [True: 37.8k, False: 53.3k]
  ------------------
 1134|       |          // A space-containing suggestion can be an "insert a space" split
 1135|       |          // whose parts each spell on their own, so it is good when every
 1136|       |          // part spells even though the whole string does not.
 1137|  37.8k|          bool bad = !spell(slst[j], spell_candidate_stack, nullptr, nullptr, check_start);
 1138|  37.8k|          if (bad && slst[j].find(' ') != std::string::npos) {
  ------------------
  |  Branch (1138:15): [True: 21.0k, False: 16.7k]
  |  Branch (1138:22): [True: 9.33k, False: 11.7k]
  ------------------
 1139|  9.33k|            bad = false;
 1140|  18.8k|            for (size_t start = 0; start <= slst[j].size(); ) {
  ------------------
  |  Branch (1140:36): [True: 18.8k, False: 0]
  ------------------
 1141|  18.8k|              size_t sp = slst[j].find(' ', start);
 1142|  18.8k|              size_t end = (sp == std::string::npos) ? slst[j].size() : sp;
  ------------------
  |  Branch (1142:28): [True: 2.50k, False: 16.3k]
  ------------------
 1143|  18.8k|              std::string part = slst[j].substr(start, end - start);
 1144|  18.8k|              if (!part.empty() &&
  ------------------
  |  Branch (1144:19): [True: 12.7k, False: 6.15k]
  ------------------
 1145|  12.7k|                  !spell(part, spell_candidate_stack, nullptr, nullptr, check_start)) {
  ------------------
  |  Branch (1145:19): [True: 7.98k, False: 4.72k]
  ------------------
 1146|  7.98k|                bad = true;
 1147|  7.98k|                break;
 1148|  7.98k|              }
 1149|  10.8k|              if (sp == std::string::npos)
  ------------------
  |  Branch (1149:19): [True: 1.35k, False: 9.53k]
  ------------------
 1150|  1.35k|                break;
 1151|  9.53k|              start = sp + 1;
 1152|  9.53k|            }
 1153|  9.33k|          }
 1154|  37.8k|          if (bad) {
  ------------------
  |  Branch (1154:15): [True: 19.7k, False: 18.0k]
  ------------------
 1155|  19.7k|            std::string s;
 1156|  19.7k|            std::vector<w_char> w;
 1157|  19.7k|            if (utf8) {
  ------------------
  |  Branch (1157:17): [True: 9.02k, False: 10.7k]
  ------------------
 1158|  9.02k|              u8_u16(w, slst[j]);
 1159|  10.7k|            } else {
 1160|  10.7k|              s = slst[j];
 1161|  10.7k|            }
 1162|  19.7k|            mkallsmall2(s, w);
 1163|  19.7k|            if (spell(s, spell_candidate_stack, nullptr, nullptr, check_start)) {
  ------------------
  |  Branch (1163:17): [True: 50, False: 19.6k]
  ------------------
 1164|     50|              slst[l] = std::move(s);
 1165|     50|              ++l;
 1166|  19.6k|            } else {
 1167|  19.6k|              mkinitcap2(s, w);
 1168|  19.6k|              if (spell(s, spell_candidate_stack, nullptr, nullptr, check_start)) {
  ------------------
  |  Branch (1168:19): [True: 54, False: 19.6k]
  ------------------
 1169|     54|                slst[l] = std::move(s);
 1170|     54|                ++l;
 1171|     54|              }
 1172|  19.6k|            }
 1173|  19.7k|          } else {
 1174|  18.0k|            slst[l] = slst[j];
 1175|  18.0k|            ++l;
 1176|  18.0k|          }
 1177|  37.8k|        }
 1178|  53.3k|        slst.resize(l);
 1179|  53.3k|      }
 1180|  99.1k|    }
 1181|  99.1k|  }
 1182|       |
 1183|       |  // remove duplications
 1184|  99.1k|  size_t l = 0;
 1185|   120k|  for (size_t j = 0; j < slst.size(); ++j) {
  ------------------
  |  Branch (1185:22): [True: 21.5k, False: 99.1k]
  ------------------
 1186|  21.5k|    slst[l] = slst[j];
 1187|  32.3k|    for (size_t k = 0; k < l; ++k) {
  ------------------
  |  Branch (1187:24): [True: 11.7k, False: 20.5k]
  ------------------
 1188|  11.7k|      if (slst[k] == slst[j]) {
  ------------------
  |  Branch (1188:11): [True: 984, False: 10.7k]
  ------------------
 1189|    984|        --l;
 1190|    984|        break;
 1191|    984|      }
 1192|  11.7k|    }
 1193|  21.5k|    ++l;
 1194|  21.5k|  }
 1195|  99.1k|  slst.resize(l);
 1196|       |
 1197|       |  // output conversion
 1198|  99.1k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1198:17): [True: 99.1k, False: 0]
  ------------------
 1199|  99.1k|  if (rl) {
  ------------------
  |  Branch (1199:7): [True: 5.34k, False: 93.8k]
  ------------------
 1200|       |    // hold the converted suggestions to the same ceiling as an analysis
 1201|  5.34k|    size_t total = 0;
 1202|  5.34k|    size_t l = 0;
 1203|  6.22k|    for (size_t i = 0; i < slst.size(); ++i) {
  ------------------
  |  Branch (1203:24): [True: 883, False: 5.34k]
  ------------------
 1204|    883|      std::string wspace;
 1205|    883|      if (rl->conv(slst[i], wspace, MAXMORPHRESULT - total)) {
  ------------------
  |  |  114|    883|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1205:11): [True: 244, False: 639]
  ------------------
 1206|    244|        slst[i] = std::move(wspace);
 1207|    244|      }
 1208|    883|      if (slst[i].size() > MAXMORPHRESULT - total)
  ------------------
  |  |  114|    883|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1208:11): [True: 0, False: 883]
  ------------------
 1209|      0|        break;
 1210|    883|      total += slst[i].size();
 1211|       |      // gh#1002: OCONV can map a generated form back to the input word
 1212|       |      // (e.g. "románórum" -> "romanórum" when the user typed "romanórum"),
 1213|       |      // leaving the misspelled word as its own suggestion.
 1214|    883|      if (slst[i] == word)
  ------------------
  |  Branch (1214:11): [True: 0, False: 883]
  ------------------
 1215|      0|        continue;
 1216|    883|      if (l != i)
  ------------------
  |  Branch (1216:11): [True: 0, False: 883]
  ------------------
 1217|      0|        slst[l] = std::move(slst[i]);
 1218|    883|      ++l;
 1219|    883|    }
 1220|  5.34k|    slst.resize(l);
 1221|  5.34k|  }
 1222|  99.1k|  return slst;
 1223|  99.1k|}
_ZN12HunspellImpl7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1225|  68.6k|std::vector<std::string> HunspellImpl::suggest(const std::string& word) {
 1226|  68.6k|  std::vector<std::string> suggest_candidate_stack;
 1227|  68.6k|  auto suggest_start = std::chrono::steady_clock::now();
 1228|  68.6k|  return suggest(word, suggest_candidate_stack, suggest_start);
 1229|  68.6k|}
_ZN12HunspellImpl16suggest_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorIS6_NS4_IS6_EEEESC_RbRmRiNS0_6chrono10time_pointINSG_12steady_clockENSG_8durationIxNS0_5ratioILl1ELl1000000000EEEEEEE:
 1235|  99.1k|        std::chrono::steady_clock::time_point suggest_start) {
 1236|       |  // The candidates tried here are the tool's own guesses, not the word the
 1237|       |  // user asked about.
 1238|  99.1k|  TraceSuppress no_trace(m_trace.get());
 1239|       |
 1240|  99.1k|  captype = NOCAP;
  ------------------
  |  |   88|  99.1k|#define NOCAP 0
  ------------------
 1241|  99.1k|  abbv = 0;
 1242|  99.1k|  capwords = false;
 1243|       |
 1244|  99.1k|  std::vector<std::string> slst;
 1245|       |
 1246|  99.1k|  int onlycmpdsug = 0;
 1247|  99.1k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1247:7): [True: 0, False: 99.1k]
  |  Branch (1247:17): [True: 0, False: 99.1k]
  ------------------
 1248|      0|    return slst;
 1249|       |
 1250|       |  // process XML input of the simplified API (see manual)
 1251|  99.1k|  if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  99.1k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  99.1k|#define SPELL_XML "<?xml?>"
  ------------------
                if (word.compare(0, sizeof(SPELL_XML) - 3, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) {
  ------------------
  |  |   80|  99.1k|#define SPELL_XML "<?xml?>"
  ------------------
  |  Branch (1251:7): [True: 23.8k, False: 75.2k]
  ------------------
 1252|  23.8k|    if (word.size() > MAXSPELLMLLEN)
  ------------------
  |  |   88|  23.8k|#define MAXSPELLMLLEN 8192
  ------------------
  |  Branch (1252:9): [True: 513, False: 23.3k]
  ------------------
 1253|    513|      return slst;
 1254|  23.3k|    return spellml(word);
 1255|  23.8k|  }
 1256|  75.2k|  if (utf8) {
  ------------------
  |  Branch (1256:7): [True: 36.4k, False: 38.8k]
  ------------------
 1257|  36.4k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   87|  36.4k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  36.4k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1257:9): [True: 180, False: 36.2k]
  ------------------
 1258|    180|      return slst;
 1259|  38.8k|  } else {
 1260|  38.8k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  38.8k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1260:9): [True: 230, False: 38.6k]
  ------------------
 1261|    230|      return slst;
 1262|  38.8k|  }
 1263|  74.8k|  size_t wl = 0;
 1264|       |
 1265|  74.8k|  std::string scw;
 1266|  74.8k|  std::vector<w_char> sunicw;
 1267|       |
 1268|       |  // input conversion
 1269|  74.8k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1269:17): [True: 74.8k, False: 0]
  ------------------
 1270|  74.8k|  {
 1271|  74.8k|    std::string wspace;
 1272|       |
 1273|  74.8k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1273:23): [True: 4.06k, False: 70.8k]
  ------------------
 1274|  74.8k|    if (convstatus) {
  ------------------
  |  Branch (1274:9): [True: 0, False: 74.8k]
  ------------------
 1275|       |      // the input conversion can grow the word without limit, so hold the
 1276|       |      // converted word to the same maximum length as the raw word
 1277|      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 (1277:11): [True: 0, False: 0]
  |  Branch (1277:11): [True: 0, False: 0]
  ------------------
 1278|      0|        return slst;
 1279|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1280|      0|    } else
 1281|  74.8k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1282|       |
 1283|  74.8k|    if (wl == 0)
  ------------------
  |  Branch (1283:9): [True: 0, False: 74.8k]
  ------------------
 1284|      0|      return slst;
 1285|       |
 1286|  74.8k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1287|  74.8k|    if (wl > 32768)
  ------------------
  |  Branch (1287:9): [True: 0, False: 74.8k]
  ------------------
 1288|      0|      return slst;
 1289|  74.8k|#endif
 1290|  74.8k|  }
 1291|       |
 1292|  74.8k|  bool good = false;
 1293|       |
 1294|       |  // check capitalized form for FORCEUCASE
 1295|  74.8k|  if (pAMgr && captype == NOCAP && pAMgr->get_forceucase()) {
  ------------------
  |  |   88|   149k|#define NOCAP 0
  ------------------
  |  Branch (1295:7): [True: 74.8k, False: 0]
  |  Branch (1295:16): [True: 21.5k, False: 53.3k]
  |  Branch (1295:36): [True: 0, False: 21.5k]
  ------------------
 1296|      0|    int info = SPELL_ORIGCAP;
  ------------------
  |  |   86|      0|#define SPELL_ORIGCAP (1 << 5)
  ------------------
 1297|      0|    if (checkword(scw, &info, nullptr, suggest_start)) {
  ------------------
  |  Branch (1297:9): [True: 0, False: 0]
  ------------------
 1298|      0|      std::string form(std::move(scw));
 1299|      0|      mkinitcap(form);
 1300|      0|      slst.push_back(std::move(form));
 1301|      0|      return slst;
 1302|      0|    }
 1303|      0|  }
 1304|       |
 1305|  74.8k|  switch (captype) {
  ------------------
  |  Branch (1305:11): [True: 74.8k, False: 0]
  ------------------
 1306|  21.5k|    case NOCAP: {
  ------------------
  |  |   88|  21.5k|#define NOCAP 0
  ------------------
  |  Branch (1306:5): [True: 21.5k, False: 53.3k]
  ------------------
 1307|  21.5k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1308|  21.5k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  21.5k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1308:11): [True: 0, False: 21.5k]
  ------------------
 1309|      0|          return slst;
 1310|  21.5k|      if (abbv) {
  ------------------
  |  Branch (1310:11): [True: 1.77k, False: 19.7k]
  ------------------
 1311|  1.77k|        std::string wspace(scw);
 1312|  1.77k|        wspace.push_back('.');
 1313|  1.77k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1314|  1.77k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  1.77k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1314:13): [True: 0, False: 1.77k]
  ------------------
 1315|      0|            return slst;
 1316|  1.77k|      }
 1317|  21.5k|      break;
 1318|  21.5k|    }
 1319|       |
 1320|  21.5k|    case INITCAP: {
  ------------------
  |  |   89|  12.1k|#define INITCAP 1
  ------------------
  |  Branch (1320:5): [True: 12.1k, False: 62.6k]
  ------------------
 1321|  12.1k|      capwords = true;
 1322|  12.1k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1323|  12.1k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  12.1k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1323:11): [True: 0, False: 12.1k]
  ------------------
 1324|      0|          return slst;
 1325|  12.1k|      std::string wspace(scw);
 1326|  12.1k|      mkallsmall2(wspace, sunicw);
 1327|  12.1k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1328|  12.1k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  12.1k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1328:11): [True: 0, False: 12.1k]
  ------------------
 1329|      0|          return slst;
 1330|  12.1k|      break;
 1331|  12.1k|    }
 1332|  15.3k|    case HUHINITCAP:
  ------------------
  |  |   92|  15.3k|#define HUHINITCAP 4
  ------------------
  |  Branch (1332:5): [True: 15.3k, False: 59.4k]
  ------------------
 1333|  15.3k|      capwords = true;
 1334|       |      /* FALLTHROUGH */
 1335|  31.9k|    case HUHCAP: {
  ------------------
  |  |   91|  31.9k|#define HUHCAP 3
  ------------------
  |  Branch (1335:5): [True: 16.5k, False: 58.3k]
  ------------------
 1336|  31.9k|      good |= pSMgr->suggest(slst, scw, &onlycmpdsug);
 1337|  31.9k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  31.9k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1337:11): [True: 0, False: 31.9k]
  ------------------
 1338|      0|          return slst;
 1339|       |      // something.The -> something. The
 1340|  31.9k|      size_t dot_pos = scw.find('.');
 1341|  31.9k|      if (dot_pos != std::string::npos) {
  ------------------
  |  Branch (1341:11): [True: 11.4k, False: 20.5k]
  ------------------
 1342|  11.4k|        std::string postdot = scw.substr(dot_pos + 1);
 1343|  11.4k|        int captype_;
 1344|  11.4k|        if (utf8) {
  ------------------
  |  Branch (1344:13): [True: 3.25k, False: 8.16k]
  ------------------
 1345|  3.25k|          std::vector<w_char> postdotu;
 1346|  3.25k|          u8_u16(postdotu, postdot);
 1347|  3.25k|          captype_ = get_captype_utf8(postdotu, langnum);
 1348|  8.16k|        } else {
 1349|  8.16k|          captype_ = get_captype(postdot, csconv);
 1350|  8.16k|        }
 1351|  11.4k|        if (captype_ == INITCAP) {
  ------------------
  |  |   89|  11.4k|#define INITCAP 1
  ------------------
  |  Branch (1351:13): [True: 6.46k, False: 4.94k]
  ------------------
 1352|  6.46k|          std::string str(scw);
 1353|  6.46k|          str.insert(dot_pos + 1, 1, ' ');
 1354|  6.46k|          insert_sug(slst, str);
 1355|  6.46k|        }
 1356|  11.4k|      }
 1357|       |
 1358|  31.9k|      std::string wspace;
 1359|       |
 1360|  31.9k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   92|  31.9k|#define HUHINITCAP 4
  ------------------
  |  Branch (1360:11): [True: 15.3k, False: 16.5k]
  ------------------
 1361|       |        // TheOpenOffice.org -> The OpenOffice.org
 1362|  15.3k|        wspace = scw;
 1363|  15.3k|        mkinitsmall2(wspace, sunicw);
 1364|  15.3k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1365|  15.3k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  15.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1365:13): [True: 0, False: 15.3k]
  ------------------
 1366|      0|            return slst;
 1367|  15.3k|      }
 1368|  31.9k|      wspace = scw;
 1369|  31.9k|      mkallsmall2(wspace, sunicw);
 1370|  31.9k|      if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1370:11): [True: 1.45k, False: 30.5k]
  ------------------
 1371|  1.45k|        insert_sug(slst, wspace);
 1372|  31.9k|      size_t prevns = slst.size();
 1373|  31.9k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1374|  31.9k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  31.9k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1374:11): [True: 0, False: 31.9k]
  ------------------
 1375|      0|          return slst;
 1376|  31.9k|      if (captype == HUHINITCAP) {
  ------------------
  |  |   92|  31.9k|#define HUHINITCAP 4
  ------------------
  |  Branch (1376:11): [True: 15.3k, False: 16.5k]
  ------------------
 1377|  15.3k|        mkinitcap2(wspace, sunicw);
 1378|  15.3k|        if (spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1378:13): [True: 580, False: 14.8k]
  ------------------
 1379|    580|          insert_sug(slst, wspace);
 1380|  15.3k|        good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1381|  15.3k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  15.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1381:13): [True: 0, False: 15.3k]
  ------------------
 1382|      0|            return slst;
 1383|  15.3k|      }
 1384|       |      // aNew -> "a New" (instead of "a new")
 1385|  32.7k|      for (size_t j = prevns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1385:31): [True: 748, False: 31.9k]
  ------------------
 1386|    748|        const char* space = strchr(slst[j].c_str(), ' ');
 1387|    748|        if (space) {
  ------------------
  |  Branch (1387:13): [True: 512, False: 236]
  ------------------
 1388|    512|          size_t slen = strlen(space + 1);
 1389|       |          // different case after space (need capitalisation)
 1390|    512|          if ((slen < wl) && strcmp(scw.c_str() + wl - slen, space + 1) != 0) {
  ------------------
  |  Branch (1390:15): [True: 512, False: 0]
  |  Branch (1390:30): [True: 492, False: 20]
  ------------------
 1391|    492|            std::string first(slst[j].c_str(), space + 1);
 1392|    492|            std::string second(space + 1);
 1393|    492|            std::vector<w_char> w;
 1394|    492|            if (utf8)
  ------------------
  |  Branch (1394:17): [True: 148, False: 344]
  ------------------
 1395|    148|              u8_u16(w, second);
 1396|    492|            mkinitcap2(second, w);
 1397|       |            // set as first suggestion
 1398|    492|            slst.erase(slst.begin() + j);
 1399|    492|            slst.insert(slst.begin(), first + second);
 1400|    492|          }
 1401|    512|        }
 1402|    748|      }
 1403|  31.9k|      break;
 1404|  31.9k|    }
 1405|       |
 1406|  9.20k|    case ALLCAP: {
  ------------------
  |  |   90|  9.20k|#define ALLCAP 2
  ------------------
  |  Branch (1406:5): [True: 9.20k, False: 65.6k]
  ------------------
 1407|  9.20k|      std::string wspace(scw);
 1408|  9.20k|      mkallsmall2(wspace, sunicw);
 1409|  9.20k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1410|  9.20k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  9.20k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1410:11): [True: 0, False: 9.20k]
  ------------------
 1411|      0|          return slst;
 1412|  9.20k|      if (pAMgr && pAMgr->get_keepcase() && spell(wspace, spell_candidate_stack, nullptr, nullptr, suggest_start))
  ------------------
  |  Branch (1412:11): [True: 9.20k, False: 0]
  |  Branch (1412:20): [True: 408, False: 8.79k]
  |  Branch (1412:45): [True: 0, False: 408]
  ------------------
 1413|      0|        insert_sug(slst, wspace);
 1414|  9.20k|      mkinitcap2(wspace, sunicw);
 1415|  9.20k|      good |= pSMgr->suggest(slst, wspace, &onlycmpdsug);
 1416|  9.20k|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  9.20k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1416:11): [True: 0, False: 9.20k]
  ------------------
 1417|      0|          return slst;
 1418|  9.20k|      for (auto& j : slst) {
  ------------------
  |  Branch (1418:20): [True: 529, False: 9.20k]
  ------------------
 1419|    529|        mkallcap(j);
 1420|    529|        if (pAMgr && pAMgr->get_checksharps()) {
  ------------------
  |  Branch (1420:13): [True: 529, False: 0]
  |  Branch (1420:22): [True: 0, False: 529]
  ------------------
 1421|      0|          if (utf8) {
  ------------------
  |  Branch (1421:15): [True: 0, False: 0]
  ------------------
 1422|      0|            mystrrep(j, "\xC3\x9F", "SS");
 1423|      0|          } else {
 1424|      0|            mystrrep(j, "\xDF", "SS");
 1425|      0|          }
 1426|      0|        }
 1427|    529|      }
 1428|  9.20k|      break;
 1429|  9.20k|    }
 1430|  74.8k|  }
 1431|       |
 1432|       |  // LANG_hu section: replace '-' with ' ' in Hungarian
 1433|  74.8k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1433:7): [True: 4.14k, False: 70.7k]
  ------------------
 1434|  4.14k|    for (auto& j : slst) {
  ------------------
  |  Branch (1434:18): [True: 443, False: 4.14k]
  ------------------
 1435|    443|      size_t pos = j.find('-');
 1436|    443|      if (pos != std::string::npos) {
  ------------------
  |  Branch (1436:11): [True: 186, False: 257]
  ------------------
 1437|    186|        int info = 0;
 1438|    186|        std::string w(j.substr(0, pos));
 1439|    186|        w.append(j.substr(pos + 1));
 1440|    186|        (void)spell(w, spell_candidate_stack, &info, nullptr, suggest_start);
 1441|    186|        if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) {
  ------------------
  |  |   81|    186|#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 (1441:13): [True: 0, False: 186]
  |  Branch (1441:40): [True: 0, False: 0]
  ------------------
 1442|      0|          j[pos] = ' ';
 1443|      0|        } else
 1444|    186|          j[pos] = '-';
 1445|    186|      }
 1446|    443|    }
 1447|  4.14k|  }
 1448|       |  // END OF LANG_hu section
 1449|       |  // try ngram approach since found nothing good suggestion
 1450|  74.8k|  if (!good && pAMgr && (slst.empty() || onlycmpdsug) && (pAMgr->get_maxngramsugs() != 0)) {
  ------------------
  |  Branch (1450:7): [True: 74.8k, False: 61]
  |  Branch (1450:16): [True: 74.8k, False: 0]
  |  Branch (1450:26): [True: 63.7k, False: 11.1k]
  |  Branch (1450:42): [True: 10.8k, False: 248]
  |  Branch (1450:58): [True: 66.4k, False: 8.14k]
  ------------------
 1451|  66.4k|    switch (captype) {
  ------------------
  |  Branch (1451:13): [True: 66.4k, False: 0]
  ------------------
 1452|  18.2k|      case NOCAP: {
  ------------------
  |  |   88|  18.2k|#define NOCAP 0
  ------------------
  |  Branch (1452:7): [True: 18.2k, False: 48.1k]
  ------------------
 1453|  18.2k|        pSMgr->ngsuggest(slst, scw.c_str(), m_HMgrs, NOCAP);
  ------------------
  |  |   88|  18.2k|#define NOCAP 0
  ------------------
 1454|  18.2k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  18.2k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1454:13): [True: 0, False: 18.2k]
  ------------------
 1455|      0|            return slst;
 1456|  18.2k|        break;
 1457|  18.2k|      }
 1458|       |      /* FALLTHROUGH */
 1459|  18.2k|      case HUHINITCAP:
  ------------------
  |  |   92|  14.4k|#define HUHINITCAP 4
  ------------------
  |  Branch (1459:7): [True: 14.4k, False: 51.9k]
  ------------------
 1460|  14.4k|        capwords = true;
 1461|       |      /* FALLTHROUGH */
 1462|  29.7k|      case HUHCAP: {
  ------------------
  |  |   91|  29.7k|#define HUHCAP 3
  ------------------
  |  Branch (1462:7): [True: 15.2k, False: 51.2k]
  ------------------
 1463|  29.7k|        std::string wspace(scw);
 1464|  29.7k|        mkallsmall2(wspace, sunicw);
 1465|  29.7k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, HUHCAP);
  ------------------
  |  |   91|  29.7k|#define HUHCAP 3
  ------------------
 1466|  29.7k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  29.7k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1466:13): [True: 0, False: 29.7k]
  ------------------
 1467|      0|            return slst;
 1468|  29.7k|        break;
 1469|  29.7k|      }
 1470|  29.7k|      case INITCAP: {
  ------------------
  |  |   89|  10.3k|#define INITCAP 1
  ------------------
  |  Branch (1470:7): [True: 10.3k, False: 56.0k]
  ------------------
 1471|  10.3k|        capwords = true;
 1472|  10.3k|        std::string wspace(scw);
 1473|  10.3k|        mkallsmall2(wspace, sunicw);
 1474|  10.3k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, INITCAP);
  ------------------
  |  |   89|  10.3k|#define INITCAP 1
  ------------------
 1475|  10.3k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  10.3k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1475:13): [True: 0, False: 10.3k]
  ------------------
 1476|      0|            return slst;
 1477|  10.3k|        break;
 1478|  10.3k|      }
 1479|  10.3k|      case ALLCAP: {
  ------------------
  |  |   90|  8.06k|#define ALLCAP 2
  ------------------
  |  Branch (1479:7): [True: 8.06k, False: 58.3k]
  ------------------
 1480|  8.06k|        std::string wspace(scw);
 1481|  8.06k|        mkallsmall2(wspace, sunicw);
 1482|  8.06k|        size_t oldns = slst.size();
 1483|  8.06k|        pSMgr->ngsuggest(slst, wspace.c_str(), m_HMgrs, ALLCAP);
  ------------------
  |  |   90|  8.06k|#define ALLCAP 2
  ------------------
 1484|  8.06k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  8.06k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1484:13): [True: 0, False: 8.06k]
  ------------------
 1485|      0|            return slst;
 1486|  10.2k|        for (size_t j = oldns; j < slst.size(); ++j) {
  ------------------
  |  Branch (1486:32): [True: 2.15k, False: 8.06k]
  ------------------
 1487|  2.15k|          mkallcap(slst[j]);
 1488|  2.15k|        }
 1489|  8.06k|        break;
 1490|  8.06k|      }
 1491|  66.4k|    }
 1492|  66.4k|  }
 1493|       |
 1494|       |  // try dash suggestion (Afo-American -> Afro-American)
 1495|       |  // Note: LibreOffice was modified to treat dashes as word
 1496|       |  // characters to check "scot-free" etc. word forms, but
 1497|       |  // we need to handle suggestions for "Afo-American", etc.,
 1498|       |  // while "Afro-American" is missing from the dictionary.
 1499|       |  // TODO avoid possible overgeneration
 1500|  74.8k|  size_t dash_pos = scw.find('-');
 1501|  74.8k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1501:7): [True: 37.7k, False: 37.0k]
  ------------------
 1502|  37.7k|    int nodashsug = 1;
 1503|  50.0k|    for (size_t j = 0; j < slst.size() && nodashsug == 1; ++j) {
  ------------------
  |  Branch (1503:24): [True: 13.0k, False: 37.0k]
  |  Branch (1503:43): [True: 12.3k, False: 772]
  ------------------
 1504|  12.3k|      if (slst[j].find('-') != std::string::npos)
  ------------------
  |  Branch (1504:11): [True: 6.62k, False: 5.68k]
  ------------------
 1505|  6.62k|        nodashsug = 0;
 1506|  12.3k|    }
 1507|       |
 1508|  37.7k|    size_t prev_pos = 0;
 1509|  37.7k|    bool last = false;
 1510|       |
 1511|   110k|    while (!good && nodashsug && !last) {
  ------------------
  |  Branch (1511:12): [True: 110k, False: 29]
  |  Branch (1511:21): [True: 73.6k, False: 37.1k]
  |  Branch (1511:34): [True: 73.0k, False: 609]
  ------------------
 1512|  73.0k|      if (dash_pos == scw.size())
  ------------------
  |  Branch (1512:11): [True: 5.45k, False: 67.5k]
  ------------------
 1513|  5.45k|        last = true;
 1514|  73.0k|      std::string chunk = scw.substr(prev_pos, dash_pos - prev_pos);
 1515|  73.0k|      if (chunk != word && !spell(chunk, spell_candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1515:11): [True: 73.0k, False: 0]
  |  Branch (1515:28): [True: 30.5k, False: 42.5k]
  ------------------
 1516|  30.5k|        std::vector<std::string> nlst = suggest(chunk, suggest_candidate_stack, suggest_start);
 1517|  30.5k|        if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|  30.5k|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (1517:13): [True: 0, False: 30.5k]
  ------------------
 1518|      0|            return slst;
 1519|  41.5k|        for (auto j = nlst.rbegin(); j != nlst.rend(); ++j) {
  ------------------
  |  Branch (1519:38): [True: 11.0k, False: 30.5k]
  ------------------
 1520|  11.0k|          std::string wspace = scw.substr(0, prev_pos);
 1521|  11.0k|          wspace.append(*j);
 1522|  11.0k|          if (!last) {
  ------------------
  |  Branch (1522:15): [True: 9.35k, False: 1.70k]
  ------------------
 1523|  9.35k|            wspace.append("-");
 1524|  9.35k|            wspace.append(scw.substr(dash_pos + 1));
 1525|  9.35k|          }
 1526|  11.0k|          int info = 0;
 1527|  11.0k|          if (pAMgr && pAMgr->get_forbiddenword())
  ------------------
  |  Branch (1527:15): [True: 11.0k, False: 0]
  |  Branch (1527:24): [True: 11.0k, False: 0]
  ------------------
 1528|  11.0k|            checkword(wspace, &info, nullptr, suggest_start);
 1529|  11.0k|          if (!(info & SPELL_FORBIDDEN))
  ------------------
  |  |   82|  11.0k|#define SPELL_FORBIDDEN (1 << 1)
  ------------------
  |  Branch (1529:15): [True: 11.0k, False: 0]
  ------------------
 1530|  11.0k|            insert_sug(slst, wspace);
 1531|  11.0k|        }
 1532|  30.5k|        nodashsug = 0;
 1533|  30.5k|      }
 1534|  73.0k|      if (!last) {
  ------------------
  |  Branch (1534:11): [True: 67.5k, False: 5.45k]
  ------------------
 1535|  67.5k|        prev_pos = dash_pos + 1;
 1536|  67.5k|        dash_pos = scw.find('-', prev_pos);
 1537|  67.5k|      }
 1538|  73.0k|      if (dash_pos == std::string::npos)
  ------------------
  |  Branch (1538:11): [True: 13.4k, False: 59.6k]
  ------------------
 1539|  13.4k|        dash_pos = scw.size();
 1540|  73.0k|    }
 1541|  37.7k|  }
 1542|  74.8k|  return slst;
 1543|  74.8k|}
_ZN12HunspellImpl4stemERKNSt3__16vectorINS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS5_IS7_EEEE:
 1549|    968|std::vector<std::string> HunspellImpl::stem(const std::vector<std::string>& desc) {
 1550|    968|  std::vector<std::string> slst;
 1551|       |
 1552|    968|  std::string result2;
 1553|    968|  if (desc.empty())
  ------------------
  |  Branch (1553:7): [True: 838, False: 130]
  ------------------
 1554|    838|    return slst;
 1555|    159|  for (const auto& i : desc) {
  ------------------
  |  Branch (1555:22): [True: 159, False: 130]
  ------------------
 1556|    159|    if (result2.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|    159|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1556:9): [True: 0, False: 159]
  ------------------
 1557|      0|      break;
 1558|       |
 1559|    159|    std::string result;
 1560|       |
 1561|       |    // add compound word parts (except the last one)
 1562|    159|    std::string tok(i, append_compound_parts(i, result));
 1563|    159|    size_t alt = 0;
 1564|    159|    while ((alt = tok.find(" | ", alt)) != std::string::npos) {
  ------------------
  |  Branch (1564:12): [True: 0, False: 159]
  ------------------
 1565|      0|      tok[alt + 1] = MSEP_ALT;
  ------------------
  |  |  119|      0|#define MSEP_ALT '\v'
  ------------------
 1566|      0|    }
 1567|    159|    std::vector<std::string> pl = line_tok(tok, MSEP_ALT);
  ------------------
  |  |  119|    159|#define MSEP_ALT '\v'
  ------------------
 1568|    159|    for (auto& k : pl) {
  ------------------
  |  Branch (1568:18): [True: 159, False: 159]
  ------------------
 1569|    159|      if (result2.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|    159|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1569:11): [True: 0, False: 159]
  ------------------
 1570|      0|        break;
 1571|       |
 1572|       |      // add derivational suffixes
 1573|    159|      if (k.find(MORPH_DERI_SFX) != std::string::npos) {
  ------------------
  |  |  105|    159|#define MORPH_DERI_SFX "ds:"
  ------------------
  |  Branch (1573:11): [True: 0, False: 159]
  ------------------
 1574|       |        // remove inflectional suffixes
 1575|      0|        const size_t is = k.find(MORPH_INFL_SFX);
  ------------------
  |  |  106|      0|#define MORPH_INFL_SFX "is:"
  ------------------
 1576|      0|        if (is != std::string::npos)
  ------------------
  |  Branch (1576:13): [True: 0, False: 0]
  ------------------
 1577|      0|          k.resize(is);
 1578|      0|        std::vector<std::string> singlepl;
 1579|      0|        singlepl.push_back(k);
 1580|      0|        std::string sg = pSMgr->suggest_gen(singlepl, k);
 1581|      0|        if (!sg.empty()) {
  ------------------
  |  Branch (1581:13): [True: 0, False: 0]
  ------------------
 1582|      0|          std::vector<std::string> gen = line_tok(sg, MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 1583|      0|          for (auto& j : gen) {
  ------------------
  |  Branch (1583:24): [True: 0, False: 0]
  ------------------
 1584|      0|            result2.push_back(MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 1585|      0|            result2.append(result);
 1586|      0|            result2.append(j);
 1587|      0|          }
 1588|      0|        }
 1589|    159|      } else {
 1590|    159|        result2.push_back(MSEP_REC);
  ------------------
  |  |  118|    159|#define MSEP_REC '\n'
  ------------------
 1591|    159|        result2.append(result);
 1592|    159|        if (k.find(MORPH_SURF_PFX) != std::string::npos) {
  ------------------
  |  |  108|    159|#define MORPH_SURF_PFX "sp:"
  ------------------
  |  Branch (1592:13): [True: 0, False: 159]
  ------------------
 1593|      0|          std::string field;
 1594|      0|          copy_field(field, k, MORPH_SURF_PFX);
  ------------------
  |  |  108|      0|#define MORPH_SURF_PFX "sp:"
  ------------------
 1595|      0|          result2.append(field);
 1596|      0|        }
 1597|    159|        std::string field;
 1598|    159|        copy_field(field, k, MORPH_STEM);
  ------------------
  |  |   99|    159|#define MORPH_STEM "st:"
  ------------------
 1599|    159|        result2.append(field);
 1600|    159|      }
 1601|    159|    }
 1602|    159|  }
 1603|    130|  slst = line_tok(result2, MSEP_REC);
  ------------------
  |  |  118|    130|#define MSEP_REC '\n'
  ------------------
 1604|    130|  uniqlist(slst);
 1605|    130|  return slst;
 1606|    968|}
_ZN12HunspellImpl4stemERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1608|    968|std::vector<std::string> HunspellImpl::stem(const std::string& word) {
 1609|    968|  return stem(analyze(word));
 1610|    968|}
_ZN12HunspellImpl9mkinitcapERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1620|  20.6k|void HunspellImpl::mkinitcap(std::string& u8) {
 1621|  20.6k|  if (utf8) {
  ------------------
  |  Branch (1621:7): [True: 7.08k, False: 13.5k]
  ------------------
 1622|  7.08k|    std::vector<w_char> u16;
 1623|  7.08k|    u8_u16(u16, u8);
 1624|  7.08k|    ::mkinitcap_utf(u16, langnum);
 1625|  7.08k|    u16_u8(u8, u16);
 1626|  13.5k|  } else {
 1627|  13.5k|    ::mkinitcap(u8, csconv);
 1628|  13.5k|  }
 1629|  20.6k|}
_ZN12HunspellImpl10mkinitcap2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1631|  2.51M|size_t HunspellImpl::mkinitcap2(std::string& u8, std::vector<w_char>& u16) {
 1632|  2.51M|  if (utf8) {
  ------------------
  |  Branch (1632:7): [True: 415k, False: 2.10M]
  ------------------
 1633|   415k|    ::mkinitcap_utf(u16, langnum);
 1634|   415k|    u16_u8(u8, u16);
 1635|  2.10M|  } else {
 1636|  2.10M|    ::mkinitcap(u8, csconv);
 1637|  2.10M|  }
 1638|  2.51M|  return u8.size();
 1639|  2.51M|}
_ZN12HunspellImpl12mkinitsmall2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_6vectorI6w_charNS4_IS9_EEEE:
 1641|   304k|size_t HunspellImpl::mkinitsmall2(std::string& u8, std::vector<w_char>& u16) {
 1642|   304k|  if (utf8) {
  ------------------
  |  Branch (1642:7): [True: 37.8k, False: 267k]
  ------------------
 1643|  37.8k|    ::mkinitsmall_utf(u16, langnum);
 1644|  37.8k|    u16_u8(u8, u16);
 1645|   267k|  } else {
 1646|   267k|    ::mkinitsmall(u8, csconv);
 1647|   267k|  }
 1648|   304k|  return u8.size();
 1649|   304k|}
_ZN12HunspellImpl3addERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1651|  5.88k|int HunspellImpl::add(const std::string& word) {
 1652|  5.88k|  if (!m_HMgrs.empty()) {
  ------------------
  |  Branch (1652:7): [True: 5.88k, False: 0]
  ------------------
 1653|  5.88k|    std::string converted;
 1654|  5.88k|    if (!entry_input_conv(word, converted))
  ------------------
  |  Branch (1654:9): [True: 0, False: 5.88k]
  ------------------
 1655|      0|      return 1;
 1656|  5.88k|    return m_HMgrs[0]->add(converted);
 1657|  5.88k|  }
 1658|      0|  return 0;
 1659|  5.88k|}
_ZN12HunspellImpl14add_with_affixERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 1671|  1.50k|int HunspellImpl::add_with_affix(const std::string& word, const std::string& example) {
 1672|  1.50k|  if (!m_HMgrs.empty()) {
  ------------------
  |  Branch (1672:7): [True: 1.50k, False: 0]
  ------------------
 1673|  1.50k|    std::string converted, converted_example;
 1674|  1.50k|    if (!entry_input_conv(word, converted) || !entry_input_conv(example, converted_example))
  ------------------
  |  Branch (1674:9): [True: 0, False: 1.50k]
  |  Branch (1674:47): [True: 0, False: 1.50k]
  ------------------
 1675|      0|      return 1;
 1676|  1.50k|    return m_HMgrs[0]->add_with_affix(converted, converted_example);
 1677|  1.50k|  }
 1678|      0|  return 0;
 1679|  1.50k|}
_ZN12HunspellImpl10cat_resultERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKS6_:
 1702|   436k|void HunspellImpl::cat_result(std::string& result, const std::string& st) {
 1703|   436k|  if (result.size() > MAXMORPHRESULT)
  ------------------
  |  |  114|   436k|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1703:7): [True: 0, False: 436k]
  ------------------
 1704|      0|    return;
 1705|   436k|  if (!st.empty()) {
  ------------------
  |  Branch (1705:7): [True: 2.52k, False: 433k]
  ------------------
 1706|  2.52k|    if (!result.empty())
  ------------------
  |  Branch (1706:9): [True: 57, False: 2.46k]
  ------------------
 1707|     57|      result.append("\n");
 1708|  2.52k|    result.append(st);
 1709|  2.52k|  }
 1710|   436k|}
_ZN12HunspellImpl7analyzeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1712|  9.24k|std::vector<std::string> HunspellImpl::analyze(const std::string& word) {
 1713|  9.24k|  std::vector<std::string> slst = analyze_internal(word);
 1714|       |  // output conversion
 1715|  9.24k|  RepList* rl = (pAMgr) ? pAMgr->get_oconvtable() : nullptr;
  ------------------
  |  Branch (1715:17): [True: 9.24k, False: 0]
  ------------------
 1716|  9.24k|  if (rl) {
  ------------------
  |  Branch (1716:7): [True: 480, False: 8.76k]
  ------------------
 1717|       |    // the output conversion can multiply the length of every line, so hold the
 1718|       |    // converted analysis to the same ceiling as the raw analysis
 1719|    480|    size_t total = 0;
 1720|    480|    size_t i = 0;
 1721|    539|    for (; i < slst.size(); ++i) {
  ------------------
  |  Branch (1721:12): [True: 59, False: 480]
  ------------------
 1722|     59|      std::string wspace;
 1723|     59|      if (rl->conv(slst[i], wspace, MAXMORPHRESULT - total)) {
  ------------------
  |  |  114|     59|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1723:11): [True: 8, False: 51]
  ------------------
 1724|      8|        slst[i] = std::move(wspace);
 1725|      8|      }
 1726|     59|      if (slst[i].size() > MAXMORPHRESULT - total)
  ------------------
  |  |  114|     59|#define MAXMORPHRESULT (4 * 1024 * 1024)
  ------------------
  |  Branch (1726:11): [True: 0, False: 59]
  ------------------
 1727|      0|        break;
 1728|     59|      total += slst[i].size();
 1729|     59|    }
 1730|    480|    slst.resize(i);
 1731|    480|  }
 1732|  9.24k|  return slst;
 1733|  9.24k|}
_ZN12HunspellImpl16analyze_internalERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 1735|  9.24k|std::vector<std::string> HunspellImpl::analyze_internal(const std::string& word) {
 1736|  9.24k|  std::vector<std::string> candidate_stack, slst;
 1737|  9.24k|  if (!pSMgr || m_HMgrs.empty())
  ------------------
  |  Branch (1737:7): [True: 0, False: 9.24k]
  |  Branch (1737:17): [True: 0, False: 9.24k]
  ------------------
 1738|      0|    return slst;
 1739|  9.24k|  if (utf8) {
  ------------------
  |  Branch (1739:7): [True: 4.33k, False: 4.90k]
  ------------------
 1740|  4.33k|    if (word.size() >= MAXWORDUTF8LEN)
  ------------------
  |  |   87|  4.33k|#define MAXWORDUTF8LEN (MAXWORDLEN * 3)
  |  |  ------------------
  |  |  |  |   90|  4.33k|#define MAXWORDLEN 100
  |  |  ------------------
  ------------------
  |  Branch (1740:9): [True: 324, False: 4.01k]
  ------------------
 1741|    324|      return slst;
 1742|  4.90k|  } else {
 1743|  4.90k|    if (word.size() >= MAXWORDLEN)
  ------------------
  |  |   90|  4.90k|#define MAXWORDLEN 100
  ------------------
  |  Branch (1743:9): [True: 600, False: 4.30k]
  ------------------
 1744|    600|      return slst;
 1745|  4.90k|  }
 1746|  8.31k|  int captype = NOCAP;
  ------------------
  |  |   88|  8.31k|#define NOCAP 0
  ------------------
 1747|  8.31k|  size_t abbv = 0;
 1748|  8.31k|  size_t wl = 0;
 1749|       |
 1750|  8.31k|  std::string scw;
 1751|  8.31k|  std::vector<w_char> sunicw;
 1752|       |
 1753|       |  // input conversion
 1754|  8.31k|  RepList* rl = (pAMgr) ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (1754:17): [True: 8.31k, False: 0]
  ------------------
 1755|  8.31k|  {
 1756|  8.31k|    std::string wspace;
 1757|       |
 1758|  8.31k|    bool convstatus = rl ? rl->conv(word, wspace) : false;
  ------------------
  |  Branch (1758:23): [True: 444, False: 7.87k]
  ------------------
 1759|  8.31k|    if (convstatus) {
  ------------------
  |  Branch (1759:9): [True: 0, False: 8.31k]
  ------------------
 1760|       |      // the input conversion can grow the word without limit, so hold the
 1761|       |      // converted word to the same maximum length as the raw word
 1762|      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 (1762:11): [True: 0, False: 0]
  |  Branch (1762:11): [True: 0, False: 0]
  ------------------
 1763|      0|        return slst;
 1764|      0|      wl = cleanword2(scw, sunicw, wspace, &captype, &abbv);
 1765|      0|    } else
 1766|  8.31k|      wl = cleanword2(scw, sunicw, word, &captype, &abbv);
 1767|       |
 1768|  8.31k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
 1769|  8.31k|    if (wl > 32768)
  ------------------
  |  Branch (1769:9): [True: 0, False: 8.31k]
  ------------------
 1770|      0|      return slst;
 1771|  8.31k|#endif
 1772|  8.31k|  }
 1773|       |
 1774|  8.31k|  if (wl == 0) {
  ------------------
  |  Branch (1774:7): [True: 457, False: 7.86k]
  ------------------
 1775|    457|    if (abbv) {
  ------------------
  |  Branch (1775:9): [True: 286, False: 171]
  ------------------
 1776|    286|      scw.clear();
 1777|  6.65k|      for (wl = 0; wl < abbv; wl++)
  ------------------
  |  Branch (1777:20): [True: 6.36k, False: 286]
  ------------------
 1778|  6.36k|        scw.push_back('.');
 1779|    286|      abbv = 0;
 1780|    286|    } else
 1781|    171|      return slst;
 1782|    457|  }
 1783|       |
 1784|  8.14k|  std::string result;
 1785|       |
 1786|  8.14k|  auto suggest_start = std::chrono::steady_clock::now();
 1787|       |
 1788|  8.14k|  size_t n = 0;
 1789|       |  // test numbers
 1790|       |  // LANG_hu section: set dash information for suggestions
 1791|  8.14k|  if (langnum == LANG_hu) {
  ------------------
  |  Branch (1791:7): [True: 435, False: 7.71k]
  ------------------
 1792|    435|    size_t n2 = 0;
 1793|    435|    size_t n3 = 0;
 1794|       |
 1795|    578|    while ((n < wl) && (((scw[n] <= '9') && (scw[n] >= '0')) ||
  ------------------
  |  Branch (1795:12): [True: 547, False: 31]
  |  Branch (1795:26): [True: 287, False: 260]
  |  Branch (1795:45): [True: 143, False: 144]
  ------------------
 1796|    404|                        (((scw[n] == '.') || (scw[n] == ',')) && (n > 0)))) {
  ------------------
  |  Branch (1796:27): [True: 28, False: 376]
  |  Branch (1796:46): [True: 0, False: 376]
  |  Branch (1796:66): [True: 0, False: 28]
  ------------------
 1797|    143|      n++;
 1798|    143|      if ((scw[n] == '.') || (scw[n] == ',')) {
  ------------------
  |  Branch (1798:11): [True: 0, False: 143]
  |  Branch (1798:30): [True: 0, False: 143]
  ------------------
 1799|      0|        if (((n2 == 0) && (n > 3)) ||
  ------------------
  |  Branch (1799:14): [True: 0, False: 0]
  |  Branch (1799:27): [True: 0, False: 0]
  ------------------
 1800|      0|            ((n2 > 0) && ((scw[n - 1] == '.') || (scw[n - 1] == ','))))
  ------------------
  |  Branch (1800:14): [True: 0, False: 0]
  |  Branch (1800:27): [True: 0, False: 0]
  |  Branch (1800:50): [True: 0, False: 0]
  ------------------
 1801|      0|          break;
 1802|      0|        n2++;
 1803|      0|        n3 = n;
 1804|      0|      }
 1805|    143|    }
 1806|       |
 1807|    435|    if ((n == wl) && (n3 > 0) && (n - n3 > 3))
  ------------------
  |  Branch (1807:9): [True: 31, False: 404]
  |  Branch (1807:22): [True: 0, False: 31]
  |  Branch (1807:34): [True: 0, False: 0]
  ------------------
 1808|      0|      return slst;
 1809|    435|    if ((n == wl) || ((n > 0) && ((scw[n] == '%') || (scw[n] == '\xB0')) && checkword(scw.substr(n), nullptr, nullptr, suggest_start))) {
  ------------------
  |  Branch (1809:9): [True: 31, False: 404]
  |  Branch (1809:9): [True: 31, False: 404]
  |  Branch (1809:23): [True: 19, False: 385]
  |  Branch (1809:35): [True: 0, False: 19]
  |  Branch (1809:54): [True: 0, False: 19]
  |  Branch (1809:77): [True: 0, False: 0]
  ------------------
 1810|     31|      result.append(scw);
 1811|     31|      result.resize(n - 1);
 1812|     31|      if (n == wl)
  ------------------
  |  Branch (1812:11): [True: 31, False: 0]
  ------------------
 1813|     31|        cat_result(result, pSMgr->suggest_morph(scw.substr(n - 1)));
 1814|      0|      else {
 1815|      0|        std::string chunk = scw.substr(n - 1, 1);
 1816|      0|        cat_result(result, pSMgr->suggest_morph(chunk));
 1817|      0|        result.push_back('+');  // XXX SPEC. MORPHCODE
 1818|      0|        cat_result(result, pSMgr->suggest_morph(scw.substr(n)));
 1819|      0|      }
 1820|     31|      return line_tok(result, MSEP_REC);
  ------------------
  |  |  118|     31|#define MSEP_REC '\n'
  ------------------
 1821|     31|    }
 1822|    435|  }
 1823|       |  // END OF LANG_hu section
 1824|       |
 1825|  8.11k|  switch (captype) {
  ------------------
  |  Branch (1825:11): [True: 8.11k, False: 0]
  ------------------
 1826|    402|    case HUHCAP:
  ------------------
  |  |   91|    402|#define HUHCAP 3
  ------------------
  |  Branch (1826:5): [True: 402, False: 7.71k]
  ------------------
 1827|  1.39k|    case HUHINITCAP:
  ------------------
  |  |   92|  1.39k|#define HUHINITCAP 4
  ------------------
  |  Branch (1827:5): [True: 990, False: 7.12k]
  ------------------
 1828|  4.48k|    case NOCAP: {
  ------------------
  |  |   88|  4.48k|#define NOCAP 0
  ------------------
  |  Branch (1828:5): [True: 3.09k, False: 5.02k]
  ------------------
 1829|  4.48k|      cat_result(result, pSMgr->suggest_morph(scw));
 1830|  4.48k|      if (abbv) {
  ------------------
  |  Branch (1830:11): [True: 267, False: 4.21k]
  ------------------
 1831|    267|        std::string u8buffer(scw);
 1832|    267|        u8buffer.push_back('.');
 1833|    267|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1834|    267|      }
 1835|  4.48k|      break;
 1836|  1.39k|    }
 1837|  2.63k|    case INITCAP: {
  ------------------
  |  |   89|  2.63k|#define INITCAP 1
  ------------------
  |  Branch (1837:5): [True: 2.63k, False: 5.48k]
  ------------------
 1838|  2.63k|      mkallsmall2(scw, sunicw);
 1839|  2.63k|      std::string u8buffer(scw);
 1840|  2.63k|      mkinitcap2(scw, sunicw);
 1841|  2.63k|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1842|  2.63k|      cat_result(result, pSMgr->suggest_morph(scw));
 1843|  2.63k|      if (abbv) {
  ------------------
  |  Branch (1843:11): [True: 222, False: 2.41k]
  ------------------
 1844|    222|        u8buffer.push_back('.');
 1845|    222|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1846|       |
 1847|    222|        u8buffer = scw;
 1848|    222|        u8buffer.push_back('.');
 1849|       |
 1850|    222|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1851|    222|      }
 1852|  2.63k|      break;
 1853|  1.39k|    }
 1854|    998|    case ALLCAP: {
  ------------------
  |  |   90|    998|#define ALLCAP 2
  ------------------
  |  Branch (1854:5): [True: 998, False: 7.11k]
  ------------------
 1855|    998|      cat_result(result, pSMgr->suggest_morph(scw));
 1856|    998|      if (abbv) {
  ------------------
  |  Branch (1856:11): [True: 233, False: 765]
  ------------------
 1857|    233|        std::string u8buffer(scw);
 1858|    233|        u8buffer.push_back('.');
 1859|    233|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1860|    233|      }
 1861|    998|      mkallsmall2(scw, sunicw);
 1862|    998|      std::string u8buffer(scw);
 1863|    998|      mkinitcap2(scw, sunicw);
 1864|       |
 1865|    998|      cat_result(result, pSMgr->suggest_morph(u8buffer));
 1866|    998|      cat_result(result, pSMgr->suggest_morph(scw));
 1867|    998|      if (abbv) {
  ------------------
  |  Branch (1867:11): [True: 233, False: 765]
  ------------------
 1868|    233|        u8buffer.push_back('.');
 1869|    233|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1870|       |
 1871|    233|        u8buffer = scw;
 1872|    233|        u8buffer.push_back('.');
 1873|       |
 1874|    233|        cat_result(result, pSMgr->suggest_morph(u8buffer));
 1875|    233|      }
 1876|    998|      break;
 1877|  1.39k|    }
 1878|  8.11k|  }
 1879|       |
 1880|  8.11k|  if (!result.empty()) {
  ------------------
  |  Branch (1880:7): [True: 2.44k, False: 5.67k]
  ------------------
 1881|       |    // word reversing wrapper for complex prefixes
 1882|  2.44k|    if (complexprefixes) {
  ------------------
  |  Branch (1882:9): [True: 178, False: 2.26k]
  ------------------
 1883|    178|      if (utf8)
  ------------------
  |  Branch (1883:11): [True: 0, False: 178]
  ------------------
 1884|      0|        reverseword_utf(result);
 1885|    178|      else
 1886|    178|        reverseword(result);
 1887|    178|    }
 1888|  2.44k|    return line_tok(result, MSEP_REC);
  ------------------
  |  |  118|  2.44k|#define MSEP_REC '\n'
  ------------------
 1889|  2.44k|  }
 1890|       |
 1891|       |  // compound word with dash (HU) I18n
 1892|       |  // LANG_hu section: set dash information for suggestions
 1893|       |
 1894|  5.67k|  size_t dash_pos = langnum == LANG_hu ? scw.find('-') : std::string::npos;
  ------------------
  |  Branch (1894:21): [True: 374, False: 5.30k]
  ------------------
 1895|  5.67k|  if (dash_pos != std::string::npos) {
  ------------------
  |  Branch (1895:7): [True: 31, False: 5.64k]
  ------------------
 1896|     31|    int nresult = 0;
 1897|       |
 1898|     31|    std::string part1 = scw.substr(0, dash_pos), part2 = scw.substr(dash_pos + 1);
 1899|       |
 1900|       |    // examine 2 sides of the dash
 1901|     31|    if (part2.empty()) {  // base word ending with dash
  ------------------
  |  Branch (1901:9): [True: 7, False: 24]
  ------------------
 1902|      7|      if (spell(part1, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1902:11): [True: 0, False: 7]
  ------------------
 1903|      0|        std::string p = pSMgr->suggest_morph(part1);
 1904|      0|        if (!p.empty()) {
  ------------------
  |  Branch (1904:13): [True: 0, False: 0]
  ------------------
 1905|      0|          slst = line_tok(p, MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 1906|      0|          return slst;
 1907|      0|        }
 1908|      0|      }
 1909|     24|    } else if (part2.size() == 1 && part2[0] == 'e') {  // XXX (HU) -e hat.
  ------------------
  |  Branch (1909:16): [True: 1, False: 23]
  |  Branch (1909:37): [True: 0, False: 1]
  ------------------
 1910|      0|      if (spell(part1, candidate_stack, nullptr, nullptr, suggest_start) &&
  ------------------
  |  Branch (1910:11): [True: 0, False: 0]
  |  Branch (1910:11): [True: 0, False: 0]
  ------------------
 1911|      0|          (spell("-e", candidate_stack, nullptr, nullptr, suggest_start))) {
  ------------------
  |  Branch (1911:11): [True: 0, False: 0]
  ------------------
 1912|      0|        std::string st = pSMgr->suggest_morph(part1);
 1913|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1913:13): [True: 0, False: 0]
  ------------------
 1914|      0|          result.append(st);
 1915|      0|        }
 1916|      0|        result.push_back('+');  // XXX spec. separator in MORPHCODE
 1917|      0|        st = pSMgr->suggest_morph("-e");
 1918|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1918:13): [True: 0, False: 0]
  ------------------
 1919|      0|          result.append(st);
 1920|      0|        }
 1921|      0|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 1922|      0|      }
 1923|     24|    } else {
 1924|       |      // first word ending with dash: word- XXX ???
 1925|     24|      part1.push_back(' ');
 1926|     24|      nresult = spell(part1, candidate_stack, nullptr, nullptr, suggest_start);
 1927|     24|      part1.erase(part1.size() - 1);
 1928|     24|      if (nresult && spell(part2, candidate_stack, nullptr, nullptr, suggest_start) &&
  ------------------
  |  Branch (1928:11): [True: 2, False: 22]
  |  Branch (1928:22): [True: 1, False: 1]
  ------------------
 1929|      1|          ((part2.size() > 1) || ((part2[0] > '0') && (part2[0] < '9')))) {
  ------------------
  |  Branch (1929:12): [True: 0, False: 1]
  |  Branch (1929:35): [True: 0, False: 1]
  |  Branch (1929:55): [True: 0, False: 0]
  ------------------
 1930|      0|        std::string st = pSMgr->suggest_morph(part1);
 1931|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1931:13): [True: 0, False: 0]
  ------------------
 1932|      0|          result.append(st);
 1933|      0|          result.push_back('+');  // XXX spec. separator in MORPHCODE
 1934|      0|        }
 1935|      0|        st = pSMgr->suggest_morph(part2);
 1936|      0|        if (!st.empty()) {
  ------------------
  |  Branch (1936:13): [True: 0, False: 0]
  ------------------
 1937|      0|          result.append(st);
 1938|      0|        }
 1939|      0|        return line_tok(result, MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 1940|      0|      }
 1941|     24|    }
 1942|       |    // affixed number in correct word
 1943|     31|    if (nresult && (dash_pos > 0) &&
  ------------------
  |  Branch (1943:9): [True: 2, False: 29]
  |  Branch (1943:20): [True: 0, False: 2]
  ------------------
 1944|      0|        (((scw[dash_pos - 1] <= '9') && (scw[dash_pos - 1] >= '0')) ||
  ------------------
  |  Branch (1944:11): [True: 0, False: 0]
  |  Branch (1944:41): [True: 0, False: 0]
  ------------------
 1945|      0|         (scw[dash_pos - 1] == '.'))) {
  ------------------
  |  Branch (1945:10): [True: 0, False: 0]
  ------------------
 1946|      0|      n = 1;
 1947|      0|      if (scw[dash_pos - n] == '.')
  ------------------
  |  Branch (1947:11): [True: 0, False: 0]
  ------------------
 1948|      0|        n++;
 1949|       |      // search first not a number character to left from dash
 1950|      0|      while ((dash_pos >= n) && ((scw[dash_pos - n] == '0') || (n < 3)) &&
  ------------------
  |  Branch (1950:14): [True: 0, False: 0]
  |  Branch (1950:34): [True: 0, False: 0]
  |  Branch (1950:64): [True: 0, False: 0]
  ------------------
 1951|      0|             (n < 6)) {
  ------------------
  |  Branch (1951:14): [True: 0, False: 0]
  ------------------
 1952|      0|        n++;
 1953|      0|      }
 1954|      0|      if (dash_pos < n)
  ------------------
  |  Branch (1954:11): [True: 0, False: 0]
  ------------------
 1955|      0|        n--;
 1956|       |      // numbers: valami1000000-hoz
 1957|       |      // examine 100000-hoz, 10000-hoz 1000-hoz, 10-hoz,
 1958|       |      // 56-hoz, 6-hoz
 1959|      0|      for (; n >= 1; n--) {
  ------------------
  |  Branch (1959:14): [True: 0, False: 0]
  ------------------
 1960|      0|        if (scw[dash_pos - n] < '0' || scw[dash_pos - n] > '9') {
  ------------------
  |  Branch (1960:13): [True: 0, False: 0]
  |  Branch (1960:40): [True: 0, False: 0]
  ------------------
 1961|      0|            continue;
 1962|      0|        }
 1963|      0|        std::string chunk = scw.substr(dash_pos - n);
 1964|      0|        if (checkword(chunk, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (1964:13): [True: 0, False: 0]
  ------------------
 1965|      0|          result.append(chunk);
 1966|      0|          std::string st = pSMgr->suggest_morph(chunk);
 1967|      0|          if (!st.empty()) {
  ------------------
  |  Branch (1967:15): [True: 0, False: 0]
  ------------------
 1968|      0|            result.append(st);
 1969|      0|          }
 1970|      0|          return line_tok(result, MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 1971|      0|        }
 1972|      0|      }
 1973|      0|    }
 1974|     31|  }
 1975|  5.67k|  return slst;
 1976|  5.67k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS0_6vectorIS6_NS4_IS6_EEEE:
 1978|  7.75k|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::vector<std::string>& pl) {
 1979|  7.75k|  std::vector<std::string> slst;
 1980|  7.75k|  if (!pSMgr || pl.empty())
  ------------------
  |  Branch (1980:7): [True: 0, False: 7.75k]
  |  Branch (1980:17): [True: 598, False: 7.15k]
  ------------------
 1981|    598|    return slst;
 1982|  7.15k|  std::vector<std::string> pl2 = analyze(word);
 1983|  7.15k|  int captype = NOCAP, abbv = 0;
  ------------------
  |  |   88|  7.15k|#define NOCAP 0
  ------------------
 1984|  7.15k|  std::string cw;
 1985|  7.15k|  cleanword(cw, word, &captype, &abbv);
 1986|  7.15k|  std::string result;
 1987|       |
 1988|  7.15k|  auto suggest_start = std::chrono::steady_clock::now();
 1989|   422k|  for (const auto& i : pl) {
  ------------------
  |  Branch (1989:22): [True: 422k, False: 7.15k]
  ------------------
 1990|   422k|    cat_result(result, pSMgr->suggest_gen(pl2, i, suggest_start));
 1991|   422k|  }
 1992|       |
 1993|  7.15k|  if (!result.empty()) {
  ------------------
  |  Branch (1993:7): [True: 0, False: 7.15k]
  ------------------
 1994|       |    // allcap
 1995|      0|    if (captype == ALLCAP)
  ------------------
  |  |   90|      0|#define ALLCAP 2
  ------------------
  |  Branch (1995:9): [True: 0, False: 0]
  ------------------
 1996|      0|      mkallcap(result);
 1997|       |
 1998|       |    // line split
 1999|      0|    slst = line_tok(result, MSEP_REC);
  ------------------
  |  |  118|      0|#define MSEP_REC '\n'
  ------------------
 2000|       |
 2001|       |    // capitalize
 2002|      0|    if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   89|      0|#define INITCAP 1
  ------------------
                  if (captype == INITCAP || captype == HUHINITCAP) {
  ------------------
  |  |   92|      0|#define HUHINITCAP 4
  ------------------
  |  Branch (2002:9): [True: 0, False: 0]
  |  Branch (2002:31): [True: 0, False: 0]
  ------------------
 2003|      0|      for (auto& str : slst) {
  ------------------
  |  Branch (2003:22): [True: 0, False: 0]
  ------------------
 2004|      0|        mkinitcap(str);
 2005|      0|      }
 2006|      0|    }
 2007|       |
 2008|       |    // temporary filtering of prefix related errors (eg.
 2009|       |    // generate("undrinkable", "eats") --> "undrinkables" and "*undrinks")
 2010|      0|    auto it = slst.begin();
 2011|      0|    while (it != slst.end()) {
  ------------------
  |  Branch (2011:12): [True: 0, False: 0]
  ------------------
 2012|      0|      if (std::chrono::steady_clock::now() - suggest_start > TIMELIMIT_GLOBAL_MS)
  ------------------
  |  |  107|      0|#define TIMELIMIT_GLOBAL_MS std::chrono::milliseconds(250)
  ------------------
  |  Branch (2012:11): [True: 0, False: 0]
  ------------------
 2013|      0|        break;
 2014|      0|      std::vector<std::string> candidate_stack;
 2015|      0|      if (!spell(*it, candidate_stack, nullptr, nullptr, suggest_start)) {
  ------------------
  |  Branch (2015:11): [True: 0, False: 0]
  ------------------
 2016|      0|        it = slst.erase(it);
 2017|      0|      } else  {
 2018|      0|        ++it;
 2019|      0|      }
 2020|      0|    }
 2021|      0|  }
 2022|  7.15k|  return slst;
 2023|  7.75k|}
_ZN12HunspellImpl8generateERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES8_:
 2025|    855|std::vector<std::string> HunspellImpl::generate(const std::string& word, const std::string& pattern) {
 2026|    855|  std::vector<std::string> pl = analyze(pattern);
 2027|    855|  std::vector<std::string> slst = generate(word, pl);
 2028|    855|  uniqlist(slst);
 2029|    855|  return slst;
 2030|    855|}
_ZN12HunspellImpl11get_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEm:
 2033|   519k|std::string HunspellImpl::get_xml_par(const std::string& in_par, std::string::size_type pos) {
 2034|   519k|  std::string dest;
 2035|   519k|  if (pos == std::string::npos)
  ------------------
  |  Branch (2035:7): [True: 6.68k, False: 513k]
  ------------------
 2036|  6.68k|    return dest;
 2037|   513k|  const char* par = in_par.c_str() + pos;
 2038|   513k|  char end = *par;
 2039|   513k|  if (end == '>')
  ------------------
  |  Branch (2039:7): [True: 509k, False: 3.42k]
  ------------------
 2040|   509k|    end = '<';
 2041|  3.42k|  else if (end != '\'' && end != '"')
  ------------------
  |  Branch (2041:12): [True: 2.94k, False: 475]
  |  Branch (2041:27): [True: 1.14k, False: 1.80k]
  ------------------
 2042|  1.14k|    return dest;  // bad XML
 2043|  10.5M|  for (par++; *par != '\0' && *par != end; ++par) {
  ------------------
  |  Branch (2043:15): [True: 10.5M, False: 32.4k]
  |  Branch (2043:31): [True: 10.0M, False: 479k]
  ------------------
 2044|  10.0M|    dest.push_back(*par);
 2045|  10.0M|  }
 2046|   511k|  mystrrep(dest, "&lt;", "<");
 2047|   511k|  mystrrep(dest, "&amp;", "&");
 2048|   511k|  return dest;
 2049|   513k|}
_ZN12HunspellImpl16entry_input_convERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERS6_:
 2066|  8.88k|bool HunspellImpl::entry_input_conv(const std::string& word, std::string& dest) {
 2067|  8.88k|  const size_t maxlen = std::numeric_limits<unsigned short>::max();
 2068|  8.88k|  RepList* rl = pAMgr ? pAMgr->get_iconvtable() : nullptr;
  ------------------
  |  Branch (2068:17): [True: 8.88k, False: 0]
  ------------------
 2069|  8.88k|  if (rl) {
  ------------------
  |  Branch (2069:7): [True: 468, False: 8.41k]
  ------------------
 2070|    468|    rl->conv(word, dest, maxlen);
 2071|    468|    return dest.size() <= maxlen;
 2072|    468|  }
 2073|  8.41k|  dest.assign(word);
 2074|  8.41k|  return true;
 2075|  8.88k|}
_ZN12HunspellImpl11get_xml_posERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 2078|  74.8k|std::string::size_type HunspellImpl::get_xml_pos(const std::string& s, std::string::size_type pos, const char* attr) {
 2079|  74.8k|  if (pos == std::string::npos)
  ------------------
  |  Branch (2079:7): [True: 0, False: 74.8k]
  ------------------
 2080|      0|    return std::string::npos;
 2081|       |
 2082|  74.8k|  std::string::size_type endpos = s.find('>', pos);
 2083|  74.8k|  if (attr == nullptr)
  ------------------
  |  Branch (2083:7): [True: 0, False: 74.8k]
  ------------------
 2084|      0|    return endpos;
 2085|   204k|  while (true) {
  ------------------
  |  Branch (2085:10): [True: 204k, Folded]
  ------------------
 2086|   204k|    pos = s.find(attr, pos);
 2087|   204k|    if (pos == std::string::npos || pos >= endpos)
  ------------------
  |  Branch (2087:9): [True: 3.64k, False: 200k]
  |  Branch (2087:37): [True: 1.82k, False: 199k]
  ------------------
 2088|  5.47k|      return std::string::npos;
 2089|   199k|    if (pos == 0 || s[pos - 1] == ' ' || s[pos - 1] == '\n')
  ------------------
  |  Branch (2089:9): [True: 0, False: 199k]
  |  Branch (2089:21): [True: 2.52k, False: 196k]
  |  Branch (2089:42): [True: 66.8k, False: 129k]
  ------------------
 2090|  69.3k|      break;
 2091|   129k|    pos += strlen(attr);
 2092|   129k|  }
 2093|  69.3k|  return pos + strlen(attr);
 2094|  74.8k|}
_ZN12HunspellImpl13check_xml_parERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKcSA_:
 2098|  74.8k|                                const char* value) {
 2099|  74.8k|  const std::string cw = get_xml_par(q, get_xml_pos(q, pos, attr));
 2100|  74.8k|  return cw == value ? 1 : 0;
  ------------------
  |  Branch (2100:10): [True: 18.6k, False: 56.1k]
  ------------------
 2101|  74.8k|}
_ZN12HunspellImpl12get_xml_listERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEmPKc:
 2103|  7.86k|std::vector<std::string> HunspellImpl::get_xml_list(const std::string& list, std::string::size_type pos, const char* tag) {
 2104|  7.86k|  std::vector<std::string> slst;
 2105|  7.86k|  if (pos == std::string::npos)
  ------------------
  |  Branch (2105:7): [True: 57, False: 7.80k]
  ------------------
 2106|     57|    return slst;
 2107|   429k|  while (true) {
  ------------------
  |  Branch (2107:10): [True: 429k, Folded]
  ------------------
 2108|   429k|    pos = list.find(tag, pos);
 2109|   429k|    if (pos == std::string::npos)
  ------------------
  |  Branch (2109:9): [True: 6.23k, False: 423k]
  ------------------
 2110|  6.23k|        break;
 2111|   423k|    std::string cw = get_xml_par(list, pos + strlen(tag) - 1);
 2112|   423k|    if (cw.empty()) {
  ------------------
  |  Branch (2112:9): [True: 1.57k, False: 421k]
  ------------------
 2113|  1.57k|      break;
 2114|  1.57k|    }
 2115|   421k|    slst.push_back(std::move(cw));
 2116|   421k|    ++pos;
 2117|   421k|  }
 2118|  7.80k|  return slst;
 2119|  7.86k|}
_ZN12HunspellImpl7spellmlERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 2121|  23.3k|std::vector<std::string> HunspellImpl::spellml(const std::string& in_word) {
 2122|       |  // The XML interface spell checks words of its own to answer the query.
 2123|  23.3k|  TraceSuppress no_trace(m_trace.get());
 2124|       |
 2125|  23.3k|  std::vector<std::string> slst;
 2126|       |
 2127|  23.3k|  std::string::size_type qpos = in_word.find("<query");
 2128|  23.3k|  if (qpos == std::string::npos)
  ------------------
  |  Branch (2128:7): [True: 484, False: 22.8k]
  ------------------
 2129|    484|    return slst;  // bad XML input
 2130|       |
 2131|  22.8k|  std::string::size_type q2pos = in_word.find('>', qpos);
 2132|  22.8k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (2132:7): [True: 303, False: 22.5k]
  ------------------
 2133|    303|    return slst;  // bad XML input
 2134|       |
 2135|  22.5k|  q2pos = in_word.find("<word", q2pos);
 2136|  22.5k|  if (q2pos == std::string::npos)
  ------------------
  |  Branch (2136:7): [True: 418, False: 22.1k]
  ------------------
 2137|    418|    return slst;  // bad XML input
 2138|       |
 2139|  22.1k|  if (check_xml_par(in_word, qpos, "type=", "analyze")) {
  ------------------
  |  Branch (2139:7): [True: 627, False: 21.5k]
  ------------------
 2140|    627|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2141|    627|    if (!cw.empty())
  ------------------
  |  Branch (2141:9): [True: 266, False: 361]
  ------------------
 2142|    266|      slst = analyze(cw);
 2143|    627|    if (slst.empty())
  ------------------
  |  Branch (2143:9): [True: 575, False: 52]
  ------------------
 2144|    575|      return slst;
 2145|       |    // convert the result to <code><a>ana1</a><a>ana2</a></code> format
 2146|     52|    std::string r;
 2147|     52|    r.append("<code>");
 2148|     52|    for (auto entry : slst) {
  ------------------
  |  Branch (2148:21): [True: 52, False: 52]
  ------------------
 2149|     52|      r.append("<a>");
 2150|       |
 2151|     52|      mystrrep(entry, "\t", " ");
 2152|     52|      mystrrep(entry, "&", "&amp;");
 2153|     52|      mystrrep(entry, "<", "&lt;");
 2154|     52|      r.append(entry);
 2155|       |
 2156|     52|      r.append("</a>");
 2157|     52|    }
 2158|     52|    r.append("</code>");
 2159|     52|    slst.clear();
 2160|     52|    slst.push_back(std::move(r));
 2161|     52|    return slst;
 2162|  21.5k|  } else if (check_xml_par(in_word, qpos, "type=", "stem")) {
  ------------------
  |  Branch (2162:14): [True: 1.38k, False: 20.1k]
  ------------------
 2163|  1.38k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2164|  1.38k|    if (!cw.empty())
  ------------------
  |  Branch (2164:9): [True: 968, False: 418]
  ------------------
 2165|    968|      return stem(cw);
 2166|  20.1k|  } else if (check_xml_par(in_word, qpos, "type=", "generate")) {
  ------------------
  |  Branch (2166:14): [True: 9.17k, False: 10.9k]
  ------------------
 2167|  9.17k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2168|  9.17k|    if (cw.empty())
  ------------------
  |  Branch (2168:9): [True: 171, False: 9.00k]
  ------------------
 2169|    171|      return slst;
 2170|  9.00k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 2171|  9.00k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (2171:9): [True: 1.00k, False: 7.99k]
  ------------------
 2172|  1.00k|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2173|  1.00k|      if (!cw2.empty()) {
  ------------------
  |  Branch (2173:11): [True: 855, False: 152]
  ------------------
 2174|    855|        return generate(cw, cw2);
 2175|    855|      }
 2176|  7.99k|    } else {
 2177|  7.99k|      q2pos = in_word.find("<code", q2pos + 1);
 2178|  7.99k|      if (q2pos != std::string::npos) {
  ------------------
  |  Branch (2178:11): [True: 7.86k, False: 133]
  ------------------
 2179|  7.86k|        std::vector<std::string> slst2 = get_xml_list(in_word, in_word.find('>', q2pos), "<a>");
 2180|  7.86k|        if (!slst2.empty()) {
  ------------------
  |  Branch (2180:13): [True: 6.89k, False: 969]
  ------------------
 2181|  6.89k|          slst = generate(cw, slst2);
 2182|  6.89k|          uniqlist(slst);
 2183|  6.89k|          return slst;
 2184|  6.89k|        }
 2185|  7.86k|      }
 2186|  7.99k|    }
 2187|  10.9k|  } else if (check_xml_par(in_word, qpos, "type=", "add")) {
  ------------------
  |  Branch (2187:14): [True: 7.49k, False: 3.47k]
  ------------------
 2188|  7.49k|    std::string cw = get_xml_par(in_word, in_word.find('>', q2pos));
 2189|  7.49k|    if (cw.empty())
  ------------------
  |  Branch (2189:9): [True: 113, False: 7.38k]
  ------------------
 2190|    113|      return slst;
 2191|  7.38k|    std::string::size_type q3pos = in_word.find("<word", q2pos + 1);
 2192|  7.38k|    if (q3pos != std::string::npos) {
  ------------------
  |  Branch (2192:9): [True: 1.76k, False: 5.61k]
  ------------------
 2193|  1.76k|      std::string cw2 = get_xml_par(in_word, in_word.find('>', q3pos));
 2194|  1.76k|      if (!cw2.empty()) {
  ------------------
  |  Branch (2194:11): [True: 1.50k, False: 266]
  ------------------
 2195|  1.50k|        add_with_affix(cw, cw2);
 2196|  1.50k|      } else {
 2197|    266|        add(cw);
 2198|    266|      }
 2199|  5.61k|    } else {
 2200|  5.61k|        add(cw);
 2201|  5.61k|    }
 2202|  7.38k|  }
 2203|  12.5k|  return slst;
 2204|  22.1k|}
_ZN8HunspellC2EPKcS1_S1_:
 2359|     38|  : m_Impl(new HunspellImpl(affpath, dpath, key)) {
 2360|     38|}
_ZN8Hunspell5spellERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPiPS6_:
 2371|  69.2k|bool Hunspell::spell(const std::string& word, int* info, std::string* root) {
 2372|  69.2k|  std::vector<std::string> candidate_stack;
 2373|  69.2k|  return m_Impl->spell(word, candidate_stack, info, root,
 2374|  69.2k|                       std::chrono::steady_clock::now());
 2375|  69.2k|}
_ZN8Hunspell7suggestERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
 2377|  68.6k|std::vector<std::string> Hunspell::suggest(const std::string& word) {
 2378|  68.6k|  return m_Impl->suggest(word);
 2379|  68.6k|}
_ZNK12HunspellImpl12active_traceEv:
  144|  40.8M|  TraceCtx* active_trace() const {
  145|  40.8M|    return m_trace->on() ? m_trace.get() : nullptr;
  ------------------
  |  Branch (145:12): [True: 0, False: 40.8M]
  ------------------
  146|  40.8M|  }

_ZNK8TraceCtx2onEv:
  110|  40.8M|  bool on() const { return m_callback && m_suppressed == 0; }
  ------------------
  |  Branch (110:28): [True: 0, False: 40.8M]
  |  Branch (110:42): [True: 0, False: 0]
  ------------------
_ZN10TraceScopeC2EP8TraceCtx:
  131|   624M|  explicit TraceScope(TraceCtx* context) : m_context(context) {
  132|   624M|    if (m_context)
  ------------------
  |  Branch (132:9): [True: 0, False: 624M]
  ------------------
  133|      0|      ++m_context->m_depth;
  134|   624M|  }
_ZN10TraceScopeD2Ev:
  135|   624M|  ~TraceScope() {
  136|   624M|    if (m_context)
  ------------------
  |  Branch (136:9): [True: 0, False: 624M]
  ------------------
  137|      0|      --m_context->m_depth;
  138|   624M|  }
_Z8trace_onP8TraceCtx:
  165|  1.36G|inline TraceCtx* trace_on(TraceCtx* context) {
  166|  1.36G|  return (context && context->on()) ? context : nullptr;
  ------------------
  |  Branch (166:11): [True: 0, False: 1.36G]
  |  Branch (166:22): [True: 0, False: 0]
  ------------------
  167|  1.36G|}
_ZN13TraceSuppressC2EP8TraceCtx:
  148|   122k|  explicit TraceSuppress(TraceCtx* context) : m_context(context) {
  149|   122k|    if (m_context)
  ------------------
  |  Branch (149:9): [True: 122k, False: 0]
  ------------------
  150|   122k|      ++m_context->m_suppressed;
  151|   122k|  }
_ZN13TraceSuppressD2Ev:
  152|   122k|  ~TraceSuppress() {
  153|   122k|    if (m_context)
  ------------------
  |  Branch (153:9): [True: 122k, False: 0]
  ------------------
  154|   122k|      --m_context->m_suppressed;
  155|   122k|  }
_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|  12.5k|std::string phonet(const std::string& inword, phonetable& parms) {
   70|       |
   71|  12.5k|  int i, k = 0, p, z, k0, n0, p0 = -333;
   72|  12.5k|  char c;
   73|  12.5k|  using uchar = unsigned char;
   74|       |
   75|  12.5k|  size_t len = inword.size();
   76|  12.5k|  if (len > MAXPHONETUTF8LEN)
  ------------------
  |  |   35|  12.5k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  12.5k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
  |  Branch (76:7): [True: 0, False: 12.5k]
  ------------------
   77|      0|    return {};
   78|  12.5k|  char word[MAXPHONETUTF8LEN + 1];
   79|  12.5k|  strncpy(word, inword.c_str(), MAXPHONETUTF8LEN);
  ------------------
  |  |   35|  12.5k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  12.5k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   80|  12.5k|  word[MAXPHONETUTF8LEN] = '\0';
  ------------------
  |  |   35|  12.5k|#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  |  |  ------------------
  |  |  |  |   34|  12.5k|#define MAXPHONETLEN 256
  |  |  ------------------
  ------------------
   81|       |
   82|  12.5k|  std::string target;
   83|       |  /**  check word  **/
   84|  12.5k|  i = z = 0;
   85|   117k|  while ((c = word[i]) != '\0') {
  ------------------
  |  Branch (85:10): [True: 104k, False: 12.5k]
  ------------------
   86|   104k|    int n = parms.hash[(uchar)c];
   87|   104k|    int z0 = 0;
   88|       |
   89|   104k|    if (n >= 0 && !parms.rules[n].empty()) {
  ------------------
  |  Branch (89:9): [True: 30.0k, False: 74.4k]
  |  Branch (89:19): [True: 30.0k, False: 0]
  ------------------
   90|       |      /**  check all rules for the same letter  **/
   91|  76.5k|      while (parms.rules[n][0] == c) {
  ------------------
  |  Branch (91:14): [True: 74.2k, False: 2.32k]
  ------------------
   92|       |        /**  check whole string  **/
   93|  74.2k|        k = 1; /** number of found letters  **/
   94|  74.2k|        p = 5; /** default priority  **/
   95|  74.2k|        const char*s = parms.rules[n].c_str();
   96|  74.2k|        s++; /**  important for (see below)  "*(s-1)"  **/
   97|       |
   98|  76.3k|        while (*s != '\0' && word[i + k] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (98:16): [True: 51.4k, False: 24.9k]
  |  Branch (98:30): [True: 2.19k, False: 49.2k]
  |  Branch (98:51): [True: 2.19k, False: 0]
  |  Branch (98:82): [True: 2.11k, False: 76]
  ------------------
   99|  2.11k|          k++;
  100|  2.11k|          s++;
  101|  2.11k|        }
  102|  74.2k|        if (*s == '(') {
  ------------------
  |  Branch (102:13): [True: 5.14k, False: 69.1k]
  ------------------
  103|       |          /**  check letters in "(..)"  **/
  104|  5.14k|          if (myisalpha(word[i + k])  // ...could be implied?
  ------------------
  |  Branch (104:15): [True: 3.78k, False: 1.35k]
  ------------------
  105|  3.78k|              && strchr(s + 1, word[i + k]) != nullptr) {
  ------------------
  |  Branch (105:18): [True: 403, False: 3.38k]
  ------------------
  106|    403|            k++;
  107|  2.30k|            while (*s && *s != ')')
  ------------------
  |  Branch (107:20): [True: 2.30k, False: 0]
  |  Branch (107:26): [True: 1.90k, False: 403]
  ------------------
  108|  1.90k|              s++;
  109|    403|            if (*s == ')')
  ------------------
  |  Branch (109:17): [True: 403, False: 0]
  ------------------
  110|    403|              s++;
  111|    403|          }
  112|  5.14k|        }
  113|  74.2k|        p0 = (int)*s;
  114|  74.2k|        k0 = k;
  115|  76.0k|        while (*s == '-' && k > 1) {
  ------------------
  |  Branch (115:16): [True: 1.76k, False: 74.2k]
  |  Branch (115:29): [True: 1.76k, False: 0]
  ------------------
  116|  1.76k|          k--;
  117|  1.76k|          s++;
  118|  1.76k|        }
  119|  74.2k|        if (*s == '<')
  ------------------
  |  Branch (119:13): [True: 87, False: 74.1k]
  ------------------
  120|     87|          s++;
  121|  74.2k|        if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (121:13): [True: 0, False: 74.2k]
  ------------------
  122|       |          /**  determine priority  **/
  123|      0|          p = *s - '0';
  124|      0|          s++;
  125|      0|        }
  126|  74.2k|        if (*s == '^' && *(s + 1) == '^')
  ------------------
  |  Branch (126:13): [True: 3.76k, False: 70.5k]
  |  Branch (126:26): [True: 0, False: 3.76k]
  ------------------
  127|      0|          s++;
  128|       |
  129|  74.2k|        if (*s == '\0' || (*s == '^' && (i == 0 || !myisalpha(word[i - 1])) &&
  ------------------
  |  Branch (129:13): [True: 26.8k, False: 47.4k]
  |  Branch (129:28): [True: 3.76k, False: 43.6k]
  |  Branch (129:42): [True: 153, False: 3.61k]
  |  Branch (129:52): [True: 911, False: 2.70k]
  ------------------
  130|  1.06k|                           (*(s + 1) != '$' || (!myisalpha(word[i + k0])))) ||
  ------------------
  |  Branch (130:29): [True: 1.06k, False: 0]
  |  Branch (130:48): [True: 0, False: 0]
  ------------------
  131|  46.3k|            (*s == '$' && i > 0 && myisalpha(word[i - 1]) &&
  ------------------
  |  Branch (131:14): [True: 2, False: 46.3k]
  |  Branch (131:27): [True: 2, False: 0]
  |  Branch (131:36): [True: 2, False: 0]
  ------------------
  132|  27.8k|             (!myisalpha(word[i + k0])))) {
  ------------------
  |  Branch (132:14): [True: 0, False: 2]
  ------------------
  133|       |          /**  search for followup rules, if:     **/
  134|       |          /**  parms.followup and k > 1  and  NO '-' in searchstring **/
  135|  27.8k|          char c0 = word[i + k - 1];
  136|  27.8k|          n0 = parms.hash[(uchar)c0];
  137|       |
  138|       |          //            if (parms.followup  &&  k > 1  &&  n0 >= 0
  139|  27.8k|          if (k > 1 && n0 >= 0 && p0 != (int)'-' && word[i + k] != '\0' && !parms.rules[n0].empty()) {
  ------------------
  |  Branch (139:15): [True: 376, False: 27.4k]
  |  Branch (139:24): [True: 376, False: 0]
  |  Branch (139:35): [True: 309, False: 67]
  |  Branch (139:53): [True: 270, False: 39]
  |  Branch (139:76): [True: 270, False: 0]
  ------------------
  140|       |            /**  test follow-up rule for "word[i+k]"  **/
  141|    748|            while (parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (141:20): [True: 643, False: 105]
  ------------------
  142|       |              /**  check whole string  **/
  143|    643|              k0 = k;
  144|    643|              p0 = 5;
  145|    643|              s = parms.rules[n0].c_str();
  146|    643|              s++;
  147|    808|              while (*s != '\0' && word[i + k0] == *s && !isdigit((unsigned char)*s) && strchr("(-<^$", *s) == nullptr) {
  ------------------
  |  Branch (147:22): [True: 538, False: 270]
  |  Branch (147:36): [True: 165, False: 373]
  |  Branch (147:58): [True: 165, False: 0]
  |  Branch (147:89): [True: 165, False: 0]
  ------------------
  148|    165|                k0++;
  149|    165|                s++;
  150|    165|              }
  151|    643|              if (*s == '(') {
  ------------------
  |  Branch (151:19): [True: 1, False: 642]
  ------------------
  152|       |                /**  check letters  **/
  153|      1|                if (myisalpha(word[i + k0]) && strchr(s + 1, word[i + k0]) != nullptr) {
  ------------------
  |  Branch (153:21): [True: 1, False: 0]
  |  Branch (153:48): [True: 0, False: 1]
  ------------------
  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|      1|              }
  161|    643|              while (*s == '-') {
  ------------------
  |  Branch (161:22): [True: 0, False: 643]
  ------------------
  162|       |                /**  "k0" gets NOT reduced   **/
  163|       |                /**  because "if (k0 == k)"  **/
  164|      0|                s++;
  165|      0|              }
  166|    643|              if (*s == '<')
  ------------------
  |  Branch (166:19): [True: 0, False: 643]
  ------------------
  167|      0|                s++;
  168|    643|              if (isdigit((unsigned char)*s)) {
  ------------------
  |  Branch (168:19): [True: 0, False: 643]
  ------------------
  169|      0|                p0 = *s - '0';
  170|      0|                s++;
  171|      0|              }
  172|       |
  173|    643|              if (*s == '\0'
  ------------------
  |  Branch (173:19): [True: 270, False: 373]
  ------------------
  174|       |                  /**  *s == '^' cuts  **/
  175|    373|                  || (*s == '$' && !myisalpha(word[i + k0]))) {
  ------------------
  |  Branch (175:23): [True: 0, False: 373]
  |  Branch (175:36): [True: 0, False: 0]
  ------------------
  176|    270|                if (k0 == k) {
  ------------------
  |  Branch (176:21): [True: 105, False: 165]
  ------------------
  177|       |                  /**  this is just a piece of the string  **/
  178|    105|                  n0 += 2;
  179|    105|                  continue;
  180|    105|                }
  181|       |
  182|    165|                if (p0 < p) {
  ------------------
  |  Branch (182:21): [True: 0, False: 165]
  ------------------
  183|       |                  /**  priority too low  **/
  184|      0|                  n0 += 2;
  185|      0|                  continue;
  186|      0|                }
  187|       |                /**  rule fits; stop search  **/
  188|    165|                break;
  189|    165|              }
  190|    373|              n0 += 2;
  191|    373|            } /**  End of "while (parms.rules[n0][0] == c0)"  **/
  192|       |
  193|    270|            if (p0 >= p && parms.rules[n0][0] == c0) {
  ------------------
  |  Branch (193:17): [True: 270, False: 0]
  |  Branch (193:28): [True: 165, False: 105]
  ------------------
  194|    165|              n += 2;
  195|    165|              continue;
  196|    165|            }
  197|    270|          } /** end of follow-up stuff **/
  198|       |
  199|       |          /**  replace string  **/
  200|  27.7k|          s = parms.rules[n + 1].c_str();
  201|  27.7k|          p0 = (!parms.rules[n].empty() && strchr(parms.rules[n].c_str() + 1, '<') != nullptr) ? 1 : 0;
  ------------------
  |  Branch (201:17): [True: 27.7k, False: 0]
  |  Branch (201:44): [True: 87, False: 27.6k]
  ------------------
  202|  27.7k|          if (p0 == 1 && z == 0) {
  ------------------
  |  Branch (202:15): [True: 87, False: 27.6k]
  |  Branch (202:26): [True: 87, False: 0]
  ------------------
  203|       |            /**  rule with '<' is used  **/
  204|     87|            if (!target.empty() && *s != '\0' &&
  ------------------
  |  Branch (204:17): [True: 79, False: 8]
  |  Branch (204:36): [True: 79, False: 0]
  ------------------
  205|     79|                (target[target.size()-1] == c || target[target.size()-1] == *s)) {
  ------------------
  |  Branch (205:18): [True: 0, False: 79]
  |  Branch (205:50): [True: 0, False: 79]
  ------------------
  206|      0|              target.erase(target.size() - 1);
  207|      0|            }
  208|     87|            z0 = 1;
  209|     87|            z = 1;
  210|     87|            k0 = 0;
  211|    174|            while (*s != '\0' && word[i + k0] != '\0') {
  ------------------
  |  Branch (211:20): [True: 87, False: 87]
  |  Branch (211:34): [True: 87, False: 0]
  ------------------
  212|     87|              word[i + k0] = *s;
  213|     87|              k0++;
  214|     87|              s++;
  215|     87|            }
  216|     87|            if (k > k0)
  ------------------
  |  Branch (216:17): [True: 1, False: 86]
  ------------------
  217|      1|              strmove(&word[0] + i + k0, &word[0] + i + k);
  218|       |
  219|       |            /**  new "actual letter"  **/
  220|     87|            c = word[i];
  221|  27.6k|          } else { /** no '<' rule used **/
  222|  27.6k|            i += k - 1;
  223|  27.6k|            z = 0;
  224|  28.1k|            while (*s != '\0' && *(s + 1) != '\0' && target.size() < len) {
  ------------------
  |  Branch (224:20): [True: 26.6k, False: 1.58k]
  |  Branch (224:34): [True: 676, False: 25.9k]
  |  Branch (224:54): [True: 576, False: 100]
  ------------------
  225|    576|              if (target.empty() || target[target.size()-1] != *s) {
  ------------------
  |  Branch (225:19): [True: 10, False: 566]
  |  Branch (225:37): [True: 190, False: 376]
  ------------------
  226|    200|                target.push_back(*s);
  227|    200|              }
  228|    576|              s++;
  229|    576|            }
  230|       |            /**  new "actual letter"  **/
  231|  27.6k|            c = *s;
  232|  27.6k|            if (!parms.rules[n].empty() && strstr(parms.rules[n].c_str() + 1, "^^") != nullptr) {
  ------------------
  |  Branch (232:17): [True: 27.6k, False: 0]
  |  Branch (232:44): [True: 0, False: 27.6k]
  ------------------
  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|  27.6k|          }
  241|  27.7k|          break;
  242|  27.8k|        } /** end of follow-up stuff **/
  243|  46.3k|        n += 2;
  244|  46.3k|      } /**  end of while (parms.rules[n][0] == c)  **/
  245|  30.0k|    }   /**  end of if (n >= 0)  **/
  246|   104k|    if (z0 == 0) {
  ------------------
  |  Branch (246:9): [True: 104k, False: 87]
  ------------------
  247|   104k|      if (k && !p0 && target.size() < len && c != '\0') {
  ------------------
  |  Branch (247:11): [True: 29.9k, False: 74.4k]
  |  Branch (247:16): [True: 27.6k, False: 2.32k]
  |  Branch (247:23): [True: 27.4k, False: 125]
  |  Branch (247:46): [True: 25.9k, False: 1.58k]
  ------------------
  248|       |        /**  condense only double letters  **/
  249|  25.9k|        target.push_back(c);
  250|       |        /// printf("\n setting \n");
  251|  25.9k|      }
  252|       |
  253|   104k|      i++;
  254|   104k|      z = 0;
  255|   104k|      k = 0;
  256|   104k|    }
  257|   104k|  } /**  end of   while ((c = word[i]) != '\0')  **/
  258|       |
  259|  12.5k|  return target;
  260|  12.5k|} /**  end of function "phonet"  **/
phonet.cxx:_ZL9myisalphac:
   59|  8.76k|static int myisalpha(char ch) {
   60|  8.76k|  if ((unsigned char)ch < 128)
  ------------------
  |  Branch (60:7): [True: 8.21k, False: 550]
  ------------------
   61|  8.21k|    return isalpha(ch);
   62|    550|  return 1;
   63|  8.76k|}
phonet.cxx:_ZL7strmovePcS_:
   53|      1|static inline void strmove(char* dest, char* src) {
   54|      2|  while (*src)
  ------------------
  |  Branch (54:10): [True: 1, False: 1]
  ------------------
   55|      1|    *dest++ = *src++;
   56|      1|  *dest = '\0';
   57|      1|}

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

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

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

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

