LLVMFuzzerTestOneInput:
   24|  10.0k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   25|  10.0k|	FuzzedDataProvider fuzzed_data(data, size);
   26|       |
   27|  10.0k|	cctz::time_zone lax;
   28|  10.0k|	std::string tz = fuzzed_data.ConsumeRandomLengthString();
   29|  10.0k|	if (load_time_zone(tz, &lax)) {
  ------------------
  |  Branch (29:6): [True: 9.37k, False: 715]
  ------------------
   30|  9.37k|		std::chrono::system_clock::time_point tp;
   31|  9.37k|		std::string date_format = fuzzed_data.ConsumeRandomLengthString();
   32|  9.37k|		std::string parse_format = fuzzed_data.ConsumeRandomLengthString();
   33|  9.37k|		cctz::parse(parse_format, date_format, lax, &tp);
   34|       |
   35|  9.37k|		const auto t1 = cctz::convert(cctz::civil_second(
   36|  9.37k|				fuzzed_data.ConsumeIntegral<uint32_t>(),
   37|  9.37k|				fuzzed_data.ConsumeIntegral<uint32_t>(),
   38|  9.37k|				fuzzed_data.ConsumeIntegral<uint32_t>(),
   39|  9.37k|				fuzzed_data.ConsumeIntegral<uint32_t>(),
   40|  9.37k|				fuzzed_data.ConsumeIntegral<uint32_t>(),
   41|  9.37k|				fuzzed_data.ConsumeIntegral<uint32_t>()), lax);
   42|  9.37k|		std::string format = fuzzed_data.ConsumeRandomLengthString();
   43|  9.37k|		cctz::format(format, t1, lax);
   44|  9.37k|	}
   45|       |
   46|  10.0k|	return 0;
   47|  10.0k|}

_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2Ellllll:
  364|  20.7k|      : civil_time(impl::n_sec(y, m, d, hh, mm, ss)) {}
_ZN4cctz6detail4impl5n_secEllllll:
  218|   635k|                         diff_t ss) noexcept {
  219|       |  // Optimization for when (non-constexpr) fields are already normalized.
  220|   635k|  if (0 <= ss && ss < 60) {
  ------------------
  |  Branch (220:7): [True: 516k, False: 119k]
  |  Branch (220:18): [True: 509k, False: 6.77k]
  ------------------
  221|   509k|    const second_t nss = static_cast<second_t>(ss);
  222|   509k|    if (0 <= mm && mm < 60) {
  ------------------
  |  Branch (222:9): [True: 499k, False: 9.79k]
  |  Branch (222:20): [True: 76.5k, False: 422k]
  ------------------
  223|  76.5k|      const minute_t nmm = static_cast<minute_t>(mm);
  224|  76.5k|      if (0 <= hh && hh < 24) {
  ------------------
  |  Branch (224:11): [True: 76.5k, False: 0]
  |  Branch (224:22): [True: 76.3k, False: 131]
  ------------------
  225|  76.3k|        const hour_t nhh = static_cast<hour_t>(hh);
  226|  76.3k|        if (1 <= d && d <= 28 && 1 <= m && m <= 12) {
  ------------------
  |  Branch (226:13): [True: 69.5k, False: 6.85k]
  |  Branch (226:23): [True: 46.2k, False: 23.2k]
  |  Branch (226:34): [True: 46.2k, False: 8]
  |  Branch (226:44): [True: 46.1k, False: 124]
  ------------------
  227|  46.1k|          const day_t nd = static_cast<day_t>(d);
  228|  46.1k|          const month_t nm = static_cast<month_t>(m);
  229|  46.1k|          return fields(y, nm, nd, nhh, nmm, nss);
  230|  46.1k|        }
  231|  30.2k|        return n_mon(y, m, d, 0, nhh, nmm, nss);
  232|  76.3k|      }
  233|    131|      return n_hour(y, m, d, hh / 24, hh % 24, nmm, nss);
  234|  76.5k|    }
  235|   432k|    return n_min(y, m, d, hh, mm / 60, mm % 60, nss);
  236|   509k|  }
  237|   126k|  diff_t cm = ss / 60;
  238|   126k|  ss %= 60;
  239|   126k|  if (ss < 0) {
  ------------------
  |  Branch (239:7): [True: 119k, False: 6.77k]
  ------------------
  240|   119k|    cm -= 1;
  241|   119k|    ss += 60;
  242|   119k|  }
  243|   126k|  return n_min(y, m, d, hh, mm / 60 + cm / 60, mm % 60 + cm % 60,
  244|   126k|               static_cast<second_t>(ss));
  245|   635k|}
_ZN4cctz6detail6fieldsC2Elaaaaa:
   61|   954k|      : y(year), m(month), d(day), hh(hour), mm(minute), ss(second) {}
_ZN4cctz6detail4impl5n_monEllllaaa:
  185|   589k|                         hour_t hh, minute_t mm, second_t ss) noexcept {
  186|   589k|  if (m != 12) {
  ------------------
  |  Branch (186:7): [True: 585k, False: 3.92k]
  ------------------
  187|   585k|    y += m / 12;
  188|   585k|    m %= 12;
  189|   585k|    if (m <= 0) {
  ------------------
  |  Branch (189:9): [True: 7.17k, False: 578k]
  ------------------
  190|  7.17k|      y -= 1;
  191|  7.17k|      m += 12;
  192|  7.17k|    }
  193|   585k|  }
  194|   589k|  return n_day(y, static_cast<month_t>(m), d, cd, hh, mm, ss);
  195|   589k|}
_ZN4cctz6detail4impl5n_dayElallaaa:
  119|   593k|                         hour_t hh, minute_t mm, second_t ss) noexcept {
  120|   593k|  year_t ey = y % 400;
  121|   593k|  const year_t oey = ey;
  122|   593k|  ey += (cd / 146097) * 400;
  123|   593k|  cd %= 146097;
  124|   593k|  if (cd < 0) {
  ------------------
  |  Branch (124:7): [True: 11.6k, False: 582k]
  ------------------
  125|  11.6k|    ey -= 400;
  126|  11.6k|    cd += 146097;
  127|  11.6k|  }
  128|   593k|  ey += (d / 146097) * 400;
  129|   593k|  d = d % 146097 + cd;
  130|   593k|  if (d > 0) {
  ------------------
  |  Branch (130:7): [True: 587k, False: 6.88k]
  ------------------
  131|   587k|    if (d > 146097) {
  ------------------
  |  Branch (131:9): [True: 1.49k, False: 585k]
  ------------------
  132|  1.49k|      ey += 400;
  133|  1.49k|      d -= 146097;
  134|  1.49k|    }
  135|   587k|  } else {
  136|  6.88k|    if (d > -365) {
  ------------------
  |  Branch (136:9): [True: 6.88k, False: 0]
  ------------------
  137|       |      // We often hit the previous year when stepping a civil time backwards,
  138|       |      // so special case it to avoid counting up by 100/4/1-year chunks.
  139|  6.88k|      ey -= 1;
  140|  6.88k|      d += days_per_year(ey, m);
  141|  6.88k|    } else {
  142|      0|      ey -= 400;
  143|      0|      d += 146097;
  144|      0|    }
  145|  6.88k|  }
  146|   593k|  if (d > 365) {
  ------------------
  |  Branch (146:7): [True: 251k, False: 342k]
  ------------------
  147|   251k|    int yi = year_index(ey, m);  // Index into Gregorian 400 year cycle.
  148|   581k|    for (;;) {
  149|   581k|      int n = days_per_century(yi);
  150|   581k|      if (d <= n) break;
  ------------------
  |  Branch (150:11): [True: 251k, False: 329k]
  ------------------
  151|   329k|      d -= n;
  152|   329k|      ey += 100;
  153|   329k|      yi += 100;
  154|   329k|      if (yi >= 400) yi -= 400;
  ------------------
  |  Branch (154:11): [True: 156k, False: 173k]
  ------------------
  155|   329k|    }
  156|  3.27M|    for (;;) {
  157|  3.27M|      int n = days_per_4years(yi);
  158|  3.27M|      if (d <= n) break;
  ------------------
  |  Branch (158:11): [True: 251k, False: 3.02M]
  ------------------
  159|  3.02M|      d -= n;
  160|  3.02M|      ey += 4;
  161|  3.02M|      yi += 4;
  162|  3.02M|      if (yi >= 400) yi -= 400;
  ------------------
  |  Branch (162:11): [True: 58.7k, False: 2.96M]
  ------------------
  163|  3.02M|    }
  164|   635k|    for (;;) {
  165|   635k|      int n = days_per_year(ey, m);
  166|   635k|      if (d <= n) break;
  ------------------
  |  Branch (166:11): [True: 251k, False: 383k]
  ------------------
  167|   383k|      d -= n;
  168|   383k|      ++ey;
  169|   383k|    }
  170|   251k|  }
  171|   593k|  if (d > 28) {
  ------------------
  |  Branch (171:7): [True: 403k, False: 189k]
  ------------------
  172|  1.87M|    for (;;) {
  173|  1.87M|      int n = days_per_month(ey, m);
  174|  1.87M|      if (d <= n) break;
  ------------------
  |  Branch (174:11): [True: 403k, False: 1.46M]
  ------------------
  175|  1.46M|      d -= n;
  176|  1.46M|      if (++m > 12) {
  ------------------
  |  Branch (176:11): [True: 8.78k, False: 1.45M]
  ------------------
  177|  8.78k|        ++ey;
  178|  8.78k|        m = 1;
  179|  8.78k|      }
  180|  1.46M|    }
  181|   403k|  }
  182|   593k|  return fields(y + (ey - oey), m, static_cast<day_t>(d), hh, mm, ss);
  183|   593k|}
_ZN4cctz6detail4impl13days_per_yearEla:
   96|   642k|CONSTEXPR_F int days_per_year(year_t y, month_t m) noexcept {
   97|   642k|  return is_leap_year(y + (m > 2)) ? 366 : 365;
  ------------------
  |  Branch (97:10): [True: 127k, False: 514k]
  ------------------
   98|   642k|}
_ZN4cctz6detail4impl12is_leap_yearEl:
   83|   899k|CONSTEXPR_F bool is_leap_year(year_t y) noexcept {
   84|   899k|  return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0);
  ------------------
  |  Branch (84:10): [True: 192k, False: 706k]
  |  Branch (84:25): [True: 180k, False: 12.7k]
  |  Branch (84:41): [True: 7.41k, False: 5.32k]
  ------------------
   85|   899k|}
_ZN4cctz6detail4impl10year_indexEla:
   86|   251k|CONSTEXPR_F int year_index(year_t y, month_t m) noexcept {
   87|   251k|  const int yi = static_cast<int>((y + (m > 2)) % 400);
   88|   251k|  return yi < 0 ? yi + 400 : yi;
  ------------------
  |  Branch (88:10): [True: 10.7k, False: 240k]
  ------------------
   89|   251k|}
_ZN4cctz6detail4impl16days_per_centuryEi:
   90|   581k|CONSTEXPR_F int days_per_century(int yi) noexcept {
   91|   581k|  return 36524 + (yi == 0 || yi > 300);
  ------------------
  |  Branch (91:19): [True: 586, False: 580k]
  |  Branch (91:30): [True: 249k, False: 331k]
  ------------------
   92|   581k|}
_ZN4cctz6detail4impl15days_per_4yearsEi:
   93|  3.27M|CONSTEXPR_F int days_per_4years(int yi) noexcept {
   94|  3.27M|  return 1460 + (yi == 0 || yi > 300 || (yi - 1) % 100 < 96);
  ------------------
  |  Branch (94:18): [True: 1.00k, False: 3.27M]
  |  Branch (94:29): [True: 1.07M, False: 2.19M]
  |  Branch (94:41): [True: 2.07M, False: 114k]
  ------------------
   95|  3.27M|}
_ZN4cctz6detail4impl14days_per_monthEla:
  114|  1.87M|CONSTEXPR_F int days_per_month(year_t y, month_t m) noexcept {
  115|  1.87M|  return k_days_per_month[m] + (m == 2 && is_leap_year(y));
  ------------------
  |  Branch (115:33): [True: 248k, False: 1.62M]
  |  Branch (115:43): [True: 59.2k, False: 189k]
  ------------------
  116|  1.87M|}
_ZN4cctz6detail4impl6n_hourElllllaa:
  197|   558k|                          diff_t hh, minute_t mm, second_t ss) noexcept {
  198|   558k|  cd += hh / 24;
  199|   558k|  hh %= 24;
  200|   558k|  if (hh < 0) {
  ------------------
  |  Branch (200:7): [True: 7.30k, False: 551k]
  ------------------
  201|  7.30k|    cd -= 1;
  202|  7.30k|    hh += 24;
  203|  7.30k|  }
  204|   558k|  return n_mon(y, m, d, cd, static_cast<hour_t>(hh), mm, ss);
  205|   558k|}
_ZN4cctz6detail4impl5n_minElllllla:
  207|   558k|                         diff_t mm, second_t ss) noexcept {
  208|   558k|  ch += mm / 60;
  209|   558k|  mm %= 60;
  210|   558k|  if (mm < 0) {
  ------------------
  |  Branch (210:7): [True: 119k, False: 439k]
  ------------------
  211|   119k|    ch -= 1;
  212|   119k|    mm += 60;
  213|   119k|  }
  214|   558k|  return n_hour(y, m, d, hh / 24 + ch / 24, hh % 24 + ch % 24,
  215|   558k|                static_cast<minute_t>(mm), ss);
  216|   558k|}
_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2ENS0_6fieldsE:
  451|   635k|  explicit CONSTEXPR_M civil_time(fields f) noexcept : f_(align(T{}, f)) {}
_ZN4cctz6detail5alignENS0_10second_tagENS0_6fieldsE:
  337|   635k|CONSTEXPR_F fields align(second_tag, fields f) noexcept {
  338|   635k|  return f;
  339|   635k|}
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE4yearEv:
  397|  1.68M|  CONSTEXPR_M year_t year() const noexcept { return f_.y; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE5monthEv:
  398|  1.12M|  CONSTEXPR_M int month() const noexcept { return f_.m; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE3dayEv:
  399|   969k|  CONSTEXPR_M int day() const noexcept { return f_.d; }
_ZN4cctz6detailplENS0_10civil_timeINS0_7day_tagEEEl:
  429|    698|  friend CONSTEXPR_F civil_time operator+(civil_time a, diff_t n) noexcept {
  430|    698|    return civil_time(step(T{}, a.f_, n));
  431|    698|  }
_ZN4cctz6detailmiENS0_10civil_timeINS0_7day_tagEEEl:
  435|  4.14k|  friend CONSTEXPR_F civil_time operator-(civil_time a, diff_t n) noexcept {
  436|  4.14k|    return n != (std::numeric_limits<diff_t>::min)()
  ------------------
  |  Branch (436:12): [True: 4.14k, False: 0]
  ------------------
  437|  4.14k|               ? civil_time(step(T{}, a.f_, -n))
  438|  4.14k|               : civil_time(step(T{}, step(T{}, a.f_, -(n + 1)), 1));
  439|  4.14k|  }
_ZN4cctz6detail4stepENS0_10second_tagENS0_6fieldsEl:
  252|   610k|CONSTEXPR_F fields step(second_tag, fields f, diff_t n) noexcept {
  253|   610k|  return impl::n_sec(f.y, f.m, f.d, f.hh, f.mm + n / 60, f.ss + n % 60);
  254|   610k|}
_ZN4cctz6detail4stepENS0_7day_tagENS0_6fieldsEl:
  261|  4.84k|CONSTEXPR_F fields step(day_tag, fields f, diff_t n) noexcept {
  262|  4.84k|  return impl::n_day(f.y, f.m, f.d, n, f.hh, f.mm, f.ss);
  263|  4.84k|}
_ZN4cctz6detail4impl9scale_addElll:
  276|  44.2k|CONSTEXPR_F diff_t scale_add(diff_t v, diff_t f, diff_t a) noexcept {
  277|  44.2k|  return (v < 0) ? ((v + 1) * f + a) - f : ((v - 1) * f + a) + f;
  ------------------
  |  Branch (277:10): [True: 6.99k, False: 37.2k]
  ------------------
  278|  44.2k|}
_ZN4cctz6detail4impl7ymd_ordElaa:
  282|  36.3k|CONSTEXPR_F diff_t ymd_ord(year_t y, month_t m, day_t d) noexcept {
  283|  36.3k|  const diff_t eyear = (m <= 2) ? y - 1 : y;
  ------------------
  |  Branch (283:24): [True: 11.1k, False: 25.2k]
  ------------------
  284|  36.3k|  const diff_t era = (eyear >= 0 ? eyear : eyear - 399) / 400;
  ------------------
  |  Branch (284:23): [True: 22.1k, False: 14.1k]
  ------------------
  285|  36.3k|  const diff_t yoe = eyear - era * 400;
  286|  36.3k|  const diff_t doy = (153 * (m + (m > 2 ? -3 : 9)) + 2) / 5 + d - 1;
  ------------------
  |  Branch (286:35): [True: 25.2k, False: 11.1k]
  ------------------
  287|  36.3k|  const diff_t doe = yoe * 365 + yoe / 4 - yoe / 100 + doy;
  288|  36.3k|  return era * 146097 + doe - 719468;
  289|  36.3k|}
_ZN4cctz6detail4impl14day_differenceElaalaa:
  297|  18.1k|                                  year_t y2, month_t m2, day_t d2) noexcept {
  298|  18.1k|  const diff_t a_c4_off = y1 % 400;
  299|  18.1k|  const diff_t b_c4_off = y2 % 400;
  300|  18.1k|  diff_t c4_diff = (y1 - a_c4_off) - (y2 - b_c4_off);
  301|  18.1k|  diff_t delta = ymd_ord(a_c4_off, m1, d1) - ymd_ord(b_c4_off, m2, d2);
  302|  18.1k|  if (c4_diff > 0 && delta < 0) {
  ------------------
  |  Branch (302:7): [True: 8.79k, False: 9.38k]
  |  Branch (302:22): [True: 641, False: 8.15k]
  ------------------
  303|    641|    delta += 2 * 146097;
  304|    641|    c4_diff -= 2 * 400;
  305|  17.5k|  } else if (c4_diff < 0 && delta > 0) {
  ------------------
  |  Branch (305:14): [True: 2.27k, False: 15.2k]
  |  Branch (305:29): [True: 13, False: 2.26k]
  ------------------
  306|     13|    delta -= 2 * 146097;
  307|     13|    c4_diff += 2 * 400;
  308|     13|  }
  309|  18.1k|  return (c4_diff / 400 * 146097) + delta;
  310|  18.1k|}
_ZN4cctz6detail10differenceENS0_7day_tagENS0_6fieldsES2_:
  321|  18.1k|CONSTEXPR_F diff_t difference(day_tag, fields f1, fields f2) noexcept {
  322|  18.1k|  return impl::day_difference(f1.y, f1.m, f1.d, f2.y, f2.m, f2.d);
  323|  18.1k|}
_ZN4cctz6detail10differenceENS0_8hour_tagENS0_6fieldsES2_:
  324|  14.7k|CONSTEXPR_F diff_t difference(hour_tag, fields f1, fields f2) noexcept {
  325|  14.7k|  return impl::scale_add(difference(day_tag{}, f1, f2), 24, (f1.hh - f2.hh));
  326|  14.7k|}
_ZN4cctz6detail10differenceENS0_10minute_tagENS0_6fieldsES2_:
  327|  14.7k|CONSTEXPR_F diff_t difference(minute_tag, fields f1, fields f2) noexcept {
  328|  14.7k|  return impl::scale_add(difference(hour_tag{}, f1, f2), 60, (f1.mm - f2.mm));
  329|  14.7k|}
_ZN4cctz6detail10differenceENS0_10second_tagENS0_6fieldsES2_:
  330|  14.7k|CONSTEXPR_F diff_t difference(second_tag, fields f1, fields f2) noexcept {
  331|  14.7k|  return impl::scale_add(difference(minute_tag{}, f1, f2), 60, f1.ss - f2.ss);
  332|  14.7k|}
_ZN4cctz6detail5alignENS0_7day_tagENS0_6fieldsE:
  346|  15.5k|CONSTEXPR_F fields align(day_tag, fields f) noexcept {
  347|  15.5k|  return fields{f.y, f.m, f.d, 0, 0, 0};
  348|  15.5k|}
_ZN4cctz6detail5alignENS0_8year_tagENS0_6fieldsE:
  352|  3.79k|CONSTEXPR_F fields align(year_tag, fields f) noexcept {
  353|  3.79k|  return fields{f.y, 1, 1, 0, 0, 0};
  354|  3.79k|}
_ZN4cctz6detail11get_weekdayERKNS0_10civil_timeINS0_10second_tagEEE:
  559|  13.6k|CONSTEXPR_F weekday get_weekday(const civil_second& cs) noexcept {
  560|  13.6k|  year_t wd = 2400 + (cs.year() % 400) - (cs.month() < 3);
  561|  13.6k|  wd += wd / 4 - wd / 100 + wd / 400;
  562|  13.6k|  wd += impl::k_weekday_offsets[cs.month()] + cs.day();
  563|  13.6k|  return impl::k_weekday_by_mon_off[wd % 7 + 6];
  564|  13.6k|}
_ZN4cctz6detail12next_weekdayENS0_10civil_timeINS0_7day_tagEEENS0_7weekdayE:
  568|    349|CONSTEXPR_F civil_day next_weekday(civil_day cd, weekday wd) noexcept {
  569|    349|  weekday base = get_weekday(cd);
  570|  2.22k|  for (int i = 0;; ++i) {
  571|  2.22k|    if (base == impl::k_weekdays_forw[i]) {
  ------------------
  |  Branch (571:9): [True: 349, False: 1.87k]
  ------------------
  572|  1.52k|      for (int j = i + 1;; ++j) {
  573|  1.52k|        if (wd == impl::k_weekdays_forw[j]) {
  ------------------
  |  Branch (573:13): [True: 349, False: 1.17k]
  ------------------
  574|    349|          return cd + (j - i);
  575|    349|        }
  576|  1.52k|      }
  577|    349|    }
  578|  2.22k|  }
  579|    349|}
_ZN4cctz6detail12prev_weekdayENS0_10civil_timeINS0_7day_tagEEENS0_7weekdayE:
  581|  3.79k|CONSTEXPR_F civil_day prev_weekday(civil_day cd, weekday wd) noexcept {
  582|  3.79k|  weekday base = get_weekday(cd);
  583|  15.1k|  for (int i = 0;; ++i) {
  584|  15.1k|    if (base == impl::k_weekdays_back[i]) {
  ------------------
  |  Branch (584:9): [True: 3.79k, False: 11.3k]
  ------------------
  585|  13.7k|      for (int j = i + 1;; ++j) {
  586|  13.7k|        if (wd == impl::k_weekdays_back[j]) {
  ------------------
  |  Branch (586:13): [True: 3.79k, False: 9.92k]
  ------------------
  587|  3.79k|          return cd - (j - i);
  588|  3.79k|        }
  589|  13.7k|      }
  590|  3.79k|    }
  591|  15.1k|  }
  592|  3.79k|}
_ZN4cctz6detail11get_yeardayERKNS0_10civil_timeINS0_10second_tagEEE:
  594|  9.37k|CONSTEXPR_F int get_yearday(const civil_second& cs) noexcept {
  595|  9.37k|  const int feb29 = (cs.month() > 2 && impl::is_leap_year(cs.year()));
  ------------------
  |  Branch (595:22): [True: 8.88k, False: 489]
  |  Branch (595:40): [True: 753, False: 8.13k]
  ------------------
  596|  9.37k|  return impl::k_month_offsets[cs.month()] + feb29 + cs.day();
  597|  9.37k|}
_ZNK4cctz6detail10civil_timeINS0_7day_tagEE4yearEv:
  397|  3.79k|  CONSTEXPR_M year_t year() const noexcept { return f_.y; }
_ZNK4cctz6detail10civil_timeINS0_7day_tagEE5monthEv:
  398|  3.79k|  CONSTEXPR_M int month() const noexcept { return f_.m; }
_ZNK4cctz6detail10civil_timeINS0_7day_tagEE3dayEv:
  399|  3.79k|  CONSTEXPR_M int day() const noexcept { return f_.d; }
_ZN4cctz6detail10civil_timeINS0_7day_tagEEC2Ellllll:
  364|  3.44k|      : civil_time(impl::n_sec(y, m, d, hh, mm, ss)) {}
_ZN4cctz6detail10civil_timeINS0_7day_tagEEC2ENS0_6fieldsE:
  451|  15.5k|  explicit CONSTEXPR_M civil_time(fields f) noexcept : f_(align(T{}, f)) {}
_ZN4cctz6detailmiENS0_10civil_timeINS0_7day_tagEEES3_:
  440|  3.44k|  friend CONSTEXPR_F diff_t operator-(civil_time lhs, civil_time rhs) noexcept {
  441|  3.44k|    return difference(T{}, lhs.f_, rhs.f_);
  442|  3.44k|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2INS0_7day_tagEEERKNS1_IT_EEPNSt3__19enable_ifIXsr3std10is_base_ofIS2_S6_EE5valueEvE4typeE:
  380|  4.14k|      : civil_time(ct.f_) {}
_ZN4cctz6detail10civil_timeINS0_8year_tagEEC2INS0_7day_tagEEERKNS1_IT_EEPNSt3__19enable_ifIXsr3std10is_base_ofIS6_S2_EE5valueEvE4typeE:
  384|  3.44k|      : civil_time(ct.f_) {}
_ZN4cctz6detail10civil_timeINS0_8year_tagEEC2ENS0_6fieldsE:
  451|  3.79k|  explicit CONSTEXPR_M civil_time(fields f) noexcept : f_(align(T{}, f)) {}
_ZN4cctz6detail10civil_timeINS0_7day_tagEEC2INS0_8year_tagEEERKNS1_IT_EEPNSt3__19enable_ifIXsr3std10is_base_ofIS2_S6_EE5valueEvE4typeE:
  380|  3.79k|      : civil_time(ct.f_) {}
_ZN4cctz6detail10civil_timeINS0_7day_tagEEC2INS0_10second_tagEEERKNS1_IT_EEPNSt3__19enable_ifIXsr3std10is_base_ofIS6_S2_EE5valueEvE4typeE:
  384|  3.44k|      : civil_time(ct.f_) {}
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE4hourEv:
  400|   821k|  CONSTEXPR_M int hour() const noexcept { return f_.hh; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE6minuteEv:
  401|   361k|  CONSTEXPR_M int minute() const noexcept { return f_.mm; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE6secondEv:
  402|  17.4k|  CONSTEXPR_M int second() const noexcept { return f_.ss; }
_ZN4cctz6detail10civil_timeINS0_8year_tagEEC2Ellllll:
  364|    349|      : civil_time(impl::n_sec(y, m, d, hh, mm, ss)) {}
_ZNK4cctz6detail10civil_timeINS0_8year_tagEE4yearEv:
  397|    349|  CONSTEXPR_M year_t year() const noexcept { return f_.y; }
_ZN4cctz6detailgtINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  499|  6.53k|                           const civil_time<T2>& rhs) noexcept {
  500|  6.53k|  return rhs < lhs;
  501|  6.53k|}
_ZN4cctz6detailplENS0_10civil_timeINS0_10second_tagEEEl:
  429|   485k|  friend CONSTEXPR_F civil_time operator+(civil_time a, diff_t n) noexcept {
  430|   485k|    return civil_time(step(T{}, a.f_, n));
  431|   485k|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEE3maxEv:
  387|    327|  static CONSTEXPR_F auto (max)() -> civil_time {
  388|    327|    const auto max_year = (std::numeric_limits<std::int_least64_t>::max)();
  389|    327|    return civil_time(max_year, 12, 31, 23, 59, 59);
  390|    327|  }
_ZN4cctz6detailltINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  474|   459k|                           const civil_time<T2>& rhs) noexcept {
  475|   459k|  return (lhs.year() < rhs.year() ||
  ------------------
  |  Branch (475:11): [True: 111k, False: 348k]
  ------------------
  476|   348k|          (lhs.year() == rhs.year() &&
  ------------------
  |  Branch (476:12): [True: 293k, False: 54.3k]
  ------------------
  477|   293k|           (lhs.month() < rhs.month() ||
  ------------------
  |  Branch (477:13): [True: 60.1k, False: 233k]
  ------------------
  478|   233k|            (lhs.month() == rhs.month() &&
  ------------------
  |  Branch (478:14): [True: 231k, False: 2.47k]
  ------------------
  479|   231k|             (lhs.day() < rhs.day() ||
  ------------------
  |  Branch (479:15): [True: 309, False: 230k]
  ------------------
  480|   230k|              (lhs.day() == rhs.day() &&
  ------------------
  |  Branch (480:16): [True: 230k, False: 359]
  ------------------
  481|   230k|               (lhs.hour() < rhs.hour() ||
  ------------------
  |  Branch (481:17): [True: 57.4k, False: 173k]
  ------------------
  482|   173k|                (lhs.hour() == rhs.hour() &&
  ------------------
  |  Branch (482:18): [True: 115k, False: 57.5k]
  ------------------
  483|   115k|                 (lhs.minute() < rhs.minute() ||
  ------------------
  |  Branch (483:19): [True: 57.5k, False: 58.0k]
  ------------------
  484|  58.0k|                  (lhs.minute() == rhs.minute() &&
  ------------------
  |  Branch (484:20): [True: 474, False: 57.5k]
  ------------------
  485|    474|                   (lhs.second() < rhs.second())))))))))));
  ------------------
  |  Branch (485:20): [True: 227, False: 247]
  ------------------
  486|   459k|}
_ZN4cctz6detail10civil_timeINS0_10second_tagEE3minEv:
  391|    295|  static CONSTEXPR_F auto (min)() -> civil_time {
  392|    295|    const auto min_year = (std::numeric_limits<std::int_least64_t>::min)();
  393|    295|    return civil_time(min_year, 1, 1, 0, 0, 0);
  394|    295|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEEmIEl:
  408|  6.27k|  CONSTEXPR_M civil_time& operator-=(diff_t n) noexcept {
  409|  6.27k|    return *this = *this - n;
  410|  6.27k|  }
_ZN4cctz6detailmiENS0_10civil_timeINS0_10second_tagEEEl:
  435|   125k|  friend CONSTEXPR_F civil_time operator-(civil_time a, diff_t n) noexcept {
  436|   125k|    return n != (std::numeric_limits<diff_t>::min)()
  ------------------
  |  Branch (436:12): [True: 125k, False: 0]
  ------------------
  437|   125k|               ? civil_time(step(T{}, a.f_, -n))
  438|   125k|               : civil_time(step(T{}, step(T{}, a.f_, -(n + 1)), 1));
  439|   125k|  }
_ZN4cctz6detailmiENS0_10civil_timeINS0_10second_tagEEES3_:
  440|  14.7k|  friend CONSTEXPR_F diff_t operator-(civil_time lhs, civil_time rhs) noexcept {
  441|  14.7k|    return difference(T{}, lhs.f_, rhs.f_);
  442|  14.7k|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2Ev:
  366|   295k|  CONSTEXPR_M civil_time() noexcept : f_{1970, 1, 1, 0, 0, 0} {}
_ZN4cctz6detailgeINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  494|   130k|                            const civil_time<T2>& rhs) noexcept {
  495|   130k|  return !(lhs < rhs);
  496|   130k|}
_ZN4cctz6detailleINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  489|  20.0k|                            const civil_time<T2>& rhs) noexcept {
  490|  20.0k|  return !(rhs < lhs);
  491|  20.0k|}

_ZN4cctz9time_zoneC2Ev:
   68|  10.0k|  time_zone() : time_zone(nullptr) {}  // Equivalent to UTC
_ZN4cctz9time_zoneC2EPKNS0_4ImplE:
  220|  20.3k|  explicit time_zone(const Impl* impl) : impl_(impl) {}
_ZN4cctz7convertERKNS_6detail10civil_timeINS0_10second_tagEEERKNS_9time_zoneE:
  257|  9.37k|                                   const time_zone& tz) {
  258|  9.37k|  const time_zone::civil_lookup cl = tz.lookup(cs);
  259|  9.37k|  if (cl.kind == time_zone::civil_lookup::SKIPPED) return cl.trans;
  ------------------
  |  Branch (259:7): [True: 11, False: 9.36k]
  ------------------
  260|  9.36k|  return cl.pre;
  261|  9.37k|}
_ZN4cctz5parseIxNSt3__15ratioILl1ELl1000000EEEEEbRKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEESB_RKNS_9time_zoneEPNS1_6chrono10time_pointINSF_12system_clockENSF_8durationIT_T0_EEEE:
  379|  9.37k|           time_point<std::chrono::duration<Rep, Period>>* tpp) {
  380|  9.37k|  time_point<seconds> sec;
  381|  9.37k|  detail::femtoseconds fs;
  382|  9.37k|  if (!detail::parse(fmt, input, tz, &sec, &fs)) return false;
  ------------------
  |  Branch (382:7): [True: 3.19k, False: 6.17k]
  ------------------
  383|       |
  384|  6.17k|  time_point<std::chrono::duration<Rep, typename Period::type>> tp;
  385|  6.17k|  if (!detail::join_seconds(sec, fs, &tp)) return false;
  ------------------
  |  Branch (385:7): [True: 1.06k, False: 5.10k]
  ------------------
  386|       |
  387|  5.10k|  *tpp = tp;
  388|  5.10k|  return true;
  389|  6.17k|}
_ZN4cctz6detail12join_secondsIxLl1000000EEENSt3__19enable_ifIXsr3std11is_integralIT_EE5valueEbE4typeERKNS2_6chrono10time_pointINS7_12system_clockENS7_8durationIlNS2_5ratioILl1ELl1EEEEEEERKNSA_IlNSB_ILl1ELl1000000000000000EEEEEPNS8_IS9_NSA_IS4_NSB_ILl1EXT0_EEEEEEE:
  427|  6.17k|    time_point<std::chrono::duration<Rep, std::ratio<1, Denom>>>* tpp) {
  428|  6.17k|  using D = std::chrono::duration<Rep, std::ratio<1, Denom>>;
  429|  6.17k|  using D_check = std::chrono::duration<std::intmax_t, std::ratio<1, Denom>>;
  430|  6.17k|  const std::intmax_t count = sec.time_since_epoch().count();
  431|  6.17k|  const auto sub =
  432|  6.17k|      std::chrono::duration_cast<D_check>(fs).count();  // [0, Denom)
  433|       |
  434|       |  // Check for overflow.
  435|  6.17k|  if (sub > (std::numeric_limits<Rep>::max)()) {
  ------------------
  |  Branch (435:7): [True: 0, False: 6.17k]
  ------------------
  436|       |    // If subseconds alone exceed the max representable value, any non-negative
  437|       |    // seconds count will cause overflow. Negative seconds might bring it back
  438|       |    // into range, which is handled by the underflow check below.
  439|      0|    if (count >= 0) return false;
  ------------------
  |  Branch (439:9): [True: 0, False: 0]
  ------------------
  440|  6.17k|  } else {
  441|       |    // Equivalent to: count * Denom + sub > max, but safe from overflow.
  442|  6.17k|    if (count > ((std::numeric_limits<Rep>::max)() - sub) / Denom) return false;
  ------------------
  |  Branch (442:9): [True: 449, False: 5.72k]
  ------------------
  443|  6.17k|  }
  444|       |
  445|       |  // Check for underflow.
  446|       |  // Equivalent to: count * Denom + sub < lowest, but safe from underflow.
  447|       |  // We cannot use "lowest - sub" directly as it would underflow.
  448|  5.72k|  const auto min_div = (std::numeric_limits<Rep>::lowest)() / Denom;
  449|  5.72k|  if (count < min_div) {
  ------------------
  |  Branch (449:7): [True: 620, False: 5.10k]
  ------------------
  450|       |    // If count is less than min_div - 1, it's definitely underflow.
  451|    620|    if (count < min_div - 1) return false;
  ------------------
  |  Branch (451:9): [True: 620, False: 0]
  ------------------
  452|       |    // If count is exactly min_div - 1, we must check if subseconds are
  453|       |    // sufficient to bring the total value back above lowest.
  454|      0|    const auto min_mod = (std::numeric_limits<Rep>::lowest)() % Denom;
  455|      0|    if (sub < Denom + min_mod) return false;
  ------------------
  |  Branch (455:9): [True: 0, False: 0]
  ------------------
  456|      0|    *tpp =
  457|      0|        time_point<D>() + D{static_cast<Rep>(min_div * Denom + (sub - Denom))};
  458|      0|    return true;
  459|      0|  }
  460|  5.10k|  *tpp = time_point<D>() + D{static_cast<Rep>(count * Denom + sub)};
  461|  5.10k|  return true;
  462|  5.72k|}
_ZN4cctz6formatINSt3__16chrono8durationIlNS1_5ratioILl1ELl1EEEEEEENS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKSC_RKNS2_10time_pointINS2_12system_clockET_EERKNS_9time_zoneE:
  324|  9.37k|                          const time_zone& tz) {
  325|  9.37k|  const auto p = detail::split_seconds(tp);
  326|  9.37k|  const auto n = std::chrono::duration_cast<detail::femtoseconds>(p.second);
  327|  9.37k|  return detail::format(fmt, p.first, n, tz);
  328|  9.37k|}
_ZN4cctz6detail13split_secondsERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
  416|  9.37k|    const time_point<seconds>& tp) {
  417|  9.37k|  return {tp, seconds::zero()};
  418|  9.37k|}

_ZN4cctz19FixedOffsetFromNameERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPNS0_6chrono8durationIlNS0_5ratioILl1ELl1EEEEE:
   57|  11.3k|bool FixedOffsetFromName(const std::string& name, seconds* offset) {
   58|  11.3k|  if (name == "UTC" || name == "UTC0") {
  ------------------
  |  Branch (58:7): [True: 1.73k, False: 9.65k]
  |  Branch (58:24): [True: 1, False: 9.65k]
  ------------------
   59|  1.73k|    *offset = seconds::zero();
   60|  1.73k|    return true;
   61|  1.73k|  }
   62|       |
   63|  9.65k|  const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1;
   64|  9.65k|  const char* const ep = kFixedZonePrefix + prefix_len;
   65|  9.65k|  if (name.size() != prefix_len + 9)  // <prefix>+99:99:99
  ------------------
  |  Branch (65:7): [True: 8.83k, False: 821]
  ------------------
   66|  8.83k|    return false;
   67|    821|  if (!std::equal(kFixedZonePrefix, ep, name.begin()))
  ------------------
  |  Branch (67:7): [True: 45, False: 776]
  ------------------
   68|     45|    return false;
   69|    776|  const char* np = name.data() + prefix_len;
   70|    776|  if (np[0] != '+' && np[0] != '-')
  ------------------
  |  Branch (70:7): [True: 423, False: 353]
  |  Branch (70:23): [True: 24, False: 399]
  ------------------
   71|     24|    return false;
   72|    752|  if (np[3] != ':' || np[6] != ':')  // see note below about large offsets
  ------------------
  |  Branch (72:7): [True: 2, False: 750]
  |  Branch (72:23): [True: 24, False: 726]
  ------------------
   73|     26|    return false;
   74|       |
   75|    726|  int hours = Parse02d(np + 1);
   76|    726|  if (hours == -1) return false;
  ------------------
  |  Branch (76:7): [True: 2, False: 724]
  ------------------
   77|    724|  int mins = Parse02d(np + 4);
   78|    724|  if (mins == -1) return false;
  ------------------
  |  Branch (78:7): [True: 2, False: 722]
  ------------------
   79|    722|  int secs = Parse02d(np + 7);
   80|    722|  if (secs == -1) return false;
  ------------------
  |  Branch (80:7): [True: 4, False: 718]
  ------------------
   81|       |
   82|    718|  secs += ((hours * 60) + mins) * 60;
   83|    718|  if (secs > 24 * 60 * 60) return false;  // outside supported offset range
  ------------------
  |  Branch (83:7): [True: 6, False: 712]
  ------------------
   84|    712|  *offset = seconds(secs * (np[0] == '-' ? -1 : 1));  // "-" means west
  ------------------
  |  Branch (84:29): [True: 383, False: 329]
  ------------------
   85|    712|  return true;
   86|    718|}
_ZN4cctz17FixedOffsetToNameERKNSt3__16chrono8durationIlNS0_5ratioILl1ELl1EEEEE:
   88|    327|std::string FixedOffsetToName(const seconds& offset) {
   89|    327|  if (offset == seconds::zero()) return "UTC";
  ------------------
  |  Branch (89:7): [True: 1, False: 326]
  ------------------
   90|    326|  if (offset < std::chrono::hours(-24) || offset > std::chrono::hours(24)) {
  ------------------
  |  Branch (90:7): [True: 0, False: 326]
  |  Branch (90:7): [True: 0, False: 326]
  |  Branch (90:43): [True: 0, False: 326]
  ------------------
   91|       |    // We don't support fixed-offset zones more than 24 hours
   92|       |    // away from UTC to avoid complications in rendering such
   93|       |    // offsets and to (somewhat) limit the total number of zones.
   94|      0|    return "UTC";
   95|      0|  }
   96|    326|  int offset_seconds = static_cast<int>(offset.count());
   97|    326|  const char sign = (offset_seconds < 0 ? '-' : '+');
  ------------------
  |  Branch (97:22): [True: 179, False: 147]
  ------------------
   98|    326|  int offset_minutes = offset_seconds / 60;
   99|    326|  offset_seconds %= 60;
  100|    326|  if (sign == '-') {
  ------------------
  |  Branch (100:7): [True: 179, False: 147]
  ------------------
  101|    179|    if (offset_seconds > 0) {
  ------------------
  |  Branch (101:9): [True: 0, False: 179]
  ------------------
  102|      0|      offset_seconds -= 60;
  103|      0|      offset_minutes += 1;
  104|      0|    }
  105|    179|    offset_seconds = -offset_seconds;
  106|    179|    offset_minutes = -offset_minutes;
  107|    179|  }
  108|    326|  int offset_hours = offset_minutes / 60;
  109|    326|  offset_minutes %= 60;
  110|    326|  const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1;
  111|    326|  char buf[prefix_len + sizeof("-24:00:00")];
  112|    326|  char* ep = std::copy_n(kFixedZonePrefix, prefix_len, buf);
  113|    326|  *ep++ = sign;
  114|    326|  ep = Format02d(ep, offset_hours);
  115|    326|  *ep++ = ':';
  116|    326|  ep = Format02d(ep, offset_minutes);
  117|    326|  *ep++ = ':';
  118|    326|  ep = Format02d(ep, offset_seconds);
  119|    326|  *ep++ = '\0';
  120|    326|  assert(ep == buf + sizeof(buf));
  ------------------
  |  Branch (120:3): [True: 326, False: 0]
  ------------------
  121|    326|  return buf;
  122|    326|}
_ZN4cctz17FixedOffsetToAbbrERKNSt3__16chrono8durationIlNS0_5ratioILl1ELl1EEEEE:
  124|    327|std::string FixedOffsetToAbbr(const seconds& offset) {
  125|    327|  std::string abbr = FixedOffsetToName(offset);
  126|    327|  const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1;
  127|    327|  if (abbr.size() == prefix_len + 9) {         // <prefix>+99:99:99
  ------------------
  |  Branch (127:7): [True: 326, False: 1]
  ------------------
  128|    326|    abbr.erase(0, prefix_len);                 // +99:99:99
  129|    326|    abbr.erase(6, 1);                          // +99:9999
  130|    326|    abbr.erase(3, 1);                          // +999999
  131|    326|    if (abbr[5] == '0' && abbr[6] == '0') {    // +999900
  ------------------
  |  Branch (131:9): [True: 118, False: 208]
  |  Branch (131:27): [True: 39, False: 79]
  ------------------
  132|     39|      abbr.erase(5, 2);                        // +9999
  133|     39|      if (abbr[3] == '0' && abbr[4] == '0') {  // +9900
  ------------------
  |  Branch (133:11): [True: 13, False: 26]
  |  Branch (133:29): [True: 4, False: 9]
  ------------------
  134|      4|        abbr.erase(3, 2);                      // +99
  135|      4|      }
  136|     39|    }
  137|    326|  }
  138|    327|  return abbr;
  139|    327|}
time_zone_fixed.cc:_ZN4cctz12_GLOBAL__N_18Parse02dEPKc:
   46|  2.17k|int Parse02d(const char* p) {
   47|  2.17k|  const int hi = ParseDigit(p[0]);
   48|  2.17k|  if (hi >= 0) {
  ------------------
  |  Branch (48:7): [True: 2.16k, False: 4]
  ------------------
   49|  2.16k|    const int lo = ParseDigit(p[1]);
   50|  2.16k|    if (lo >= 0) return (hi * 10) + lo;
  ------------------
  |  Branch (50:9): [True: 2.16k, False: 4]
  ------------------
   51|  2.16k|  }
   52|      8|  return -1;
   53|  2.17k|}
time_zone_fixed.cc:_ZN4cctz12_GLOBAL__N_110ParseDigitEc:
   39|  4.34k|int ParseDigit(char ch) {
   40|  4.34k|  const char* const dp = std::strchr(kDigits, ch);
   41|       |  // Note that std::strchr() considers the terminating NUL as part of
   42|       |  // the string to scan, so we must also check that we did not find it.
   43|  4.34k|  return (dp == nullptr || *dp == '\0') ? -1 : static_cast<int>(dp - kDigits);
  ------------------
  |  Branch (43:11): [True: 4, False: 4.33k]
  |  Branch (43:28): [True: 4, False: 4.33k]
  ------------------
   44|  4.34k|}
time_zone_fixed.cc:_ZN4cctz12_GLOBAL__N_19Format02dEPci:
   32|    978|char* Format02d(char* p, int v) {
   33|    978|  *p++ = kDigits[(v / 10) % 10];
   34|    978|  *p++ = kDigits[v % 10];
   35|    978|  return p;
   36|    978|}

_ZN4cctz6detail6formatERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_6chrono10time_pointINSA_12system_clockENSA_8durationIlNS1_5ratioILl1ELl1EEEEEEERKNSD_IlNSE_ILl1ELl1000000000000000EEEEERKNS_9time_zoneE:
  339|  9.37k|                   const detail::femtoseconds& fs, const time_zone& tz) {
  340|  9.37k|  std::string result;
  341|  9.37k|  result.reserve(2 * format.size());  // A guess for the result size.
  342|  9.37k|  const time_zone::absolute_lookup al = tz.lookup(tp);
  343|  9.37k|  const std::tm tm = ToTM(al);
  344|       |
  345|       |  // Scratch buffer for internal conversions.
  346|  9.37k|  char buf[6 + (kDigits10_64 + 2)];  // enough for longest conversion (%F)
  347|  9.37k|  char* const ep = buf + sizeof(buf);
  348|  9.37k|  char* bp;  // works back from ep
  349|       |
  350|       |  // Maintain three, disjoint subsequences that span format.
  351|       |  //   [format.begin() ... pending) : already formatted into result
  352|       |  //   [pending ... cur) : formatting pending, but no special cases
  353|       |  //   [cur ... format.end()) : unexamined
  354|       |  // Initially, everything is in the unexamined part.
  355|  9.37k|  const char* pending = format.data();
  356|  9.37k|  const char* cur = pending;
  357|  9.37k|  const char* const end = pending + format.size();
  358|       |
  359|   121k|  while (cur != end) {  // while something is unexamined
  ------------------
  |  Branch (359:10): [True: 112k, False: 9.37k]
  ------------------
  360|       |    // Moves cur to the next percent sign.
  361|   112k|    const char* start = cur;
  362|  27.5M|    while (cur != end && *cur != '%') {
  ------------------
  |  Branch (362:12): [True: 27.5M, False: 603]
  |  Branch (362:26): [True: 27.4M, False: 111k]
  ------------------
  363|  27.4M|      if (*cur == '\0' && pending != start) {
  ------------------
  |  Branch (363:11): [True: 48.4k, False: 27.4M]
  |  Branch (363:27): [True: 5.08k, False: 43.3k]
  ------------------
  364|  5.08k|        FormatTM(&result, std::string(pending, cur), tm);
  365|  5.08k|        pending = start = cur;
  366|  5.08k|      }
  367|  27.4M|      ++cur;
  368|  27.4M|    }
  369|       |
  370|       |    // If the new pending text is all ordinary, copy it out.
  371|   112k|    if (cur != start && pending == start) {
  ------------------
  |  Branch (371:9): [True: 77.3k, False: 35.1k]
  |  Branch (371:25): [True: 14.5k, False: 62.8k]
  ------------------
  372|  14.5k|      result.append(pending, cur);
  373|  14.5k|      pending = start = cur;
  374|  14.5k|    }
  375|       |
  376|       |    // Span the sequential percent signs.
  377|   112k|    const char* const percent = cur;
  378|  1.68M|    while (cur != end && *cur == '%') ++cur;
  ------------------
  |  Branch (378:12): [True: 1.68M, False: 696]
  |  Branch (378:26): [True: 1.57M, False: 111k]
  ------------------
  379|       |
  380|       |    // If the new pending text is all percents, copy out one
  381|       |    // percent for every matched pair, then skip those pairs.
  382|   112k|    if (cur != start && pending == start) {
  ------------------
  |  Branch (382:9): [True: 112k, False: 240]
  |  Branch (382:25): [True: 47.8k, False: 64.3k]
  ------------------
  383|  47.8k|      std::size_t escaped = static_cast<std::size_t>(cur - pending) / 2;
  384|  47.8k|      result.append(pending, escaped);
  385|  47.8k|      pending += escaped * 2;
  386|       |      // Also copy out a single trailing percent.
  387|  47.8k|      if (pending != cur && cur == end) {
  ------------------
  |  Branch (387:11): [True: 46.9k, False: 864]
  |  Branch (387:29): [True: 44, False: 46.9k]
  ------------------
  388|     44|        result.push_back(*pending++);
  389|     44|      }
  390|  47.8k|    }
  391|       |
  392|       |    // Loop unless we have an unescaped percent.
  393|   112k|    if (cur == end || (cur - percent) % 2 == 0) continue;
  ------------------
  |  Branch (393:9): [True: 696, False: 111k]
  |  Branch (393:23): [True: 5.65k, False: 106k]
  ------------------
  394|       |
  395|       |    // Simple specifiers that we handle ourselves.
  396|   106k|    if (*cur == '\0' || strchr("YmdeFUuWwHMSTzZs%", *cur)) {
  ------------------
  |  Branch (396:9): [True: 864, False: 105k]
  |  Branch (396:25): [True: 13.7k, False: 91.5k]
  ------------------
  397|  14.6k|      FormatTM(&result, std::string(pending, cur - 1), tm);
  398|  14.6k|      switch (*cur) {
  ------------------
  |  Branch (398:15): [True: 14.6k, False: 0]
  ------------------
  399|    864|        case '\0':
  ------------------
  |  Branch (399:9): [True: 864, False: 13.7k]
  ------------------
  400|       |          // Because we allow NULs in the format string, we must give
  401|       |          // some meaning to the "%\0" specifier.  We choose the common
  402|       |          // (but undefined) strftime() behavior of echoing unknown
  403|       |          // specifiers.
  404|    864|          result.push_back('%');
  405|    864|          result.push_back('\0');
  406|    864|          break;
  407|  1.66k|        case 'Y':
  ------------------
  |  Branch (407:9): [True: 1.66k, False: 12.9k]
  ------------------
  408|       |          // This avoids the tm.tm_year overflow problem for %Y, however
  409|       |          // tm.tm_year will still be used by other specifiers like %D.
  410|  1.66k|          bp = Format64(ep, 0, al.cs.year());
  411|  1.66k|          result.append(bp, ep);
  412|  1.66k|          break;
  413|    199|        case 'm':
  ------------------
  |  Branch (413:9): [True: 199, False: 14.4k]
  ------------------
  414|    199|          bp = Format02d(ep, al.cs.month());
  415|    199|          result.append(bp, ep);
  416|    199|          break;
  417|    202|        case 'd':
  ------------------
  |  Branch (417:9): [True: 202, False: 14.4k]
  ------------------
  418|    949|        case 'e':
  ------------------
  |  Branch (418:9): [True: 747, False: 13.8k]
  ------------------
  419|    949|          bp = Format02d(ep, al.cs.day());
  420|    949|          if (*cur == 'e' && *bp == '0') *bp = ' ';  // for Windows
  ------------------
  |  Branch (420:15): [True: 747, False: 202]
  |  Branch (420:30): [True: 211, False: 536]
  ------------------
  421|    949|          result.append(bp, ep);
  422|    949|          break;
  423|    785|        case 'F':
  ------------------
  |  Branch (423:9): [True: 785, False: 13.8k]
  ------------------
  424|    785|          bp = Format02d(ep, al.cs.day());
  425|    785|          *--bp = '-';
  426|    785|          bp = Format02d(bp, al.cs.month());
  427|    785|          *--bp = '-';
  428|    785|          bp = Format64(bp, 0, al.cs.year());
  429|    785|          result.append(bp, ep);
  430|    785|          break;
  431|    772|        case 'U':
  ------------------
  |  Branch (431:9): [True: 772, False: 13.8k]
  ------------------
  432|    772|          bp = Format02d(ep, ToWeek(civil_day(al.cs), weekday::sunday));
  433|    772|          result.append(bp, ep);
  434|    772|          break;
  435|    545|        case 'u':
  ------------------
  |  Branch (435:9): [True: 545, False: 14.0k]
  ------------------
  436|    545|          bp = Format64(ep, 0, tm.tm_wday ? tm.tm_wday : 7);
  ------------------
  |  Branch (436:32): [True: 336, False: 209]
  ------------------
  437|    545|          result.append(bp, ep);
  438|    545|          break;
  439|  2.67k|        case 'W':
  ------------------
  |  Branch (439:9): [True: 2.67k, False: 11.9k]
  ------------------
  440|  2.67k|          bp = Format02d(ep, ToWeek(civil_day(al.cs), weekday::monday));
  441|  2.67k|          result.append(bp, ep);
  442|  2.67k|          break;
  443|    221|        case 'w':
  ------------------
  |  Branch (443:9): [True: 221, False: 14.4k]
  ------------------
  444|    221|          bp = Format64(ep, 0, tm.tm_wday);
  445|    221|          result.append(bp, ep);
  446|    221|          break;
  447|    212|        case 'H':
  ------------------
  |  Branch (447:9): [True: 212, False: 14.4k]
  ------------------
  448|    212|          bp = Format02d(ep, al.cs.hour());
  449|    212|          result.append(bp, ep);
  450|    212|          break;
  451|    225|        case 'M':
  ------------------
  |  Branch (451:9): [True: 225, False: 14.4k]
  ------------------
  452|    225|          bp = Format02d(ep, al.cs.minute());
  453|    225|          result.append(bp, ep);
  454|    225|          break;
  455|    511|        case 'S':
  ------------------
  |  Branch (455:9): [True: 511, False: 14.1k]
  ------------------
  456|    511|          bp = Format02d(ep, al.cs.second());
  457|    511|          result.append(bp, ep);
  458|    511|          break;
  459|    239|        case 'T':
  ------------------
  |  Branch (459:9): [True: 239, False: 14.3k]
  ------------------
  460|    239|          bp = Format02d(ep, al.cs.second());
  461|    239|          *--bp = ':';
  462|    239|          bp = Format02d(bp, al.cs.minute());
  463|    239|          *--bp = ':';
  464|    239|          bp = Format02d(bp, al.cs.hour());
  465|    239|          result.append(bp, ep);
  466|    239|          break;
  467|  1.87k|        case 'z':
  ------------------
  |  Branch (467:9): [True: 1.87k, False: 12.7k]
  ------------------
  468|  1.87k|          bp = FormatOffset(ep, al.offset, "");
  469|  1.87k|          result.append(bp, ep);
  470|  1.87k|          break;
  471|    214|        case 'Z':
  ------------------
  |  Branch (471:9): [True: 214, False: 14.4k]
  ------------------
  472|    214|          result.append(al.abbr);
  473|    214|          break;
  474|  2.67k|        case 's':
  ------------------
  |  Branch (474:9): [True: 2.67k, False: 11.9k]
  ------------------
  475|  2.67k|          bp = Format64(ep, 0, ToUnixSeconds(tp));
  476|  2.67k|          result.append(bp, ep);
  477|  2.67k|          break;
  478|      0|        case '%':
  ------------------
  |  Branch (478:9): [True: 0, False: 14.6k]
  ------------------
  479|      0|          result.push_back('%');
  480|      0|          break;
  481|  14.6k|      }
  482|  14.6k|      pending = ++cur;
  483|  14.6k|      continue;
  484|  14.6k|    }
  485|       |
  486|       |    // More complex specifiers that we handle ourselves.
  487|  91.5k|    if (*cur == ':' && cur + 1 != end) {
  ------------------
  |  Branch (487:9): [True: 20.1k, False: 71.4k]
  |  Branch (487:24): [True: 20.0k, False: 10]
  ------------------
  488|  20.0k|      if (*(cur + 1) == 'z') {
  ------------------
  |  Branch (488:11): [True: 6.50k, False: 13.5k]
  ------------------
  489|       |        // Formats %:z.
  490|  6.50k|        FormatTM(&result, std::string(pending, cur - 1), tm);
  491|  6.50k|        bp = FormatOffset(ep, al.offset, ":");
  492|  6.50k|        result.append(bp, ep);
  493|  6.50k|        pending = cur += 2;
  494|  6.50k|        continue;
  495|  6.50k|      }
  496|  13.5k|      if (*(cur + 1) == ':' && cur + 2 != end) {
  ------------------
  |  Branch (496:11): [True: 9.47k, False: 4.11k]
  |  Branch (496:32): [True: 9.47k, False: 1]
  ------------------
  497|  9.47k|        if (*(cur + 2) == 'z') {
  ------------------
  |  Branch (497:13): [True: 2.78k, False: 6.68k]
  ------------------
  498|       |          // Formats %::z.
  499|  2.78k|          FormatTM(&result, std::string(pending, cur - 1), tm);
  500|  2.78k|          bp = FormatOffset(ep, al.offset, ":*");
  501|  2.78k|          result.append(bp, ep);
  502|  2.78k|          pending = cur += 3;
  503|  2.78k|          continue;
  504|  2.78k|        }
  505|  6.68k|        if (*(cur + 2) == ':' && cur + 3 != end) {
  ------------------
  |  Branch (505:13): [True: 4.19k, False: 2.49k]
  |  Branch (505:34): [True: 4.18k, False: 1]
  ------------------
  506|  4.18k|          if (*(cur + 3) == 'z') {
  ------------------
  |  Branch (506:15): [True: 3.50k, False: 688]
  ------------------
  507|       |            // Formats %:::z.
  508|  3.50k|            FormatTM(&result, std::string(pending, cur - 1), tm);
  509|  3.50k|            bp = FormatOffset(ep, al.offset, ":*:");
  510|  3.50k|            result.append(bp, ep);
  511|  3.50k|            pending = cur += 4;
  512|  3.50k|            continue;
  513|  3.50k|          }
  514|  4.18k|        }
  515|  6.68k|      }
  516|  13.5k|    }
  517|       |
  518|       |    // Loop if there is no E modifier.
  519|  78.7k|    if (*cur != 'E' || ++cur == end) continue;
  ------------------
  |  Branch (519:9): [True: 38.7k, False: 39.9k]
  |  Branch (519:24): [True: 14, False: 39.9k]
  ------------------
  520|       |
  521|       |    // Format our extensions.
  522|  39.9k|    if (*cur == 'T') {
  ------------------
  |  Branch (522:9): [True: 1.51k, False: 38.4k]
  ------------------
  523|       |      // Formats %ET.
  524|  1.51k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  525|  1.51k|      result.append("T");
  526|  1.51k|      pending = ++cur;
  527|  38.4k|    } else if (*cur == 'z') {
  ------------------
  |  Branch (527:16): [True: 2.82k, False: 35.6k]
  ------------------
  528|       |      // Formats %Ez.
  529|  2.82k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  530|  2.82k|      bp = FormatOffset(ep, al.offset, ":");
  531|  2.82k|      result.append(bp, ep);
  532|  2.82k|      pending = ++cur;
  533|  35.6k|    } else if (*cur == '*' && cur + 1 != end && *(cur + 1) == 'z') {
  ------------------
  |  Branch (533:16): [True: 4.43k, False: 31.1k]
  |  Branch (533:31): [True: 4.43k, False: 2]
  |  Branch (533:49): [True: 1.40k, False: 3.02k]
  ------------------
  534|       |      // Formats %E*z.
  535|  1.40k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  536|  1.40k|      bp = FormatOffset(ep, al.offset, ":*");
  537|  1.40k|      result.append(bp, ep);
  538|  1.40k|      pending = cur += 2;
  539|  34.2k|    } else if (*cur == '*' && cur + 1 != end &&
  ------------------
  |  Branch (539:16): [True: 3.02k, False: 31.1k]
  |  Branch (539:31): [True: 3.02k, False: 2]
  ------------------
  540|  3.02k|               (*(cur + 1) == 'S' || *(cur + 1) == 'f')) {
  ------------------
  |  Branch (540:17): [True: 1.78k, False: 1.24k]
  |  Branch (540:38): [True: 781, False: 463]
  ------------------
  541|       |      // Formats %E*S or %E*F.
  542|  2.56k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  543|  2.56k|      char* cp = ep;
  544|  2.56k|      bp = Format64(cp, 15, fs.count());
  545|  40.9k|      while (cp != bp && cp[-1] == '0') --cp;
  ------------------
  |  Branch (545:14): [True: 38.4k, False: 2.56k]
  |  Branch (545:26): [True: 38.4k, False: 0]
  ------------------
  546|  2.56k|      switch (*(cur + 1)) {
  ------------------
  |  Branch (546:15): [True: 2.56k, False: 0]
  ------------------
  547|  1.78k|        case 'S':
  ------------------
  |  Branch (547:9): [True: 1.78k, False: 781]
  ------------------
  548|  1.78k|          if (cp != bp) *--bp = '.';
  ------------------
  |  Branch (548:15): [True: 0, False: 1.78k]
  ------------------
  549|  1.78k|          bp = Format02d(bp, al.cs.second());
  550|  1.78k|          break;
  551|    781|        case 'f':
  ------------------
  |  Branch (551:9): [True: 781, False: 1.78k]
  ------------------
  552|    781|          if (cp == bp) *--bp = '0';
  ------------------
  |  Branch (552:15): [True: 781, False: 0]
  ------------------
  553|    781|          break;
  554|  2.56k|      }
  555|  2.56k|      result.append(bp, cp);
  556|  2.56k|      pending = cur += 2;
  557|  31.6k|    } else if (*cur == '4' && cur + 1 != end && *(cur + 1) == 'Y') {
  ------------------
  |  Branch (557:16): [True: 4.35k, False: 27.2k]
  |  Branch (557:31): [True: 4.35k, False: 6]
  |  Branch (557:49): [True: 3.43k, False: 917]
  ------------------
  558|       |      // Formats %E4Y.
  559|  3.43k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  560|  3.43k|      bp = Format64(ep, 4, al.cs.year());
  561|  3.43k|      result.append(bp, ep);
  562|  3.43k|      pending = cur += 2;
  563|  28.2k|    } else if (isdigit(*cur)) {
  ------------------
  |  Branch (563:16): [True: 20.9k, False: 7.22k]
  ------------------
  564|       |      // Possibly found %E#S or %E#f.
  565|  20.9k|      int n = 0;
  566|  20.9k|      if (const char* np = ParseInt(cur, 0, 0, 1024, &n)) {
  ------------------
  |  Branch (566:23): [True: 6.54k, False: 14.4k]
  ------------------
  567|  6.54k|        if (*np == 'S' || *np == 'f') {
  ------------------
  |  Branch (567:13): [True: 296, False: 6.24k]
  |  Branch (567:27): [True: 2.00k, False: 4.24k]
  ------------------
  568|       |          // Formats %E#S or %E#f.
  569|  2.30k|          FormatTM(&result, std::string(pending, cur - 2), tm);
  570|  2.30k|          bp = ep;
  571|  2.30k|          if (n > 0) {
  ------------------
  |  Branch (571:15): [True: 1.84k, False: 457]
  ------------------
  572|  1.84k|            if (n > kDigits10_64) n = kDigits10_64;
  ------------------
  |  Branch (572:17): [True: 909, False: 936]
  ------------------
  573|  1.84k|            bp = Format64(bp, n, (n > 15) ? fs.count() * kExp10[n - 15]
  ------------------
  |  Branch (573:34): [True: 912, False: 933]
  ------------------
  574|  1.84k|                                          : fs.count() / kExp10[15 - n]);
  575|  1.84k|            if (*np == 'S') *--bp = '.';
  ------------------
  |  Branch (575:17): [True: 266, False: 1.57k]
  ------------------
  576|  1.84k|          }
  577|  2.30k|          if (*np == 'S') bp = Format02d(bp, al.cs.second());
  ------------------
  |  Branch (577:15): [True: 296, False: 2.00k]
  ------------------
  578|  2.30k|          result.append(bp, ep);
  579|  2.30k|          pending = cur = ++np;
  580|  2.30k|        }
  581|  6.54k|      }
  582|  20.9k|    }
  583|  39.9k|  }
  584|       |
  585|       |  // Formats any remaining data.
  586|  9.37k|  FormatTM(&result, std::string(pending, end), tm);
  587|       |
  588|  9.37k|  return result;
  589|  9.37k|}
_ZN4cctz6detail5parseERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_9time_zoneEPNS1_6chrono10time_pointINSD_12system_clockENSD_8durationIlNS1_5ratioILl1ELl1EEEEEEEPNSG_IlNSH_ILl1ELl1000000000000000EEEEEPS7_:
  706|  9.37k|           detail::femtoseconds* fs, std::string* err) {
  707|  9.37k|#if !defined(__cpp_lib_chrono) || __cpp_lib_chrono < 201907L
  708|       |  // Assert that the std::chrono::system_clock epoch is the Unix epoch.
  709|       |  // This is required by C++20, but was also ubiquitous before that.
  710|       |  // We use this in join_seconds() to simplify overflow detection.
  711|  9.37k|  assert(std::chrono::system_clock::from_time_t(0).time_since_epoch() ==
  ------------------
  |  Branch (711:3): [True: 9.37k, False: 0]
  ------------------
  712|  9.37k|         std::chrono::system_clock::duration::zero());
  713|  9.37k|#endif
  714|       |
  715|       |  // The unparsed input.  Even though we allow NULs in input, and
  716|       |  // match them against corresponding NULs in format, we depend on
  717|       |  // *edata being a NUL so that we can call strptime().  This also
  718|       |  // makes our handling of input easier.
  719|  9.37k|  const char* data = input.c_str();  // NUL terminated
  720|  9.37k|  const char* const edata = data + input.size();
  721|       |
  722|       |  // Skips leading whitespace.
  723|  9.57k|  while (isspace(*data)) ++data;
  ------------------
  |  Branch (723:10): [True: 197, False: 9.37k]
  ------------------
  724|       |
  725|  9.37k|  const year_t kyearmax = std::numeric_limits<year_t>::max();
  726|  9.37k|  const year_t kyearmin = std::numeric_limits<year_t>::min();
  727|       |
  728|       |  // Sets default values for unspecified fields.
  729|  9.37k|  bool saw_year = false;
  730|  9.37k|  year_t year = 1970;
  731|  9.37k|  std::tm tm{};
  732|  9.37k|  tm.tm_year = 1970 - 1900;
  733|  9.37k|  tm.tm_mon = 1 - 1;  // Jan
  734|  9.37k|  tm.tm_mday = 1;
  735|  9.37k|  tm.tm_hour = 0;
  736|  9.37k|  tm.tm_min = 0;
  737|  9.37k|  tm.tm_sec = 0;
  738|  9.37k|  tm.tm_wday = 4;  // Thu
  739|  9.37k|  tm.tm_yday = 0;
  740|  9.37k|  tm.tm_isdst = 0;
  741|  9.37k|  auto subseconds = detail::femtoseconds::zero();
  742|  9.37k|  bool saw_offset = false;
  743|  9.37k|  int offset = 0;  // No offset from passed tz.
  744|  9.37k|  std::string zone = "UTC";
  745|       |
  746|       |  // Even though we allow NULs in format, and match them against
  747|       |  // corresponding NULs in input, we simplify its handling by also
  748|       |  // ensuring that *efmt is a NUL.
  749|  9.37k|  const char* fmt = format.c_str();  // NUL terminated
  750|  9.37k|  const char* const efmt = fmt + format.size();
  751|  9.37k|  bool twelve_hour = false;
  752|  9.37k|  bool afternoon = false;
  753|  9.37k|  int week_num = -1;
  754|  9.37k|  weekday week_start = weekday::sunday;
  755|       |
  756|  9.37k|  bool saw_percent_s = false;
  757|  9.37k|  std::int_fast64_t percent_s = 0;
  758|       |
  759|       |  // Steps through format, one specifier at a time.
  760|  34.9k|  while (data != nullptr && fmt != efmt) {
  ------------------
  |  Branch (760:10): [True: 32.3k, False: 2.50k]
  |  Branch (760:29): [True: 25.5k, False: 6.86k]
  ------------------
  761|  25.5k|    if (isspace(*fmt)) {
  ------------------
  |  Branch (761:9): [True: 1.79k, False: 23.7k]
  ------------------
  762|  3.49k|      while (isspace(*data)) ++data;
  ------------------
  |  Branch (762:14): [True: 1.70k, False: 1.79k]
  ------------------
  763|  1.98k|      while (isspace(*++fmt)) continue;
  ------------------
  |  Branch (763:14): [True: 195, False: 1.79k]
  ------------------
  764|  1.79k|      continue;
  765|  1.79k|    }
  766|       |
  767|  23.7k|    if (*fmt != '%') {
  ------------------
  |  Branch (767:9): [True: 926, False: 22.8k]
  ------------------
  768|    926|      if (data != edata && *data == *fmt) {
  ------------------
  |  Branch (768:11): [True: 853, False: 73]
  |  Branch (768:28): [True: 817, False: 36]
  ------------------
  769|    817|        ++data;
  770|    817|        ++fmt;
  771|    817|      } else {
  772|    109|        data = nullptr;
  773|    109|      }
  774|    926|      continue;
  775|    926|    }
  776|       |
  777|  22.8k|    const char* const percent = fmt;
  778|  22.8k|    if (++fmt == efmt) {
  ------------------
  |  Branch (778:9): [True: 7, False: 22.8k]
  ------------------
  779|      7|      data = nullptr;
  780|      7|      continue;
  781|      7|    }
  782|  22.8k|    switch (*fmt++) {
  ------------------
  |  Branch (782:13): [True: 21.8k, False: 935]
  ------------------
  783|      1|      case '\0':
  ------------------
  |  Branch (783:7): [True: 1, False: 22.8k]
  ------------------
  784|       |        // Because we allow NULs in the format string, we must give
  785|       |        // some meaning to the "%\0" specifier.  We choose the common
  786|       |        // (but undefined) strptime() behavior of failing on unknown
  787|       |        // specifiers.
  788|      1|        data = nullptr;
  789|      1|        continue;
  790|  2.19k|      case 'Y':
  ------------------
  |  Branch (790:7): [True: 2.19k, False: 20.6k]
  ------------------
  791|       |        // Symmetrically with format(), directly handing %Y avoids the
  792|       |        // tm.tm_year overflow problem.  However, tm.tm_year will still be
  793|       |        // used by other specifiers like %D.
  794|  2.19k|        data = ParseInt(data, 0, kyearmin, kyearmax, &year);
  795|  2.19k|        if (data != nullptr) saw_year = true;
  ------------------
  |  Branch (795:13): [True: 2.09k, False: 98]
  ------------------
  796|  2.19k|        continue;
  797|    528|      case 'm':
  ------------------
  |  Branch (797:7): [True: 528, False: 22.2k]
  ------------------
  798|    528|        data = ParseInt(data, 2, 1, 12, &tm.tm_mon);
  799|    528|        if (data != nullptr) tm.tm_mon -= 1;
  ------------------
  |  Branch (799:13): [True: 488, False: 40]
  ------------------
  800|    528|        week_num = -1;
  801|    528|        continue;
  802|    720|      case 'd':
  ------------------
  |  Branch (802:7): [True: 720, False: 22.0k]
  ------------------
  803|    989|      case 'e':
  ------------------
  |  Branch (803:7): [True: 269, False: 22.5k]
  ------------------
  804|    989|        data = ParseInt(data, 2, 1, 31, &tm.tm_mday);
  805|    989|        week_num = -1;
  806|    989|        continue;
  807|  1.02k|      case 'F':
  ------------------
  |  Branch (807:7): [True: 1.02k, False: 21.7k]
  ------------------
  808|  1.02k|        data = ParseInt(data, 0, kyearmin, kyearmax, &year);
  809|  1.02k|        if (data != nullptr) {
  ------------------
  |  Branch (809:13): [True: 933, False: 90]
  ------------------
  810|    933|          saw_year = true;
  811|    933|          data = (*data == '-' ? data + 1 : nullptr);
  ------------------
  |  Branch (811:19): [True: 662, False: 271]
  ------------------
  812|    933|        }
  813|  1.02k|        data = ParseInt(data, 2, 1, 12, &tm.tm_mon);
  814|  1.02k|        if (data != nullptr) {
  ------------------
  |  Branch (814:13): [True: 613, False: 410]
  ------------------
  815|    613|          tm.tm_mon -= 1;
  816|    613|          data = (*data == '-' ? data + 1 : nullptr);
  ------------------
  |  Branch (816:19): [True: 591, False: 22]
  ------------------
  817|    613|        }
  818|  1.02k|        data = ParseInt(data, 2, 1, 31, &tm.tm_mday);
  819|  1.02k|        week_num = -1;
  820|  1.02k|        continue;
  821|    526|      case 'U':
  ------------------
  |  Branch (821:7): [True: 526, False: 22.2k]
  ------------------
  822|    526|        data = ParseInt(data, 0, 0, 53, &week_num);
  823|    526|        week_start = weekday::sunday;
  824|    526|        continue;
  825|    395|      case 'W':
  ------------------
  |  Branch (825:7): [True: 395, False: 22.4k]
  ------------------
  826|    395|        data = ParseInt(data, 0, 0, 53, &week_num);
  827|    395|        week_start = weekday::monday;
  828|    395|        continue;
  829|    356|      case 'u':
  ------------------
  |  Branch (829:7): [True: 356, False: 22.4k]
  ------------------
  830|    356|        data = ParseInt(data, 0, 1, 7, &tm.tm_wday);
  831|    356|        if (data != nullptr) tm.tm_wday %= 7;
  ------------------
  |  Branch (831:13): [True: 144, False: 212]
  ------------------
  832|    356|        continue;
  833|    393|      case 'w':
  ------------------
  |  Branch (833:7): [True: 393, False: 22.4k]
  ------------------
  834|    393|        data = ParseInt(data, 0, 0, 6, &tm.tm_wday);
  835|    393|        continue;
  836|    488|      case 'H':
  ------------------
  |  Branch (836:7): [True: 488, False: 22.3k]
  ------------------
  837|    488|        data = ParseInt(data, 2, 0, 23, &tm.tm_hour);
  838|    488|        twelve_hour = false;
  839|    488|        continue;
  840|    698|      case 'M':
  ------------------
  |  Branch (840:7): [True: 698, False: 22.1k]
  ------------------
  841|    698|        data = ParseInt(data, 2, 0, 59, &tm.tm_min);
  842|    698|        continue;
  843|    662|      case 'S':
  ------------------
  |  Branch (843:7): [True: 662, False: 22.1k]
  ------------------
  844|    662|        data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  845|    662|        continue;
  846|    608|      case 'T':
  ------------------
  |  Branch (846:7): [True: 608, False: 22.1k]
  ------------------
  847|    608|        data = ParseInt(data, 2, 0, 23, &tm.tm_hour);
  848|    608|        twelve_hour = false;
  849|    608|        data = (data != nullptr && *data == ':' ? data + 1 : nullptr);
  ------------------
  |  Branch (849:17): [True: 567, False: 41]
  |  Branch (849:36): [True: 548, False: 19]
  ------------------
  850|    608|        data = ParseInt(data, 2, 0, 59, &tm.tm_min);
  851|    608|        data = (data != nullptr && *data == ':' ? data + 1 : nullptr);
  ------------------
  |  Branch (851:17): [True: 518, False: 90]
  |  Branch (851:36): [True: 481, False: 37]
  ------------------
  852|    608|        data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  853|    608|        continue;
  854|     81|      case 'I':
  ------------------
  |  Branch (854:7): [True: 81, False: 22.7k]
  ------------------
  855|    154|      case 'l':
  ------------------
  |  Branch (855:7): [True: 73, False: 22.7k]
  ------------------
  856|    164|      case 'r':  // probably uses %I
  ------------------
  |  Branch (856:7): [True: 10, False: 22.7k]
  ------------------
  857|    164|        twelve_hour = true;
  858|    164|        break;
  859|     24|      case 'R':  // uses %H
  ------------------
  |  Branch (859:7): [True: 24, False: 22.7k]
  ------------------
  860|     25|      case 'c':  // probably uses %H
  ------------------
  |  Branch (860:7): [True: 1, False: 22.8k]
  ------------------
  861|     44|      case 'X':  // probably uses %H
  ------------------
  |  Branch (861:7): [True: 19, False: 22.7k]
  ------------------
  862|     44|        twelve_hour = false;
  863|     44|        break;
  864|  3.19k|      case 'z':
  ------------------
  |  Branch (864:7): [True: 3.19k, False: 19.6k]
  ------------------
  865|  3.19k|        data = ParseOffset(data, "", &offset);
  866|  3.19k|        if (data != nullptr) saw_offset = true;
  ------------------
  |  Branch (866:13): [True: 3.12k, False: 74]
  ------------------
  867|  3.19k|        continue;
  868|    982|      case 'Z':  // ignored; zone abbreviations are ambiguous
  ------------------
  |  Branch (868:7): [True: 982, False: 21.8k]
  ------------------
  869|    982|        data = ParseZone(data, &zone);
  870|    982|        continue;
  871|    759|      case 's':
  ------------------
  |  Branch (871:7): [True: 759, False: 22.0k]
  ------------------
  872|    759|        data = ParseInt(data, 0,
  873|    759|                        std::numeric_limits<std::int_fast64_t>::min(),
  874|    759|                        std::numeric_limits<std::int_fast64_t>::max(),
  875|    759|                        &percent_s);
  876|    759|        if (data != nullptr) saw_percent_s = true;
  ------------------
  |  Branch (876:13): [True: 664, False: 95]
  ------------------
  877|    759|        continue;
  878|    791|      case ':':
  ------------------
  |  Branch (878:7): [True: 791, False: 22.0k]
  ------------------
  879|    791|        if (fmt[0] == 'z' ||
  ------------------
  |  Branch (879:13): [True: 354, False: 437]
  ------------------
  880|    437|            (fmt[0] == ':' &&
  ------------------
  |  Branch (880:14): [True: 419, False: 18]
  ------------------
  881|    745|             (fmt[1] == 'z' || (fmt[1] == ':' && fmt[2] == 'z')))) {
  ------------------
  |  Branch (881:15): [True: 197, False: 222]
  |  Branch (881:33): [True: 206, False: 16]
  |  Branch (881:50): [True: 194, False: 12]
  ------------------
  882|    745|          data = ParseOffset(data, ":", &offset);
  883|    745|          if (data != nullptr) saw_offset = true;
  ------------------
  |  Branch (883:15): [True: 723, False: 22]
  ------------------
  884|    745|          fmt += (fmt[0] == 'z') ? 1 : (fmt[1] == 'z') ? 2 : 3;
  ------------------
  |  Branch (884:18): [True: 354, False: 391]
  |  Branch (884:40): [True: 197, False: 194]
  ------------------
  885|    745|          continue;
  886|    745|        }
  887|     46|        break;
  888|    205|      case '%':
  ------------------
  |  Branch (888:7): [True: 205, False: 22.5k]
  ------------------
  889|    205|        data = (*data == '%' ? data + 1 : nullptr);
  ------------------
  |  Branch (889:17): [True: 194, False: 11]
  ------------------
  890|    205|        continue;
  891|  6.78k|      case 'E':
  ------------------
  |  Branch (891:7): [True: 6.78k, False: 16.0k]
  ------------------
  892|  6.78k|        if (fmt[0] == 'T') {
  ------------------
  |  Branch (892:13): [True: 401, False: 6.38k]
  ------------------
  893|    401|          if (*data == 'T' || *data == 't') {
  ------------------
  |  Branch (893:15): [True: 194, False: 207]
  |  Branch (893:31): [True: 195, False: 12]
  ------------------
  894|    389|            ++data;
  895|    389|            ++fmt;
  896|    389|          } else {
  897|     12|            data = nullptr;
  898|     12|          }
  899|    401|          continue;
  900|    401|        }
  901|  6.38k|        if (fmt[0] == 'z' || (fmt[0] == '*' && fmt[1] == 'z')) {
  ------------------
  |  Branch (901:13): [True: 1.62k, False: 4.75k]
  |  Branch (901:31): [True: 2.68k, False: 2.07k]
  |  Branch (901:48): [True: 444, False: 2.24k]
  ------------------
  902|  2.06k|          data = ParseOffset(data, ":", &offset);
  903|  2.06k|          if (data != nullptr) saw_offset = true;
  ------------------
  |  Branch (903:15): [True: 2.05k, False: 16]
  ------------------
  904|  2.06k|          fmt += (fmt[0] == 'z') ? 1 : 2;
  ------------------
  |  Branch (904:18): [True: 1.62k, False: 444]
  ------------------
  905|  2.06k|          continue;
  906|  2.06k|        }
  907|  4.31k|        if (fmt[0] == '*' && fmt[1] == 'S') {
  ------------------
  |  Branch (907:13): [True: 2.24k, False: 2.07k]
  |  Branch (907:30): [True: 478, False: 1.76k]
  ------------------
  908|    478|          data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  909|    478|          if (data != nullptr && *data == '.') {
  ------------------
  |  Branch (909:15): [True: 468, False: 10]
  |  Branch (909:34): [True: 10, False: 458]
  ------------------
  910|     10|            data = ParseSubSeconds(data + 1, &subseconds);
  911|     10|          }
  912|    478|          fmt += 2;
  913|    478|          continue;
  914|    478|        }
  915|  3.83k|        if (fmt[0] == '*' && fmt[1] == 'f') {
  ------------------
  |  Branch (915:13): [True: 1.76k, False: 2.07k]
  |  Branch (915:30): [True: 1.73k, False: 26]
  ------------------
  916|  1.73k|          if (data != nullptr && isdigit(*data)) {
  ------------------
  |  Branch (916:15): [True: 1.73k, False: 0]
  |  Branch (916:34): [True: 798, False: 941]
  ------------------
  917|    798|            data = ParseSubSeconds(data, &subseconds);
  918|    798|          }
  919|  1.73k|          fmt += 2;
  920|  1.73k|          continue;
  921|  1.73k|        }
  922|  2.09k|        if (fmt[0] == '4' && fmt[1] == 'Y') {
  ------------------
  |  Branch (922:13): [True: 650, False: 1.44k]
  |  Branch (922:30): [True: 321, False: 329]
  ------------------
  923|    321|          const char* bp = data;
  924|    321|          data = ParseInt(data, 4, year_t{-999}, year_t{9999}, &year);
  925|    321|          if (data != nullptr) {
  ------------------
  |  Branch (925:15): [True: 301, False: 20]
  ------------------
  926|    301|            if (data - bp == 4) {
  ------------------
  |  Branch (926:17): [True: 257, False: 44]
  ------------------
  927|    257|              saw_year = true;
  928|    257|            } else {
  929|     44|              data = nullptr;  // stopped too soon
  930|     44|            }
  931|    301|          }
  932|    321|          fmt += 2;
  933|    321|          continue;
  934|    321|        }
  935|  1.77k|        if (isdigit(*fmt)) {
  ------------------
  |  Branch (935:13): [True: 1.68k, False: 96]
  ------------------
  936|  1.68k|          int n = 0;  // value ignored
  937|  1.68k|          if (const char* np = ParseInt(fmt, 0, 0, 1024, &n)) {
  ------------------
  |  Branch (937:27): [True: 1.54k, False: 136]
  ------------------
  938|  1.54k|            if (*np == 'S') {
  ------------------
  |  Branch (938:17): [True: 436, False: 1.10k]
  ------------------
  939|    436|              data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  940|    436|              if (data != nullptr && *data == '.') {
  ------------------
  |  Branch (940:19): [True: 416, False: 20]
  |  Branch (940:38): [True: 10, False: 406]
  ------------------
  941|     10|                data = ParseSubSeconds(data + 1, &subseconds);
  942|     10|              }
  943|    436|              fmt = ++np;
  944|    436|              continue;
  945|    436|            }
  946|  1.10k|            if (*np == 'f') {
  ------------------
  |  Branch (946:17): [True: 1.05k, False: 56]
  ------------------
  947|  1.05k|              if (data != nullptr && isdigit(*data)) {
  ------------------
  |  Branch (947:19): [True: 1.05k, False: 0]
  |  Branch (947:38): [True: 413, False: 640]
  ------------------
  948|    413|                data = ParseSubSeconds(data, &subseconds);
  949|    413|              }
  950|  1.05k|              fmt = ++np;
  951|  1.05k|              continue;
  952|  1.05k|            }
  953|  1.10k|          }
  954|  1.68k|        }
  955|    288|        if (*fmt == 'c') twelve_hour = false;  // probably uses %H
  ------------------
  |  Branch (955:13): [True: 1, False: 287]
  ------------------
  956|    288|        if (*fmt == 'X') twelve_hour = false;  // probably uses %H
  ------------------
  |  Branch (956:13): [True: 10, False: 278]
  ------------------
  957|    288|        if (*fmt != '\0') ++fmt;
  ------------------
  |  Branch (957:13): [True: 279, False: 9]
  ------------------
  958|    288|        break;
  959|     84|      case 'O':
  ------------------
  |  Branch (959:7): [True: 84, False: 22.7k]
  ------------------
  960|     84|        if (*fmt == 'H') twelve_hour = false;
  ------------------
  |  Branch (960:13): [True: 40, False: 44]
  ------------------
  961|     84|        if (*fmt == 'I') twelve_hour = true;
  ------------------
  |  Branch (961:13): [True: 20, False: 64]
  ------------------
  962|     84|        if (*fmt != '\0') ++fmt;
  ------------------
  |  Branch (962:13): [True: 78, False: 6]
  ------------------
  963|     84|        break;
  964|  22.8k|    }
  965|       |
  966|       |    // Parses the current specifier.
  967|  1.56k|    const char* const orig_data = data;
  968|  1.56k|    std::string spec(percent, fmt);
  969|  1.56k|    data = ParseTM(data, spec.c_str(), &tm);
  970|       |
  971|       |    // If we successfully parsed %p we need to remember whether the result
  972|       |    // was AM or PM so that we can adjust tm_hour before time_zone::lookup().
  973|       |    // So reparse the input with a known AM hour, and check if it is shifted
  974|       |    // to a PM hour.
  975|  1.56k|    if (spec == "%p" && data != nullptr) {
  ------------------
  |  Branch (975:9): [True: 267, False: 1.29k]
  |  Branch (975:25): [True: 260, False: 7]
  ------------------
  976|    260|      std::string test_input = "1";
  977|    260|      test_input.append(orig_data, data);
  978|    260|      std::tm tmp{};
  979|    260|      ParseTM(test_input.c_str(), "%I%p", &tmp);
  980|    260|      afternoon = (tmp.tm_hour == 13);
  981|    260|    }
  982|  1.56k|  }
  983|       |
  984|       |  // Adjust a 12-hour tm_hour value if it should be in the afternoon.
  985|  9.37k|  if (twelve_hour && afternoon && tm.tm_hour < 12) {
  ------------------
  |  Branch (985:7): [True: 46, False: 9.32k]
  |  Branch (985:22): [True: 7, False: 39]
  |  Branch (985:35): [True: 5, False: 2]
  ------------------
  986|      5|    tm.tm_hour += 12;
  987|      5|  }
  988|       |
  989|  9.37k|  if (data == nullptr) {
  ------------------
  |  Branch (989:7): [True: 2.50k, False: 6.86k]
  ------------------
  990|  2.50k|    if (err != nullptr) *err = "Failed to parse input";
  ------------------
  |  Branch (990:9): [True: 0, False: 2.50k]
  ------------------
  991|  2.50k|    return false;
  992|  2.50k|  }
  993|       |
  994|       |  // Skip any remaining whitespace.
  995|  7.06k|  while (isspace(*data)) ++data;
  ------------------
  |  Branch (995:10): [True: 196, False: 6.86k]
  ------------------
  996|       |
  997|       |  // parse() must consume the entire input string.
  998|  6.86k|  if (data != edata) {
  ------------------
  |  Branch (998:7): [True: 286, False: 6.58k]
  ------------------
  999|    286|    if (err != nullptr) *err = "Illegal trailing data in input string";
  ------------------
  |  Branch (999:9): [True: 0, False: 286]
  ------------------
 1000|    286|    return false;
 1001|    286|  }
 1002|       |
 1003|       |  // If we saw %s then we ignore anything else and return that time.
 1004|  6.58k|  if (saw_percent_s) {
  ------------------
  |  Branch (1004:7): [True: 303, False: 6.27k]
  ------------------
 1005|    303|    *sec = FromUnixSeconds(percent_s);
 1006|    303|    *fs = detail::femtoseconds::zero();
 1007|    303|    return true;
 1008|    303|  }
 1009|       |
 1010|       |  // If we saw %z, %Ez, or %E*z then we want to interpret the parsed fields
 1011|       |  // in UTC and then shift by that offset.  Otherwise we want to interpret
 1012|       |  // the fields directly in the passed time_zone.
 1013|  6.27k|  time_zone ptz = saw_offset ? utc_time_zone() : tz;
  ------------------
  |  Branch (1013:19): [True: 209, False: 6.07k]
  ------------------
 1014|       |
 1015|       |  // Allows a leap second of 60 to normalize forward to the following ":00".
 1016|  6.27k|  if (tm.tm_sec == 60) {
  ------------------
  |  Branch (1016:7): [True: 36, False: 6.24k]
  ------------------
 1017|     36|    tm.tm_sec -= 1;
 1018|     36|    offset -= 1;
 1019|     36|    subseconds = detail::femtoseconds::zero();
 1020|     36|  }
 1021|       |
 1022|  6.27k|  if (!saw_year) {
  ------------------
  |  Branch (1022:7): [True: 4.48k, False: 1.79k]
  ------------------
 1023|  4.48k|    year = year_t{tm.tm_year};
 1024|  4.48k|    if (year > kyearmax - 1900) {
  ------------------
  |  Branch (1024:9): [True: 0, False: 4.48k]
  ------------------
 1025|       |      // Platform-dependent, maybe unreachable.
 1026|      0|      if (err != nullptr) *err = "Out-of-range year";
  ------------------
  |  Branch (1026:11): [True: 0, False: 0]
  ------------------
 1027|      0|      return false;
 1028|      0|    }
 1029|  4.48k|    year += 1900;
 1030|  4.48k|  }
 1031|       |
 1032|       |  // Compute year, tm.tm_mon and tm.tm_mday if we parsed a week number.
 1033|  6.27k|  if (week_num != -1) {
  ------------------
  |  Branch (1033:7): [True: 349, False: 5.93k]
  ------------------
 1034|    349|    if (!FromWeek(week_num, week_start, &year, &tm)) {
  ------------------
  |  Branch (1034:9): [True: 2, False: 347]
  ------------------
 1035|      2|      if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1035:11): [True: 0, False: 2]
  ------------------
 1036|      2|      return false;
 1037|      2|    }
 1038|    349|  }
 1039|       |
 1040|  6.27k|  const int month = tm.tm_mon + 1;
 1041|  6.27k|  civil_second cs(year, month, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
 1042|       |
 1043|       |  // parse() should not allow normalization. Due to the restricted field
 1044|       |  // ranges above (see ParseInt()), the only possibility is for days to roll
 1045|       |  // into months. That is, parsing "Sep 31" should not produce "Oct 1".
 1046|  6.27k|  if (cs.month() != month || cs.day() != tm.tm_mday) {
  ------------------
  |  Branch (1046:7): [True: 1, False: 6.27k]
  |  Branch (1046:30): [True: 0, False: 6.27k]
  ------------------
 1047|      1|    if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1047:9): [True: 0, False: 1]
  ------------------
 1048|      1|    return false;
 1049|      1|  }
 1050|       |
 1051|       |  // Accounts for the offset adjustment before converting to absolute time.
 1052|  6.27k|  if ((offset < 0 && cs > civil_second::max() + offset) ||
  ------------------
  |  Branch (1052:7): [True: 1, False: 6.27k]
  |  Branch (1052:8): [True: 108, False: 6.16k]
  |  Branch (1052:22): [True: 0, False: 108]
  ------------------
 1053|  6.27k|      (offset > 0 && cs < civil_second::min() + offset)) {
  ------------------
  |  Branch (1053:8): [True: 100, False: 6.17k]
  |  Branch (1053:22): [True: 1, False: 99]
  ------------------
 1054|      1|    if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1054:9): [True: 0, False: 1]
  ------------------
 1055|      1|    return false;
 1056|      1|  }
 1057|  6.27k|  cs -= offset;
 1058|       |
 1059|  6.27k|  const auto tp = ptz.lookup(cs).pre;
 1060|       |  // Checks for overflow/underflow and returns an error as necessary.
 1061|  6.27k|  if (tp == time_point<seconds>::max()) {
  ------------------
  |  Branch (1061:7): [True: 385, False: 5.89k]
  ------------------
 1062|    385|    const auto al = ptz.lookup(time_point<seconds>::max());
 1063|    385|    if (cs > al.cs) {
  ------------------
  |  Branch (1063:9): [True: 252, False: 133]
  ------------------
 1064|    252|      if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1064:11): [True: 0, False: 252]
  ------------------
 1065|    252|      return false;
 1066|    252|    }
 1067|    385|  }
 1068|  6.02k|  if (tp == time_point<seconds>::min()) {
  ------------------
  |  Branch (1068:7): [True: 344, False: 5.67k]
  ------------------
 1069|    344|    const auto al = ptz.lookup(time_point<seconds>::min());
 1070|    344|    if (cs < al.cs) {
  ------------------
  |  Branch (1070:9): [True: 149, False: 195]
  ------------------
 1071|    149|      if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1071:11): [True: 0, False: 149]
  ------------------
 1072|    149|      return false;
 1073|    149|    }
 1074|    344|  }
 1075|       |
 1076|  5.87k|  *sec = tp;
 1077|  5.87k|  *fs = subseconds;
 1078|  5.87k|  return true;
 1079|  6.02k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_14ToTMERKNS_9time_zone15absolute_lookupE:
  121|  9.37k|std::tm ToTM(const time_zone::absolute_lookup& al) {
  122|  9.37k|  std::tm tm{};
  123|  9.37k|  tm.tm_sec = al.cs.second();
  124|  9.37k|  tm.tm_min = al.cs.minute();
  125|  9.37k|  tm.tm_hour = al.cs.hour();
  126|  9.37k|  tm.tm_mday = al.cs.day();
  127|  9.37k|  tm.tm_mon = al.cs.month() - 1;
  128|       |
  129|       |  // Saturate tm.tm_year in cases of over/underflow.
  130|  9.37k|  if (al.cs.year() < std::numeric_limits<int>::min() + 1900) {
  ------------------
  |  Branch (130:7): [True: 0, False: 9.37k]
  ------------------
  131|      0|    tm.tm_year = std::numeric_limits<int>::min();
  132|  9.37k|  } else if (al.cs.year() - 1900 > std::numeric_limits<int>::max()) {
  ------------------
  |  Branch (132:14): [True: 572, False: 8.80k]
  ------------------
  133|    572|    tm.tm_year = std::numeric_limits<int>::max();
  134|  8.80k|  } else {
  135|  8.80k|    tm.tm_year = static_cast<int>(al.cs.year() - 1900);
  136|  8.80k|  }
  137|       |
  138|  9.37k|  tm.tm_wday = ToTmWday(get_weekday(al.cs));
  139|  9.37k|  tm.tm_yday = get_yearday(al.cs) - 1;
  140|  9.37k|  tm.tm_isdst = al.is_dst ? 1 : 0;
  ------------------
  |  Branch (140:17): [True: 695, False: 8.67k]
  ------------------
  141|  9.37k|  return tm;
  142|  9.37k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18ToTmWdayENS0_7weekdayE:
   80|  9.37k|int ToTmWday(weekday wd) {
   81|  9.37k|  switch (wd) {
  ------------------
  |  Branch (81:11): [True: 9.37k, False: 0]
  ------------------
   82|    560|    case weekday::sunday:
  ------------------
  |  Branch (82:5): [True: 560, False: 8.81k]
  ------------------
   83|    560|      return 0;
   84|    462|    case weekday::monday:
  ------------------
  |  Branch (84:5): [True: 462, False: 8.91k]
  ------------------
   85|    462|      return 1;
   86|  6.47k|    case weekday::tuesday:
  ------------------
  |  Branch (86:5): [True: 6.47k, False: 2.90k]
  ------------------
   87|  6.47k|      return 2;
   88|    509|    case weekday::wednesday:
  ------------------
  |  Branch (88:5): [True: 509, False: 8.86k]
  ------------------
   89|    509|      return 3;
   90|    510|    case weekday::thursday:
  ------------------
  |  Branch (90:5): [True: 510, False: 8.86k]
  ------------------
   91|    510|      return 4;
   92|    398|    case weekday::friday:
  ------------------
  |  Branch (92:5): [True: 398, False: 8.97k]
  ------------------
   93|    398|      return 5;
   94|    464|    case weekday::saturday:
  ------------------
  |  Branch (94:5): [True: 464, False: 8.90k]
  ------------------
   95|    464|      return 6;
   96|  9.37k|  }
   97|      0|  return 0; /*NOTREACHED*/
   98|  9.37k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18FormatTMEPNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKS8_RK2tm:
  224|  55.9k|void FormatTM(std::string* out, const std::string& fmt, const std::tm& tm) {
  225|       |  // We assume that 16 times the length of the format string will
  226|       |  // be sufficient to store the result.  The extreme case appears
  227|       |  // to be "%c" (2 chars), which, in the POSIX locale, produces
  228|       |  // "Thu Jan 1 00:00:00 1970" (24 chars).
  229|  55.9k|  auto out_size = out->size();
  230|  55.9k|  auto buf_size = (16 * fmt.size()) + 1;
  231|  55.9k|  out->resize(out_size + buf_size);
  232|  55.9k|  auto len = strftime(&(*out)[out_size], buf_size, fmt.c_str(), &tm);
  233|  55.9k|  out->resize(out_size + len);
  234|  55.9k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18Format64EPcil:
  156|  13.7k|char* Format64(char* ep, int width, std::int_fast64_t v) {
  157|  13.7k|  bool neg = false;
  158|  13.7k|  if (v < 0) {
  ------------------
  |  Branch (158:7): [True: 832, False: 12.8k]
  ------------------
  159|    832|    --width;
  160|    832|    neg = true;
  161|    832|    if (v == std::numeric_limits<std::int_fast64_t>::min()) {
  ------------------
  |  Branch (161:9): [True: 0, False: 832]
  ------------------
  162|       |      // Avoid negating minimum value.
  163|      0|      std::int_fast64_t last_digit = -(v % 10);
  164|      0|      v /= 10;
  165|      0|      if (last_digit < 0) {
  ------------------
  |  Branch (165:11): [True: 0, False: 0]
  ------------------
  166|      0|        ++v;
  167|      0|        last_digit += 10;
  168|      0|      }
  169|      0|      --width;
  170|      0|      *--ep = kDigits[last_digit];
  171|      0|    }
  172|    832|    v = -v;
  173|    832|  }
  174|  92.9k|  do {
  175|  92.9k|    --width;
  176|  92.9k|    *--ep = kDigits[v % 10];
  177|  92.9k|  } while (v /= 10);
  ------------------
  |  Branch (177:12): [True: 79.2k, False: 13.7k]
  ------------------
  178|  67.9k|  while (--width >= 0) *--ep = '0';  // zero pad
  ------------------
  |  Branch (178:10): [True: 54.2k, False: 13.7k]
  ------------------
  179|  13.7k|  if (neg) *--ep = '-';
  ------------------
  |  Branch (179:7): [True: 832, False: 12.8k]
  ------------------
  180|  13.7k|  return ep;
  181|  13.7k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_19Format02dEPci:
  184|  49.4k|char* Format02d(char* ep, int v) {
  185|  49.4k|  *--ep = kDigits[v % 10];
  186|  49.4k|  *--ep = kDigits[(v / 10) % 10];
  187|  49.4k|  return ep;
  188|  49.4k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_16ToWeekERKNS0_10civil_timeINS0_7day_tagEEENS0_7weekdayE:
  146|  3.44k|int ToWeek(const civil_day& cd, weekday week_start) {
  147|  3.44k|  const civil_day d(cd.year() % 400, cd.month(), cd.day());
  148|  3.44k|  return static_cast<int>((d - prev_weekday(civil_year(d), week_start)) / 7);
  149|  3.44k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_112FormatOffsetEPciPKc:
  191|  18.8k|char* FormatOffset(char* ep, int offset, const char* mode) {
  192|       |  // TODO: Follow the RFC3339 "Unknown Local Offset Convention" and
  193|       |  // generate a "negative zero" when we're formatting a zero offset
  194|       |  // as the result of a failed load_time_zone().
  195|  18.8k|  char sign = '+';
  196|  18.8k|  if (offset < 0) {
  ------------------
  |  Branch (196:7): [True: 4.74k, False: 14.1k]
  ------------------
  197|  4.74k|    offset = -offset;  // bounded by -25h so no overflow
  198|  4.74k|    sign = '-';
  199|  4.74k|  }
  200|  18.8k|  const int seconds = offset % 60;
  201|  18.8k|  const int minutes = (offset /= 60) % 60;
  202|  18.8k|  const int hours = offset /= 60;
  203|  18.8k|  const char sep = mode[0];
  204|  18.8k|  const bool ext = (sep != '\0' && mode[1] == '*');
  ------------------
  |  Branch (204:21): [True: 17.0k, False: 1.87k]
  |  Branch (204:36): [True: 7.69k, False: 9.32k]
  ------------------
  205|  18.8k|  const bool ccc = (ext && mode[2] == ':');
  ------------------
  |  Branch (205:21): [True: 7.69k, False: 11.2k]
  |  Branch (205:28): [True: 3.50k, False: 4.19k]
  ------------------
  206|  18.8k|  if (ext && (!ccc || seconds != 0)) {
  ------------------
  |  Branch (206:7): [True: 7.69k, False: 11.2k]
  |  Branch (206:15): [True: 4.19k, False: 3.50k]
  |  Branch (206:23): [True: 416, False: 3.08k]
  ------------------
  207|  4.61k|    ep = Format02d(ep, seconds);
  208|  4.61k|    *--ep = sep;
  209|  14.2k|  } else {
  210|       |    // If we're not rendering seconds, sub-minute negative offsets
  211|       |    // should get a positive sign (e.g., offset=-10s => "+00:00").
  212|  14.2k|    if (hours == 0 && minutes == 0) sign = '+';
  ------------------
  |  Branch (212:9): [True: 4.84k, False: 9.44k]
  |  Branch (212:23): [True: 3.85k, False: 991]
  ------------------
  213|  14.2k|  }
  214|  18.8k|  if (!ccc || minutes != 0 || seconds != 0) {
  ------------------
  |  Branch (214:7): [True: 15.3k, False: 3.50k]
  |  Branch (214:15): [True: 419, False: 3.08k]
  |  Branch (214:31): [True: 207, False: 2.87k]
  ------------------
  215|  16.0k|    ep = Format02d(ep, minutes);
  216|  16.0k|    if (sep != '\0') *--ep = sep;
  ------------------
  |  Branch (216:9): [True: 14.1k, False: 1.87k]
  ------------------
  217|  16.0k|  }
  218|  18.8k|  ep = Format02d(ep, hours);  // bounded by 26h so fits in two digits
  219|  18.8k|  *--ep = sign;
  220|  18.8k|  return ep;
  221|  18.8k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_17isdigitEc:
   60|  32.7k|bool isdigit(char ch) {
   61|  32.7k|  return std::isdigit(static_cast<unsigned char>(ch)) != 0;
   62|  32.7k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_17isspaceEc:
   64|   311k|bool isspace(char ch) {
   65|   311k|  return std::isspace(static_cast<unsigned char>(ch)) != 0;
   66|   311k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_111ParseOffsetEPKcS3_Pi:
  593|  6.00k|const char* ParseOffset(const char* dp, const char* mode, int* offset) {
  594|  6.00k|  if (dp != nullptr) {
  ------------------
  |  Branch (594:7): [True: 6.00k, False: 0]
  ------------------
  595|  6.00k|    const char first = *dp++;
  596|  6.00k|    if (first == '+' || first == '-') {
  ------------------
  |  Branch (596:9): [True: 1.19k, False: 4.81k]
  |  Branch (596:25): [True: 3.32k, False: 1.49k]
  ------------------
  597|  4.51k|      char sep = mode[0];
  598|  4.51k|      int hours = 0;
  599|  4.51k|      int minutes = 0;
  600|  4.51k|      int seconds = 0;
  601|  4.51k|      const char* ap = ParseInt(dp, 2, 0, 23, &hours);
  602|  4.51k|      if (ap != nullptr && ap - dp == 2) {
  ------------------
  |  Branch (602:11): [True: 4.48k, False: 32]
  |  Branch (602:28): [True: 4.46k, False: 14]
  ------------------
  603|  4.46k|        dp = ap;
  604|  4.46k|        if (sep != '\0' && *ap == sep) ++ap;
  ------------------
  |  Branch (604:13): [True: 1.75k, False: 2.71k]
  |  Branch (604:28): [True: 19, False: 1.73k]
  ------------------
  605|  4.46k|        const char* bp = ParseInt(ap, 2, 0, 59, &minutes);
  606|  4.46k|        if (bp != nullptr && bp - ap == 2) {
  ------------------
  |  Branch (606:13): [True: 2.88k, False: 1.58k]
  |  Branch (606:30): [True: 2.12k, False: 759]
  ------------------
  607|  2.12k|          dp = bp;
  608|  2.12k|          if (sep != '\0' && *bp == sep) ++bp;
  ------------------
  |  Branch (608:15): [True: 911, False: 1.21k]
  |  Branch (608:30): [True: 10, False: 901]
  ------------------
  609|  2.12k|          const char* cp = ParseInt(bp, 2, 0, 59, &seconds);
  610|  2.12k|          if (cp != nullptr && cp - bp == 2) dp = cp;
  ------------------
  |  Branch (610:15): [True: 694, False: 1.43k]
  |  Branch (610:32): [True: 435, False: 259]
  ------------------
  611|  2.12k|        }
  612|  4.46k|        *offset = ((hours * 60 + minutes) * 60) + seconds;
  613|  4.46k|        if (first == '-') *offset = -*offset;
  ------------------
  |  Branch (613:13): [True: 3.29k, False: 1.17k]
  ------------------
  614|  4.46k|      } else {
  615|     46|        dp = nullptr;
  616|     46|      }
  617|  4.51k|    } else if (first == 'Z' || first == 'z') {  // Zulu
  ------------------
  |  Branch (617:16): [True: 764, False: 731]
  |  Branch (617:32): [True: 665, False: 66]
  ------------------
  618|  1.42k|      *offset = 0;
  619|  1.42k|    } else {
  620|     66|      dp = nullptr;
  621|     66|    }
  622|  6.00k|  }
  623|  6.00k|  return dp;
  624|  6.00k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_19ParseZoneEPKcPNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  626|    982|const char* ParseZone(const char* dp, std::string* zone) {
  627|    982|  zone->clear();
  628|    982|  if (dp != nullptr) {
  ------------------
  |  Branch (628:7): [True: 982, False: 0]
  ------------------
  629|   264k|    while (*dp != '\0' && !isspace(*dp)) zone->push_back(*dp++);
  ------------------
  |  Branch (629:12): [True: 264k, False: 275]
  |  Branch (629:27): [True: 263k, False: 707]
  ------------------
  630|    982|    if (zone->empty()) dp = nullptr;
  ------------------
  |  Branch (630:9): [True: 23, False: 959]
  ------------------
  631|    982|  }
  632|    982|  return dp;
  633|    982|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_115ParseSubSecondsEPKcPNSt3__16chrono8durationIlNS4_5ratioILl1ELl1000000000000000EEEEE:
  635|  1.23k|const char* ParseSubSeconds(const char* dp, detail::femtoseconds* subseconds) {
  636|  1.23k|  if (dp != nullptr) {
  ------------------
  |  Branch (636:7): [True: 1.23k, False: 0]
  ------------------
  637|  1.23k|    std::int_fast64_t v = 0;
  638|  1.23k|    std::int_fast64_t exp = 0;
  639|  1.23k|    const char* const bp = dp;
  640|  3.59k|    while (const char* cp = strchr(kDigits, *dp)) {
  ------------------
  |  Branch (640:24): [True: 2.41k, False: 1.18k]
  ------------------
  641|  2.41k|      int d = static_cast<int>(cp - kDigits);
  642|  2.41k|      if (d >= 10) break;
  ------------------
  |  Branch (642:11): [True: 51, False: 2.36k]
  ------------------
  643|  2.36k|      if (exp < 15) {
  ------------------
  |  Branch (643:11): [True: 2.03k, False: 332]
  ------------------
  644|  2.03k|        exp += 1;
  645|  2.03k|        v *= 10;
  646|  2.03k|        v += d;
  647|  2.03k|      }
  648|  2.36k|      ++dp;
  649|  2.36k|    }
  650|  1.23k|    if (dp != bp) {
  ------------------
  |  Branch (650:9): [True: 1.22k, False: 8]
  ------------------
  651|  1.22k|      v *= kExp10[15 - exp];
  652|  1.22k|      *subseconds = detail::femtoseconds(v);
  653|  1.22k|    } else {
  654|      8|      dp = nullptr;
  655|      8|    }
  656|  1.23k|  }
  657|  1.23k|  return dp;
  658|  1.23k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_17ParseTMEPKcS3_P2tm:
  661|  1.82k|const char* ParseTM(const char* dp, const char* fmt, std::tm* tm) {
  662|  1.82k|  if (dp != nullptr) {
  ------------------
  |  Branch (662:7): [True: 1.82k, False: 0]
  ------------------
  663|  1.82k|    dp = strptime(dp, fmt, tm);
  664|  1.82k|  }
  665|  1.82k|  return dp;
  666|  1.82k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18FromWeekEiNS0_7weekdayEPlP2tm:
  671|    349|bool FromWeek(int week_num, weekday week_start, year_t* year, std::tm* tm) {
  672|    349|  const civil_year y(*year % 400);
  673|    349|  civil_day cd = prev_weekday(y, week_start);  // week 0
  674|    349|  cd = next_weekday(cd - 1, FromTmWday(tm->tm_wday)) + (week_num * 7);
  675|    349|  if (const year_t shift = cd.year() - y.year()) {
  ------------------
  |  Branch (675:20): [True: 211, False: 138]
  ------------------
  676|    211|    if (shift > 0) {
  ------------------
  |  Branch (676:9): [True: 73, False: 138]
  ------------------
  677|     73|      if (*year > std::numeric_limits<year_t>::max() - shift) return false;
  ------------------
  |  Branch (677:11): [True: 1, False: 72]
  ------------------
  678|    138|    } else {
  679|    138|      if (*year < std::numeric_limits<year_t>::min() - shift) return false;
  ------------------
  |  Branch (679:11): [True: 1, False: 137]
  ------------------
  680|    138|    }
  681|    209|    *year += shift;
  682|    209|  }
  683|    347|  tm->tm_mon = cd.month() - 1;
  684|    347|  tm->tm_mday = cd.day();
  685|    347|  return true;
  686|    349|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_110FromTmWdayEi:
  101|    349|weekday FromTmWday(int tm_wday) {
  102|    349|  switch (tm_wday) {
  ------------------
  |  Branch (102:11): [True: 349, False: 0]
  ------------------
  103|     12|    case 0:
  ------------------
  |  Branch (103:5): [True: 12, False: 337]
  ------------------
  104|     12|      return weekday::sunday;
  105|     21|    case 1:
  ------------------
  |  Branch (105:5): [True: 21, False: 328]
  ------------------
  106|     21|      return weekday::monday;
  107|      2|    case 2:
  ------------------
  |  Branch (107:5): [True: 2, False: 347]
  ------------------
  108|      2|      return weekday::tuesday;
  109|     15|    case 3:
  ------------------
  |  Branch (109:5): [True: 15, False: 334]
  ------------------
  110|     15|      return weekday::wednesday;
  111|    286|    case 4:
  ------------------
  |  Branch (111:5): [True: 286, False: 63]
  ------------------
  112|    286|      return weekday::thursday;
  113|      7|    case 5:
  ------------------
  |  Branch (113:5): [True: 7, False: 342]
  ------------------
  114|      7|      return weekday::friday;
  115|      6|    case 6:
  ------------------
  |  Branch (115:5): [True: 6, False: 343]
  ------------------
  116|      6|      return weekday::saturday;
  117|    349|  }
  118|      0|  return weekday::sunday; /*NOTREACHED*/
  119|    349|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18ParseIntIiEEPKcS4_iT_S5_PS5_:
  238|  43.6k|const char* ParseInt(const char* dp, int width, T min, T max, T* vp) {
  239|  43.6k|  if (dp != nullptr) {
  ------------------
  |  Branch (239:7): [True: 42.6k, False: 980]
  ------------------
  240|  42.6k|    const T kmin = std::numeric_limits<T>::min();
  241|  42.6k|    bool erange = false;
  242|  42.6k|    bool neg = false;
  243|  42.6k|    T value = 0;
  244|  42.6k|    if (*dp == '-') {
  ------------------
  |  Branch (244:9): [True: 2.19k, False: 40.4k]
  ------------------
  245|  2.19k|      neg = true;
  246|  2.19k|      if (width <= 0 || --width != 0) {
  ------------------
  |  Branch (246:11): [True: 191, False: 2.00k]
  |  Branch (246:25): [True: 2.00k, False: 0]
  ------------------
  247|  2.19k|        ++dp;
  248|  2.19k|      } else {
  249|      0|        dp = nullptr;  // width was 1
  250|      0|      }
  251|  2.19k|    }
  252|  42.6k|    if (const char* const bp = dp) {
  ------------------
  |  Branch (252:27): [True: 42.6k, False: 0]
  ------------------
  253|   204k|      while (const char* cp = strchr(kDigits, *dp)) {
  ------------------
  |  Branch (253:26): [True: 179k, False: 24.9k]
  ------------------
  254|   179k|        int d = static_cast<int>(cp - kDigits);
  255|   179k|        if (d >= 10) break;
  ------------------
  |  Branch (255:13): [True: 2.08k, False: 177k]
  ------------------
  256|   177k|        if (value < kmin / 10) {
  ------------------
  |  Branch (256:13): [True: 1.53k, False: 175k]
  ------------------
  257|  1.53k|          erange = true;
  258|  1.53k|          break;
  259|  1.53k|        }
  260|   175k|        value *= 10;
  261|   175k|        if (value < kmin + d) {
  ------------------
  |  Branch (261:13): [True: 330, False: 175k]
  ------------------
  262|    330|          erange = true;
  263|    330|          break;
  264|    330|        }
  265|   175k|        value -= d;
  266|   175k|        dp += 1;
  267|   175k|        if (width > 0 && --width == 0) break;
  ------------------
  |  Branch (267:13): [True: 28.8k, False: 146k]
  |  Branch (267:26): [True: 13.7k, False: 15.1k]
  ------------------
  268|   175k|      }
  269|  42.6k|      if (dp != bp && !erange && (neg || value != kmin)) {
  ------------------
  |  Branch (269:11): [True: 41.3k, False: 1.23k]
  |  Branch (269:23): [True: 39.5k, False: 1.86k]
  |  Branch (269:35): [True: 2.16k, False: 37.3k]
  |  Branch (269:42): [True: 28.4k, False: 8.96k]
  ------------------
  270|  30.5k|        if (!neg || value != 0) {
  ------------------
  |  Branch (270:13): [True: 28.4k, False: 2.16k]
  |  Branch (270:21): [True: 880, False: 1.28k]
  ------------------
  271|  29.2k|          if (!neg) value = -value;  // make positive
  ------------------
  |  Branch (271:15): [True: 28.4k, False: 880]
  ------------------
  272|  29.2k|          if (min <= value && value <= max) {
  ------------------
  |  Branch (272:15): [True: 28.3k, False: 888]
  |  Branch (272:31): [True: 23.8k, False: 4.54k]
  ------------------
  273|  23.8k|            *vp = value;
  274|  23.8k|          } else {
  275|  5.42k|            dp = nullptr;
  276|  5.42k|          }
  277|  29.2k|        } else {
  278|  1.28k|          dp = nullptr;
  279|  1.28k|        }
  280|  30.5k|      } else {
  281|  12.0k|        dp = nullptr;
  282|  12.0k|      }
  283|  42.6k|    }
  284|  42.6k|  }
  285|  43.6k|  return dp;
  286|  43.6k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18ParseIntIlEEPKcS4_iT_S5_PS5_:
  238|  4.29k|const char* ParseInt(const char* dp, int width, T min, T max, T* vp) {
  239|  4.29k|  if (dp != nullptr) {
  ------------------
  |  Branch (239:7): [True: 4.29k, False: 0]
  ------------------
  240|  4.29k|    const T kmin = std::numeric_limits<T>::min();
  241|  4.29k|    bool erange = false;
  242|  4.29k|    bool neg = false;
  243|  4.29k|    T value = 0;
  244|  4.29k|    if (*dp == '-') {
  ------------------
  |  Branch (244:9): [True: 2.11k, False: 2.18k]
  ------------------
  245|  2.11k|      neg = true;
  246|  2.11k|      if (width <= 0 || --width != 0) {
  ------------------
  |  Branch (246:11): [True: 2.06k, False: 50]
  |  Branch (246:25): [True: 50, False: 0]
  ------------------
  247|  2.11k|        ++dp;
  248|  2.11k|      } else {
  249|      0|        dp = nullptr;  // width was 1
  250|      0|      }
  251|  2.11k|    }
  252|  4.29k|    if (const char* const bp = dp) {
  ------------------
  |  Branch (252:27): [True: 4.29k, False: 0]
  ------------------
  253|  36.2k|      while (const char* cp = strchr(kDigits, *dp)) {
  ------------------
  |  Branch (253:26): [True: 34.8k, False: 1.40k]
  ------------------
  254|  34.8k|        int d = static_cast<int>(cp - kDigits);
  255|  34.8k|        if (d >= 10) break;
  ------------------
  |  Branch (255:13): [True: 2.44k, False: 32.4k]
  ------------------
  256|  32.4k|        if (value < kmin / 10) {
  ------------------
  |  Branch (256:13): [True: 195, False: 32.2k]
  ------------------
  257|    195|          erange = true;
  258|    195|          break;
  259|    195|        }
  260|  32.2k|        value *= 10;
  261|  32.2k|        if (value < kmin + d) {
  ------------------
  |  Branch (261:13): [True: 3, False: 32.2k]
  ------------------
  262|      3|          erange = true;
  263|      3|          break;
  264|      3|        }
  265|  32.2k|        value -= d;
  266|  32.2k|        dp += 1;
  267|  32.2k|        if (width > 0 && --width == 0) break;
  ------------------
  |  Branch (267:13): [True: 1.07k, False: 31.1k]
  |  Branch (267:26): [True: 257, False: 813]
  ------------------
  268|  32.2k|      }
  269|  4.29k|      if (dp != bp && !erange && (neg || value != kmin)) {
  ------------------
  |  Branch (269:11): [True: 4.19k, False: 98]
  |  Branch (269:23): [True: 4.00k, False: 198]
  |  Branch (269:35): [True: 2.08k, False: 1.91k]
  |  Branch (269:42): [True: 1.90k, False: 3]
  ------------------
  270|  3.99k|        if (!neg || value != 0) {
  ------------------
  |  Branch (270:13): [True: 1.90k, False: 2.08k]
  |  Branch (270:21): [True: 2.08k, False: 4]
  ------------------
  271|  3.99k|          if (!neg) value = -value;  // make positive
  ------------------
  |  Branch (271:15): [True: 1.90k, False: 2.08k]
  ------------------
  272|  3.99k|          if (min <= value && value <= max) {
  ------------------
  |  Branch (272:15): [True: 3.99k, False: 0]
  |  Branch (272:31): [True: 3.99k, False: 0]
  ------------------
  273|  3.99k|            *vp = value;
  274|  3.99k|          } else {
  275|      0|            dp = nullptr;
  276|      0|          }
  277|  3.99k|        } else {
  278|      4|          dp = nullptr;
  279|      4|        }
  280|  3.99k|      } else {
  281|    299|        dp = nullptr;
  282|    299|      }
  283|  4.29k|    }
  284|  4.29k|  }
  285|  4.29k|  return dp;
  286|  4.29k|}

_ZN4cctz10TimeZoneIf3UTCEv:
   21|      1|std::unique_ptr<TimeZoneIf> TimeZoneIf::UTC() {
   22|      1|  return TimeZoneInfo::UTC();
   23|      1|}
_ZN4cctz10TimeZoneIf4MakeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   25|  1.55k|std::unique_ptr<TimeZoneIf> TimeZoneIf::Make(const std::string& name) {
   26|       |  // Support "libc:localtime" and "libc:*" to access the legacy
   27|       |  // localtime and UTC support respectively from the C library.
   28|       |  // NOTE: The "libc:*" zones are internal, test-only interfaces, and
   29|       |  // are subject to change/removal without notice. Do not use them.
   30|  1.55k|  if (name.compare(0, 5, "libc:") == 0) {
  ------------------
  |  Branch (30:7): [True: 256, False: 1.30k]
  ------------------
   31|    256|    return TimeZoneLibC::Make(name.substr(5));
   32|    256|  }
   33|       |
   34|       |  // Otherwise use the "zoneinfo" implementation.
   35|  1.30k|  return TimeZoneInfo::Make(name);
   36|  1.55k|}
_ZN4cctz10TimeZoneIfD2Ev:
   39|    715|TimeZoneIf::~TimeZoneIf() {}

_ZN4cctz13ToUnixSecondsERKNSt3__16chrono10time_pointINS1_12system_clockENS1_8durationIlNS0_5ratioILl1ELl1EEEEEEE:
   61|  14.3k|inline std::int_fast64_t ToUnixSeconds(const time_point<seconds>& tp) {
   62|  14.3k|  return (tp - std::chrono::time_point_cast<seconds>(
   63|  14.3k|                   std::chrono::system_clock::from_time_t(0))).count();
   64|  14.3k|}
_ZN4cctz15FromUnixSecondsEl:
   65|  15.4k|inline time_point<seconds> FromUnixSeconds(std::int_fast64_t t) {
   66|  15.4k|  return std::chrono::time_point_cast<seconds>(
   67|  15.4k|             std::chrono::system_clock::from_time_t(0)) + seconds(t);
   68|  15.4k|}
_ZN4cctz10TimeZoneIfC2Ev:
   52|  1.56k|  TimeZoneIf() = default;

_ZN4cctz9time_zone4Impl3UTCEv:
   45|    209|time_zone time_zone::Impl::UTC() {
   46|    209|  return time_zone(UTCImpl());
   47|    209|}
_ZN4cctz9time_zone4Impl12LoadTimeZoneERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPS0_:
   49|  10.0k|bool time_zone::Impl::LoadTimeZone(const std::string& name, time_zone* tz) {
   50|  10.0k|  const Impl* const utc_impl = UTCImpl();
   51|       |
   52|       |  // Check for UTC (which is never a key in time_zone_map).
   53|  10.0k|  auto offset = seconds::zero();
   54|  10.0k|  if (FixedOffsetFromName(name, &offset) && offset == seconds::zero()) {
  ------------------
  |  Branch (54:7): [True: 2.11k, False: 7.96k]
  |  Branch (54:7): [True: 1.73k, False: 8.35k]
  |  Branch (54:45): [True: 1.73k, False: 384]
  ------------------
   55|  1.73k|    *tz = time_zone(utc_impl);
   56|  1.73k|    return true;
   57|  1.73k|  }
   58|       |
   59|       |  // Check whether the time zone has already been loaded.
   60|  8.35k|  {
   61|  8.35k|    std::lock_guard<std::mutex> lock(TimeZoneMutex());
   62|  8.35k|    if (time_zone_map != nullptr) {
  ------------------
  |  Branch (62:9): [True: 8.35k, False: 1]
  ------------------
   63|  8.35k|      TimeZoneImplByName::const_iterator itr = time_zone_map->find(name);
   64|  8.35k|      if (itr != time_zone_map->end()) {
  ------------------
  |  Branch (64:11): [True: 6.79k, False: 1.55k]
  ------------------
   65|  6.79k|        *tz = time_zone(itr->second);
   66|  6.79k|        return itr->second != utc_impl;
   67|  6.79k|      }
   68|  8.35k|    }
   69|  8.35k|  }
   70|       |
   71|       |  // Load the new time zone (outside the lock).
   72|  1.55k|  std::unique_ptr<const Impl> new_impl(new Impl(name));
   73|       |
   74|       |  // Add the new time zone to the map.
   75|  1.55k|  std::lock_guard<std::mutex> lock(TimeZoneMutex());
   76|  1.55k|  if (time_zone_map == nullptr) time_zone_map = new TimeZoneImplByName;
  ------------------
  |  Branch (76:7): [True: 1, False: 1.55k]
  ------------------
   77|  1.55k|  if (!new_impl->zone_) {
  ------------------
  |  Branch (77:7): [True: 715, False: 844]
  ------------------
   78|       |    // Load failed, but a successful insertion may have happened concurrently.
   79|       |    // Check it now that we have the lock. Otherwise, avoid caching negative
   80|       |    // entries to avoid unbounded growth and DoS attacks.
   81|    715|    auto itr = time_zone_map->find(name);
   82|    715|    const Impl* impl = (itr != time_zone_map->end()) ? itr->second : utc_impl;
  ------------------
  |  Branch (82:24): [True: 0, False: 715]
  ------------------
   83|    715|    *tz = time_zone(impl);
   84|    715|    return impl != utc_impl;
   85|    715|  }
   86|    844|  const Impl*& impl = (*time_zone_map)[name];
   87|    844|  if (impl == nullptr) {  // this thread won any load race
  ------------------
  |  Branch (87:7): [True: 844, False: 0]
  ------------------
   88|    844|    impl = new_impl.release();
   89|    844|  }
   90|    844|  *tz = time_zone(impl);
   91|    844|  return impl != utc_impl;
   92|  1.55k|}
_ZN4cctz9time_zone4ImplC2Ev:
  109|      1|time_zone::Impl::Impl() : name_("UTC"), zone_(TimeZoneIf::UTC()) {}
_ZN4cctz9time_zone4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  112|  1.55k|    : name_(name), zone_(TimeZoneIf::Make(name_)) {}
_ZN4cctz9time_zone4Impl7UTCImplEv:
  114|  10.2k|const time_zone::Impl* time_zone::Impl::UTCImpl() {
  115|  10.2k|  static const Impl* utc_impl = new Impl;
  116|  10.2k|  return utc_impl;
  117|  10.2k|}
time_zone_impl.cc:_ZN4cctz12_GLOBAL__N_113TimeZoneMutexEv:
   36|  9.91k|std::mutex& TimeZoneMutex() {
   37|       |  // This mutex is intentionally "leaked" to avoid the static deinitialization
   38|       |  // order fiasco (std::mutex's destructor is not trivial on many platforms).
   39|  9.91k|  static std::mutex* time_zone_mutex = new std::mutex;
   40|  9.91k|  return *time_zone_mutex;
   41|  9.91k|}

_ZNK4cctz9time_zone4Impl9BreakTimeERKNSt3__16chrono10time_pointINS3_12system_clockENS3_8durationIlNS2_5ratioILl1ELl1EEEEEEE:
   49|  10.1k|  time_zone::absolute_lookup BreakTime(const time_point<seconds>& tp) const {
   50|  10.1k|    return zone_->BreakTime(tp);
   51|  10.1k|  }
_ZNK4cctz9time_zone4Impl8MakeTimeERKNS_6detail10civil_timeINS2_10second_tagEEE:
   56|  15.6k|  time_zone::civil_lookup MakeTime(const civil_second& cs) const {
   57|  15.6k|    return zone_->MakeTime(cs);
   58|  15.6k|  }

_ZN4cctz12TimeZoneInfo17GetTransitionTypeElbRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPh:
  273|    385|                                     std::uint_least8_t* index) {
  274|    385|  std::size_t type_index = 0;
  275|    385|  std::size_t abbr_index = abbreviations_.size();
  276|    580|  for (; type_index != transition_types_.size(); ++type_index) {
  ------------------
  |  Branch (276:10): [True: 580, False: 0]
  ------------------
  277|    580|    const TransitionType& tt(transition_types_[type_index]);
  278|    580|    const char* tt_abbr = &abbreviations_[tt.abbr_index];
  279|    580|    if (tt_abbr == abbr) abbr_index = tt.abbr_index;
  ------------------
  |  Branch (279:9): [True: 385, False: 195]
  ------------------
  280|    580|    if (tt.utc_offset == utc_offset && tt.is_dst == is_dst) {
  ------------------
  |  Branch (280:9): [True: 403, False: 177]
  |  Branch (280:40): [True: 397, False: 6]
  ------------------
  281|    397|      if (abbr_index == tt.abbr_index) break;  // reuse
  ------------------
  |  Branch (281:11): [True: 385, False: 12]
  ------------------
  282|    397|    }
  283|    580|  }
  284|    385|  if (type_index > 255 || abbr_index > 255) {
  ------------------
  |  Branch (284:7): [True: 0, False: 385]
  |  Branch (284:27): [True: 0, False: 385]
  ------------------
  285|       |    // No index space (8 bits) available for a new type or abbreviation.
  286|      0|    return false;
  287|      0|  }
  288|    385|  if (type_index == transition_types_.size()) {
  ------------------
  |  Branch (288:7): [True: 0, False: 385]
  ------------------
  289|      0|    TransitionType& tt(*transition_types_.emplace(transition_types_.end()));
  290|      0|    tt.utc_offset = static_cast<std::int_least32_t>(utc_offset);
  291|      0|    tt.is_dst = is_dst;
  292|      0|    if (abbr_index == abbreviations_.size()) {
  ------------------
  |  Branch (292:9): [True: 0, False: 0]
  ------------------
  293|      0|      abbreviations_.append(abbr);
  294|      0|      abbreviations_.append(1, '\0');
  295|      0|    }
  296|      0|    tt.abbr_index = static_cast<std::uint_least8_t>(abbr_index);
  297|      0|  }
  298|    385|  *index = static_cast<std::uint_least8_t>(type_index);
  299|    385|  return true;
  300|    385|}
_ZNK4cctz12TimeZoneInfo16EquivTransitionsEhh:
  306|    139|                                    std::uint_fast8_t tt2_index) const {
  307|    139|  if (tt1_index == tt2_index) return true;
  ------------------
  |  Branch (307:7): [True: 139, False: 0]
  ------------------
  308|      0|  const TransitionType& tt1(transition_types_[tt1_index]);
  309|      0|  const TransitionType& tt2(transition_types_[tt2_index]);
  310|      0|  if (tt1.utc_offset != tt2.utc_offset) return false;
  ------------------
  |  Branch (310:7): [True: 0, False: 0]
  ------------------
  311|      0|  if (tt1.is_dst != tt2.is_dst) return false;
  ------------------
  |  Branch (311:7): [True: 0, False: 0]
  ------------------
  312|      0|  if (tt1.abbr_index != tt2.abbr_index) return false;
  ------------------
  |  Branch (312:7): [True: 0, False: 0]
  ------------------
  313|      0|  return true;
  314|      0|}
_ZN4cctz12TimeZoneInfo17ExtendTransitionsEv:
  318|    262|bool TimeZoneInfo::ExtendTransitions() {
  319|    262|  extended_ = false;
  320|    262|  if (future_spec_.empty()) return true;  // last transition prevails
  ------------------
  |  Branch (320:7): [True: 0, False: 262]
  ------------------
  321|       |
  322|    262|  PosixTimeZone posix;
  323|    262|  if (!ParsePosixSpec(future_spec_, &posix)) return false;
  ------------------
  |  Branch (323:7): [True: 0, False: 262]
  ------------------
  324|       |
  325|       |  // Find transition type for the future std specification.
  326|    262|  std::uint_least8_t std_ti;
  327|    262|  if (!GetTransitionType(posix.std_offset, false, posix.std_abbr, &std_ti))
  ------------------
  |  Branch (327:7): [True: 0, False: 262]
  ------------------
  328|      0|    return false;
  329|       |
  330|    262|  if (posix.dst_abbr.empty()) {  // std only
  ------------------
  |  Branch (330:7): [True: 139, False: 123]
  ------------------
  331|       |    // The future specification should match the last transition, and
  332|       |    // that means that handling the future will fall out naturally.
  333|    139|    return EquivTransitions(transitions_.back().type_index, std_ti);
  334|    139|  }
  335|       |
  336|       |  // Find transition type for the future dst specification.
  337|    123|  std::uint_least8_t dst_ti;
  338|    123|  if (!GetTransitionType(posix.dst_offset, true, posix.dst_abbr, &dst_ti))
  ------------------
  |  Branch (338:7): [True: 0, False: 123]
  ------------------
  339|      0|    return false;
  340|       |
  341|    123|  if (AllYearDST(posix)) {  // dst only
  ------------------
  |  Branch (341:7): [True: 0, False: 123]
  ------------------
  342|       |    // The future specification should match the last transition, and
  343|       |    // that means that handling the future will fall out naturally.
  344|      0|    return EquivTransitions(transitions_.back().type_index, dst_ti);
  345|      0|  }
  346|       |
  347|       |  // We require that zoneinfo data with a rule for future transitions
  348|       |  // ends with a non-negative transition.  This removes the need to add
  349|       |  // any "second-half" transition to ensure differences between adjacent
  350|       |  // transitions are always representable, while also guaranteeing that
  351|       |  // the arithmetic used to shift between 400-year cycles never overflows.
  352|       |  // All valid zones easily meet this requirement.
  353|    123|  if (transitions_.back().unix_time < 0) return false;
  ------------------
  |  Branch (353:7): [True: 0, False: 123]
  ------------------
  354|       |
  355|       |  // Extend the transitions for an additional 401 years using the future
  356|       |  // specification. Years beyond those can be handled by mapping back to
  357|       |  // a cycle-equivalent year within that range. Note that we need 401
  358|       |  // (well, at least the first transition in the 401st year) so that the
  359|       |  // end of the 400th year is mapped back to an extended year. And first
  360|       |  // we may also need two additional transitions for the current year.
  361|    123|  transitions_.reserve(transitions_.size() + 2 + 401 * 2);
  362|    123|  extended_ = true;
  363|       |
  364|    123|  const Transition& last(transitions_.back());
  365|    123|  const std::int_fast64_t last_time = last.unix_time;
  366|    123|  const TransitionType& last_tt(transition_types_[last.type_index]);
  367|    123|  last_year_ = LocalTime(last_time, last_tt).cs.year();
  368|    123|  bool leap_year = IsLeap(last_year_);
  369|    123|  const civil_second jan1(last_year_);
  370|    123|  std::int_fast64_t jan1_time = jan1 - civil_second();
  371|    123|  int jan1_weekday = ToPosixWeekday(get_weekday(jan1));
  372|       |
  373|    123|  Transition dst = {0, dst_ti, civil_second(), civil_second()};
  374|    123|  Transition std = {0, std_ti, civil_second(), civil_second()};
  375|  49.4k|  for (const year_t limit = last_year_ + 401;; ++last_year_) {
  376|  49.4k|    auto dst_trans_off = TransOffset(leap_year, jan1_weekday, posix.dst_start);
  377|  49.4k|    auto std_trans_off = TransOffset(leap_year, jan1_weekday, posix.dst_end);
  378|  49.4k|    dst.unix_time = jan1_time + dst_trans_off - posix.std_offset;
  379|  49.4k|    std.unix_time = jan1_time + std_trans_off - posix.dst_offset;
  380|  49.4k|    const auto* ta = dst.unix_time < std.unix_time ? &dst : &std;
  ------------------
  |  Branch (380:22): [True: 49.4k, False: 0]
  ------------------
  381|  49.4k|    const auto* tb = dst.unix_time < std.unix_time ? &std : &dst;
  ------------------
  |  Branch (381:22): [True: 49.4k, False: 0]
  ------------------
  382|  49.4k|    if (last_time < tb->unix_time) {
  ------------------
  |  Branch (382:9): [True: 49.3k, False: 123]
  ------------------
  383|  49.3k|      if (last_time < ta->unix_time) transitions_.push_back(*ta);
  ------------------
  |  Branch (383:11): [True: 49.3k, False: 0]
  ------------------
  384|  49.3k|      transitions_.push_back(*tb);
  385|  49.3k|    }
  386|  49.4k|    if (last_year_ == limit) break;
  ------------------
  |  Branch (386:9): [True: 123, False: 49.3k]
  ------------------
  387|  49.3k|    jan1_time += kSecsPerYear[leap_year];
  388|  49.3k|    jan1_weekday = (jan1_weekday + kDaysPerYear[leap_year]) % 7;
  389|  49.3k|    leap_year = !leap_year && IsLeap(last_year_ + 1);
  ------------------
  |  Branch (389:17): [True: 37.3k, False: 11.9k]
  |  Branch (389:31): [True: 11.9k, False: 25.4k]
  ------------------
  390|  49.3k|  }
  391|       |
  392|    123|  return true;
  393|    123|}
_ZN4cctz12TimeZoneInfo17ResetToBuiltinUTCERKNSt3__16chrono8durationIlNS1_5ratioILl1ELl1EEEEE:
  671|    327|bool TimeZoneInfo::ResetToBuiltinUTC(const seconds& offset) {
  672|    327|  transition_types_.resize(1);
  673|    327|  TransitionType& tt(transition_types_.back());
  674|    327|  tt.utc_offset = static_cast<std::int_least32_t>(offset.count());
  675|    327|  tt.is_dst = false;
  676|    327|  tt.abbr_index = 0;
  677|       |
  678|       |  // We temporarily add some redundant, contemporary (2015 through 2025)
  679|       |  // transitions for performance reasons.  See TimeZoneInfo::LocalTime().
  680|       |  // TODO: Fix the performance issue and remove the extra transitions.
  681|    327|  transitions_.clear();
  682|    327|  transitions_.reserve(12);
  683|    327|  for (const std::int_fast64_t unix_time : {
  ------------------
  |  Branch (683:42): [True: 3.92k, False: 327]
  ------------------
  684|    327|           -(1LL << 59),  // a "first half" transition
  685|    327|           1420070400LL,  // 2015-01-01T00:00:00+00:00
  686|    327|           1451606400LL,  // 2016-01-01T00:00:00+00:00
  687|    327|           1483228800LL,  // 2017-01-01T00:00:00+00:00
  688|    327|           1514764800LL,  // 2018-01-01T00:00:00+00:00
  689|    327|           1546300800LL,  // 2019-01-01T00:00:00+00:00
  690|    327|           1577836800LL,  // 2020-01-01T00:00:00+00:00
  691|    327|           1609459200LL,  // 2021-01-01T00:00:00+00:00
  692|    327|           1640995200LL,  // 2022-01-01T00:00:00+00:00
  693|    327|           1672531200LL,  // 2023-01-01T00:00:00+00:00
  694|    327|           1704067200LL,  // 2024-01-01T00:00:00+00:00
  695|    327|           1735689600LL,  // 2025-01-01T00:00:00+00:00
  696|  3.92k|       }) {
  697|  3.92k|    Transition& tr(*transitions_.emplace(transitions_.end()));
  698|  3.92k|    tr.unix_time = unix_time;
  699|  3.92k|    tr.type_index = 0;
  700|  3.92k|    tr.civil_sec = LocalTime(tr.unix_time, tt).cs;
  701|  3.92k|    tr.prev_civil_sec = tr.civil_sec - 1;
  702|  3.92k|  }
  703|       |
  704|    327|  default_transition_type_ = 0;
  705|    327|  abbreviations_ = FixedOffsetToAbbr(offset);
  706|    327|  abbreviations_.append(1, '\0');
  707|    327|  future_spec_.clear();  // never needed for a fixed-offset zone
  708|    327|  extended_ = false;
  709|       |
  710|    327|  tt.civil_max = LocalTime(seconds::max().count(), tt).cs;
  711|    327|  tt.civil_min = LocalTime(seconds::min().count(), tt).cs;
  712|       |
  713|    327|  transitions_.shrink_to_fit();
  714|    327|  return true;
  715|    327|}
_ZN4cctz12TimeZoneInfo4LoadEPNS_14ZoneInfoSourceE:
  717|    263|bool TimeZoneInfo::Load(ZoneInfoSource* zip) {
  718|       |  // Read and validate the header.
  719|    263|  tzhead tzh;
  720|    263|  if (zip->Read(&tzh, sizeof(tzh)) != sizeof(tzh))
  ------------------
  |  Branch (720:7): [True: 0, False: 263]
  ------------------
  721|      0|    return false;
  722|    263|  if (std::strncmp(tzh.tzh_magic, TZ_MAGIC, sizeof(tzh.tzh_magic)) != 0)
  ------------------
  |  |   27|    263|#define TZ_MAGIC "TZif"
  ------------------
  |  Branch (722:7): [True: 1, False: 262]
  ------------------
  723|      1|    return false;
  724|    262|  Header hdr;
  725|    262|  if (!hdr.Build(tzh))
  ------------------
  |  Branch (725:7): [True: 0, False: 262]
  ------------------
  726|      0|    return false;
  727|    262|  std::size_t time_len = 4;
  728|    262|  if (tzh.tzh_version[0] != '\0') {
  ------------------
  |  Branch (728:7): [True: 262, False: 0]
  ------------------
  729|       |    // Skip the 4-byte data.
  730|    262|    if (zip->Skip(hdr.DataLength(time_len)) != 0)
  ------------------
  |  Branch (730:9): [True: 0, False: 262]
  ------------------
  731|      0|      return false;
  732|       |    // Read and validate the header for the 8-byte data.
  733|    262|    if (zip->Read(&tzh, sizeof(tzh)) != sizeof(tzh))
  ------------------
  |  Branch (733:9): [True: 0, False: 262]
  ------------------
  734|      0|      return false;
  735|    262|    if (std::strncmp(tzh.tzh_magic, TZ_MAGIC, sizeof(tzh.tzh_magic)) != 0)
  ------------------
  |  |   27|    262|#define TZ_MAGIC "TZif"
  ------------------
  |  Branch (735:9): [True: 0, False: 262]
  ------------------
  736|      0|      return false;
  737|    262|    if (tzh.tzh_version[0] == '\0')
  ------------------
  |  Branch (737:9): [True: 0, False: 262]
  ------------------
  738|      0|      return false;
  739|    262|    if (!hdr.Build(tzh))
  ------------------
  |  Branch (739:9): [True: 0, False: 262]
  ------------------
  740|      0|      return false;
  741|    262|    time_len = 8;
  742|    262|  }
  743|    262|  if (hdr.typecnt == 0)
  ------------------
  |  Branch (743:7): [True: 0, False: 262]
  ------------------
  744|      0|    return false;
  745|    262|  if (hdr.leapcnt != 0) {
  ------------------
  |  Branch (745:7): [True: 0, False: 262]
  ------------------
  746|       |    // This code assumes 60-second minutes so we do not want
  747|       |    // the leap-second encoded zoneinfo. We could reverse the
  748|       |    // compensation, but the "right" encoding is rarely used
  749|       |    // so currently we simply reject such data.
  750|      0|    return false;
  751|      0|  }
  752|    262|  if (hdr.ttisstdcnt != 0 && hdr.ttisstdcnt != hdr.typecnt)
  ------------------
  |  Branch (752:7): [True: 129, False: 133]
  |  Branch (752:30): [True: 0, False: 129]
  ------------------
  753|      0|    return false;
  754|    262|  if (hdr.ttisutcnt != 0 && hdr.ttisutcnt != hdr.typecnt)
  ------------------
  |  Branch (754:7): [True: 64, False: 198]
  |  Branch (754:29): [True: 0, False: 64]
  ------------------
  755|      0|    return false;
  756|       |
  757|       |  // Bound the header counts before sizing tbuf so that a hostile TZif blob
  758|       |  // cannot force a very large zero-filled allocation from a tiny input.
  759|    262|  if (hdr.timecnt > TZ_MAX_TIMES)
  ------------------
  |  |   94|    262|# define TZ_MAX_TIMES 2000
  ------------------
  |  Branch (759:7): [True: 0, False: 262]
  ------------------
  760|      0|    return false;
  761|    262|  if (hdr.typecnt > TZ_MAX_TYPES)
  ------------------
  |  |   99|    262|# define TZ_MAX_TYPES 256 /* Limited to 256 by Internet RFC 9636.  */
  ------------------
  |  Branch (761:7): [True: 0, False: 262]
  ------------------
  762|      0|    return false;
  763|    262|  if (hdr.charcnt > TZ_MAX_CHARS)
  ------------------
  |  |  104|    262|# define TZ_MAX_CHARS 256	/* Maximum number of abbreviation characters */
  ------------------
  |  Branch (763:7): [True: 0, False: 262]
  ------------------
  764|      0|    return false;
  765|       |
  766|       |  // Read the data into a local buffer.
  767|    262|  std::size_t len = hdr.DataLength(time_len);
  768|    262|  std::vector<char> tbuf(len);
  769|    262|  if (zip->Read(tbuf.data(), len) != len)
  ------------------
  |  Branch (769:7): [True: 0, False: 262]
  ------------------
  770|      0|    return false;
  771|    262|  const char* bp = tbuf.data();
  772|       |
  773|       |  // Decode and validate the transitions.
  774|    262|  transitions_.reserve(hdr.timecnt + 2);
  775|    262|  transitions_.resize(hdr.timecnt);
  776|  16.3k|  for (auto& tr : transitions_) {
  ------------------
  |  Branch (776:17): [True: 16.3k, False: 262]
  ------------------
  777|  16.3k|    tr.unix_time = (time_len == 4) ? Decode32(bp) : Decode64(bp);
  ------------------
  |  Branch (777:20): [True: 0, False: 16.3k]
  ------------------
  778|  16.3k|    bp += time_len;
  779|       |    // A valid zoneinfo file keeps transition times far from the 64-bit
  780|       |    // limits, but a hostile one can place them at the extremes where
  781|       |    // the reverse-conversion arithmetic in MakeTime() might overflow.
  782|       |    // So, bound transitions to the range +/-(1<<59).
  783|  16.3k|    if (tr.unix_time < -(1LL << 59) || tr.unix_time > (1LL << 59)) {
  ------------------
  |  Branch (783:9): [True: 0, False: 16.3k]
  |  Branch (783:40): [True: 0, False: 16.3k]
  ------------------
  784|      0|      return false;  // out of range
  785|      0|    }
  786|  16.3k|  }
  787|    262|  bool seen_type_0 = false;
  788|  16.3k|  for (auto& tr : transitions_) {
  ------------------
  |  Branch (788:17): [True: 16.3k, False: 262]
  ------------------
  789|  16.3k|    tr.type_index = Decode8(bp++);
  790|  16.3k|    if (tr.type_index >= hdr.typecnt) return false;
  ------------------
  |  Branch (790:9): [True: 0, False: 16.3k]
  ------------------
  791|  16.3k|    if (tr.type_index == 0) seen_type_0 = true;
  ------------------
  |  Branch (791:9): [True: 4.00k, False: 12.3k]
  ------------------
  792|  16.3k|  }
  793|       |
  794|       |  // Decode and validate the transition types.
  795|    262|  transition_types_.reserve(hdr.typecnt + 2);
  796|    262|  transition_types_.resize(hdr.typecnt);
  797|    706|  for (auto& tt : transition_types_) {
  ------------------
  |  Branch (797:17): [True: 706, False: 262]
  ------------------
  798|    706|    tt.utc_offset = static_cast<std::int_least32_t>(Decode32(bp));
  799|    706|    bp += 4;
  800|    706|    if (tt.utc_offset >= 26 * 60 * 60 || tt.utc_offset <= -25 * 60 * 60)
  ------------------
  |  Branch (800:9): [True: 0, False: 706]
  |  Branch (800:42): [True: 0, False: 706]
  ------------------
  801|      0|      return false;
  802|    706|    tt.is_dst = (Decode8(bp++) != 0);
  803|    706|    tt.abbr_index = Decode8(bp++);
  804|    706|    if (tt.abbr_index >= hdr.charcnt) return false;
  ------------------
  |  Branch (804:9): [True: 0, False: 706]
  ------------------
  805|    706|  }
  806|       |
  807|       |  // Determine the before-first-transition type.
  808|    262|  default_transition_type_ = 0;
  809|    262|  if (seen_type_0 && hdr.timecnt != 0) {
  ------------------
  |  Branch (809:7): [True: 123, False: 139]
  |  Branch (809:22): [True: 123, False: 0]
  ------------------
  810|    123|    std::size_t index = 0;
  811|    123|    if (transition_types_[0].is_dst) {
  ------------------
  |  Branch (811:9): [True: 0, False: 123]
  ------------------
  812|      0|      index = transitions_[0].type_index;
  813|      0|      while (index != 0 && transition_types_[index].is_dst)
  ------------------
  |  Branch (813:14): [True: 0, False: 0]
  |  Branch (813:28): [True: 0, False: 0]
  ------------------
  814|      0|        --index;
  815|      0|    }
  816|    123|    while (index != hdr.typecnt && transition_types_[index].is_dst)
  ------------------
  |  Branch (816:12): [True: 123, False: 0]
  |  Branch (816:36): [True: 0, False: 123]
  ------------------
  817|      0|      ++index;
  818|    123|    if (index != hdr.typecnt)
  ------------------
  |  Branch (818:9): [True: 123, False: 0]
  ------------------
  819|    123|      default_transition_type_ = static_cast<std::uint_fast8_t>(index);
  820|    123|  }
  821|       |
  822|       |  // Copy all the abbreviations. The area holds NUL-terminated strings, and
  823|       |  // LocalTime() hands out a pointer into it, so the final abbreviation has
  824|       |  // to be terminated within the area itself. Otherwise an abbreviation runs
  825|       |  // on into whatever ExtendTransitions() later appends. (hdr.charcnt != 0
  826|       |  // because every abbr_index was validated to be less than it.)
  827|    262|  if (bp[hdr.charcnt - 1] != '\0')
  ------------------
  |  Branch (827:7): [True: 0, False: 262]
  ------------------
  828|      0|    return false;
  829|    262|  abbreviations_.reserve(hdr.charcnt + 10);
  830|    262|  abbreviations_.assign(bp, hdr.charcnt);
  831|    262|  bp += hdr.charcnt;
  832|       |
  833|       |  // Skip the unused portions. We've already dispensed with leap-second
  834|       |  // encoded zoneinfo. The ttisstd/ttisgmt indicators only apply when
  835|       |  // interpreting a POSIX spec that does not include start/end rules, and
  836|       |  // that isn't the case here (see "zic -p").
  837|    262|  bp += (time_len + 4) * hdr.leapcnt;  // leap-time + TAI-UTC
  838|    262|  bp += 1 * hdr.ttisstdcnt;            // UTC/local indicators
  839|    262|  bp += 1 * hdr.ttisutcnt;             // standard/wall indicators
  840|    262|  assert(bp == tbuf.data() + tbuf.size());
  ------------------
  |  Branch (840:3): [True: 262, False: 0]
  ------------------
  841|       |
  842|    262|  future_spec_.clear();
  843|    262|  if (tzh.tzh_version[0] != '\0') {
  ------------------
  |  Branch (843:7): [True: 262, False: 0]
  ------------------
  844|       |    // Snarf up the NL-enclosed future POSIX spec. Note
  845|       |    // that version '3' files utilize an extended format.
  846|    262|    auto get_char = [](ZoneInfoSource* azip) -> int {
  847|    262|      unsigned char ch;  // all non-EOF results are positive
  848|    262|      return (azip->Read(&ch, 1) == 1) ? ch : EOF;
  849|    262|    };
  850|    262|    if (get_char(zip) != '\n')
  ------------------
  |  Branch (850:9): [True: 0, False: 262]
  ------------------
  851|      0|      return false;
  852|  4.02k|    for (int c = get_char(zip); c != '\n'; c = get_char(zip)) {
  ------------------
  |  Branch (852:33): [True: 3.76k, False: 262]
  ------------------
  853|  3.76k|      if (c == EOF)
  ------------------
  |  Branch (853:11): [True: 0, False: 3.76k]
  ------------------
  854|      0|        return false;
  855|  3.76k|      future_spec_.push_back(static_cast<char>(c));
  856|  3.76k|    }
  857|    262|  }
  858|       |
  859|       |  // We don't check for EOF so that we're forwards compatible.
  860|       |
  861|       |  // If we did not find version information during the standard loading
  862|       |  // process (as of tzh_version '3' that is unsupported), then ask the
  863|       |  // ZoneInfoSource for any out-of-bound version string it may be privy to.
  864|    262|  if (version_.empty()) {
  ------------------
  |  Branch (864:7): [True: 262, False: 0]
  ------------------
  865|    262|    version_ = zip->Version();
  866|    262|  }
  867|       |
  868|       |  // Ensure that there is always a transition in the first half of the
  869|       |  // time line (the second half is handled below) so that the signed
  870|       |  // difference between a civil_second and the civil_second of its
  871|       |  // previous transition is always representable, without overflow.
  872|    262|  if (transitions_.empty() || transitions_.front().unix_time >= 0) {
  ------------------
  |  Branch (872:7): [True: 133, False: 129]
  |  Branch (872:31): [True: 61, False: 68]
  ------------------
  873|    194|    Transition& tr(*transitions_.emplace(transitions_.begin()));
  874|    194|    tr.unix_time = -(1LL << 59);  // -18267312070-10-26T17:01:52+00:00
  875|    194|    tr.type_index = default_transition_type_;
  876|    194|  }
  877|       |
  878|       |  // Extend the transitions using the future specification.
  879|    262|  if (!ExtendTransitions()) return false;
  ------------------
  |  Branch (879:7): [True: 0, False: 262]
  ------------------
  880|       |
  881|       |  // Ensure that there is always a transition in the second half of the
  882|       |  // time line (the first half is handled above) so that the signed
  883|       |  // difference between a civil_second and the civil_second of its
  884|       |  // previous transition is always representable, without overflow.
  885|    262|  const Transition& last(transitions_.back());
  886|    262|  if (last.unix_time < 0) {
  ------------------
  |  Branch (886:7): [True: 133, False: 129]
  ------------------
  887|    133|    assert(!extended_);
  ------------------
  |  Branch (887:5): [True: 133, False: 0]
  ------------------
  888|    133|    const std::uint_fast8_t type_index = last.type_index;
  889|    133|    Transition& tr(*transitions_.emplace(transitions_.end()));
  890|    133|    tr.unix_time = 2147483647;  // 2038-01-19T03:14:07+00:00
  891|    133|    tr.type_index = type_index;
  892|    133|  }
  893|       |
  894|       |  // Compute the local civil time for each transition and the preceding
  895|       |  // second. These will be used for reverse conversions in MakeTime().
  896|    262|  const TransitionType* ttp = &transition_types_[default_transition_type_];
  897|   115k|  for (std::size_t i = 0; i != transitions_.size(); ++i) {
  ------------------
  |  Branch (897:27): [True: 115k, False: 262]
  ------------------
  898|   115k|    Transition& tr(transitions_[i]);
  899|   115k|    tr.prev_civil_sec = LocalTime(tr.unix_time, *ttp).cs - 1;
  900|   115k|    ttp = &transition_types_[tr.type_index];
  901|   115k|    tr.civil_sec = LocalTime(tr.unix_time, *ttp).cs;
  902|   115k|    if (i != 0) {
  ------------------
  |  Branch (902:9): [True: 115k, False: 262]
  ------------------
  903|       |      // Check that offset changes don't cross each other, including the
  904|       |      // civil times each one skips or repeats. No one does this in
  905|       |      // practice, and we depend on increasing absolute and civil times
  906|       |      // in BreakTime() and MakeTime() respectively.
  907|   115k|      const Transition& prev_tr(transitions_[i - 1]);
  908|   115k|      if (prev_tr.unix_time >= tr.unix_time) {
  ------------------
  |  Branch (908:11): [True: 0, False: 115k]
  ------------------
  909|      0|        return false;  // out of order
  910|      0|      }
  911|   115k|      if (std::max(prev_tr.prev_civil_sec, prev_tr.civil_sec) >=
  ------------------
  |  Branch (911:11): [True: 0, False: 115k]
  ------------------
  912|   115k|          std::min(tr.prev_civil_sec, tr.civil_sec)) {
  913|      0|        return false;  // transitions too close
  914|      0|      }
  915|   115k|    }
  916|   115k|  }
  917|       |
  918|       |  // Compute the maximum/minimum civil times that can be converted to a
  919|       |  // time_point<seconds> for each of the zone's transition types.
  920|    706|  for (auto& tt : transition_types_) {
  ------------------
  |  Branch (920:17): [True: 706, False: 262]
  ------------------
  921|    706|    tt.civil_max = LocalTime(seconds::max().count(), tt).cs;
  922|    706|    tt.civil_min = LocalTime(seconds::min().count(), tt).cs;
  923|    706|  }
  924|       |
  925|    262|  transitions_.shrink_to_fit();
  926|    262|  return true;
  927|    262|}
_ZN4cctz12TimeZoneInfo4LoadERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  929|  1.30k|bool TimeZoneInfo::Load(const std::string& name) {
  930|       |  // We can ensure that the loading of UTC or any other fixed-offset
  931|       |  // zone never fails because the simple, fixed-offset state can be
  932|       |  // internally generated. Note that this depends on our choice to not
  933|       |  // accept leap-second encoded ("right") zoneinfo.
  934|  1.30k|  auto offset = seconds::zero();
  935|  1.30k|  if (FixedOffsetFromName(name, &offset)) {
  ------------------
  |  Branch (935:7): [True: 326, False: 977]
  ------------------
  936|    326|    return ResetToBuiltinUTC(offset);
  937|    326|  }
  938|       |
  939|       |  // Find and use a ZoneInfoSource to load the named zone.
  940|    977|  auto zip = cctz_extension::zone_info_source_factory(
  941|    977|      name, [](const std::string& n) -> std::unique_ptr<ZoneInfoSource> {
  942|    977|        if (auto z = FileZoneInfoSource::Open(n)) return z;
  943|    977|        if (auto z = AndroidZoneInfoSource::Open(n)) return z;
  944|    977|        if (auto z = FuchsiaZoneInfoSource::Open(n)) return z;
  945|    977|        return nullptr;
  946|    977|      });
  947|    977|  return zip != nullptr && Load(zip.get());
  ------------------
  |  Branch (947:10): [True: 263, False: 714]
  |  Branch (947:28): [True: 262, False: 1]
  ------------------
  948|  1.30k|}
_ZN4cctz12TimeZoneInfo3UTCEv:
  950|      1|std::unique_ptr<TimeZoneInfo> TimeZoneInfo::UTC() {
  951|      1|  auto tz = std::unique_ptr<TimeZoneInfo>(new TimeZoneInfo);
  952|      1|  tz->ResetToBuiltinUTC(seconds::zero());
  953|      1|  return tz;
  954|      1|}
_ZN4cctz12TimeZoneInfo4MakeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  956|  1.30k|std::unique_ptr<TimeZoneInfo> TimeZoneInfo::Make(const std::string& name) {
  957|  1.30k|  auto tz = std::unique_ptr<TimeZoneInfo>(new TimeZoneInfo);
  958|  1.30k|  if (!tz->Load(name)) tz.reset();  // fallback to UTC
  ------------------
  |  Branch (958:7): [True: 715, False: 588]
  ------------------
  959|  1.30k|  return tz;
  960|  1.30k|}
_ZNK4cctz12TimeZoneInfo9LocalTimeElRKNS_14TransitionTypeE:
  964|   238k|    std::int_fast64_t unix_time, const TransitionType& tt) const {
  965|       |  // A civil time in "+offset" looks like (time+offset) in UTC.
  966|       |  // Note: We perform two additions in the civil_second domain to
  967|       |  // sidestep the chance of overflow in (unix_time + tt.utc_offset).
  968|   238k|  return {(civil_second() + unix_time) + tt.utc_offset,
  969|   238k|          tt.utc_offset, tt.is_dst, &abbreviations_[tt.abbr_index]};
  970|   238k|}
_ZNK4cctz12TimeZoneInfo9LocalTimeElRKNS_10TransitionE:
  974|  7.15k|    std::int_fast64_t unix_time, const Transition& tr) const {
  975|  7.15k|  const TransitionType& tt = transition_types_[tr.type_index];
  976|       |  // Note: (unix_time - tr.unix_time) will never overflow as we
  977|       |  // have ensured that there is always a "nearby" transition.
  978|  7.15k|  return {tr.civil_sec + (unix_time - tr.unix_time),  // TODO: Optimize.
  979|  7.15k|          tt.utc_offset, tt.is_dst, &abbreviations_[tt.abbr_index]};
  980|  7.15k|}
_ZNK4cctz12TimeZoneInfo9TimeLocalERKNS_6detail10civil_timeINS1_10second_tagEEEl:
  984|  1.73k|                                                year_t c4_shift) const {
  985|  1.73k|  assert(last_year_ - 400 < cs.year() && cs.year() <= last_year_);
  ------------------
  |  Branch (985:3): [True: 1.73k, False: 0]
  |  Branch (985:3): [True: 1.73k, False: 0]
  |  Branch (985:3): [True: 1.73k, False: 0]
  ------------------
  986|  1.73k|  time_zone::civil_lookup cl = MakeTime(cs);
  987|  1.73k|  if (c4_shift > seconds::max().count() / kSecsPer400Years) {
  ------------------
  |  Branch (987:7): [True: 170, False: 1.56k]
  ------------------
  988|    170|    cl.pre = cl.trans = cl.post = time_point<seconds>::max();
  989|  1.56k|  } else {
  990|  1.56k|    const auto offset = seconds(c4_shift * kSecsPer400Years);
  991|  1.56k|    const auto limit = time_point<seconds>::max() - offset;
  992|  4.68k|    for (auto* tp : {&cl.pre, &cl.trans, &cl.post}) {
  ------------------
  |  Branch (992:19): [True: 4.68k, False: 1.56k]
  ------------------
  993|  4.68k|      if (*tp > limit) {
  ------------------
  |  Branch (993:11): [True: 30, False: 4.65k]
  ------------------
  994|     30|        *tp = time_point<seconds>::max();
  995|  4.65k|      } else {
  996|  4.65k|        *tp += offset;
  997|  4.65k|      }
  998|  4.68k|    }
  999|  1.56k|  }
 1000|  1.73k|  return cl;
 1001|  1.73k|}
_ZNK4cctz12TimeZoneInfo9BreakTimeERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
 1004|  10.1k|    const time_point<seconds>& tp) const {
 1005|  10.1k|  std::int_fast64_t unix_time = ToUnixSeconds(tp);
 1006|  10.1k|  const std::size_t timecnt = transitions_.size();
 1007|  10.1k|  assert(timecnt != 0);  // We always add a transition.
  ------------------
  |  Branch (1007:3): [True: 10.1k, False: 0]
  ------------------
 1008|       |
 1009|  10.1k|  if (unix_time < transitions_[0].unix_time) {
  ------------------
  |  Branch (1009:7): [True: 1.42k, False: 8.72k]
  ------------------
 1010|  1.42k|    return LocalTime(unix_time, transition_types_[default_transition_type_]);
 1011|  1.42k|  }
 1012|  8.72k|  if (unix_time >= transitions_[timecnt - 1].unix_time) {
  ------------------
  |  Branch (1012:7): [True: 2.80k, False: 5.91k]
  ------------------
 1013|       |    // After the last transition. If we extended the transitions using
 1014|       |    // future_spec_, shift back to a supported year using the 400-year
 1015|       |    // cycle of calendaric equivalence and then compensate accordingly.
 1016|  2.80k|    if (extended_) {
  ------------------
  |  Branch (1016:9): [True: 1.56k, False: 1.24k]
  ------------------
 1017|  1.56k|      const std::int_fast64_t diff =
 1018|  1.56k|          unix_time - transitions_[timecnt - 1].unix_time;
 1019|  1.56k|      const year_t shift = diff / kSecsPer400Years + 1;
 1020|  1.56k|      const auto d = seconds(shift * kSecsPer400Years);
 1021|  1.56k|      time_zone::absolute_lookup al = BreakTime(tp - d);
 1022|  1.56k|      al.cs = YearShift(al.cs, shift * 400);
 1023|  1.56k|      return al;
 1024|  1.56k|    }
 1025|  1.24k|    return LocalTime(unix_time, transitions_[timecnt - 1]);
 1026|  2.80k|  }
 1027|       |
 1028|  5.91k|  const std::size_t hint = local_time_hint_.load(std::memory_order_relaxed);
 1029|  5.91k|  if (0 < hint && hint < timecnt) {
  ------------------
  |  Branch (1029:7): [True: 5.58k, False: 332]
  |  Branch (1029:19): [True: 5.58k, False: 0]
  ------------------
 1030|  5.58k|    if (transitions_[hint - 1].unix_time <= unix_time) {
  ------------------
  |  Branch (1030:9): [True: 4.57k, False: 1.00k]
  ------------------
 1031|  4.57k|      if (unix_time < transitions_[hint].unix_time) {
  ------------------
  |  Branch (1031:11): [True: 3.60k, False: 966]
  ------------------
 1032|  3.60k|        return LocalTime(unix_time, transitions_[hint - 1]);
 1033|  3.60k|      }
 1034|  4.57k|    }
 1035|  5.58k|  }
 1036|       |
 1037|  2.30k|  const Transition target = {unix_time, 0, civil_second(), civil_second()};
 1038|  2.30k|  const Transition* begin = &transitions_[0];
 1039|  2.30k|  const Transition* tr = std::upper_bound(begin, begin + timecnt, target,
 1040|  2.30k|                                          Transition::ByUnixTime());
 1041|  2.30k|  local_time_hint_.store(static_cast<std::size_t>(tr - begin),
 1042|  2.30k|                         std::memory_order_relaxed);
 1043|  2.30k|  return LocalTime(unix_time, *--tr);
 1044|  5.91k|}
_ZNK4cctz12TimeZoneInfo8MakeTimeERKNS_6detail10civil_timeINS1_10second_tagEEE:
 1046|  15.1k|time_zone::civil_lookup TimeZoneInfo::MakeTime(const civil_second& cs) const {
 1047|  15.1k|  const std::size_t timecnt = transitions_.size();
 1048|  15.1k|  assert(timecnt != 0);  // We always add a transition.
  ------------------
  |  Branch (1048:3): [True: 15.1k, False: 0]
  ------------------
 1049|       |
 1050|       |  // Find the first transition after our target civil time.
 1051|  15.1k|  const Transition* tr = nullptr;
 1052|  15.1k|  const Transition* begin = &transitions_[0];
 1053|  15.1k|  const Transition* end = begin + timecnt;
 1054|  15.1k|  if (cs < begin->civil_sec) {
  ------------------
  |  Branch (1054:7): [True: 1.67k, False: 13.4k]
  ------------------
 1055|  1.67k|    tr = begin;
 1056|  13.4k|  } else if (cs >= transitions_[timecnt - 1].civil_sec) {
  ------------------
  |  Branch (1056:14): [True: 3.14k, False: 10.3k]
  ------------------
 1057|  3.14k|    tr = end;
 1058|  10.3k|  } else {
 1059|  10.3k|    const std::size_t hint = time_local_hint_.load(std::memory_order_relaxed);
 1060|  10.3k|    if (0 < hint && hint < timecnt) {
  ------------------
  |  Branch (1060:9): [True: 9.73k, False: 575]
  |  Branch (1060:21): [True: 9.73k, False: 0]
  ------------------
 1061|  9.73k|      if (transitions_[hint - 1].civil_sec <= cs) {
  ------------------
  |  Branch (1061:11): [True: 7.97k, False: 1.75k]
  ------------------
 1062|  7.97k|        if (cs < transitions_[hint].civil_sec) {
  ------------------
  |  Branch (1062:13): [True: 6.20k, False: 1.76k]
  ------------------
 1063|  6.20k|          tr = begin + hint;
 1064|  6.20k|        }
 1065|  7.97k|      }
 1066|  9.73k|    }
 1067|  10.3k|    if (tr == nullptr) {
  ------------------
  |  Branch (1067:9): [True: 4.09k, False: 6.20k]
  ------------------
 1068|  4.09k|      const Transition target = {0, 0, cs, civil_second()};
 1069|  4.09k|      tr = std::upper_bound(begin, end, target, Transition::ByCivilTime());
 1070|  4.09k|      time_local_hint_.store(static_cast<std::size_t>(tr - begin),
 1071|  4.09k|                             std::memory_order_relaxed);
 1072|  4.09k|    }
 1073|  10.3k|  }
 1074|       |
 1075|  15.1k|  if (tr == begin) {
  ------------------
  |  Branch (1075:7): [True: 1.67k, False: 13.4k]
  ------------------
 1076|  1.67k|    if (tr->prev_civil_sec >= cs) {
  ------------------
  |  Branch (1076:9): [True: 1.67k, False: 1]
  ------------------
 1077|       |      // Before first transition, so use the default offset.
 1078|  1.67k|      const TransitionType& tt(transition_types_[default_transition_type_]);
 1079|  1.67k|      if (cs < tt.civil_min) return MakeUnique(time_point<seconds>::min());
  ------------------
  |  Branch (1079:11): [True: 149, False: 1.52k]
  ------------------
 1080|  1.52k|      return MakeUnique(cs - (civil_second() + tt.utc_offset));
 1081|  1.67k|    }
 1082|       |    // tr->prev_civil_sec < cs < tr->civil_sec
 1083|      1|    return MakeSkipped(*tr, cs);
 1084|  1.67k|  }
 1085|       |
 1086|  13.4k|  if (tr == end) {
  ------------------
  |  Branch (1086:7): [True: 3.14k, False: 10.3k]
  ------------------
 1087|  3.14k|    if (cs > (--tr)->prev_civil_sec) {
  ------------------
  |  Branch (1087:9): [True: 3.13k, False: 10]
  ------------------
 1088|       |      // After the last transition. If we extended the transitions using
 1089|       |      // future_spec_, shift back to a supported year using the 400-year
 1090|       |      // cycle of calendaric equivalence and then compensate accordingly.
 1091|  3.13k|      if (extended_ && cs.year() > last_year_) {
  ------------------
  |  Branch (1091:11): [True: 1.74k, False: 1.38k]
  |  Branch (1091:24): [True: 1.73k, False: 14]
  ------------------
 1092|  1.73k|        const year_t shift = (cs.year() - last_year_ - 1) / 400 + 1;
 1093|  1.73k|        return TimeLocal(YearShift(cs, shift * -400), shift);
 1094|  1.73k|      }
 1095|  1.40k|      const TransitionType& tt(transition_types_[tr->type_index]);
 1096|  1.40k|      if (cs > tt.civil_max) return MakeUnique(time_point<seconds>::max());
  ------------------
  |  Branch (1096:11): [True: 72, False: 1.32k]
  ------------------
 1097|  1.32k|      return MakeUnique(tr->unix_time + (cs - tr->civil_sec));
 1098|  1.40k|    }
 1099|       |    // tr->civil_sec <= cs <= tr->prev_civil_sec
 1100|     10|    return MakeRepeated(*tr, cs);
 1101|  3.14k|  }
 1102|       |
 1103|  10.3k|  if (tr->prev_civil_sec < cs) {
  ------------------
  |  Branch (1103:7): [True: 10, False: 10.2k]
  ------------------
 1104|       |    // tr->prev_civil_sec < cs < tr->civil_sec
 1105|     10|    return MakeSkipped(*tr, cs);
 1106|     10|  }
 1107|       |
 1108|  10.2k|  if (cs <= (--tr)->prev_civil_sec) {
  ------------------
  |  Branch (1108:7): [True: 28, False: 10.2k]
  ------------------
 1109|       |    // tr->civil_sec <= cs <= tr->prev_civil_sec
 1110|     28|    return MakeRepeated(*tr, cs);
 1111|     28|  }
 1112|       |
 1113|       |  // In between transitions.
 1114|  10.2k|  return MakeUnique(tr->unix_time + (cs - tr->civil_sec));
 1115|  10.2k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110AllYearDSTERKNS_13PosixTimeZoneE:
  189|    123|bool AllYearDST(const PosixTimeZone& posix) {
  190|    123|  if (posix.dst_start.date.fmt != PosixTransition::N) return false;
  ------------------
  |  Branch (190:7): [True: 123, False: 0]
  ------------------
  191|      0|  if (posix.dst_start.date.n.day != 0) return false;
  ------------------
  |  Branch (191:7): [True: 0, False: 0]
  ------------------
  192|      0|  if (posix.dst_start.time.offset != 0) return false;
  ------------------
  |  Branch (192:7): [True: 0, False: 0]
  ------------------
  193|       |
  194|      0|  if (posix.dst_end.date.fmt != PosixTransition::J) return false;
  ------------------
  |  Branch (194:7): [True: 0, False: 0]
  ------------------
  195|      0|  if (posix.dst_end.date.j.day != kDaysPerYear[0]) return false;
  ------------------
  |  Branch (195:7): [True: 0, False: 0]
  ------------------
  196|      0|  const auto offset = posix.std_offset - posix.dst_offset;
  197|      0|  if (posix.dst_end.time.offset + offset != kSecsPerDay) return false;
  ------------------
  |  Branch (197:7): [True: 0, False: 0]
  ------------------
  198|       |
  199|      0|  return true;
  200|      0|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_16IsLeapEl:
   68|  37.5k|inline bool IsLeap(year_t year) {
   69|  37.5k|  return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
  ------------------
  |  Branch (69:10): [True: 12.3k, False: 25.2k]
  |  Branch (69:30): [True: 11.8k, False: 492]
  |  Branch (69:51): [True: 123, False: 369]
  ------------------
   70|  37.5k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_114ToPosixWeekdayENS_6detail7weekdayE:
   95|    123|inline int ToPosixWeekday(weekday wd) {
   96|    123|  switch (wd) {
  ------------------
  |  Branch (96:11): [True: 123, False: 0]
  ------------------
   97|      0|    case weekday::sunday:
  ------------------
  |  Branch (97:5): [True: 0, False: 123]
  ------------------
   98|      0|      return 0;
   99|      0|    case weekday::monday:
  ------------------
  |  Branch (99:5): [True: 0, False: 123]
  ------------------
  100|      0|      return 1;
  101|      0|    case weekday::tuesday:
  ------------------
  |  Branch (101:5): [True: 0, False: 123]
  ------------------
  102|      0|      return 2;
  103|      0|    case weekday::wednesday:
  ------------------
  |  Branch (103:5): [True: 0, False: 123]
  ------------------
  104|      0|      return 3;
  105|    123|    case weekday::thursday:
  ------------------
  |  Branch (105:5): [True: 123, False: 0]
  ------------------
  106|    123|      return 4;
  107|      0|    case weekday::friday:
  ------------------
  |  Branch (107:5): [True: 0, False: 123]
  ------------------
  108|      0|      return 5;
  109|      0|    case weekday::saturday:
  ------------------
  |  Branch (109:5): [True: 0, False: 123]
  ------------------
  110|      0|      return 6;
  111|    123|  }
  112|      0|  return 0; /*NOTREACHED*/
  113|    123|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_111TransOffsetEbiRKNS_15PosixTransitionE:
  204|  98.8k|                              const PosixTransition& pt) {
  205|  98.8k|  std::int_fast64_t days = 0;
  206|  98.8k|  switch (pt.date.fmt) {
  ------------------
  |  Branch (206:11): [True: 98.8k, False: 0]
  ------------------
  207|      0|    case PosixTransition::J: {
  ------------------
  |  Branch (207:5): [True: 0, False: 98.8k]
  ------------------
  208|      0|      days = pt.date.j.day;
  209|      0|      if (!leap_year || days < kMonthOffsets[1][3]) days -= 1;
  ------------------
  |  Branch (209:11): [True: 0, False: 0]
  |  Branch (209:25): [True: 0, False: 0]
  ------------------
  210|      0|      break;
  211|      0|    }
  212|      0|    case PosixTransition::N: {
  ------------------
  |  Branch (212:5): [True: 0, False: 98.8k]
  ------------------
  213|      0|      days = pt.date.n.day;
  214|      0|      break;
  215|      0|    }
  216|  98.8k|    case PosixTransition::M: {
  ------------------
  |  Branch (216:5): [True: 98.8k, False: 0]
  ------------------
  217|  98.8k|      const bool last_week = (pt.date.m.week == 5);
  218|  98.8k|      days = kMonthOffsets[leap_year][pt.date.m.month + last_week];
  219|  98.8k|      const std::int_fast64_t weekday = (jan1_weekday + days) % 7;
  220|  98.8k|      if (last_week) {
  ------------------
  |  Branch (220:11): [True: 96.4k, False: 2.41k]
  ------------------
  221|  96.4k|        days -= (weekday + 7 - 1 - pt.date.m.weekday) % 7 + 1;
  222|  96.4k|      } else {
  223|  2.41k|        days += (pt.date.m.weekday + 7 - weekday) % 7;
  224|  2.41k|        days += (pt.date.m.week - 1) * 7;
  225|  2.41k|      }
  226|  98.8k|      break;
  227|      0|    }
  228|  98.8k|  }
  229|  98.8k|  return (days * kSecsPerDay) + pt.time.offset;
  230|  98.8k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_16Header5BuildERK6tzhead:
  157|    524|bool Header::Build(const tzhead& tzh) {
  158|    524|  std::int_fast32_t v;
  159|    524|  if ((v = Decode32(tzh.tzh_timecnt)) < 0) return false;
  ------------------
  |  Branch (159:7): [True: 0, False: 524]
  ------------------
  160|    524|  timecnt = static_cast<std::size_t>(v);
  161|    524|  if ((v = Decode32(tzh.tzh_typecnt)) < 0) return false;
  ------------------
  |  Branch (161:7): [True: 0, False: 524]
  ------------------
  162|    524|  typecnt = static_cast<std::size_t>(v);
  163|    524|  if ((v = Decode32(tzh.tzh_charcnt)) < 0) return false;
  ------------------
  |  Branch (163:7): [True: 0, False: 524]
  ------------------
  164|    524|  charcnt = static_cast<std::size_t>(v);
  165|    524|  if ((v = Decode32(tzh.tzh_leapcnt)) < 0) return false;
  ------------------
  |  Branch (165:7): [True: 0, False: 524]
  ------------------
  166|    524|  leapcnt = static_cast<std::size_t>(v);
  167|    524|  if ((v = Decode32(tzh.tzh_ttisstdcnt)) < 0) return false;
  ------------------
  |  Branch (167:7): [True: 0, False: 524]
  ------------------
  168|    524|  ttisstdcnt = static_cast<std::size_t>(v);
  169|    524|  if ((v = Decode32(tzh.tzh_ttisutcnt)) < 0) return false;
  ------------------
  |  Branch (169:7): [True: 0, False: 524]
  ------------------
  170|    524|  ttisutcnt = static_cast<std::size_t>(v);
  171|    524|  return true;
  172|    524|}
time_zone_info.cc:_ZNK4cctz12_GLOBAL__N_16Header10DataLengthEm:
  176|    524|std::size_t Header::DataLength(std::size_t time_len) const {
  177|    524|  std::size_t len = 0;
  178|    524|  len += (time_len + 1) * timecnt;  // unix_time + type_index
  179|    524|  len += (4 + 1 + 1) * typecnt;     // utc_offset + is_dst + abbr_index
  180|    524|  len += 1 * charcnt;               // abbreviations
  181|    524|  len += (time_len + 4) * leapcnt;  // leap-time + TAI-UTC
  182|    524|  len += 1 * ttisstdcnt;            // UTC/local indicators
  183|    524|  len += 1 * ttisutcnt;             // standard/wall indicators
  184|    524|  return len;
  185|    524|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_18Decode32EPKc:
  126|  3.85k|std::int_fast32_t Decode32(const char* cp) {
  127|  3.85k|  std::uint_fast32_t v = 0;
  128|  19.2k|  for (int i = 0; i != (32 / 8); ++i) v = (v << 8) | Decode8(cp++);
  ------------------
  |  Branch (128:19): [True: 15.4k, False: 3.85k]
  ------------------
  129|  3.85k|  const std::int_fast32_t s32max = 0x7fffffff;
  130|  3.85k|  const auto s32maxU = static_cast<std::uint_fast32_t>(s32max);
  131|  3.85k|  if (v <= s32maxU) return static_cast<std::int_fast32_t>(v);
  ------------------
  |  Branch (131:7): [True: 3.78k, False: 66]
  ------------------
  132|     66|  return static_cast<std::int_fast32_t>(v - s32maxU - 1) - s32max - 1;
  133|  3.85k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_18Decode64EPKc:
  135|  16.3k|std::int_fast64_t Decode64(const char* cp) {
  136|  16.3k|  std::uint_fast64_t v = 0;
  137|   146k|  for (int i = 0; i != (64 / 8); ++i) v = (v << 8) | Decode8(cp++);
  ------------------
  |  Branch (137:19): [True: 130k, False: 16.3k]
  ------------------
  138|  16.3k|  const std::int_fast64_t s64max = 0x7fffffffffffffff;
  139|  16.3k|  const auto s64maxU = static_cast<std::uint_fast64_t>(s64max);
  140|  16.3k|  if (v <= s64maxU) return static_cast<std::int_fast64_t>(v);
  ------------------
  |  Branch (140:7): [True: 15.4k, False: 919]
  ------------------
  141|    919|  return static_cast<std::int_fast64_t>(v - s64maxU - 1) - s64max - 1;
  142|  16.3k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_17Decode8EPKc:
  116|   163k|inline std::uint_fast8_t Decode8(const char* cp) {
  117|   163k|  return static_cast<std::uint_fast8_t>(*cp) & 0xff;
  118|   163k|}
time_zone_info.cc:_ZZN4cctz12TimeZoneInfo4LoadEPNS_14ZoneInfoSourceEENK3$_0clES2_:
  846|  4.28k|    auto get_char = [](ZoneInfoSource* azip) -> int {
  847|  4.28k|      unsigned char ch;  // all non-EOF results are positive
  848|  4.28k|      return (azip->Read(&ch, 1) == 1) ? ch : EOF;
  ------------------
  |  Branch (848:14): [True: 4.28k, False: 0]
  ------------------
  849|  4.28k|    };
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_19YearShiftERKNS_6detail10civil_timeINS1_10second_tagEEEl:
  263|  3.29k|inline civil_second YearShift(const civil_second& cs, year_t shift) {
  264|  3.29k|  return civil_second(cs.year() + shift, cs.month(), cs.day(),
  265|  3.29k|                      cs.hour(), cs.minute(), cs.second());
  266|  3.29k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110MakeUniqueERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
  232|  13.3k|inline time_zone::civil_lookup MakeUnique(const time_point<seconds>& tp) {
  233|  13.3k|  time_zone::civil_lookup cl;
  234|  13.3k|  cl.kind = time_zone::civil_lookup::UNIQUE;
  235|  13.3k|  cl.pre = cl.trans = cl.post = tp;
  236|  13.3k|  return cl;
  237|  13.3k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110MakeUniqueEl:
  239|  13.1k|inline time_zone::civil_lookup MakeUnique(std::int_fast64_t unix_time) {
  240|  13.1k|  return MakeUnique(FromUnixSeconds(unix_time));
  241|  13.1k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_111MakeSkippedERKNS_10TransitionERKNS_6detail10civil_timeINS4_10second_tagEEE:
  244|     11|                                           const civil_second& cs) {
  245|     11|  time_zone::civil_lookup cl;
  246|     11|  cl.kind = time_zone::civil_lookup::SKIPPED;
  247|     11|  cl.pre = FromUnixSeconds(tr.unix_time - 1 + (cs - tr.prev_civil_sec));
  248|     11|  cl.trans = FromUnixSeconds(tr.unix_time);
  249|     11|  cl.post = FromUnixSeconds(tr.unix_time - (tr.civil_sec - cs));
  250|     11|  return cl;
  251|     11|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_112MakeRepeatedERKNS_10TransitionERKNS_6detail10civil_timeINS4_10second_tagEEE:
  254|     38|                                            const civil_second& cs) {
  255|     38|  time_zone::civil_lookup cl;
  256|     38|  cl.kind = time_zone::civil_lookup::REPEATED;
  257|     38|  cl.pre = FromUnixSeconds(tr.unix_time - 1 - (tr.prev_civil_sec - cs));
  258|     38|  cl.trans = FromUnixSeconds(tr.unix_time);
  259|     38|  cl.post = FromUnixSeconds(tr.unix_time + (cs - tr.civil_sec));
  260|     38|  return cl;
  261|     38|}
time_zone_info.cc:_ZZN4cctz12TimeZoneInfo4LoadERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clES9_:
  941|    977|      name, [](const std::string& n) -> std::unique_ptr<ZoneInfoSource> {
  942|    977|        if (auto z = FileZoneInfoSource::Open(n)) return z;
  ------------------
  |  Branch (942:18): [True: 263, False: 714]
  ------------------
  943|    714|        if (auto z = AndroidZoneInfoSource::Open(n)) return z;
  ------------------
  |  Branch (943:18): [True: 0, False: 714]
  ------------------
  944|    714|        if (auto z = FuchsiaZoneInfoSource::Open(n)) return z;
  ------------------
  |  Branch (944:18): [True: 0, False: 714]
  ------------------
  945|    714|        return nullptr;
  946|    714|      });
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSource4OpenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  500|    977|    const std::string& name) {
  501|       |  // Use of the "file:" prefix is intended for testing purposes only.
  502|    977|  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
  ------------------
  |  Branch (502:27): [True: 34, False: 943]
  ------------------
  503|       |
  504|       |  // Reject unsafe paths (e.g., "../../etc/passwd").
  505|    977|  if (UnsafePath(name, pos)) {
  ------------------
  |  Branch (505:7): [True: 20, False: 957]
  ------------------
  506|     20|    return nullptr;
  507|     20|  }
  508|       |
  509|       |  // Map the time-zone name to a path name.
  510|    957|  std::string path;
  511|    957|  if (pos == name.size() || name[pos] != '/') {
  ------------------
  |  Branch (511:7): [True: 15, False: 942]
  |  Branch (511:29): [True: 926, False: 16]
  ------------------
  512|    941|    const char* tzdir = "/usr/share/zoneinfo";
  513|    941|    char* tzdir_env = nullptr;
  514|       |#if defined(_MSC_VER)
  515|       |    _dupenv_s(&tzdir_env, nullptr, "TZDIR");
  516|       |#else
  517|    941|    tzdir_env = std::getenv("TZDIR");
  518|    941|#endif
  519|    941|    if (tzdir_env && *tzdir_env) tzdir = tzdir_env;
  ------------------
  |  Branch (519:9): [True: 0, False: 941]
  |  Branch (519:22): [True: 0, False: 0]
  ------------------
  520|    941|    path += tzdir;
  521|    941|    path += '/';
  522|       |#if defined(_MSC_VER)
  523|       |    free(tzdir_env);
  524|       |#endif
  525|    941|  }
  526|    957|  path.append(name, pos, std::string::npos);
  527|       |
  528|       |  // Open the zoneinfo file.
  529|    957|  auto fp = FOpen(path.c_str());
  530|    957|  if (fp == nullptr) return nullptr;
  ------------------
  |  Branch (530:7): [True: 694, False: 263]
  ------------------
  531|    263|  return std::unique_ptr<ZoneInfoSource>(new FileZoneInfoSource(std::move(fp)));
  532|    957|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110UnsafePathERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEm:
  455|  1.69k|bool UnsafePath(const std::string& name, std::size_t pos) {
  456|       |  // Path traversal: a ".." component that is at the beginning or preceded
  457|       |  // by a separator, and at the end or followed by a separator.
  458|  34.4k|  for (auto i = pos; (i = name.find("..", i)) != std::string::npos; i += 2) {
  ------------------
  |  Branch (458:22): [True: 32.8k, False: 1.65k]
  ------------------
  459|  32.8k|    if ((i == pos || IsPathSeparator(name[i - 1])) &&
  ------------------
  |  Branch (459:10): [True: 118, False: 32.7k]
  |  Branch (459:22): [True: 3.40k, False: 29.3k]
  ------------------
  460|  3.52k|        (i == name.size() - 2 || IsPathSeparator(name[i + 2]))) {
  ------------------
  |  Branch (460:10): [True: 34, False: 3.48k]
  |  Branch (460:34): [True: 6, False: 3.48k]
  ------------------
  461|     40|      return true;
  462|     40|    }
  463|  32.8k|  }
  464|  1.65k|  return false;
  465|  1.69k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_115IsPathSeparatorEc:
  446|  36.1k|inline bool IsPathSeparator(char c) {
  447|       |#if defined(_WIN32)
  448|       |  return c == '/' || c == '\\';
  449|       |#else
  450|  36.1k|  return c == '/';
  451|  36.1k|#endif
  452|  36.1k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_15FOpenEPKc:
  400|  5.82k|inline FilePtr FOpen(const char* path) {
  401|       |#if defined(_MSC_VER)
  402|       |  FILE* fp;
  403|       |  if (fopen_s(&fp, path, "rb") != 0) fp = nullptr;
  404|       |  return FilePtr(fp, fclose);
  405|       |#else
  406|       |  // Open non-blocking and verify the target is a regular file before handing it
  407|       |  // to stdio. Zone names are potentially attacker-controlled, and a plain
  408|       |  // fopen() on a FIFO or device node (reachable via the "file:" prefix or an
  409|       |  // absolute path) would block indefinitely or read unbounded data.
  410|       |#ifndef O_CLOEXEC
  411|       |#define O_CLOEXEC 0
  412|       |#endif
  413|       |#ifndef O_NONBLOCK
  414|       |#define O_NONBLOCK 0
  415|       |#endif
  416|  5.82k|  const int fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
  417|  5.82k|  if (fd >= 0) {
  ------------------
  |  Branch (417:7): [True: 308, False: 5.51k]
  ------------------
  418|       |#if defined(__APPLE__)
  419|       |    // On Apple platforms, avoid fstat() to prevent triggering Apple's Required
  420|       |    // Reason API (NSPrivacyAccessedAPICategoryFileTimestamp) scanner.
  421|       |    // Security implications of skipping this check on Apple platforms:
  422|       |    //   - FIFO hangs are mitigated by O_NONBLOCK
  423|       |    //   - Path traversal is handled by UnsafePath()
  424|       |    //   - /usr/share/zoneinfo is a read-only system volume on iOS
  425|       |    // On general POSIX operating systems, the check remains as
  426|       |    // defense-in-depth.
  427|       |    auto is_regular = [](int) { return true; };
  428|       |#else
  429|    308|    auto is_regular = [](int stat_fd) {
  430|    308|      struct stat st;
  431|    308|      return fstat(stat_fd, &st) == 0 && S_ISREG(st.st_mode);
  432|    308|    };
  433|    308|#endif
  434|    308|    if (is_regular(fd)) {
  ------------------
  |  Branch (434:9): [True: 263, False: 45]
  ------------------
  435|    263|      FILE* fp = fdopen(fd, "rb");
  436|    263|      if (fp != nullptr) return FilePtr(fp, std::fclose);
  ------------------
  |  Branch (436:11): [True: 263, False: 0]
  ------------------
  437|    263|    }
  438|     45|    close(fd);
  439|     45|  }
  440|  5.56k|  return FilePtr(nullptr, std::fclose);
  441|  5.82k|#endif
  442|  5.82k|}
time_zone_info.cc:_ZZN4cctz12_GLOBAL__N_15FOpenEPKcENKUliE_clEi:
  429|    308|    auto is_regular = [](int stat_fd) {
  430|    308|      struct stat st;
  431|    308|      return fstat(stat_fd, &st) == 0 && S_ISREG(st.st_mode);
  ------------------
  |  Branch (431:14): [True: 308, False: 0]
  |  Branch (431:42): [True: 263, False: 45]
  ------------------
  432|    308|    };
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSourceC2ENSt3__110unique_ptrI8_IO_FILEPFiPS4_EEEm:
  492|    263|      : fp_(std::move(fp)), len_(len) {}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSource4ReadEPvm:
  472|  5.07k|  std::size_t Read(void* ptr, std::size_t size) override {
  473|  5.07k|    size = std::min(size, len_);
  474|  5.07k|    std::size_t nread = std::fread(ptr, 1, size, fp_.get());
  475|  5.07k|    len_ -= nread;
  476|  5.07k|    return nread;
  477|  5.07k|  }
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSource4SkipEm:
  478|    262|  int Skip(std::size_t offset) override {
  479|    262|    offset = std::min(offset, len_);
  480|    262|    int rc = std::fseek(fp_.get(), static_cast<long>(offset), SEEK_CUR);
  481|    262|    if (rc == 0) len_ -= offset;
  ------------------
  |  Branch (481:9): [True: 262, False: 0]
  ------------------
  482|    262|    return rc;
  483|    262|  }
time_zone_info.cc:_ZNK4cctz12_GLOBAL__N_118FileZoneInfoSource7VersionEv:
  484|    262|  std::string Version() const override {
  485|       |    // TODO: It would nice if the zoneinfo data included the tzdb version.
  486|    262|    return std::string();
  487|    262|  }
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_121AndroidZoneInfoSource4OpenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  547|    714|    const std::string& name) {
  548|       |  // Use of the "file:" prefix is intended for testing purposes only.
  549|    714|  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
  ------------------
  |  Branch (549:27): [True: 31, False: 683]
  ------------------
  550|       |
  551|       |  // See Android's libc/tzcode/bionic.cpp for additional information.
  552|    714|  for (const char* tzdata : {"/apex/com.android.tzdata/etc/tz/tzdata",
  ------------------
  |  Branch (552:27): [True: 2.14k, False: 714]
  ------------------
  553|    714|                             "/data/misc/zoneinfo/current/tzdata",
  554|  2.14k|                             "/system/usr/share/zoneinfo/tzdata"}) {
  555|  2.14k|    auto fp = FOpen(tzdata);
  556|  2.14k|    if (fp == nullptr) continue;
  ------------------
  |  Branch (556:9): [True: 2.14k, False: 0]
  ------------------
  557|       |
  558|      0|    char hbuf[24];  // covers header.zonetab_offset too
  559|      0|    if (std::fread(hbuf, 1, sizeof(hbuf), fp.get()) != sizeof(hbuf)) continue;
  ------------------
  |  Branch (559:9): [True: 0, False: 0]
  ------------------
  560|      0|    if (std::strncmp(hbuf, "tzdata", 6) != 0) continue;
  ------------------
  |  Branch (560:9): [True: 0, False: 0]
  ------------------
  561|      0|    const char* vers = (hbuf[11] == '\0') ? hbuf + 6 : "";
  ------------------
  |  Branch (561:24): [True: 0, False: 0]
  ------------------
  562|      0|    const std::int_fast32_t index_offset = Decode32(hbuf + 12);
  563|      0|    const std::int_fast32_t data_offset = Decode32(hbuf + 16);
  564|      0|    if (index_offset < 0 || data_offset < index_offset) continue;
  ------------------
  |  Branch (564:9): [True: 0, False: 0]
  |  Branch (564:29): [True: 0, False: 0]
  ------------------
  565|      0|    if (std::fseek(fp.get(), static_cast<long>(index_offset), SEEK_SET) != 0)
  ------------------
  |  Branch (565:9): [True: 0, False: 0]
  ------------------
  566|      0|      continue;
  567|       |
  568|      0|    char ebuf[52];  // covers entry.unused too
  569|      0|    const std::size_t index_size =
  570|      0|        static_cast<std::size_t>(data_offset - index_offset);
  571|      0|    const std::size_t zonecnt = index_size / sizeof(ebuf);
  572|      0|    if (zonecnt * sizeof(ebuf) != index_size) continue;
  ------------------
  |  Branch (572:9): [True: 0, False: 0]
  ------------------
  573|      0|    for (std::size_t i = 0; i != zonecnt; ++i) {
  ------------------
  |  Branch (573:29): [True: 0, False: 0]
  ------------------
  574|      0|      if (std::fread(ebuf, 1, sizeof(ebuf), fp.get()) != sizeof(ebuf)) break;
  ------------------
  |  Branch (574:11): [True: 0, False: 0]
  ------------------
  575|      0|      const std::int_fast64_t start =
  576|      0|          std::int_fast64_t{data_offset} + Decode32(ebuf + 40);
  577|      0|      const std::int_fast32_t length = Decode32(ebuf + 44);
  578|      0|      if (start < 0 || length < 0) break;
  ------------------
  |  Branch (578:11): [True: 0, False: 0]
  |  Branch (578:24): [True: 0, False: 0]
  ------------------
  579|       |      // std::fseek() takes a long
  580|      0|      if (start > std::numeric_limits<long>::max()) break;
  ------------------
  |  Branch (580:11): [True: 0, False: 0]
  ------------------
  581|      0|      ebuf[40] = '\0';  // ensure zone name is NUL terminated
  582|      0|      if (strcmp(name.c_str() + pos, ebuf) == 0) {
  ------------------
  |  Branch (582:11): [True: 0, False: 0]
  ------------------
  583|      0|        if (std::fseek(fp.get(), static_cast<long>(start), SEEK_SET) != 0)
  ------------------
  |  Branch (583:13): [True: 0, False: 0]
  ------------------
  584|      0|          break;
  585|      0|        return std::unique_ptr<ZoneInfoSource>(new AndroidZoneInfoSource(
  586|      0|            std::move(fp), static_cast<std::size_t>(length), vers));
  587|      0|      }
  588|      0|    }
  589|      0|  }
  590|       |
  591|    714|  return nullptr;
  592|    714|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_121FuchsiaZoneInfoSource4OpenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  614|    714|    const std::string& name) {
  615|       |  // Use of the "file:" prefix is intended for testing purposes only.
  616|    714|  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
  ------------------
  |  Branch (616:27): [True: 31, False: 683]
  ------------------
  617|       |
  618|       |  // Reject unsafe paths (e.g., "../../etc/passwd").
  619|    714|  if (UnsafePath(name, pos)) {
  ------------------
  |  Branch (619:7): [True: 20, False: 694]
  ------------------
  620|     20|    return nullptr;
  621|     20|  }
  622|       |
  623|       |  // Prefixes where a Fuchsia component might find zoneinfo files,
  624|       |  // in descending order of preference.
  625|    694|  const auto kTzdataPrefixes = {
  626|       |      // The tzdata from `config-data`.
  627|    694|      "/config/data/tzdata/",
  628|       |      // The tzdata bundled in the component's package.
  629|    694|      "/pkg/data/tzdata/",
  630|       |      // General data storage.
  631|    694|      "/data/tzdata/",
  632|       |      // The recommended path for routed-in tzdata files.
  633|       |      // See for details:
  634|       |      // https://fuchsia.dev/fuchsia-src/concepts/process/namespaces?hl=en#typical_directory_structure
  635|    694|      "/config/tzdata/",
  636|    694|  };
  637|    694|  const auto kEmptyPrefix = {""};
  638|    694|  const bool name_absolute = (pos != name.size() && name[pos] == '/');
  ------------------
  |  Branch (638:31): [True: 679, False: 15]
  |  Branch (638:53): [True: 16, False: 663]
  ------------------
  639|    694|  const auto prefixes = name_absolute ? kEmptyPrefix : kTzdataPrefixes;
  ------------------
  |  Branch (639:25): [True: 16, False: 678]
  ------------------
  640|       |
  641|       |  // Fuchsia builds place zoneinfo files at "<prefix><format><name>".
  642|  2.72k|  for (const std::string prefix : prefixes) {
  ------------------
  |  Branch (642:33): [True: 2.72k, False: 694]
  ------------------
  643|  2.72k|    std::string path = prefix;
  644|  2.72k|    if (!prefix.empty()) path += "zoneinfo/tzif2/";  // format
  ------------------
  |  Branch (644:9): [True: 2.71k, False: 16]
  ------------------
  645|  2.72k|    path.append(name, pos, std::string::npos);
  646|       |
  647|  2.72k|    auto fp = FOpen(path.c_str());
  648|  2.72k|    if (fp == nullptr) continue;
  ------------------
  |  Branch (648:9): [True: 2.72k, False: 0]
  ------------------
  649|       |
  650|      0|    std::string version;
  651|      0|    if (!prefix.empty()) {
  ------------------
  |  Branch (651:9): [True: 0, False: 0]
  ------------------
  652|       |      // Fuchsia builds place the version in "<prefix>revision.txt".
  653|      0|      std::ifstream version_stream(prefix + "revision.txt");
  654|      0|      if (version_stream.is_open()) {
  ------------------
  |  Branch (654:11): [True: 0, False: 0]
  ------------------
  655|       |        // revision.txt should contain no newlines, but to be
  656|       |        // defensive we read just the first line.
  657|      0|        std::getline(version_stream, version);
  658|      0|      }
  659|      0|    }
  660|       |
  661|      0|    return std::unique_ptr<ZoneInfoSource>(
  662|      0|        new FuchsiaZoneInfoSource(std::move(fp), std::move(version)));
  663|  2.72k|  }
  664|       |
  665|    694|  return nullptr;
  666|    694|}

_ZNK4cctz10Transition10ByUnixTimeclERKS0_S3_:
   41|  20.5k|    inline bool operator()(const Transition& lhs, const Transition& rhs) const {
   42|  20.5k|      return lhs.unix_time < rhs.unix_time;
   43|  20.5k|    }
_ZNK4cctz10Transition11ByCivilTimeclERKS0_S3_:
   46|  35.7k|    inline bool operator()(const Transition& lhs, const Transition& rhs) const {
   47|  35.7k|      return lhs.civil_sec < rhs.civil_sec;
   48|  35.7k|    }
_ZN4cctz12TimeZoneInfoC2Ev:
   81|  1.30k|  TimeZoneInfo() = default;

_ZN4cctz12TimeZoneLibC4MakeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  218|    256|std::unique_ptr<TimeZoneLibC> TimeZoneLibC::Make(const std::string& name) {
  219|    256|  return std::unique_ptr<TimeZoneLibC>(new TimeZoneLibC(name));
  220|    256|}
_ZNK4cctz12TimeZoneLibC9BreakTimeERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
  223|  1.52k|    const time_point<seconds>& tp) const {
  224|  1.52k|  time_zone::absolute_lookup al;
  225|  1.52k|  al.offset = 0;
  226|  1.52k|  al.is_dst = false;
  227|  1.52k|  al.abbr = "-00";
  228|       |
  229|  1.52k|  const std::int_fast64_t s = ToUnixSeconds(tp);
  230|       |
  231|       |  // If std::time_t cannot hold the input we saturate the output.
  232|  1.52k|  if (s < std::numeric_limits<std::time_t>::min()) {
  ------------------
  |  Branch (232:7): [True: 0, False: 1.52k]
  ------------------
  233|      0|    al.cs = civil_second::min();
  234|      0|    return al;
  235|      0|  }
  236|  1.52k|  if (s > std::numeric_limits<std::time_t>::max()) {
  ------------------
  |  Branch (236:7): [True: 0, False: 1.52k]
  ------------------
  237|      0|    al.cs = civil_second::max();
  238|      0|    return al;
  239|      0|  }
  240|       |
  241|  1.52k|  const std::time_t t = static_cast<std::time_t>(s);
  242|  1.52k|  std::tm tm;
  243|  1.52k|  std::tm* tmp = local_ ? local_time(&t, &tm) : gm_time(&t, &tm);
  ------------------
  |  Branch (243:18): [True: 448, False: 1.07k]
  ------------------
  244|       |
  245|       |  // If std::tm cannot hold the result we saturate the output.
  246|  1.52k|  if (tmp == nullptr) {
  ------------------
  |  Branch (246:7): [True: 414, False: 1.10k]
  ------------------
  247|    414|    al.cs = (s < 0) ? civil_second::min() : civil_second::max();
  ------------------
  |  Branch (247:13): [True: 195, False: 219]
  ------------------
  248|    414|    return al;
  249|    414|  }
  250|       |
  251|  1.10k|  const year_t year = tmp->tm_year + year_t{1900};
  252|  1.10k|  al.cs = civil_second(year, tmp->tm_mon + 1, tmp->tm_mday,
  253|  1.10k|                       tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
  254|  1.10k|  al.offset = static_cast<int>(tm_gmtoff(*tmp));
  255|  1.10k|  al.abbr = local_ ? tm_zone(*tmp) : "UTC";  // as expected by cctz
  ------------------
  |  Branch (255:13): [True: 325, False: 784]
  ------------------
  256|  1.10k|  al.is_dst = tmp->tm_isdst > 0;
  257|  1.10k|  return al;
  258|  1.52k|}
_ZNK4cctz12TimeZoneLibC8MakeTimeERKNS_6detail10civil_timeINS1_10second_tagEEE:
  260|  2.25k|time_zone::civil_lookup TimeZoneLibC::MakeTime(const civil_second& cs) const {
  261|  2.25k|  if (!local_) {
  ------------------
  |  Branch (261:7): [True: 1.60k, False: 651]
  ------------------
  262|       |    // If time_point<seconds> cannot hold the result we saturate.
  263|  1.60k|    static const civil_second min_tp_cs =
  264|  1.60k|        civil_second() + ToUnixSeconds(time_point<seconds>::min());
  265|  1.60k|    static const civil_second max_tp_cs =
  266|  1.60k|        civil_second() + ToUnixSeconds(time_point<seconds>::max());
  267|  1.60k|    const time_point<seconds> tp =
  268|  1.60k|        (cs < min_tp_cs)
  ------------------
  |  Branch (268:9): [True: 106, False: 1.50k]
  ------------------
  269|  1.60k|            ? time_point<seconds>::min()
  270|  1.60k|            : (cs > max_tp_cs) ? time_point<seconds>::max()
  ------------------
  |  Branch (270:15): [True: 101, False: 1.39k]
  ------------------
  271|  1.50k|                               : FromUnixSeconds(cs - civil_second());
  272|  1.60k|    return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  273|  1.60k|  }
  274|       |
  275|       |  // If tm_year cannot hold the requested year we saturate the result.
  276|    651|  if (cs.year() < 0) {
  ------------------
  |  Branch (276:7): [True: 394, False: 257]
  ------------------
  277|    394|    if (cs.year() < std::numeric_limits<int>::min() + year_t{1900}) {
  ------------------
  |  Branch (277:9): [True: 88, False: 306]
  ------------------
  278|     88|      const time_point<seconds> tp = time_point<seconds>::min();
  279|     88|      return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  280|     88|    }
  281|    394|  } else {
  282|    257|    if (cs.year() - year_t{1900} > std::numeric_limits<int>::max()) {
  ------------------
  |  Branch (282:9): [True: 34, False: 223]
  ------------------
  283|     34|      const time_point<seconds> tp = time_point<seconds>::max();
  284|     34|      return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  285|     34|    }
  286|    257|  }
  287|       |
  288|       |  // We probe with "is_dst" values of 0 and 1 to try to distinguish unique
  289|       |  // civil seconds from skipped or repeated ones.  This is not always possible
  290|       |  // however, as the "dst" flag does not change over some offset transitions.
  291|       |  // We are also subject to the vagaries of mktime() implementations. For
  292|       |  // example, some implementations treat "tm_isdst" as a demand (useless),
  293|       |  // and some as a disambiguator (useful).
  294|    529|  std::time_t t0, t1;
  295|    529|  std::tm tm0, tm1;
  296|    529|  if (make_time(cs, 0, &t0, &tm0) && make_time(cs, 1, &t1, &tm1)) {
  ------------------
  |  Branch (296:7): [True: 529, False: 0]
  |  Branch (296:38): [True: 528, False: 1]
  ------------------
  297|    528|    if (tm0.tm_isdst == tm1.tm_isdst) {
  ------------------
  |  Branch (297:9): [True: 528, False: 0]
  ------------------
  298|       |      // The civil time was singular (pre == trans == post).
  299|    528|      const time_point<seconds> tp = FromUnixSeconds(tm0.tm_isdst ? t1 : t0);
  ------------------
  |  Branch (299:54): [True: 0, False: 528]
  ------------------
  300|    528|      return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  301|    528|    }
  302|       |
  303|      0|    tm_gmtoff_t offset = tm_gmtoff(tm0);
  304|      0|    if (t0 < t1) {  // negative DST
  ------------------
  |  Branch (304:9): [True: 0, False: 0]
  ------------------
  305|      0|      std::swap(t0, t1);
  306|      0|      offset = tm_gmtoff(tm1);
  307|      0|    }
  308|       |
  309|      0|    const std::time_t tt = find_trans(t1, t0, offset);
  310|      0|    const time_point<seconds> trans = FromUnixSeconds(tt);
  311|       |
  312|      0|    if (tm0.tm_isdst) {
  ------------------
  |  Branch (312:9): [True: 0, False: 0]
  ------------------
  313|       |      // The civil time did not exist (pre >= trans > post).
  314|      0|      const time_point<seconds> pre = FromUnixSeconds(t0);
  315|      0|      const time_point<seconds> post = FromUnixSeconds(t1);
  316|      0|      return {time_zone::civil_lookup::SKIPPED, pre, trans, post};
  317|      0|    }
  318|       |
  319|       |    // The civil time was ambiguous (pre < trans <= post).
  320|      0|    const time_point<seconds> pre = FromUnixSeconds(t1);
  321|      0|    const time_point<seconds> post = FromUnixSeconds(t0);
  322|      0|    return {time_zone::civil_lookup::REPEATED, pre, trans, post};
  323|      0|  }
  324|       |
  325|       |  // make_time() failed somehow so we saturate the result.
  326|      1|  const time_point<seconds> tp = (cs < civil_second())
  ------------------
  |  Branch (326:34): [True: 1, False: 0]
  ------------------
  327|      1|                                     ? time_point<seconds>::min()
  328|      1|                                     : time_point<seconds>::max();
  329|      1|  return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  330|    529|}
_ZN4cctz12TimeZoneLibCC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  351|    256|    : local_(name == "localtime") {}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_110local_timeEPKlP2tm:
  153|    451|inline std::tm* local_time(const std::time_t *timep, std::tm *result) {
  154|       |#if defined(_WIN32)
  155|       |    return localtime_s(result, timep) ? nullptr : result;
  156|       |#else
  157|    451|    return localtime_r(timep, result);
  158|    451|#endif
  159|    451|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_17gm_timeEPKlP2tm:
  145|  1.07k|inline std::tm* gm_time(const std::time_t *timep, std::tm *result) {
  146|       |#if defined(_WIN32)
  147|       |    return gmtime_s(result, timep) ? nullptr : result;
  148|       |#else
  149|  1.07k|    return gmtime_r(timep, result);
  150|  1.07k|#endif
  151|  1.07k|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_19make_timeERKNS_6detail10civil_timeINS1_10second_tagEEEiPlP2tm:
  165|  1.05k|               std::tm* tm) {
  166|  1.05k|  tm->tm_year = static_cast<int>(cs.year() - year_t{1900});
  167|  1.05k|  tm->tm_mon = cs.month() - 1;
  168|  1.05k|  tm->tm_mday = cs.day();
  169|  1.05k|  tm->tm_hour = cs.hour();
  170|  1.05k|  tm->tm_min = cs.minute();
  171|  1.05k|  tm->tm_sec = cs.second();
  172|  1.05k|  tm->tm_isdst = is_dst;
  173|  1.05k|  *t = std::mktime(tm);
  174|  1.05k|  if (*t == std::time_t{-1}) {
  ------------------
  |  Branch (174:7): [True: 3, False: 1.05k]
  ------------------
  175|      3|    std::tm tm2;
  176|      3|    const std::tm* tmp = local_time(t, &tm2);
  177|      3|    if (tmp == nullptr || tmp->tm_year != tm->tm_year ||
  ------------------
  |  Branch (177:9): [True: 0, False: 3]
  |  Branch (177:27): [True: 1, False: 2]
  ------------------
  178|      2|        tmp->tm_mon != tm->tm_mon || tmp->tm_mday != tm->tm_mday ||
  ------------------
  |  Branch (178:9): [True: 0, False: 2]
  |  Branch (178:38): [True: 0, False: 2]
  ------------------
  179|      2|        tmp->tm_hour != tm->tm_hour || tmp->tm_min != tm->tm_min ||
  ------------------
  |  Branch (179:9): [True: 0, False: 2]
  |  Branch (179:40): [True: 0, False: 2]
  ------------------
  180|      2|        tmp->tm_sec != tm->tm_sec) {
  ------------------
  |  Branch (180:9): [True: 0, False: 2]
  ------------------
  181|       |      // A true error (not just one second before the epoch).
  182|      1|      return false;
  183|      1|    }
  184|      3|  }
  185|  1.05k|  return true;
  186|  1.05k|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_19tm_gmtoffI2tmEEDtdtfp_9tm_gmtoffERKT_:
  116|  1.10k|auto tm_gmtoff(const T& tm) -> decltype(tm.tm_gmtoff) {
  117|  1.10k|  return tm.tm_gmtoff;
  118|  1.10k|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_17tm_zoneI2tmEEDtdtfp_7tm_zoneERKT_:
  134|    325|auto tm_zone(const T& tm) -> decltype(tm.tm_zone) {
  135|    325|  return tm.tm_zone;
  136|    325|}

_ZNK4cctz9time_zone6lookupERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
   53|  10.1k|    const time_point<seconds>& tp) const {
   54|  10.1k|  return effective_impl().BreakTime(tp);
   55|  10.1k|}
_ZNK4cctz9time_zone6lookupERKNS_6detail10civil_timeINS1_10second_tagEEE:
   57|  15.6k|time_zone::civil_lookup time_zone::lookup(const civil_second& cs) const {
   58|  15.6k|  return effective_impl().MakeTime(cs);
   59|  15.6k|}
_ZNK4cctz9time_zone14effective_implEv:
   79|  25.7k|const time_zone::Impl& time_zone::effective_impl() const {
   80|  25.7k|  if (impl_ == nullptr) {
  ------------------
  |  Branch (80:7): [True: 0, False: 25.7k]
  ------------------
   81|       |    // Dereferencing an implicit-UTC time_zone is expected to be
   82|       |    // rare, so we don't mind paying a small synchronization cost.
   83|      0|    return *time_zone::Impl::UTC().impl_;
   84|      0|  }
   85|  25.7k|  return *impl_;
   86|  25.7k|}
_ZN4cctz14load_time_zoneERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPNS_9time_zoneE:
   88|  10.0k|bool load_time_zone(const std::string& name, time_zone* tz) {
   89|  10.0k|  return time_zone::Impl::LoadTimeZone(name, tz);
   90|  10.0k|}
_ZN4cctz13utc_time_zoneEv:
   92|    209|time_zone utc_time_zone() {
   93|    209|  return time_zone::Impl::UTC();  // avoid name lookup
   94|    209|}

_ZN4cctz14ParsePosixSpecERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPNS_13PosixTimeZoneE:
  135|    262|bool ParsePosixSpec(const std::string& spec, PosixTimeZone* res) {
  136|    262|  const char* p = spec.c_str();
  137|    262|  if (*p == ':') return false;
  ------------------
  |  Branch (137:7): [True: 0, False: 262]
  ------------------
  138|       |
  139|    262|  p = ParseAbbr(p, &res->std_abbr);
  140|    262|  p = ParseOffset(p, 0, 24, -1, &res->std_offset);
  141|    262|  if (p == nullptr) return false;
  ------------------
  |  Branch (141:7): [True: 0, False: 262]
  ------------------
  142|    262|  if (*p == '\0') return true;
  ------------------
  |  Branch (142:7): [True: 139, False: 123]
  ------------------
  143|       |
  144|    123|  p = ParseAbbr(p, &res->dst_abbr);
  145|    123|  if (p == nullptr) return false;
  ------------------
  |  Branch (145:7): [True: 0, False: 123]
  ------------------
  146|    123|  res->dst_offset = res->std_offset + (60 * 60);  // default
  147|    123|  if (*p != ',') p = ParseOffset(p, 0, 24, -1, &res->dst_offset);
  ------------------
  |  Branch (147:7): [True: 0, False: 123]
  ------------------
  148|       |
  149|    123|  p = ParseDateTime(p, &res->dst_start);
  150|    123|  p = ParseDateTime(p, &res->dst_end);
  151|       |
  152|    123|  return p != nullptr && *p == '\0';
  ------------------
  |  Branch (152:10): [True: 123, False: 0]
  |  Branch (152:26): [True: 123, False: 0]
  ------------------
  153|    123|}
time_zone_posix.cc:_ZN4cctz12_GLOBAL__N_19ParseAbbrEPKcPNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
   46|    385|const char* ParseAbbr(const char* p, std::string* abbr) {
   47|    385|  const char* op = p;
   48|    385|  if (*p == '<') {  // special zoneinfo <...> form
  ------------------
  |  Branch (48:7): [True: 6, False: 379]
  ------------------
   49|      6|    if (*++p == '>' || *p == '\0') return nullptr;  // no "<>"
  ------------------
  |  Branch (49:9): [True: 0, False: 6]
  |  Branch (49:24): [True: 0, False: 6]
  ------------------
   50|     18|    while (*++p != '>') {
  ------------------
  |  Branch (50:12): [True: 12, False: 6]
  ------------------
   51|     12|      if (*p == '\0') return nullptr;
  ------------------
  |  Branch (51:11): [True: 0, False: 12]
  ------------------
   52|     12|    }
   53|      6|    abbr->assign(op + 1, static_cast<std::size_t>(p - op) - 1);
   54|      6|    return ++p;
   55|      6|  }
   56|  1.63k|  while (*p != '\0') {
  ------------------
  |  Branch (56:10): [True: 1.63k, False: 0]
  ------------------
   57|  1.63k|    if (strchr("-+,", *p)) break;
  ------------------
  |  Branch (57:9): [True: 197, False: 1.43k]
  ------------------
   58|  1.43k|    if (strchr(kDigits, *p)) break;
  ------------------
  |  Branch (58:9): [True: 182, False: 1.25k]
  ------------------
   59|  1.25k|    ++p;
   60|  1.25k|  }
   61|    379|  if (p - op < 3) return nullptr;
  ------------------
  |  Branch (61:7): [True: 0, False: 379]
  ------------------
   62|    379|  abbr->assign(op, static_cast<std::size_t>(p - op));
   63|    379|  return p;
   64|    379|}
time_zone_posix.cc:_ZN4cctz12_GLOBAL__N_111ParseOffsetEPKciiiPl:
   68|    397|                        std::int_fast32_t* offset) {
   69|    397|  if (p == nullptr) return nullptr;
  ------------------
  |  Branch (69:7): [True: 0, False: 397]
  ------------------
   70|    397|  if (*p == '+' || *p == '-') {
  ------------------
  |  Branch (70:7): [True: 0, False: 397]
  |  Branch (70:20): [True: 80, False: 317]
  ------------------
   71|     80|    if (*p++ == '-') sign = -sign;
  ------------------
  |  Branch (71:9): [True: 80, False: 0]
  ------------------
   72|     80|  }
   73|    397|  int hours = 0;
   74|    397|  int minutes = 0;
   75|    397|  int seconds = 0;
   76|       |
   77|    397|  p = ParseInt(p, min_hour, max_hour, &hours);
   78|    397|  if (p == nullptr) return nullptr;
  ------------------
  |  Branch (78:7): [True: 0, False: 397]
  ------------------
   79|    397|  if (*p == ':') {
  ------------------
  |  Branch (79:7): [True: 0, False: 397]
  ------------------
   80|      0|    p = ParseInt(p + 1, 0, 59, &minutes);
   81|      0|    if (p == nullptr) return nullptr;
  ------------------
  |  Branch (81:9): [True: 0, False: 0]
  ------------------
   82|      0|    if (*p == ':') {
  ------------------
  |  Branch (82:9): [True: 0, False: 0]
  ------------------
   83|      0|      p = ParseInt(p + 1, 0, 59, &seconds);
   84|      0|      if (p == nullptr) return nullptr;
  ------------------
  |  Branch (84:11): [True: 0, False: 0]
  ------------------
   85|      0|    }
   86|      0|  }
   87|    397|  *offset = sign * ((((hours * 60) + minutes) * 60) + seconds);
   88|    397|  return p;
   89|    397|}
time_zone_posix.cc:_ZN4cctz12_GLOBAL__N_18ParseIntEPKciiPi:
   28|  1.13k|const char* ParseInt(const char* p, int min, int max, int* vp) {
   29|  1.13k|  int value = 0;
   30|  1.13k|  const char* op = p;
   31|  1.13k|  const int kMaxInt = std::numeric_limits<int>::max();
   32|  2.40k|  for (; const char* dp = strchr(kDigits, *p); ++p) {
  ------------------
  |  Branch (32:22): [True: 1.53k, False: 873]
  ------------------
   33|  1.53k|    int d = static_cast<int>(dp - kDigits);
   34|  1.53k|    if (d >= 10) break;  // '\0'
  ------------------
  |  Branch (34:9): [True: 262, False: 1.27k]
  ------------------
   35|  1.27k|    if (value > kMaxInt / 10) return nullptr;
  ------------------
  |  Branch (35:9): [True: 0, False: 1.27k]
  ------------------
   36|  1.27k|    value *= 10;
   37|  1.27k|    if (value > kMaxInt - d) return nullptr;
  ------------------
  |  Branch (37:9): [True: 0, False: 1.27k]
  ------------------
   38|  1.27k|    value += d;
   39|  1.27k|  }
   40|  1.13k|  if (p == op || value < min || value > max) return nullptr;
  ------------------
  |  Branch (40:7): [True: 0, False: 1.13k]
  |  Branch (40:18): [True: 0, False: 1.13k]
  |  Branch (40:33): [True: 0, False: 1.13k]
  ------------------
   41|  1.13k|  *vp = value;
   42|  1.13k|  return p;
   43|  1.13k|}
time_zone_posix.cc:_ZN4cctz12_GLOBAL__N_113ParseDateTimeEPKcPNS_15PosixTransitionE:
   92|    246|const char* ParseDateTime(const char* p, PosixTransition* res) {
   93|    246|  if (p != nullptr) {
  ------------------
  |  Branch (93:7): [True: 246, False: 0]
  ------------------
   94|    246|    if (*p != ',') return nullptr;
  ------------------
  |  Branch (94:9): [True: 0, False: 246]
  ------------------
   95|    246|    if (*++p == 'M') {
  ------------------
  |  Branch (95:9): [True: 246, False: 0]
  ------------------
   96|    246|      int month = 0;
   97|    246|      if ((p = ParseInt(p + 1, 1, 12, &month)) != nullptr) {
  ------------------
  |  Branch (97:11): [True: 246, False: 0]
  ------------------
   98|    246|        if (*p != '.') return nullptr;
  ------------------
  |  Branch (98:13): [True: 0, False: 246]
  ------------------
   99|    246|        int week = 0;
  100|    246|        if ((p = ParseInt(p + 1, 1, 5, &week)) != nullptr) {
  ------------------
  |  Branch (100:13): [True: 246, False: 0]
  ------------------
  101|    246|          if (*p != '.') return nullptr;
  ------------------
  |  Branch (101:15): [True: 0, False: 246]
  ------------------
  102|    246|          int weekday = 0;
  103|    246|          if ((p = ParseInt(p + 1, 0, 6, &weekday)) != nullptr) {
  ------------------
  |  Branch (103:15): [True: 246, False: 0]
  ------------------
  104|    246|            res->date.fmt = PosixTransition::M;
  105|    246|            res->date.m.month = static_cast<std::int_fast8_t>(month);
  106|    246|            res->date.m.week = static_cast<std::int_fast8_t>(week);
  107|    246|            res->date.m.weekday = static_cast<std::int_fast8_t>(weekday);
  108|    246|          }
  109|    246|        }
  110|    246|      }
  111|    246|    } else if (*p == 'J') {
  ------------------
  |  Branch (111:16): [True: 0, False: 0]
  ------------------
  112|      0|      int day = 0;
  113|      0|      if ((p = ParseInt(p + 1, 1, 365, &day)) != nullptr) {
  ------------------
  |  Branch (113:11): [True: 0, False: 0]
  ------------------
  114|      0|        res->date.fmt = PosixTransition::J;
  115|      0|        res->date.j.day = static_cast<std::int_fast16_t>(day);
  116|      0|      }
  117|      0|    } else {
  118|      0|      int day = 0;
  119|      0|      if ((p = ParseInt(p, 0, 365, &day)) != nullptr) {
  ------------------
  |  Branch (119:11): [True: 0, False: 0]
  ------------------
  120|      0|        res->date.fmt = PosixTransition::N;
  121|      0|        res->date.n.day = static_cast<std::int_fast16_t>(day);
  122|      0|      }
  123|      0|    }
  124|    246|    if (p != nullptr) {
  ------------------
  |  Branch (124:9): [True: 246, False: 0]
  ------------------
  125|    246|      res->time.offset = 2 * 60 * 60;  // default offset is 02:00:00
  126|    246|      if (*p == '/') p = ParseOffset(p + 1, -167, 167, 1, &res->time.offset);
  ------------------
  |  Branch (126:11): [True: 135, False: 111]
  ------------------
  127|    246|    }
  128|    246|  }
  129|    246|  return p;
  130|    246|}

_ZN4cctz14ZoneInfoSourceD2Ev:
   20|    263|ZoneInfoSource::~ZoneInfoSource() {}
zone_info_source.cc:_ZN14cctz_extension12_GLOBAL__N_114DefaultFactoryERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_8functionIFNS1_10unique_ptrIN4cctz14ZoneInfoSourceENS1_14default_deleteISD_EEEES9_EEE:
   34|    977|        const std::string& name)>& fallback_factory) {
   35|    977|  return fallback_factory(name);
   36|    977|}

