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

_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2Ellllll:
  359|  19.6k|      : civil_time(impl::n_sec(y, m, d, hh, mm, ss)) {}
_ZN4cctz6detail4impl5n_secEllllll:
  213|   682k|                         diff_t ss) noexcept {
  214|       |  // Optimization for when (non-constexpr) fields are already normalized.
  215|   682k|  if (0 <= ss && ss < 60) {
  ------------------
  |  Branch (215:7): [True: 553k, False: 128k]
  |  Branch (215:18): [True: 547k, False: 6.63k]
  ------------------
  216|   547k|    const second_t nss = static_cast<second_t>(ss);
  217|   547k|    if (0 <= mm && mm < 60) {
  ------------------
  |  Branch (217:9): [True: 540k, False: 7.07k]
  |  Branch (217:20): [True: 99.3k, False: 440k]
  ------------------
  218|  99.3k|      const minute_t nmm = static_cast<minute_t>(mm);
  219|  99.3k|      if (0 <= hh && hh < 24) {
  ------------------
  |  Branch (219:11): [True: 99.3k, False: 0]
  |  Branch (219:22): [True: 99.2k, False: 120]
  ------------------
  220|  99.2k|        const hour_t nhh = static_cast<hour_t>(hh);
  221|  99.2k|        if (1 <= d && d <= 28 && 1 <= m && m <= 12) {
  ------------------
  |  Branch (221:13): [True: 92.8k, False: 6.32k]
  |  Branch (221:23): [True: 60.0k, False: 32.7k]
  |  Branch (221:34): [True: 60.0k, False: 7]
  |  Branch (221:44): [True: 59.9k, False: 128]
  ------------------
  222|  59.9k|          const day_t nd = static_cast<day_t>(d);
  223|  59.9k|          const month_t nm = static_cast<month_t>(m);
  224|  59.9k|          return fields(y, nm, nd, nhh, nmm, nss);
  225|  59.9k|        }
  226|  39.2k|        return n_mon(y, m, d, 0, nhh, nmm, nss);
  227|  99.2k|      }
  228|    120|      return n_hour(y, m, d, hh / 24, hh % 24, nmm, nss);
  229|  99.3k|    }
  230|   448k|    return n_min(y, m, d, hh, mm / 60, mm % 60, nss);
  231|   547k|  }
  232|   135k|  diff_t cm = ss / 60;
  233|   135k|  ss %= 60;
  234|   135k|  if (ss < 0) {
  ------------------
  |  Branch (234:7): [True: 128k, False: 6.63k]
  ------------------
  235|   128k|    cm -= 1;
  236|   128k|    ss += 60;
  237|   128k|  }
  238|   135k|  return n_min(y, m, d, hh, mm / 60 + cm / 60, mm % 60 + cm % 60,
  239|   135k|               static_cast<second_t>(ss));
  240|   682k|}
_ZN4cctz6detail6fieldsC2Elaaaaa:
   56|  1.03M|      : y(year), m(month), d(day), hh(hour), mm(minute), ss(second) {}
_ZN4cctz6detail4impl5n_monEllllaaa:
  180|   622k|                         hour_t hh, minute_t mm, second_t ss) noexcept {
  181|   622k|  if (m != 12) {
  ------------------
  |  Branch (181:7): [True: 618k, False: 3.93k]
  ------------------
  182|   618k|    y += m / 12;
  183|   618k|    m %= 12;
  184|   618k|    if (m <= 0) {
  ------------------
  |  Branch (184:9): [True: 6.65k, False: 612k]
  ------------------
  185|  6.65k|      y -= 1;
  186|  6.65k|      m += 12;
  187|  6.65k|    }
  188|   618k|  }
  189|   622k|  return n_day(y, static_cast<month_t>(m), d, cd, hh, mm, ss);
  190|   622k|}
_ZN4cctz6detail4impl5n_dayElallaaa:
  114|   629k|                         hour_t hh, minute_t mm, second_t ss) noexcept {
  115|   629k|  year_t ey = y % 400;
  116|   629k|  const year_t oey = ey;
  117|   629k|  ey += (cd / 146097) * 400;
  118|   629k|  cd %= 146097;
  119|   629k|  if (cd < 0) {
  ------------------
  |  Branch (119:7): [True: 13.0k, False: 616k]
  ------------------
  120|  13.0k|    ey -= 400;
  121|  13.0k|    cd += 146097;
  122|  13.0k|  }
  123|   629k|  ey += (d / 146097) * 400;
  124|   629k|  d = d % 146097 + cd;
  125|   629k|  if (d > 0) {
  ------------------
  |  Branch (125:7): [True: 623k, False: 6.35k]
  ------------------
  126|   623k|    if (d > 146097) {
  ------------------
  |  Branch (126:9): [True: 1.42k, False: 622k]
  ------------------
  127|  1.42k|      ey += 400;
  128|  1.42k|      d -= 146097;
  129|  1.42k|    }
  130|   623k|  } else {
  131|  6.35k|    if (d > -365) {
  ------------------
  |  Branch (131:9): [True: 6.35k, False: 0]
  ------------------
  132|       |      // We often hit the previous year when stepping a civil time backwards,
  133|       |      // so special case it to avoid counting up by 100/4/1-year chunks.
  134|  6.35k|      ey -= 1;
  135|  6.35k|      d += days_per_year(ey, m);
  136|  6.35k|    } else {
  137|      0|      ey -= 400;
  138|      0|      d += 146097;
  139|      0|    }
  140|  6.35k|  }
  141|   629k|  if (d > 365) {
  ------------------
  |  Branch (141:7): [True: 272k, False: 357k]
  ------------------
  142|   272k|    int yi = year_index(ey, m);  // Index into Gregorian 400 year cycle.
  143|   633k|    for (;;) {
  144|   633k|      int n = days_per_century(yi);
  145|   633k|      if (d <= n) break;
  ------------------
  |  Branch (145:11): [True: 272k, False: 361k]
  ------------------
  146|   361k|      d -= n;
  147|   361k|      ey += 100;
  148|   361k|      yi += 100;
  149|   361k|      if (yi >= 400) yi -= 400;
  ------------------
  |  Branch (149:11): [True: 170k, False: 190k]
  ------------------
  150|   361k|    }
  151|  3.56M|    for (;;) {
  152|  3.56M|      int n = days_per_4years(yi);
  153|  3.56M|      if (d <= n) break;
  ------------------
  |  Branch (153:11): [True: 272k, False: 3.29M]
  ------------------
  154|  3.29M|      d -= n;
  155|  3.29M|      ey += 4;
  156|  3.29M|      yi += 4;
  157|  3.29M|      if (yi >= 400) yi -= 400;
  ------------------
  |  Branch (157:11): [True: 63.2k, False: 3.23M]
  ------------------
  158|  3.29M|    }
  159|   691k|    for (;;) {
  160|   691k|      int n = days_per_year(ey, m);
  161|   691k|      if (d <= n) break;
  ------------------
  |  Branch (161:11): [True: 272k, False: 419k]
  ------------------
  162|   419k|      d -= n;
  163|   419k|      ++ey;
  164|   419k|    }
  165|   272k|  }
  166|   629k|  if (d > 28) {
  ------------------
  |  Branch (166:7): [True: 437k, False: 192k]
  ------------------
  167|  2.02M|    for (;;) {
  168|  2.02M|      int n = days_per_month(ey, m);
  169|  2.02M|      if (d <= n) break;
  ------------------
  |  Branch (169:11): [True: 437k, False: 1.58M]
  ------------------
  170|  1.58M|      d -= n;
  171|  1.58M|      if (++m > 12) {
  ------------------
  |  Branch (171:11): [True: 8.09k, False: 1.58M]
  ------------------
  172|  8.09k|        ++ey;
  173|  8.09k|        m = 1;
  174|  8.09k|      }
  175|  1.58M|    }
  176|   437k|  }
  177|   629k|  return fields(y + (ey - oey), m, static_cast<day_t>(d), hh, mm, ss);
  178|   629k|}
_ZN4cctz6detail4impl13days_per_yearEla:
   91|   698k|CONSTEXPR_F int days_per_year(year_t y, month_t m) noexcept {
   92|   698k|  return is_leap_year(y + (m > 2)) ? 366 : 365;
  ------------------
  |  Branch (92:10): [True: 139k, False: 558k]
  ------------------
   93|   698k|}
_ZN4cctz6detail4impl12is_leap_yearEl:
   78|   975k|CONSTEXPR_F bool is_leap_year(year_t y) noexcept {
   79|   975k|  return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0);
  ------------------
  |  Branch (79:10): [True: 211k, False: 764k]
  |  Branch (79:25): [True: 197k, False: 13.3k]
  |  Branch (79:41): [True: 8.08k, False: 5.31k]
  ------------------
   80|   975k|}
_ZN4cctz6detail4impl10year_indexEla:
   81|   272k|CONSTEXPR_F int year_index(year_t y, month_t m) noexcept {
   82|   272k|  const int yi = static_cast<int>((y + (m > 2)) % 400);
   83|   272k|  return yi < 0 ? yi + 400 : yi;
  ------------------
  |  Branch (83:10): [True: 12.2k, False: 260k]
  ------------------
   84|   272k|}
_ZN4cctz6detail4impl16days_per_centuryEi:
   85|   633k|CONSTEXPR_F int days_per_century(int yi) noexcept {
   86|   633k|  return 36524 + (yi == 0 || yi > 300);
  ------------------
  |  Branch (86:19): [True: 478, False: 633k]
  |  Branch (86:30): [True: 270k, False: 363k]
  ------------------
   87|   633k|}
_ZN4cctz6detail4impl15days_per_4yearsEi:
   88|  3.56M|CONSTEXPR_F int days_per_4years(int yi) noexcept {
   89|  3.56M|  return 1460 + (yi == 0 || yi > 300 || (yi - 1) % 100 < 96);
  ------------------
  |  Branch (89:18): [True: 1.00k, False: 3.56M]
  |  Branch (89:29): [True: 1.14M, False: 2.42M]
  |  Branch (89:41): [True: 2.29M, False: 125k]
  ------------------
   90|  3.56M|}
_ZN4cctz6detail4impl14days_per_monthEla:
  106|  2.02M|CONSTEXPR_F int days_per_month(year_t y, month_t m) noexcept {
  107|  2.02M|  CONSTEXPR_D int k_days_per_month[1 + 12] = {
  ------------------
  |  |   25|  2.02M|#define CONSTEXPR_D constexpr  // data
  ------------------
  108|  2.02M|      -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31  // non leap year
  109|  2.02M|  };
  110|  2.02M|  return k_days_per_month[m] + (m == 2 && is_leap_year(y));
  ------------------
  |  Branch (110:33): [True: 269k, False: 1.75M]
  |  Branch (110:43): [True: 65.9k, False: 203k]
  ------------------
  111|  2.02M|}
_ZN4cctz6detail4impl6n_hourElllllaa:
  192|   583k|                          diff_t hh, minute_t mm, second_t ss) noexcept {
  193|   583k|  cd += hh / 24;
  194|   583k|  hh %= 24;
  195|   583k|  if (hh < 0) {
  ------------------
  |  Branch (195:7): [True: 6.46k, False: 577k]
  ------------------
  196|  6.46k|    cd -= 1;
  197|  6.46k|    hh += 24;
  198|  6.46k|  }
  199|   583k|  return n_mon(y, m, d, cd, static_cast<hour_t>(hh), mm, ss);
  200|   583k|}
_ZN4cctz6detail4impl5n_minElllllla:
  202|   583k|                         diff_t mm, second_t ss) noexcept {
  203|   583k|  ch += mm / 60;
  204|   583k|  mm %= 60;
  205|   583k|  if (mm < 0) {
  ------------------
  |  Branch (205:7): [True: 129k, False: 454k]
  ------------------
  206|   129k|    ch -= 1;
  207|   129k|    mm += 60;
  208|   129k|  }
  209|   583k|  return n_hour(y, m, d, hh / 24 + ch / 24, hh % 24 + ch % 24,
  210|   583k|                static_cast<minute_t>(mm), ss);
  211|   583k|}
_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2ENS0_6fieldsE:
  446|   683k|  explicit CONSTEXPR_M civil_time(fields f) noexcept : f_(align(T{}, f)) {}
_ZN4cctz6detail5alignENS0_10second_tagENS0_6fieldsE:
  332|   683k|CONSTEXPR_F fields align(second_tag, fields f) noexcept {
  333|   683k|  return f;
  334|   683k|}
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE4yearEv:
  392|   768k|  CONSTEXPR_M year_t year() const noexcept { return f_.y; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE5monthEv:
  393|   211k|  CONSTEXPR_M int month() const noexcept { return f_.m; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE3dayEv:
  394|  48.5k|  CONSTEXPR_M int day() const noexcept { return f_.d; }
_ZN4cctz6detailplENS0_10civil_timeINS0_7day_tagEEEl:
  424|    586|  friend CONSTEXPR_F civil_time operator+(civil_time a, diff_t n) noexcept {
  425|    586|    return civil_time(step(T{}, a.f_, n));
  426|    586|  }
_ZN4cctz6detailmiENS0_10civil_timeINS0_7day_tagEEEl:
  430|  6.43k|  friend CONSTEXPR_F civil_time operator-(civil_time a, diff_t n) noexcept {
  431|  6.43k|    return n != (std::numeric_limits<diff_t>::min)()
  ------------------
  |  Branch (431:12): [True: 6.43k, False: 0]
  ------------------
  432|  6.43k|               ? civil_time(step(T{}, a.f_, -n))
  433|  6.43k|               : civil_time(step(T{}, step(T{}, a.f_, -(n + 1)), 1));
  434|  6.43k|  }
_ZN4cctz6detail4stepENS0_10second_tagENS0_6fieldsEl:
  247|   657k|CONSTEXPR_F fields step(second_tag, fields f, diff_t n) noexcept {
  248|   657k|  return impl::n_sec(f.y, f.m, f.d, f.hh, f.mm + n / 60, f.ss + n % 60);
  249|   657k|}
_ZN4cctz6detail4stepENS0_7day_tagENS0_6fieldsEl:
  256|  7.01k|CONSTEXPR_F fields step(day_tag, fields f, diff_t n) noexcept {
  257|  7.01k|  return impl::n_day(f.y, f.m, f.d, n, f.hh, f.mm, f.ss);
  258|  7.01k|}
_ZN4cctz6detail4impl9scale_addElll:
  271|  41.5k|CONSTEXPR_F diff_t scale_add(diff_t v, diff_t f, diff_t a) noexcept {
  272|  41.5k|  return (v < 0) ? ((v + 1) * f + a) - f : ((v - 1) * f + a) + f;
  ------------------
  |  Branch (272:10): [True: 6.28k, False: 35.2k]
  ------------------
  273|  41.5k|}
_ZN4cctz6detail4impl7ymd_ordElaa:
  277|  39.3k|CONSTEXPR_F diff_t ymd_ord(year_t y, month_t m, day_t d) noexcept {
  278|  39.3k|  const diff_t eyear = (m <= 2) ? y - 1 : y;
  ------------------
  |  Branch (278:24): [True: 10.3k, False: 29.0k]
  ------------------
  279|  39.3k|  const diff_t era = (eyear >= 0 ? eyear : eyear - 399) / 400;
  ------------------
  |  Branch (279:23): [True: 25.9k, False: 13.4k]
  ------------------
  280|  39.3k|  const diff_t yoe = eyear - era * 400;
  281|  39.3k|  const diff_t doy = (153 * (m + (m > 2 ? -3 : 9)) + 2) / 5 + d - 1;
  ------------------
  |  Branch (281:35): [True: 29.0k, False: 10.3k]
  ------------------
  282|  39.3k|  const diff_t doe = yoe * 365 + yoe / 4 - yoe / 100 + doy;
  283|  39.3k|  return era * 146097 + doe - 719468;
  284|  39.3k|}
_ZN4cctz6detail4impl14day_differenceElaalaa:
  292|  19.6k|                                  year_t y2, month_t m2, day_t d2) noexcept {
  293|  19.6k|  const diff_t a_c4_off = y1 % 400;
  294|  19.6k|  const diff_t b_c4_off = y2 % 400;
  295|  19.6k|  diff_t c4_diff = (y1 - a_c4_off) - (y2 - b_c4_off);
  296|  19.6k|  diff_t delta = ymd_ord(a_c4_off, m1, d1) - ymd_ord(b_c4_off, m2, d2);
  297|  19.6k|  if (c4_diff > 0 && delta < 0) {
  ------------------
  |  Branch (297:7): [True: 8.44k, False: 11.2k]
  |  Branch (297:22): [True: 599, False: 7.84k]
  ------------------
  298|    599|    delta += 2 * 146097;
  299|    599|    c4_diff -= 2 * 400;
  300|  19.0k|  } else if (c4_diff < 0 && delta > 0) {
  ------------------
  |  Branch (300:14): [True: 2.04k, False: 17.0k]
  |  Branch (300:29): [True: 9, False: 2.03k]
  ------------------
  301|      9|    delta -= 2 * 146097;
  302|      9|    c4_diff += 2 * 400;
  303|      9|  }
  304|  19.6k|  return (c4_diff / 400 * 146097) + delta;
  305|  19.6k|}
_ZN4cctz6detail10differenceENS0_7day_tagENS0_6fieldsES2_:
  316|  19.6k|CONSTEXPR_F diff_t difference(day_tag, fields f1, fields f2) noexcept {
  317|  19.6k|  return impl::day_difference(f1.y, f1.m, f1.d, f2.y, f2.m, f2.d);
  318|  19.6k|}
_ZN4cctz6detail10differenceENS0_8hour_tagENS0_6fieldsES2_:
  319|  13.8k|CONSTEXPR_F diff_t difference(hour_tag, fields f1, fields f2) noexcept {
  320|  13.8k|  return impl::scale_add(difference(day_tag{}, f1, f2), 24, (f1.hh - f2.hh));
  321|  13.8k|}
_ZN4cctz6detail10differenceENS0_10minute_tagENS0_6fieldsES2_:
  322|  13.8k|CONSTEXPR_F diff_t difference(minute_tag, fields f1, fields f2) noexcept {
  323|  13.8k|  return impl::scale_add(difference(hour_tag{}, f1, f2), 60, (f1.mm - f2.mm));
  324|  13.8k|}
_ZN4cctz6detail10differenceENS0_10second_tagENS0_6fieldsES2_:
  325|  13.8k|CONSTEXPR_F diff_t difference(second_tag, fields f1, fields f2) noexcept {
  326|  13.8k|  return impl::scale_add(difference(minute_tag{}, f1, f2), 60, f1.ss - f2.ss);
  327|  13.8k|}
_ZN4cctz6detail5alignENS0_7day_tagENS0_6fieldsE:
  341|  24.8k|CONSTEXPR_F fields align(day_tag, fields f) noexcept {
  342|  24.8k|  return fields{f.y, f.m, f.d, 0, 0, 0};
  343|  24.8k|}
_ZN4cctz6detail5alignENS0_8year_tagENS0_6fieldsE:
  347|  6.13k|CONSTEXPR_F fields align(year_tag, fields f) noexcept {
  348|  6.13k|  return fields{f.y, 1, 1, 0, 0, 0};
  349|  6.13k|}
_ZN4cctz6detail11get_weekdayERKNS0_10civil_timeINS0_10second_tagEEE:
  522|  15.4k|CONSTEXPR_F weekday get_weekday(const civil_second& cs) noexcept {
  523|  15.4k|  CONSTEXPR_D weekday k_weekday_by_mon_off[13] = {
  ------------------
  |  |   25|  15.4k|#define CONSTEXPR_D constexpr  // data
  ------------------
  524|  15.4k|      weekday::monday,    weekday::tuesday,  weekday::wednesday,
  525|  15.4k|      weekday::thursday,  weekday::friday,   weekday::saturday,
  526|  15.4k|      weekday::sunday,    weekday::monday,   weekday::tuesday,
  527|  15.4k|      weekday::wednesday, weekday::thursday, weekday::friday,
  528|  15.4k|      weekday::saturday,
  529|  15.4k|  };
  530|  15.4k|  CONSTEXPR_D int k_weekday_offsets[1 + 12] = {
  ------------------
  |  |   25|  15.4k|#define CONSTEXPR_D constexpr  // data
  ------------------
  531|  15.4k|      -1, 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4,
  532|  15.4k|  };
  533|  15.4k|  year_t wd = 2400 + (cs.year() % 400) - (cs.month() < 3);
  534|  15.4k|  wd += wd / 4 - wd / 100 + wd / 400;
  535|  15.4k|  wd += k_weekday_offsets[cs.month()] + cs.day();
  536|  15.4k|  return k_weekday_by_mon_off[wd % 7 + 6];
  537|  15.4k|}
_ZN4cctz6detail12next_weekdayENS0_10civil_timeINS0_7day_tagEEENS0_7weekdayE:
  541|    293|CONSTEXPR_F civil_day next_weekday(civil_day cd, weekday wd) noexcept {
  542|    293|  CONSTEXPR_D weekday k_weekdays_forw[14] = {
  ------------------
  |  |   25|    293|#define CONSTEXPR_D constexpr  // data
  ------------------
  543|    293|      weekday::monday,    weekday::tuesday,  weekday::wednesday,
  544|    293|      weekday::thursday,  weekday::friday,   weekday::saturday,
  545|    293|      weekday::sunday,    weekday::monday,   weekday::tuesday,
  546|    293|      weekday::wednesday, weekday::thursday, weekday::friday,
  547|    293|      weekday::saturday,  weekday::sunday,
  548|    293|  };
  549|    293|  weekday base = get_weekday(cd);
  550|  1.86k|  for (int i = 0;; ++i) {
  551|  1.86k|    if (base == k_weekdays_forw[i]) {
  ------------------
  |  Branch (551:9): [True: 293, False: 1.56k]
  ------------------
  552|  1.29k|      for (int j = i + 1;; ++j) {
  553|  1.29k|        if (wd == k_weekdays_forw[j]) {
  ------------------
  |  Branch (553:13): [True: 293, False: 1.00k]
  ------------------
  554|    293|          return cd + (j - i);
  555|    293|        }
  556|  1.29k|      }
  557|    293|    }
  558|  1.86k|  }
  559|    293|}
_ZN4cctz6detail12prev_weekdayENS0_10civil_timeINS0_7day_tagEEENS0_7weekdayE:
  561|  6.13k|CONSTEXPR_F civil_day prev_weekday(civil_day cd, weekday wd) noexcept {
  562|  6.13k|  CONSTEXPR_D weekday k_weekdays_back[14] = {
  ------------------
  |  |   25|  6.13k|#define CONSTEXPR_D constexpr  // data
  ------------------
  563|  6.13k|      weekday::sunday,   weekday::saturday,  weekday::friday,
  564|  6.13k|      weekday::thursday, weekday::wednesday, weekday::tuesday,
  565|  6.13k|      weekday::monday,   weekday::sunday,    weekday::saturday,
  566|  6.13k|      weekday::friday,   weekday::thursday,  weekday::wednesday,
  567|  6.13k|      weekday::tuesday,  weekday::monday,
  568|  6.13k|  };
  569|  6.13k|  weekday base = get_weekday(cd);
  570|  26.5k|  for (int i = 0;; ++i) {
  571|  26.5k|    if (base == k_weekdays_back[i]) {
  ------------------
  |  Branch (571:9): [True: 6.13k, False: 20.4k]
  ------------------
  572|  21.7k|      for (int j = i + 1;; ++j) {
  573|  21.7k|        if (wd == k_weekdays_back[j]) {
  ------------------
  |  Branch (573:13): [True: 6.13k, False: 15.6k]
  ------------------
  574|  6.13k|          return cd - (j - i);
  575|  6.13k|        }
  576|  21.7k|      }
  577|  6.13k|    }
  578|  26.5k|  }
  579|  6.13k|}
_ZN4cctz6detail11get_yeardayERKNS0_10civil_timeINS0_10second_tagEEE:
  581|  8.86k|CONSTEXPR_F int get_yearday(const civil_second& cs) noexcept {
  582|  8.86k|  CONSTEXPR_D int k_month_offsets[1 + 12] = {
  ------------------
  |  |   25|  8.86k|#define CONSTEXPR_D constexpr  // data
  ------------------
  583|  8.86k|      -1, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,
  584|  8.86k|  };
  585|  8.86k|  const int feb29 = (cs.month() > 2 && impl::is_leap_year(cs.year()));
  ------------------
  |  Branch (585:22): [True: 8.34k, False: 515]
  |  Branch (585:40): [True: 701, False: 7.64k]
  ------------------
  586|  8.86k|  return k_month_offsets[cs.month()] + feb29 + cs.day();
  587|  8.86k|}
_ZNK4cctz6detail10civil_timeINS0_7day_tagEE4yearEv:
  392|  6.13k|  CONSTEXPR_M year_t year() const noexcept { return f_.y; }
_ZNK4cctz6detail10civil_timeINS0_7day_tagEE5monthEv:
  393|  6.13k|  CONSTEXPR_M int month() const noexcept { return f_.m; }
_ZNK4cctz6detail10civil_timeINS0_7day_tagEE3dayEv:
  394|  6.13k|  CONSTEXPR_M int day() const noexcept { return f_.d; }
_ZN4cctz6detail10civil_timeINS0_7day_tagEEC2Ellllll:
  359|  5.84k|      : civil_time(impl::n_sec(y, m, d, hh, mm, ss)) {}
_ZN4cctz6detail10civil_timeINS0_7day_tagEEC2ENS0_6fieldsE:
  446|  24.8k|  explicit CONSTEXPR_M civil_time(fields f) noexcept : f_(align(T{}, f)) {}
_ZN4cctz6detailmiENS0_10civil_timeINS0_7day_tagEEES3_:
  435|  5.84k|  friend CONSTEXPR_F diff_t operator-(civil_time lhs, civil_time rhs) noexcept {
  436|  5.84k|    return difference(T{}, lhs.f_, rhs.f_);
  437|  5.84k|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2INS0_7day_tagEEERKNS1_IT_EEPNSt3__19enable_ifIXsr3std10is_base_ofIS2_S6_EE5valueEvE4typeE:
  375|  6.43k|      : civil_time(ct.f_) {}
_ZN4cctz6detail10civil_timeINS0_8year_tagEEC2INS0_7day_tagEEERKNS1_IT_EEPNSt3__19enable_ifIXsr3std10is_base_ofIS6_S2_EE5valueEvE4typeE:
  379|  5.84k|      : civil_time(ct.f_) {}
_ZN4cctz6detail10civil_timeINS0_8year_tagEEC2ENS0_6fieldsE:
  446|  6.13k|  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:
  375|  6.13k|      : civil_time(ct.f_) {}
_ZN4cctz6detail10civil_timeINS0_7day_tagEEC2INS0_10second_tagEEERKNS1_IT_EEPNSt3__19enable_ifIXsr3std10is_base_ofIS6_S2_EE5valueEvE4typeE:
  379|  5.84k|      : civil_time(ct.f_) {}
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE4hourEv:
  395|  15.7k|  CONSTEXPR_M int hour() const noexcept { return f_.hh; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE6minuteEv:
  396|  15.1k|  CONSTEXPR_M int minute() const noexcept { return f_.mm; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE6secondEv:
  397|  37.0k|  CONSTEXPR_M int second() const noexcept { return f_.ss; }
_ZN4cctz6detail10civil_timeINS0_8year_tagEEC2Ellllll:
  359|    293|      : civil_time(impl::n_sec(y, m, d, hh, mm, ss)) {}
_ZNK4cctz6detail10civil_timeINS0_8year_tagEE4yearEv:
  392|    293|  CONSTEXPR_M year_t year() const noexcept { return f_.y; }
_ZN4cctz6detailgtINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  494|  6.35k|                           const civil_time<T2>& rhs) noexcept {
  495|  6.35k|  return rhs < lhs;
  496|  6.35k|}
_ZN4cctz6detailplENS0_10civil_timeINS0_10second_tagEEEl:
  424|   522k|  friend CONSTEXPR_F civil_time operator+(civil_time a, diff_t n) noexcept {
  425|   522k|    return civil_time(step(T{}, a.f_, n));
  426|   522k|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEE3maxEv:
  382|    333|  static CONSTEXPR_F auto (max)() -> civil_time {
  383|    333|    const auto max_year = (std::numeric_limits<std::int_least64_t>::max)();
  384|    333|    return civil_time(max_year, 12, 31, 23, 59, 59);
  385|    333|  }
_ZN4cctz6detailltINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  469|   232k|                           const civil_time<T2>& rhs) noexcept {
  470|   232k|  return (lhs.year() < rhs.year() ||
  ------------------
  |  Branch (470:11): [True: 113k, False: 119k]
  ------------------
  471|   119k|          (lhs.year() == rhs.year() &&
  ------------------
  |  Branch (471:12): [True: 68.3k, False: 51.1k]
  ------------------
  472|  68.3k|           (lhs.month() < rhs.month() ||
  ------------------
  |  Branch (472:13): [True: 64.8k, False: 3.50k]
  ------------------
  473|  3.50k|            (lhs.month() == rhs.month() &&
  ------------------
  |  Branch (473:14): [True: 1.09k, False: 2.41k]
  ------------------
  474|  1.09k|             (lhs.day() < rhs.day() ||
  ------------------
  |  Branch (474:15): [True: 231, False: 861]
  ------------------
  475|    861|              (lhs.day() == rhs.day() &&
  ------------------
  |  Branch (475:16): [True: 586, False: 275]
  ------------------
  476|    586|               (lhs.hour() < rhs.hour() ||
  ------------------
  |  Branch (476:17): [True: 96, False: 490]
  ------------------
  477|    490|                (lhs.hour() == rhs.hour() &&
  ------------------
  |  Branch (477:18): [True: 361, False: 129]
  ------------------
  478|    361|                 (lhs.minute() < rhs.minute() ||
  ------------------
  |  Branch (478:19): [True: 44, False: 317]
  ------------------
  479|    317|                  (lhs.minute() == rhs.minute() &&
  ------------------
  |  Branch (479:20): [True: 149, False: 168]
  ------------------
  480|    149|                   (lhs.second() < rhs.second())))))))))));
  ------------------
  |  Branch (480:20): [True: 30, False: 119]
  ------------------
  481|   232k|}
_ZN4cctz6detail10civil_timeINS0_10second_tagEE3minEv:
  386|    283|  static CONSTEXPR_F auto (min)() -> civil_time {
  387|    283|    const auto min_year = (std::numeric_limits<std::int_least64_t>::min)();
  388|    283|    return civil_time(min_year, 1, 1, 0, 0, 0);
  389|    283|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEEmIEl:
  403|  5.85k|  CONSTEXPR_M civil_time& operator-=(diff_t n) noexcept {
  404|  5.85k|    return *this = *this - n;
  405|  5.85k|  }
_ZN4cctz6detailmiENS0_10civil_timeINS0_10second_tagEEEl:
  430|   134k|  friend CONSTEXPR_F civil_time operator-(civil_time a, diff_t n) noexcept {
  431|   134k|    return n != (std::numeric_limits<diff_t>::min)()
  ------------------
  |  Branch (431:12): [True: 134k, False: 0]
  ------------------
  432|   134k|               ? civil_time(step(T{}, a.f_, -n))
  433|   134k|               : civil_time(step(T{}, step(T{}, a.f_, -(n + 1)), 1));
  434|   134k|  }
_ZN4cctz6detailmiENS0_10civil_timeINS0_10second_tagEEES3_:
  435|  13.8k|  friend CONSTEXPR_F diff_t operator-(civil_time lhs, civil_time rhs) noexcept {
  436|  13.8k|    return difference(T{}, lhs.f_, rhs.f_);
  437|  13.8k|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2Ev:
  361|   314k|  CONSTEXPR_M civil_time() noexcept : f_{1970, 1, 1, 0, 0, 0} {}
_ZN4cctz6detailgeINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  489|  14.2k|                            const civil_time<T2>& rhs) noexcept {
  490|  14.2k|  return !(lhs < rhs);
  491|  14.2k|}
_ZN4cctz6detailleINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  484|  18.9k|                            const civil_time<T2>& rhs) noexcept {
  485|  18.9k|  return !(rhs < lhs);
  486|  18.9k|}

_ZN4cctz9time_zoneC2Ev:
   67|  9.50k|  time_zone() : time_zone(nullptr) {}  // Equivalent to UTC
_ZN4cctz9time_zoneC2EPKNS0_4ImplE:
  219|  19.2k|  explicit time_zone(const Impl* impl) : impl_(impl) {}
_ZN4cctz7convertERKNS_6detail10civil_timeINS0_10second_tagEEERKNS_9time_zoneE:
  256|  8.86k|                                   const time_zone& tz) {
  257|  8.86k|  const time_zone::civil_lookup cl = tz.lookup(cs);
  258|  8.86k|  if (cl.kind == time_zone::civil_lookup::SKIPPED) return cl.trans;
  ------------------
  |  Branch (258:7): [True: 12, False: 8.85k]
  ------------------
  259|  8.85k|  return cl.pre;
  260|  8.86k|}
_ZN4cctz5parseINSt3__16chrono8durationIxNS1_5ratioILl1ELl1000000EEEEEEEbRKNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEESE_RKNS_9time_zoneEPNS2_10time_pointINS2_12system_clockET_EE:
  369|  8.86k|                  const time_zone& tz, time_point<D>* tpp) {
  370|  8.86k|  time_point<seconds> sec;
  371|  8.86k|  detail::femtoseconds fs;
  372|  8.86k|  return detail::parse(fmt, input, tz, &sec, &fs) &&
  ------------------
  |  Branch (372:10): [True: 5.74k, False: 3.11k]
  ------------------
  373|  5.74k|         detail::join_seconds(sec, fs, tpp);
  ------------------
  |  Branch (373:10): [True: 5.74k, False: 0]
  ------------------
  374|  8.86k|}
_ZN4cctz6detail12join_secondsIxLl1000000EEEbRKNSt3__16chrono10time_pointINS3_12system_clockENS3_8durationIlNS2_5ratioILl1ELl1EEEEEEERKNS6_IlNS7_ILl1ELl1000000000000000EEEEEPNS4_IS5_NS6_IT_NS7_ILl1EXT0_EEEEEEE:
  405|  5.74k|    time_point<std::chrono::duration<Rep, std::ratio<1, Denom>>>* tpp) {
  406|  5.74k|  using D = std::chrono::duration<Rep, std::ratio<1, Denom>>;
  407|       |  // TODO(#199): Return false if result unrepresentable as a time_point<D>.
  408|  5.74k|  *tpp = std::chrono::time_point_cast<D>(sec);
  409|  5.74k|  *tpp += std::chrono::duration_cast<D>(fs);
  410|  5.74k|  return true;
  411|  5.74k|}
_ZN4cctz6formatINSt3__16chrono8durationIlNS1_5ratioILl1ELl1EEEEEEENS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKSC_RKNS2_10time_pointINS2_12system_clockET_EERKNS_9time_zoneE:
  315|  8.86k|                          const time_zone& tz) {
  316|  8.86k|  const auto p = detail::split_seconds(tp);
  317|  8.86k|  const auto n = std::chrono::duration_cast<detail::femtoseconds>(p.second);
  318|  8.86k|  return detail::format(fmt, p.first, n, tz);
  319|  8.86k|}
_ZN4cctz6detail13split_secondsERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
  395|  8.86k|    const time_point<seconds>& tp) {
  396|  8.86k|  return {tp, seconds::zero()};
  397|  8.86k|}

_ZN4cctz19FixedOffsetFromNameERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPNS0_6chrono8durationIlNS0_5ratioILl1ELl1EEEEE:
   57|  10.7k|bool FixedOffsetFromName(const std::string& name, seconds* offset) {
   58|  10.7k|  if (name == "UTC" || name == "UTC0") {
  ------------------
  |  Branch (58:7): [True: 1.59k, False: 9.11k]
  |  Branch (58:24): [True: 1, False: 9.11k]
  ------------------
   59|  1.59k|    *offset = seconds::zero();
   60|  1.59k|    return true;
   61|  1.59k|  }
   62|       |
   63|  9.11k|  const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1;
   64|  9.11k|  const char* const ep = kFixedZonePrefix + prefix_len;
   65|  9.11k|  if (name.size() != prefix_len + 9)  // <prefix>+99:99:99
  ------------------
  |  Branch (65:7): [True: 8.24k, False: 870]
  ------------------
   66|  8.24k|    return false;
   67|    870|  if (!std::equal(kFixedZonePrefix, ep, name.begin()))
  ------------------
  |  Branch (67:7): [True: 47, False: 823]
  ------------------
   68|     47|    return false;
   69|    823|  const char* np = name.data() + prefix_len;
   70|    823|  if (np[0] != '+' && np[0] != '-')
  ------------------
  |  Branch (70:7): [True: 486, False: 337]
  |  Branch (70:23): [True: 36, False: 450]
  ------------------
   71|     36|    return false;
   72|    787|  if (np[3] != ':' || np[6] != ':')  // see note below about large offsets
  ------------------
  |  Branch (72:7): [True: 6, False: 781]
  |  Branch (72:23): [True: 14, False: 767]
  ------------------
   73|     20|    return false;
   74|       |
   75|    767|  int hours = Parse02d(np + 1);
   76|    767|  if (hours == -1) return false;
  ------------------
  |  Branch (76:7): [True: 8, False: 759]
  ------------------
   77|    759|  int mins = Parse02d(np + 4);
   78|    759|  if (mins == -1) return false;
  ------------------
  |  Branch (78:7): [True: 4, False: 755]
  ------------------
   79|    755|  int secs = Parse02d(np + 7);
   80|    755|  if (secs == -1) return false;
  ------------------
  |  Branch (80:7): [True: 4, False: 751]
  ------------------
   81|       |
   82|    751|  secs += ((hours * 60) + mins) * 60;
   83|    751|  if (secs > 24 * 60 * 60) return false;  // outside supported offset range
  ------------------
  |  Branch (83:7): [True: 14, False: 737]
  ------------------
   84|    737|  *offset = seconds(secs * (np[0] == '-' ? -1 : 1));  // "-" means west
  ------------------
  |  Branch (84:29): [True: 416, False: 321]
  ------------------
   85|    737|  return true;
   86|    751|}
_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: 185, False: 141]
  ------------------
   98|    326|  int offset_minutes = offset_seconds / 60;
   99|    326|  offset_seconds %= 60;
  100|    326|  if (sign == '-') {
  ------------------
  |  Branch (100:7): [True: 185, False: 141]
  ------------------
  101|    185|    if (offset_seconds > 0) {
  ------------------
  |  Branch (101:9): [True: 0, False: 185]
  ------------------
  102|      0|      offset_seconds -= 60;
  103|      0|      offset_minutes += 1;
  104|      0|    }
  105|    185|    offset_seconds = -offset_seconds;
  106|    185|    offset_minutes = -offset_minutes;
  107|    185|  }
  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: 105, False: 221]
  |  Branch (131:27): [True: 40, False: 65]
  ------------------
  132|     40|      abbr.erase(5, 2);                        // +9999
  133|     40|      if (abbr[3] == '0' && abbr[4] == '0') {  // +9900
  ------------------
  |  Branch (133:11): [True: 20, False: 20]
  |  Branch (133:29): [True: 4, False: 16]
  ------------------
  134|      4|        abbr.erase(3, 2);                      // +99
  135|      4|      }
  136|     40|    }
  137|    326|  }
  138|    327|  return abbr;
  139|    327|}
time_zone_fixed.cc:_ZN4cctz12_GLOBAL__N_18Parse02dEPKc:
   46|  2.28k|int Parse02d(const char* p) {
   47|  2.28k|  const int hi = ParseDigit(p[0]);
   48|  2.28k|  if (hi >= 0) {
  ------------------
  |  Branch (48:7): [True: 2.27k, False: 8]
  ------------------
   49|  2.27k|    const int lo = ParseDigit(p[1]);
   50|  2.27k|    if (lo >= 0) return (hi * 10) + lo;
  ------------------
  |  Branch (50:9): [True: 2.26k, False: 8]
  ------------------
   51|  2.27k|  }
   52|     16|  return -1;
   53|  2.28k|}
time_zone_fixed.cc:_ZN4cctz12_GLOBAL__N_110ParseDigitEc:
   41|  4.55k|int ParseDigit(char ch) {
   42|  4.55k|  const char* const dp = std::strchr(kDigits, ch);
   43|  4.55k|  return (dp == nullptr || *dp == '\0') ? -1 : static_cast<int>(dp - kDigits);
  ------------------
  |  Branch (43:11): [True: 6, False: 4.54k]
  |  Branch (43:28): [True: 10, False: 4.53k]
  ------------------
   44|  4.55k|}
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:
  338|  8.86k|                   const detail::femtoseconds& fs, const time_zone& tz) {
  339|  8.86k|  std::string result;
  340|  8.86k|  result.reserve(2 * format.size());  // A guess for the result size.
  341|  8.86k|  const time_zone::absolute_lookup al = tz.lookup(tp);
  342|  8.86k|  const std::tm tm = ToTM(al);
  343|       |
  344|       |  // Scratch buffer for internal conversions.
  345|  8.86k|  char buf[6 + (kDigits10_64 + 2)];  // enough for longest conversion (%F)
  346|  8.86k|  char* const ep = buf + sizeof(buf);
  347|  8.86k|  char* bp;  // works back from ep
  348|       |
  349|       |  // Maintain three, disjoint subsequences that span format.
  350|       |  //   [format.begin() ... pending) : already formatted into result
  351|       |  //   [pending ... cur) : formatting pending, but no special cases
  352|       |  //   [cur ... format.end()) : unexamined
  353|       |  // Initially, everything is in the unexamined part.
  354|  8.86k|  const char* pending = format.data();
  355|  8.86k|  const char* cur = pending;
  356|  8.86k|  const char* const end = pending + format.size();
  357|       |
  358|   148k|  while (cur != end) {  // while something is unexamined
  ------------------
  |  Branch (358:10): [True: 139k, False: 8.86k]
  ------------------
  359|       |    // Moves cur to the next percent sign.
  360|   139k|    const char* start = cur;
  361|  33.0M|    while (cur != end && *cur != '%') {
  ------------------
  |  Branch (361:12): [True: 33.0M, False: 697]
  |  Branch (361:26): [True: 32.8M, False: 139k]
  ------------------
  362|  32.8M|      if (*cur == '\0' && pending != start) {
  ------------------
  |  Branch (362:11): [True: 1.09M, False: 31.7M]
  |  Branch (362:27): [True: 7.69k, False: 1.09M]
  ------------------
  363|  7.69k|        FormatTM(&result, std::string(pending, cur), tm);
  364|  7.69k|        pending = start = cur;
  365|  7.69k|      }
  366|  32.8M|      ++cur;
  367|  32.8M|    }
  368|       |
  369|       |    // If the new pending text is all ordinary, copy it out.
  370|   139k|    if (cur != start && pending == start) {
  ------------------
  |  Branch (370:9): [True: 85.3k, False: 54.3k]
  |  Branch (370:25): [True: 20.6k, False: 64.7k]
  ------------------
  371|  20.6k|      result.append(pending, cur);
  372|  20.6k|      pending = start = cur;
  373|  20.6k|    }
  374|       |
  375|       |    // Span the sequential percent signs.
  376|   139k|    const char* const percent = cur;
  377|   379k|    while (cur != end && *cur == '%') ++cur;
  ------------------
  |  Branch (377:12): [True: 378k, False: 798]
  |  Branch (377:26): [True: 239k, False: 138k]
  ------------------
  378|       |
  379|       |    // If the new pending text is all percents, copy out one
  380|       |    // percent for every matched pair, then skip those pairs.
  381|   139k|    if (cur != start && pending == start) {
  ------------------
  |  Branch (381:9): [True: 139k, False: 301]
  |  Branch (381:25): [True: 72.6k, False: 66.7k]
  ------------------
  382|  72.6k|      std::size_t escaped = static_cast<std::size_t>(cur - pending) / 2;
  383|  72.6k|      result.append(pending, escaped);
  384|  72.6k|      pending += escaped * 2;
  385|       |      // Also copy out a single trailing percent.
  386|  72.6k|      if (pending != cur && cur == end) {
  ------------------
  |  Branch (386:11): [True: 70.8k, False: 1.83k]
  |  Branch (386:29): [True: 37, False: 70.8k]
  ------------------
  387|     37|        result.push_back(*pending++);
  388|     37|      }
  389|  72.6k|    }
  390|       |
  391|       |    // Loop unless we have an unescaped percent.
  392|   139k|    if (cur == end || (cur - percent) % 2 == 0) continue;
  ------------------
  |  Branch (392:9): [True: 798, False: 138k]
  |  Branch (392:23): [True: 4.04k, False: 134k]
  ------------------
  393|       |
  394|       |    // Simple specifiers that we handle ourselves.
  395|   134k|    if (*cur == '\0' || strchr("YmdeFUuWwHMSTzZs%", *cur)) {
  ------------------
  |  Branch (395:9): [True: 2.06k, False: 132k]
  |  Branch (395:25): [True: 17.4k, False: 115k]
  ------------------
  396|  19.5k|      FormatTM(&result, std::string(pending, cur - 1), tm);
  397|  19.5k|      switch (*cur) {
  ------------------
  |  Branch (397:15): [True: 19.5k, False: 0]
  ------------------
  398|  2.06k|        case '\0':
  ------------------
  |  Branch (398:9): [True: 2.06k, False: 17.4k]
  ------------------
  399|       |          // Because we allow NULs in the format string, we must give
  400|       |          // some meaning to the "%\0" specifier.  We choose the common
  401|       |          // (but undefined) strftime() behavior of echoing unknown
  402|       |          // specifiers.
  403|  2.06k|          result.push_back('%');
  404|  2.06k|          result.push_back('\0');
  405|  2.06k|          break;
  406|    693|        case 'Y':
  ------------------
  |  Branch (406:9): [True: 693, False: 18.8k]
  ------------------
  407|       |          // This avoids the tm.tm_year overflow problem for %Y, however
  408|       |          // tm.tm_year will still be used by other specifiers like %D.
  409|    693|          bp = Format64(ep, 0, al.cs.year());
  410|    693|          result.append(bp, ep);
  411|    693|          break;
  412|    213|        case 'm':
  ------------------
  |  Branch (412:9): [True: 213, False: 19.3k]
  ------------------
  413|    213|          bp = Format02d(ep, al.cs.month());
  414|    213|          result.append(bp, ep);
  415|    213|          break;
  416|    383|        case 'd':
  ------------------
  |  Branch (416:9): [True: 383, False: 19.1k]
  ------------------
  417|    965|        case 'e':
  ------------------
  |  Branch (417:9): [True: 582, False: 18.9k]
  ------------------
  418|    965|          bp = Format02d(ep, al.cs.day());
  419|    965|          if (*cur == 'e' && *bp == '0') *bp = ' ';  // for Windows
  ------------------
  |  Branch (419:15): [True: 582, False: 383]
  |  Branch (419:30): [True: 355, False: 227]
  ------------------
  420|    965|          result.append(bp, ep);
  421|    965|          break;
  422|    594|        case 'F':
  ------------------
  |  Branch (422:9): [True: 594, False: 18.9k]
  ------------------
  423|    594|          bp = Format02d(ep, al.cs.day());
  424|    594|          *--bp = '-';
  425|    594|          bp = Format02d(bp, al.cs.month());
  426|    594|          *--bp = '-';
  427|    594|          bp = Format64(bp, 0, al.cs.year());
  428|    594|          result.append(bp, ep);
  429|    594|          break;
  430|  3.25k|        case 'U':
  ------------------
  |  Branch (430:9): [True: 3.25k, False: 16.2k]
  ------------------
  431|  3.25k|          bp = Format02d(ep, ToWeek(civil_day(al.cs), weekday::sunday));
  432|  3.25k|          result.append(bp, ep);
  433|  3.25k|          break;
  434|    669|        case 'u':
  ------------------
  |  Branch (434:9): [True: 669, False: 18.8k]
  ------------------
  435|    669|          bp = Format64(ep, 0, tm.tm_wday ? tm.tm_wday : 7);
  ------------------
  |  Branch (435:32): [True: 467, False: 202]
  ------------------
  436|    669|          result.append(bp, ep);
  437|    669|          break;
  438|  2.58k|        case 'W':
  ------------------
  |  Branch (438:9): [True: 2.58k, False: 16.9k]
  ------------------
  439|  2.58k|          bp = Format02d(ep, ToWeek(civil_day(al.cs), weekday::monday));
  440|  2.58k|          result.append(bp, ep);
  441|  2.58k|          break;
  442|    194|        case 'w':
  ------------------
  |  Branch (442:9): [True: 194, False: 19.3k]
  ------------------
  443|    194|          bp = Format64(ep, 0, tm.tm_wday);
  444|    194|          result.append(bp, ep);
  445|    194|          break;
  446|    214|        case 'H':
  ------------------
  |  Branch (446:9): [True: 214, False: 19.3k]
  ------------------
  447|    214|          bp = Format02d(ep, al.cs.hour());
  448|    214|          result.append(bp, ep);
  449|    214|          break;
  450|    385|        case 'M':
  ------------------
  |  Branch (450:9): [True: 385, False: 19.1k]
  ------------------
  451|    385|          bp = Format02d(ep, al.cs.minute());
  452|    385|          result.append(bp, ep);
  453|    385|          break;
  454|    740|        case 'S':
  ------------------
  |  Branch (454:9): [True: 740, False: 18.8k]
  ------------------
  455|    740|          bp = Format02d(ep, al.cs.second());
  456|    740|          result.append(bp, ep);
  457|    740|          break;
  458|    430|        case 'T':
  ------------------
  |  Branch (458:9): [True: 430, False: 19.1k]
  ------------------
  459|    430|          bp = Format02d(ep, al.cs.second());
  460|    430|          *--bp = ':';
  461|    430|          bp = Format02d(bp, al.cs.minute());
  462|    430|          *--bp = ':';
  463|    430|          bp = Format02d(bp, al.cs.hour());
  464|    430|          result.append(bp, ep);
  465|    430|          break;
  466|  4.30k|        case 'z':
  ------------------
  |  Branch (466:9): [True: 4.30k, False: 15.2k]
  ------------------
  467|  4.30k|          bp = FormatOffset(ep, al.offset, "");
  468|  4.30k|          result.append(bp, ep);
  469|  4.30k|          break;
  470|    226|        case 'Z':
  ------------------
  |  Branch (470:9): [True: 226, False: 19.3k]
  ------------------
  471|    226|          result.append(al.abbr);
  472|    226|          break;
  473|  2.02k|        case 's':
  ------------------
  |  Branch (473:9): [True: 2.02k, False: 17.5k]
  ------------------
  474|  2.02k|          bp = Format64(ep, 0, ToUnixSeconds(tp));
  475|  2.02k|          result.append(bp, ep);
  476|  2.02k|          break;
  477|      0|        case '%':
  ------------------
  |  Branch (477:9): [True: 0, False: 19.5k]
  ------------------
  478|      0|          result.push_back('%');
  479|      0|          break;
  480|  19.5k|      }
  481|  19.5k|      pending = ++cur;
  482|  19.5k|      continue;
  483|  19.5k|    }
  484|       |
  485|       |    // More complex specifiers that we handle ourselves.
  486|   115k|    if (*cur == ':' && cur + 1 != end) {
  ------------------
  |  Branch (486:9): [True: 15.6k, False: 99.6k]
  |  Branch (486:24): [True: 15.6k, False: 10]
  ------------------
  487|  15.6k|      if (*(cur + 1) == 'z') {
  ------------------
  |  Branch (487:11): [True: 2.12k, False: 13.5k]
  ------------------
  488|       |        // Formats %:z.
  489|  2.12k|        FormatTM(&result, std::string(pending, cur - 1), tm);
  490|  2.12k|        bp = FormatOffset(ep, al.offset, ":");
  491|  2.12k|        result.append(bp, ep);
  492|  2.12k|        pending = cur += 2;
  493|  2.12k|        continue;
  494|  2.12k|      }
  495|  13.5k|      if (*(cur + 1) == ':' && cur + 2 != end) {
  ------------------
  |  Branch (495:11): [True: 4.39k, False: 9.12k]
  |  Branch (495:32): [True: 4.39k, False: 2]
  ------------------
  496|  4.39k|        if (*(cur + 2) == 'z') {
  ------------------
  |  Branch (496:13): [True: 1.43k, False: 2.95k]
  ------------------
  497|       |          // Formats %::z.
  498|  1.43k|          FormatTM(&result, std::string(pending, cur - 1), tm);
  499|  1.43k|          bp = FormatOffset(ep, al.offset, ":*");
  500|  1.43k|          result.append(bp, ep);
  501|  1.43k|          pending = cur += 3;
  502|  1.43k|          continue;
  503|  1.43k|        }
  504|  2.95k|        if (*(cur + 2) == ':' && cur + 3 != end) {
  ------------------
  |  Branch (504:13): [True: 1.87k, False: 1.08k]
  |  Branch (504:34): [True: 1.87k, False: 1]
  ------------------
  505|  1.87k|          if (*(cur + 3) == 'z') {
  ------------------
  |  Branch (505:15): [True: 1.47k, False: 403]
  ------------------
  506|       |            // Formats %:::z.
  507|  1.47k|            FormatTM(&result, std::string(pending, cur - 1), tm);
  508|  1.47k|            bp = FormatOffset(ep, al.offset, ":*:");
  509|  1.47k|            result.append(bp, ep);
  510|  1.47k|            pending = cur += 4;
  511|  1.47k|            continue;
  512|  1.47k|          }
  513|  1.87k|        }
  514|  2.95k|      }
  515|  13.5k|    }
  516|       |
  517|       |    // Loop if there is no E modifier.
  518|   110k|    if (*cur != 'E' || ++cur == end) continue;
  ------------------
  |  Branch (518:9): [True: 34.8k, False: 75.4k]
  |  Branch (518:24): [True: 10, False: 75.4k]
  ------------------
  519|       |
  520|       |    // Format our extensions.
  521|  75.4k|    if (*cur == 'T') {
  ------------------
  |  Branch (521:9): [True: 1.84k, False: 73.5k]
  ------------------
  522|       |      // Formats %ET.
  523|  1.84k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  524|  1.84k|      result.append("T");
  525|  1.84k|      pending = ++cur;
  526|  73.5k|    } else if (*cur == 'z') {
  ------------------
  |  Branch (526:16): [True: 3.39k, False: 70.1k]
  ------------------
  527|       |      // Formats %Ez.
  528|  3.39k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  529|  3.39k|      bp = FormatOffset(ep, al.offset, ":");
  530|  3.39k|      result.append(bp, ep);
  531|  3.39k|      pending = ++cur;
  532|  70.1k|    } else if (*cur == '*' && cur + 1 != end && *(cur + 1) == 'z') {
  ------------------
  |  Branch (532:16): [True: 26.4k, False: 43.7k]
  |  Branch (532:31): [True: 26.4k, False: 9]
  |  Branch (532:49): [True: 4.83k, False: 21.6k]
  ------------------
  533|       |      // Formats %E*z.
  534|  4.83k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  535|  4.83k|      bp = FormatOffset(ep, al.offset, ":*");
  536|  4.83k|      result.append(bp, ep);
  537|  4.83k|      pending = cur += 2;
  538|  65.3k|    } else if (*cur == '*' && cur + 1 != end &&
  ------------------
  |  Branch (538:16): [True: 21.6k, False: 43.7k]
  |  Branch (538:31): [True: 21.6k, False: 9]
  ------------------
  539|  21.6k|               (*(cur + 1) == 'S' || *(cur + 1) == 'f')) {
  ------------------
  |  Branch (539:17): [True: 18.2k, False: 3.34k]
  |  Branch (539:38): [True: 2.20k, False: 1.14k]
  ------------------
  540|       |      // Formats %E*S or %E*F.
  541|  20.4k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  542|  20.4k|      char* cp = ep;
  543|  20.4k|      bp = Format64(cp, 15, fs.count());
  544|   327k|      while (cp != bp && cp[-1] == '0') --cp;
  ------------------
  |  Branch (544:14): [True: 306k, False: 20.4k]
  |  Branch (544:26): [True: 306k, False: 0]
  ------------------
  545|  20.4k|      switch (*(cur + 1)) {
  ------------------
  |  Branch (545:15): [True: 20.4k, False: 0]
  ------------------
  546|  18.2k|        case 'S':
  ------------------
  |  Branch (546:9): [True: 18.2k, False: 2.20k]
  ------------------
  547|  18.2k|          if (cp != bp) *--bp = '.';
  ------------------
  |  Branch (547:15): [True: 0, False: 18.2k]
  ------------------
  548|  18.2k|          bp = Format02d(bp, al.cs.second());
  549|  18.2k|          break;
  550|  2.20k|        case 'f':
  ------------------
  |  Branch (550:9): [True: 2.20k, False: 18.2k]
  ------------------
  551|  2.20k|          if (cp == bp) *--bp = '0';
  ------------------
  |  Branch (551:15): [True: 2.20k, False: 0]
  ------------------
  552|  2.20k|          break;
  553|  20.4k|      }
  554|  20.4k|      result.append(bp, cp);
  555|  20.4k|      pending = cur += 2;
  556|  44.8k|    } else if (*cur == '4' && cur + 1 != end && *(cur + 1) == 'Y') {
  ------------------
  |  Branch (556:16): [True: 2.02k, False: 42.8k]
  |  Branch (556:31): [True: 2.02k, False: 5]
  |  Branch (556:49): [True: 1.03k, False: 990]
  ------------------
  557|       |      // Formats %E4Y.
  558|  1.03k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  559|  1.03k|      bp = Format64(ep, 4, al.cs.year());
  560|  1.03k|      result.append(bp, ep);
  561|  1.03k|      pending = cur += 2;
  562|  43.8k|    } else if (isdigit(*cur)) {
  ------------------
  |  Branch (562:16): [True: 34.4k, False: 9.42k]
  ------------------
  563|       |      // Possibly found %E#S or %E#f.
  564|  34.4k|      int n = 0;
  565|  34.4k|      if (const char* np = ParseInt(cur, 0, 0, 1024, &n)) {
  ------------------
  |  Branch (565:23): [True: 11.3k, False: 23.0k]
  ------------------
  566|  11.3k|        if (*np == 'S' || *np == 'f') {
  ------------------
  |  Branch (566:13): [True: 4.40k, False: 6.99k]
  |  Branch (566:27): [True: 2.10k, False: 4.88k]
  ------------------
  567|       |          // Formats %E#S or %E#f.
  568|  6.51k|          FormatTM(&result, std::string(pending, cur - 2), tm);
  569|  6.51k|          bp = ep;
  570|  6.51k|          if (n > 0) {
  ------------------
  |  Branch (570:15): [True: 4.77k, False: 1.73k]
  ------------------
  571|  4.77k|            if (n > kDigits10_64) n = kDigits10_64;
  ------------------
  |  Branch (571:17): [True: 1.11k, False: 3.65k]
  ------------------
  572|  4.77k|            bp = Format64(bp, n, (n > 15) ? fs.count() * kExp10[n - 15]
  ------------------
  |  Branch (572:34): [True: 1.11k, False: 3.65k]
  ------------------
  573|  4.77k|                                          : fs.count() / kExp10[15 - n]);
  574|  4.77k|            if (*np == 'S') *--bp = '.';
  ------------------
  |  Branch (574:17): [True: 2.89k, False: 1.88k]
  ------------------
  575|  4.77k|          }
  576|  6.51k|          if (*np == 'S') bp = Format02d(bp, al.cs.second());
  ------------------
  |  Branch (576:15): [True: 4.40k, False: 2.10k]
  ------------------
  577|  6.51k|          result.append(bp, ep);
  578|  6.51k|          pending = cur = ++np;
  579|  6.51k|        }
  580|  11.3k|      }
  581|  34.4k|    }
  582|  75.4k|  }
  583|       |
  584|       |  // Formats any remaining data.
  585|  8.86k|  FormatTM(&result, std::string(pending, end), tm);
  586|       |
  587|  8.86k|  return result;
  588|  8.86k|}
_ZN4cctz6detail5parseERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_9time_zoneEPNS1_6chrono10time_pointINSD_12system_clockENSD_8durationIlNS1_5ratioILl1ELl1EEEEEEEPNSG_IlNSH_ILl1ELl1000000000000000EEEEEPS7_:
  705|  8.86k|           detail::femtoseconds* fs, std::string* err) {
  706|       |  // The unparsed input.  Even though we allow NULs in input, and
  707|       |  // match them against corresponding NULs in format, we depend on
  708|       |  // *edata being a NUL so that we can call strptime().  This also
  709|       |  // makes our handling of input easier.
  710|  8.86k|  const char* data = input.c_str();  // NUL terminated
  711|  8.86k|  const char* const edata = data + input.size();
  712|       |
  713|       |  // Skips leading whitespace.
  714|  9.24k|  while (isspace(*data)) ++data;
  ------------------
  |  Branch (714:10): [True: 385, False: 8.86k]
  ------------------
  715|       |
  716|  8.86k|  const year_t kyearmax = std::numeric_limits<year_t>::max();
  717|  8.86k|  const year_t kyearmin = std::numeric_limits<year_t>::min();
  718|       |
  719|       |  // Sets default values for unspecified fields.
  720|  8.86k|  bool saw_year = false;
  721|  8.86k|  year_t year = 1970;
  722|  8.86k|  std::tm tm{};
  723|  8.86k|  tm.tm_year = 1970 - 1900;
  724|  8.86k|  tm.tm_mon = 1 - 1;  // Jan
  725|  8.86k|  tm.tm_mday = 1;
  726|  8.86k|  tm.tm_hour = 0;
  727|  8.86k|  tm.tm_min = 0;
  728|  8.86k|  tm.tm_sec = 0;
  729|  8.86k|  tm.tm_wday = 4;  // Thu
  730|  8.86k|  tm.tm_yday = 0;
  731|  8.86k|  tm.tm_isdst = 0;
  732|  8.86k|  auto subseconds = detail::femtoseconds::zero();
  733|  8.86k|  bool saw_offset = false;
  734|  8.86k|  int offset = 0;  // No offset from passed tz.
  735|  8.86k|  std::string zone = "UTC";
  736|       |
  737|       |  // Even though we allow NULs in format, and match them against
  738|       |  // corresponding NULs in input, we simplify its handling by also
  739|       |  // ensuring that *efmt is a NUL.
  740|  8.86k|  const char* fmt = format.c_str();  // NUL terminated
  741|  8.86k|  const char* const efmt = fmt + format.size();
  742|  8.86k|  bool twelve_hour = false;
  743|  8.86k|  bool afternoon = false;
  744|  8.86k|  int week_num = -1;
  745|  8.86k|  weekday week_start = weekday::sunday;
  746|       |
  747|  8.86k|  bool saw_percent_s = false;
  748|  8.86k|  std::int_fast64_t percent_s = 0;
  749|       |
  750|       |  // Steps through format, one specifier at a time.
  751|  34.8k|  while (data != nullptr && fmt != efmt) {
  ------------------
  |  Branch (751:10): [True: 32.4k, False: 2.44k]
  |  Branch (751:29): [True: 26.0k, False: 6.41k]
  ------------------
  752|  26.0k|    if (isspace(*fmt)) {
  ------------------
  |  Branch (752:9): [True: 1.48k, False: 24.5k]
  ------------------
  753|  2.87k|      while (isspace(*data)) ++data;
  ------------------
  |  Branch (753:14): [True: 1.38k, False: 1.48k]
  ------------------
  754|  1.68k|      while (isspace(*++fmt)) continue;
  ------------------
  |  Branch (754:14): [True: 200, False: 1.48k]
  ------------------
  755|  1.48k|      continue;
  756|  1.48k|    }
  757|       |
  758|  24.5k|    if (*fmt != '%') {
  ------------------
  |  Branch (758:9): [True: 2.75k, False: 21.7k]
  ------------------
  759|  2.75k|      if (data != edata && *data == *fmt) {
  ------------------
  |  Branch (759:11): [True: 2.65k, False: 101]
  |  Branch (759:28): [True: 2.59k, False: 64]
  ------------------
  760|  2.59k|        ++data;
  761|  2.59k|        ++fmt;
  762|  2.59k|      } else {
  763|    165|        data = nullptr;
  764|    165|      }
  765|  2.75k|      continue;
  766|  2.75k|    }
  767|       |
  768|  21.7k|    const char* const percent = fmt;
  769|  21.7k|    if (++fmt == efmt) {
  ------------------
  |  Branch (769:9): [True: 8, False: 21.7k]
  ------------------
  770|      8|      data = nullptr;
  771|      8|      continue;
  772|      8|    }
  773|  21.7k|    switch (*fmt++) {
  ------------------
  |  Branch (773:13): [True: 20.9k, False: 863]
  ------------------
  774|      2|      case '\0':
  ------------------
  |  Branch (774:7): [True: 2, False: 21.7k]
  ------------------
  775|       |        // Because we allow NULs in the format string, we must give
  776|       |        // some meaning to the "%\0" specifier.  We choose the common
  777|       |        // (but undefined) strptime() behavior of failing on unknown
  778|       |        // specifiers.
  779|      2|        data = nullptr;
  780|      2|        continue;
  781|  2.05k|      case 'Y':
  ------------------
  |  Branch (781:7): [True: 2.05k, False: 19.7k]
  ------------------
  782|       |        // Symmetrically with format(), directly handing %Y avoids the
  783|       |        // tm.tm_year overflow problem.  However, tm.tm_year will still be
  784|       |        // used by other specifiers like %D.
  785|  2.05k|        data = ParseInt(data, 0, kyearmin, kyearmax, &year);
  786|  2.05k|        if (data != nullptr) saw_year = true;
  ------------------
  |  Branch (786:13): [True: 1.95k, False: 91]
  ------------------
  787|  2.05k|        continue;
  788|    625|      case 'm':
  ------------------
  |  Branch (788:7): [True: 625, False: 21.1k]
  ------------------
  789|    625|        data = ParseInt(data, 2, 1, 12, &tm.tm_mon);
  790|    625|        if (data != nullptr) tm.tm_mon -= 1;
  ------------------
  |  Branch (790:13): [True: 588, False: 37]
  ------------------
  791|    625|        week_num = -1;
  792|    625|        continue;
  793|    141|      case 'd':
  ------------------
  |  Branch (793:7): [True: 141, False: 21.6k]
  ------------------
  794|    511|      case 'e':
  ------------------
  |  Branch (794:7): [True: 370, False: 21.3k]
  ------------------
  795|    511|        data = ParseInt(data, 2, 1, 31, &tm.tm_mday);
  796|    511|        week_num = -1;
  797|    511|        continue;
  798|    734|      case 'F':
  ------------------
  |  Branch (798:7): [True: 734, False: 21.0k]
  ------------------
  799|    734|        data = ParseInt(data, 0, kyearmin, kyearmax, &year);
  800|    734|        if (data != nullptr) {
  ------------------
  |  Branch (800:13): [True: 683, False: 51]
  ------------------
  801|    683|          saw_year = true;
  802|    683|          data = (*data == '-' ? data + 1 : nullptr);
  ------------------
  |  Branch (802:19): [True: 408, False: 275]
  ------------------
  803|    683|        }
  804|    734|        data = ParseInt(data, 2, 1, 12, &tm.tm_mon);
  805|    734|        if (data != nullptr) {
  ------------------
  |  Branch (805:13): [True: 374, False: 360]
  ------------------
  806|    374|          tm.tm_mon -= 1;
  807|    374|          data = (*data == '-' ? data + 1 : nullptr);
  ------------------
  |  Branch (807:19): [True: 355, False: 19]
  ------------------
  808|    374|        }
  809|    734|        data = ParseInt(data, 2, 1, 31, &tm.tm_mday);
  810|    734|        week_num = -1;
  811|    734|        continue;
  812|    490|      case 'U':
  ------------------
  |  Branch (812:7): [True: 490, False: 21.2k]
  ------------------
  813|    490|        data = ParseInt(data, 0, 0, 53, &week_num);
  814|    490|        week_start = weekday::sunday;
  815|    490|        continue;
  816|    386|      case 'W':
  ------------------
  |  Branch (816:7): [True: 386, False: 21.3k]
  ------------------
  817|    386|        data = ParseInt(data, 0, 0, 53, &week_num);
  818|    386|        week_start = weekday::monday;
  819|    386|        continue;
  820|    286|      case 'u':
  ------------------
  |  Branch (820:7): [True: 286, False: 21.4k]
  ------------------
  821|    286|        data = ParseInt(data, 0, 1, 7, &tm.tm_wday);
  822|    286|        if (data != nullptr) tm.tm_wday %= 7;
  ------------------
  |  Branch (822:13): [True: 82, False: 204]
  ------------------
  823|    286|        continue;
  824|    302|      case 'w':
  ------------------
  |  Branch (824:7): [True: 302, False: 21.4k]
  ------------------
  825|    302|        data = ParseInt(data, 0, 0, 6, &tm.tm_wday);
  826|    302|        continue;
  827|    448|      case 'H':
  ------------------
  |  Branch (827:7): [True: 448, False: 21.3k]
  ------------------
  828|    448|        data = ParseInt(data, 2, 0, 23, &tm.tm_hour);
  829|    448|        twelve_hour = false;
  830|    448|        continue;
  831|    495|      case 'M':
  ------------------
  |  Branch (831:7): [True: 495, False: 21.2k]
  ------------------
  832|    495|        data = ParseInt(data, 2, 0, 59, &tm.tm_min);
  833|    495|        continue;
  834|    515|      case 'S':
  ------------------
  |  Branch (834:7): [True: 515, False: 21.2k]
  ------------------
  835|    515|        data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  836|    515|        continue;
  837|    434|      case 'T':
  ------------------
  |  Branch (837:7): [True: 434, False: 21.3k]
  ------------------
  838|    434|        data = ParseInt(data, 2, 0, 23, &tm.tm_hour);
  839|    434|        twelve_hour = false;
  840|    434|        data = (data != nullptr && *data == ':' ? data + 1 : nullptr);
  ------------------
  |  Branch (840:17): [True: 398, False: 36]
  |  Branch (840:36): [True: 381, False: 17]
  ------------------
  841|    434|        data = ParseInt(data, 2, 0, 59, &tm.tm_min);
  842|    434|        data = (data != nullptr && *data == ':' ? data + 1 : nullptr);
  ------------------
  |  Branch (842:17): [True: 350, False: 84]
  |  Branch (842:36): [True: 319, False: 31]
  ------------------
  843|    434|        data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  844|    434|        continue;
  845|     76|      case 'I':
  ------------------
  |  Branch (845:7): [True: 76, False: 21.6k]
  ------------------
  846|    148|      case 'l':
  ------------------
  |  Branch (846:7): [True: 72, False: 21.6k]
  ------------------
  847|    160|      case 'r':  // probably uses %I
  ------------------
  |  Branch (847:7): [True: 12, False: 21.7k]
  ------------------
  848|    160|        twelve_hour = true;
  849|    160|        break;
  850|     36|      case 'R':  // uses %H
  ------------------
  |  Branch (850:7): [True: 36, False: 21.7k]
  ------------------
  851|     37|      case 'c':  // probably uses %H
  ------------------
  |  Branch (851:7): [True: 1, False: 21.7k]
  ------------------
  852|     57|      case 'X':  // probably uses %H
  ------------------
  |  Branch (852:7): [True: 20, False: 21.7k]
  ------------------
  853|     57|        twelve_hour = false;
  854|     57|        break;
  855|  3.05k|      case 'z':
  ------------------
  |  Branch (855:7): [True: 3.05k, False: 18.7k]
  ------------------
  856|  3.05k|        data = ParseOffset(data, "", &offset);
  857|  3.05k|        if (data != nullptr) saw_offset = true;
  ------------------
  |  Branch (857:13): [True: 2.99k, False: 66]
  ------------------
  858|  3.05k|        continue;
  859|    899|      case 'Z':  // ignored; zone abbreviations are ambiguous
  ------------------
  |  Branch (859:7): [True: 899, False: 20.8k]
  ------------------
  860|    899|        data = ParseZone(data, &zone);
  861|    899|        continue;
  862|    642|      case 's':
  ------------------
  |  Branch (862:7): [True: 642, False: 21.1k]
  ------------------
  863|    642|        data = ParseInt(data, 0,
  864|    642|                        std::numeric_limits<std::int_fast64_t>::min(),
  865|    642|                        std::numeric_limits<std::int_fast64_t>::max(),
  866|    642|                        &percent_s);
  867|    642|        if (data != nullptr) saw_percent_s = true;
  ------------------
  |  Branch (867:13): [True: 548, False: 94]
  ------------------
  868|    642|        continue;
  869|    922|      case ':':
  ------------------
  |  Branch (869:7): [True: 922, False: 20.8k]
  ------------------
  870|    922|        if (fmt[0] == 'z' ||
  ------------------
  |  Branch (870:13): [True: 462, False: 460]
  ------------------
  871|    460|            (fmt[0] == ':' &&
  ------------------
  |  Branch (871:14): [True: 449, False: 11]
  ------------------
  872|    895|             (fmt[1] == 'z' || (fmt[1] == ':' && fmt[2] == 'z')))) {
  ------------------
  |  Branch (872:15): [True: 237, False: 212]
  |  Branch (872:33): [True: 205, False: 7]
  |  Branch (872:50): [True: 196, False: 9]
  ------------------
  873|    895|          data = ParseOffset(data, ":", &offset);
  874|    895|          if (data != nullptr) saw_offset = true;
  ------------------
  |  Branch (874:15): [True: 874, False: 21]
  ------------------
  875|    895|          fmt += (fmt[0] == 'z') ? 1 : (fmt[1] == 'z') ? 2 : 3;
  ------------------
  |  Branch (875:18): [True: 462, False: 433]
  |  Branch (875:40): [True: 237, False: 196]
  ------------------
  876|    895|          continue;
  877|    895|        }
  878|     27|        break;
  879|    203|      case '%':
  ------------------
  |  Branch (879:7): [True: 203, False: 21.5k]
  ------------------
  880|    203|        data = (*data == '%' ? data + 1 : nullptr);
  ------------------
  |  Branch (880:17): [True: 194, False: 9]
  ------------------
  881|    203|        continue;
  882|  7.59k|      case 'E':
  ------------------
  |  Branch (882:7): [True: 7.59k, False: 14.1k]
  ------------------
  883|  7.59k|        if (fmt[0] == 'T') {
  ------------------
  |  Branch (883:13): [True: 398, False: 7.19k]
  ------------------
  884|    398|          if (*data == 'T' || *data == 't') {
  ------------------
  |  Branch (884:15): [True: 194, False: 204]
  |  Branch (884:31): [True: 194, False: 10]
  ------------------
  885|    388|            ++data;
  886|    388|            ++fmt;
  887|    388|          } else {
  888|     10|            data = nullptr;
  889|     10|          }
  890|    398|          continue;
  891|    398|        }
  892|  7.19k|        if (fmt[0] == 'z' || (fmt[0] == '*' && fmt[1] == 'z')) {
  ------------------
  |  Branch (892:13): [True: 1.82k, False: 5.36k]
  |  Branch (892:31): [True: 3.57k, False: 1.79k]
  |  Branch (892:48): [True: 626, False: 2.94k]
  ------------------
  893|  2.45k|          data = ParseOffset(data, ":", &offset);
  894|  2.45k|          if (data != nullptr) saw_offset = true;
  ------------------
  |  Branch (894:15): [True: 2.43k, False: 16]
  ------------------
  895|  2.45k|          fmt += (fmt[0] == 'z') ? 1 : 2;
  ------------------
  |  Branch (895:18): [True: 1.82k, False: 626]
  ------------------
  896|  2.45k|          continue;
  897|  2.45k|        }
  898|  4.74k|        if (fmt[0] == '*' && fmt[1] == 'S') {
  ------------------
  |  Branch (898:13): [True: 2.94k, False: 1.79k]
  |  Branch (898:30): [True: 489, False: 2.45k]
  ------------------
  899|    489|          data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  900|    489|          if (data != nullptr && *data == '.') {
  ------------------
  |  Branch (900:15): [True: 475, False: 14]
  |  Branch (900:34): [True: 10, False: 465]
  ------------------
  901|     10|            data = ParseSubSeconds(data + 1, &subseconds);
  902|     10|          }
  903|    489|          fmt += 2;
  904|    489|          continue;
  905|    489|        }
  906|  4.25k|        if (fmt[0] == '*' && fmt[1] == 'f') {
  ------------------
  |  Branch (906:13): [True: 2.45k, False: 1.79k]
  |  Branch (906:30): [True: 2.43k, False: 25]
  ------------------
  907|  2.43k|          if (data != nullptr && isdigit(*data)) {
  ------------------
  |  Branch (907:15): [True: 2.43k, False: 0]
  |  Branch (907:34): [True: 951, False: 1.48k]
  ------------------
  908|    951|            data = ParseSubSeconds(data, &subseconds);
  909|    951|          }
  910|  2.43k|          fmt += 2;
  911|  2.43k|          continue;
  912|  2.43k|        }
  913|  1.82k|        if (fmt[0] == '4' && fmt[1] == 'Y') {
  ------------------
  |  Branch (913:13): [True: 625, False: 1.19k]
  |  Branch (913:30): [True: 301, False: 324]
  ------------------
  914|    301|          const char* bp = data;
  915|    301|          data = ParseInt(data, 4, year_t{-999}, year_t{9999}, &year);
  916|    301|          if (data != nullptr) {
  ------------------
  |  Branch (916:15): [True: 281, False: 20]
  ------------------
  917|    281|            if (data - bp == 4) {
  ------------------
  |  Branch (917:17): [True: 231, False: 50]
  ------------------
  918|    231|              saw_year = true;
  919|    231|            } else {
  920|     50|              data = nullptr;  // stopped too soon
  921|     50|            }
  922|    281|          }
  923|    301|          fmt += 2;
  924|    301|          continue;
  925|    301|        }
  926|  1.52k|        if (isdigit(*fmt)) {
  ------------------
  |  Branch (926:13): [True: 1.40k, False: 111]
  ------------------
  927|  1.40k|          int n = 0;  // value ignored
  928|  1.40k|          if (const char* np = ParseInt(fmt, 0, 0, 1024, &n)) {
  ------------------
  |  Branch (928:27): [True: 1.29k, False: 119]
  ------------------
  929|  1.29k|            if (*np == 'S') {
  ------------------
  |  Branch (929:17): [True: 262, False: 1.02k]
  ------------------
  930|    262|              data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  931|    262|              if (data != nullptr && *data == '.') {
  ------------------
  |  Branch (931:19): [True: 243, False: 19]
  |  Branch (931:38): [True: 10, False: 233]
  ------------------
  932|     10|                data = ParseSubSeconds(data + 1, &subseconds);
  933|     10|              }
  934|    262|              fmt = ++np;
  935|    262|              continue;
  936|    262|            }
  937|  1.02k|            if (*np == 'f') {
  ------------------
  |  Branch (937:17): [True: 971, False: 57]
  ------------------
  938|    971|              if (data != nullptr && isdigit(*data)) {
  ------------------
  |  Branch (938:19): [True: 971, False: 0]
  |  Branch (938:38): [True: 391, False: 580]
  ------------------
  939|    391|                data = ParseSubSeconds(data, &subseconds);
  940|    391|              }
  941|    971|              fmt = ++np;
  942|    971|              continue;
  943|    971|            }
  944|  1.02k|          }
  945|  1.40k|        }
  946|    287|        if (*fmt == 'c') twelve_hour = false;  // probably uses %H
  ------------------
  |  Branch (946:13): [True: 1, False: 286]
  ------------------
  947|    287|        if (*fmt == 'X') twelve_hour = false;  // probably uses %H
  ------------------
  |  Branch (947:13): [True: 11, False: 276]
  ------------------
  948|    287|        if (*fmt != '\0') ++fmt;
  ------------------
  |  Branch (948:13): [True: 275, False: 12]
  ------------------
  949|    287|        break;
  950|     96|      case 'O':
  ------------------
  |  Branch (950:7): [True: 96, False: 21.6k]
  ------------------
  951|     96|        if (*fmt == 'H') twelve_hour = false;
  ------------------
  |  Branch (951:13): [True: 37, False: 59]
  ------------------
  952|     96|        if (*fmt == 'I') twelve_hour = true;
  ------------------
  |  Branch (952:13): [True: 36, False: 60]
  ------------------
  953|     96|        if (*fmt != '\0') ++fmt;
  ------------------
  |  Branch (953:13): [True: 90, False: 6]
  ------------------
  954|     96|        break;
  955|  21.7k|    }
  956|       |
  957|       |    // Parses the current specifier.
  958|  1.49k|    const char* const orig_data = data;
  959|  1.49k|    std::string spec(percent, fmt);
  960|  1.49k|    data = ParseTM(data, spec.c_str(), &tm);
  961|       |
  962|       |    // If we successfully parsed %p we need to remember whether the result
  963|       |    // was AM or PM so that we can adjust tm_hour before time_zone::lookup().
  964|       |    // So reparse the input with a known AM hour, and check if it is shifted
  965|       |    // to a PM hour.
  966|  1.49k|    if (spec == "%p" && data != nullptr) {
  ------------------
  |  Branch (966:9): [True: 240, False: 1.25k]
  |  Branch (966:25): [True: 234, False: 6]
  ------------------
  967|    234|      std::string test_input = "1";
  968|    234|      test_input.append(orig_data, data);
  969|    234|      std::tm tmp{};
  970|    234|      ParseTM(test_input.c_str(), "%I%p", &tmp);
  971|    234|      afternoon = (tmp.tm_hour == 13);
  972|    234|    }
  973|  1.49k|  }
  974|       |
  975|       |  // Adjust a 12-hour tm_hour value if it should be in the afternoon.
  976|  8.86k|  if (twelve_hour && afternoon && tm.tm_hour < 12) {
  ------------------
  |  Branch (976:7): [True: 43, False: 8.81k]
  |  Branch (976:22): [True: 6, False: 37]
  |  Branch (976:35): [True: 4, False: 2]
  ------------------
  977|      4|    tm.tm_hour += 12;
  978|      4|  }
  979|       |
  980|  8.86k|  if (data == nullptr) {
  ------------------
  |  Branch (980:7): [True: 2.44k, False: 6.41k]
  ------------------
  981|  2.44k|    if (err != nullptr) *err = "Failed to parse input";
  ------------------
  |  Branch (981:9): [True: 0, False: 2.44k]
  ------------------
  982|  2.44k|    return false;
  983|  2.44k|  }
  984|       |
  985|       |  // Skip any remaining whitespace.
  986|  6.61k|  while (isspace(*data)) ++data;
  ------------------
  |  Branch (986:10): [True: 201, False: 6.41k]
  ------------------
  987|       |
  988|       |  // parse() must consume the entire input string.
  989|  6.41k|  if (data != edata) {
  ------------------
  |  Branch (989:7): [True: 266, False: 6.14k]
  ------------------
  990|    266|    if (err != nullptr) *err = "Illegal trailing data in input string";
  ------------------
  |  Branch (990:9): [True: 0, False: 266]
  ------------------
  991|    266|    return false;
  992|    266|  }
  993|       |
  994|       |  // If we saw %s then we ignore anything else and return that time.
  995|  6.14k|  if (saw_percent_s) {
  ------------------
  |  Branch (995:7): [True: 290, False: 5.85k]
  ------------------
  996|    290|    *sec = FromUnixSeconds(percent_s);
  997|    290|    *fs = detail::femtoseconds::zero();
  998|    290|    return true;
  999|    290|  }
 1000|       |
 1001|       |  // If we saw %z, %Ez, or %E*z then we want to interpret the parsed fields
 1002|       |  // in UTC and then shift by that offset.  Otherwise we want to interpret
 1003|       |  // the fields directly in the passed time_zone.
 1004|  5.85k|  time_zone ptz = saw_offset ? utc_time_zone() : tz;
  ------------------
  |  Branch (1004:19): [True: 196, False: 5.66k]
  ------------------
 1005|       |
 1006|       |  // Allows a leap second of 60 to normalize forward to the following ":00".
 1007|  5.85k|  if (tm.tm_sec == 60) {
  ------------------
  |  Branch (1007:7): [True: 40, False: 5.81k]
  ------------------
 1008|     40|    tm.tm_sec -= 1;
 1009|     40|    offset -= 1;
 1010|     40|    subseconds = detail::femtoseconds::zero();
 1011|     40|  }
 1012|       |
 1013|  5.85k|  if (!saw_year) {
  ------------------
  |  Branch (1013:7): [True: 4.11k, False: 1.74k]
  ------------------
 1014|  4.11k|    year = year_t{tm.tm_year};
 1015|  4.11k|    if (year > kyearmax - 1900) {
  ------------------
  |  Branch (1015:9): [True: 0, False: 4.11k]
  ------------------
 1016|       |      // Platform-dependent, maybe unreachable.
 1017|      0|      if (err != nullptr) *err = "Out-of-range year";
  ------------------
  |  Branch (1017:11): [True: 0, False: 0]
  ------------------
 1018|      0|      return false;
 1019|      0|    }
 1020|  4.11k|    year += 1900;
 1021|  4.11k|  }
 1022|       |
 1023|       |  // Compute year, tm.tm_mon and tm.tm_mday if we parsed a week number.
 1024|  5.85k|  if (week_num != -1) {
  ------------------
  |  Branch (1024:7): [True: 293, False: 5.56k]
  ------------------
 1025|    293|    if (!FromWeek(week_num, week_start, &year, &tm)) {
  ------------------
  |  Branch (1025:9): [True: 2, False: 291]
  ------------------
 1026|      2|      if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1026:11): [True: 0, False: 2]
  ------------------
 1027|      2|      return false;
 1028|      2|    }
 1029|    293|  }
 1030|       |
 1031|  5.85k|  const int month = tm.tm_mon + 1;
 1032|  5.85k|  civil_second cs(year, month, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
 1033|       |
 1034|       |  // parse() should not allow normalization. Due to the restricted field
 1035|       |  // ranges above (see ParseInt()), the only possibility is for days to roll
 1036|       |  // into months. That is, parsing "Sep 31" should not produce "Oct 1".
 1037|  5.85k|  if (cs.month() != month || cs.day() != tm.tm_mday) {
  ------------------
  |  Branch (1037:7): [True: 2, False: 5.85k]
  |  Branch (1037:30): [True: 0, False: 5.85k]
  ------------------
 1038|      2|    if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1038:9): [True: 0, False: 2]
  ------------------
 1039|      2|    return false;
 1040|      2|  }
 1041|       |
 1042|       |  // Accounts for the offset adjustment before converting to absolute time.
 1043|  5.85k|  if ((offset < 0 && cs > civil_second::max() + offset) ||
  ------------------
  |  Branch (1043:7): [True: 1, False: 5.85k]
  |  Branch (1043:8): [True: 118, False: 5.73k]
  |  Branch (1043:22): [True: 0, False: 118]
  ------------------
 1044|  5.85k|      (offset > 0 && cs < civil_second::min() + offset)) {
  ------------------
  |  Branch (1044:8): [True: 84, False: 5.77k]
  |  Branch (1044:22): [True: 1, False: 83]
  ------------------
 1045|      1|    if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1045:9): [True: 0, False: 1]
  ------------------
 1046|      1|    return false;
 1047|      1|  }
 1048|  5.85k|  cs -= offset;
 1049|       |
 1050|  5.85k|  const auto tp = ptz.lookup(cs).pre;
 1051|       |  // Checks for overflow/underflow and returns an error as necessary.
 1052|  5.85k|  if (tp == time_point<seconds>::max()) {
  ------------------
  |  Branch (1052:7): [True: 387, False: 5.46k]
  ------------------
 1053|    387|    const auto al = ptz.lookup(time_point<seconds>::max());
 1054|    387|    if (cs > al.cs) {
  ------------------
  |  Branch (1054:9): [True: 238, False: 149]
  ------------------
 1055|    238|      if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1055:11): [True: 0, False: 238]
  ------------------
 1056|    238|      return false;
 1057|    238|    }
 1058|    387|  }
 1059|  5.61k|  if (tp == time_point<seconds>::min()) {
  ------------------
  |  Branch (1059:7): [True: 355, False: 5.26k]
  ------------------
 1060|    355|    const auto al = ptz.lookup(time_point<seconds>::min());
 1061|    355|    if (cs < al.cs) {
  ------------------
  |  Branch (1061:9): [True: 156, False: 199]
  ------------------
 1062|    156|      if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1062:11): [True: 0, False: 156]
  ------------------
 1063|    156|      return false;
 1064|    156|    }
 1065|    355|  }
 1066|       |
 1067|  5.45k|  *sec = tp;
 1068|  5.45k|  *fs = subseconds;
 1069|  5.45k|  return true;
 1070|  5.61k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_14ToTMERKNS_9time_zone15absolute_lookupE:
  120|  8.86k|std::tm ToTM(const time_zone::absolute_lookup& al) {
  121|  8.86k|  std::tm tm{};
  122|  8.86k|  tm.tm_sec = al.cs.second();
  123|  8.86k|  tm.tm_min = al.cs.minute();
  124|  8.86k|  tm.tm_hour = al.cs.hour();
  125|  8.86k|  tm.tm_mday = al.cs.day();
  126|  8.86k|  tm.tm_mon = al.cs.month() - 1;
  127|       |
  128|       |  // Saturate tm.tm_year in cases of over/underflow.
  129|  8.86k|  if (al.cs.year() < std::numeric_limits<int>::min() + 1900) {
  ------------------
  |  Branch (129:7): [True: 0, False: 8.86k]
  ------------------
  130|      0|    tm.tm_year = std::numeric_limits<int>::min();
  131|  8.86k|  } else if (al.cs.year() - 1900 > std::numeric_limits<int>::max()) {
  ------------------
  |  Branch (131:14): [True: 665, False: 8.19k]
  ------------------
  132|    665|    tm.tm_year = std::numeric_limits<int>::max();
  133|  8.19k|  } else {
  134|  8.19k|    tm.tm_year = static_cast<int>(al.cs.year() - 1900);
  135|  8.19k|  }
  136|       |
  137|  8.86k|  tm.tm_wday = ToTmWday(get_weekday(al.cs));
  138|  8.86k|  tm.tm_yday = get_yearday(al.cs) - 1;
  139|  8.86k|  tm.tm_isdst = al.is_dst ? 1 : 0;
  ------------------
  |  Branch (139:17): [True: 730, False: 8.13k]
  ------------------
  140|  8.86k|  return tm;
  141|  8.86k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18ToTmWdayENS0_7weekdayE:
   79|  8.86k|int ToTmWday(weekday wd) {
   80|  8.86k|  switch (wd) {
  ------------------
  |  Branch (80:11): [True: 8.86k, False: 0]
  ------------------
   81|    514|    case weekday::sunday:
  ------------------
  |  Branch (81:5): [True: 514, False: 8.34k]
  ------------------
   82|    514|      return 0;
   83|    462|    case weekday::monday:
  ------------------
  |  Branch (83:5): [True: 462, False: 8.40k]
  ------------------
   84|    462|      return 1;
   85|  6.05k|    case weekday::tuesday:
  ------------------
  |  Branch (85:5): [True: 6.05k, False: 2.80k]
  ------------------
   86|  6.05k|      return 2;
   87|    458|    case weekday::wednesday:
  ------------------
  |  Branch (87:5): [True: 458, False: 8.40k]
  ------------------
   88|    458|      return 3;
   89|    499|    case weekday::thursday:
  ------------------
  |  Branch (89:5): [True: 499, False: 8.36k]
  ------------------
   90|    499|      return 4;
   91|    429|    case weekday::friday:
  ------------------
  |  Branch (91:5): [True: 429, False: 8.43k]
  ------------------
   92|    429|      return 5;
   93|    447|    case weekday::saturday:
  ------------------
  |  Branch (93:5): [True: 447, False: 8.41k]
  ------------------
   94|    447|      return 6;
   95|  8.86k|  }
   96|      0|  return 0; /*NOTREACHED*/
   97|  8.86k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18FormatTMEPNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKS8_RK2tm:
  223|  79.2k|void FormatTM(std::string* out, const std::string& fmt, const std::tm& tm) {
  224|       |  // We assume that 16 times the length of the format string will
  225|       |  // be sufficient to store the result.  The extreme case appears
  226|       |  // to be "%c" (2 chars), which, in the POSIX locale, produces
  227|       |  // "Thu Jan 1 00:00:00 1970" (24 chars).
  228|  79.2k|  auto out_size = out->size();
  229|  79.2k|  auto buf_size = (16 * fmt.size()) + 1;
  230|  79.2k|  out->resize(out_size + buf_size);
  231|  79.2k|  auto len = strftime(&(*out)[out_size], buf_size, fmt.c_str(), &tm);
  232|  79.2k|  out->resize(out_size + len);
  233|  79.2k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18Format64EPcil:
  155|  30.4k|char* Format64(char* ep, int width, std::int_fast64_t v) {
  156|  30.4k|  bool neg = false;
  157|  30.4k|  if (v < 0) {
  ------------------
  |  Branch (157:7): [True: 827, False: 29.6k]
  ------------------
  158|    827|    --width;
  159|    827|    neg = true;
  160|    827|    if (v == std::numeric_limits<std::int_fast64_t>::min()) {
  ------------------
  |  Branch (160:9): [True: 0, False: 827]
  ------------------
  161|       |      // Avoid negating minimum value.
  162|      0|      std::int_fast64_t last_digit = -(v % 10);
  163|      0|      v /= 10;
  164|      0|      if (last_digit < 0) {
  ------------------
  |  Branch (164:11): [True: 0, False: 0]
  ------------------
  165|      0|        ++v;
  166|      0|        last_digit += 10;
  167|      0|      }
  168|      0|      --width;
  169|      0|      *--ep = kDigits[last_digit];
  170|      0|    }
  171|    827|    v = -v;
  172|    827|  }
  173|  73.2k|  do {
  174|  73.2k|    --width;
  175|  73.2k|    *--ep = kDigits[v % 10];
  176|  73.2k|  } while (v /= 10);
  ------------------
  |  Branch (176:12): [True: 42.8k, False: 30.4k]
  ------------------
  177|   348k|  while (--width >= 0) *--ep = '0';  // zero pad
  ------------------
  |  Branch (177:10): [True: 317k, False: 30.4k]
  ------------------
  178|  30.4k|  if (neg) *--ep = '-';
  ------------------
  |  Branch (178:7): [True: 827, False: 29.6k]
  ------------------
  179|  30.4k|  return ep;
  180|  30.4k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_19Format02dEPci:
  183|  74.2k|char* Format02d(char* ep, int v) {
  184|  74.2k|  *--ep = kDigits[v % 10];
  185|  74.2k|  *--ep = kDigits[(v / 10) % 10];
  186|  74.2k|  return ep;
  187|  74.2k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_16ToWeekERKNS0_10civil_timeINS0_7day_tagEEENS0_7weekdayE:
  145|  5.84k|int ToWeek(const civil_day& cd, weekday week_start) {
  146|  5.84k|  const civil_day d(cd.year() % 400, cd.month(), cd.day());
  147|  5.84k|  return static_cast<int>((d - prev_weekday(civil_year(d), week_start)) / 7);
  148|  5.84k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_112FormatOffsetEPciPKc:
  190|  17.5k|char* FormatOffset(char* ep, int offset, const char* mode) {
  191|       |  // TODO: Follow the RFC3339 "Unknown Local Offset Convention" and
  192|       |  // generate a "negative zero" when we're formatting a zero offset
  193|       |  // as the result of a failed load_time_zone().
  194|  17.5k|  char sign = '+';
  195|  17.5k|  if (offset < 0) {
  ------------------
  |  Branch (195:7): [True: 6.23k, False: 11.3k]
  ------------------
  196|  6.23k|    offset = -offset;  // bounded by 24h so no overflow
  197|  6.23k|    sign = '-';
  198|  6.23k|  }
  199|  17.5k|  const int seconds = offset % 60;
  200|  17.5k|  const int minutes = (offset /= 60) % 60;
  201|  17.5k|  const int hours = offset /= 60;
  202|  17.5k|  const char sep = mode[0];
  203|  17.5k|  const bool ext = (sep != '\0' && mode[1] == '*');
  ------------------
  |  Branch (203:21): [True: 13.2k, False: 4.30k]
  |  Branch (203:36): [True: 7.74k, False: 5.52k]
  ------------------
  204|  17.5k|  const bool ccc = (ext && mode[2] == ':');
  ------------------
  |  Branch (204:21): [True: 7.74k, False: 9.82k]
  |  Branch (204:28): [True: 1.47k, False: 6.27k]
  ------------------
  205|  17.5k|  if (ext && (!ccc || seconds != 0)) {
  ------------------
  |  Branch (205:7): [True: 7.74k, False: 9.82k]
  |  Branch (205:15): [True: 6.27k, False: 1.47k]
  |  Branch (205:23): [True: 289, False: 1.18k]
  ------------------
  206|  6.56k|    ep = Format02d(ep, seconds);
  207|  6.56k|    *--ep = sep;
  208|  11.0k|  } else {
  209|       |    // If we're not rendering seconds, sub-minute negative offsets
  210|       |    // should get a positive sign (e.g., offset=-10s => "+00:00").
  211|  11.0k|    if (hours == 0 && minutes == 0) sign = '+';
  ------------------
  |  Branch (211:9): [True: 5.19k, False: 5.80k]
  |  Branch (211:23): [True: 4.31k, False: 885]
  ------------------
  212|  11.0k|  }
  213|  17.5k|  if (!ccc || minutes != 0 || seconds != 0) {
  ------------------
  |  Branch (213:7): [True: 16.0k, False: 1.47k]
  |  Branch (213:15): [True: 294, False: 1.17k]
  |  Branch (213:31): [True: 204, False: 972]
  ------------------
  214|  16.5k|    ep = Format02d(ep, minutes);
  215|  16.5k|    if (sep != '\0') *--ep = sep;
  ------------------
  |  Branch (215:9): [True: 12.2k, False: 4.30k]
  ------------------
  216|  16.5k|  }
  217|  17.5k|  ep = Format02d(ep, hours);
  218|  17.5k|  *--ep = sign;
  219|  17.5k|  return ep;
  220|  17.5k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_17isdigitEc:
   59|  48.7k|bool isdigit(char ch) {
   60|  48.7k|  return std::isdigit(static_cast<unsigned char>(ch)) != 0;
   61|  48.7k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_17isspaceEc:
   63|  48.7k|bool isspace(char ch) {
   64|  48.7k|  return std::isspace(static_cast<unsigned char>(ch)) != 0;
   65|  48.7k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_111ParseOffsetEPKcS3_Pi:
  592|  6.40k|const char* ParseOffset(const char* dp, const char* mode, int* offset) {
  593|  6.40k|  if (dp != nullptr) {
  ------------------
  |  Branch (593:7): [True: 6.40k, False: 0]
  ------------------
  594|  6.40k|    const char first = *dp++;
  595|  6.40k|    if (first == '+' || first == '-') {
  ------------------
  |  Branch (595:9): [True: 1.16k, False: 5.24k]
  |  Branch (595:25): [True: 3.55k, False: 1.69k]
  ------------------
  596|  4.71k|      char sep = mode[0];
  597|  4.71k|      int hours = 0;
  598|  4.71k|      int minutes = 0;
  599|  4.71k|      int seconds = 0;
  600|  4.71k|      const char* ap = ParseInt(dp, 2, 0, 23, &hours);
  601|  4.71k|      if (ap != nullptr && ap - dp == 2) {
  ------------------
  |  Branch (601:11): [True: 4.67k, False: 32]
  |  Branch (601:28): [True: 4.66k, False: 12]
  ------------------
  602|  4.66k|        dp = ap;
  603|  4.66k|        if (sep != '\0' && *ap == sep) ++ap;
  ------------------
  |  Branch (603:13): [True: 2.21k, False: 2.45k]
  |  Branch (603:28): [True: 19, False: 2.19k]
  ------------------
  604|  4.66k|        const char* bp = ParseInt(ap, 2, 0, 59, &minutes);
  605|  4.66k|        if (bp != nullptr && bp - ap == 2) {
  ------------------
  |  Branch (605:13): [True: 2.81k, False: 1.85k]
  |  Branch (605:30): [True: 2.10k, False: 711]
  ------------------
  606|  2.10k|          dp = bp;
  607|  2.10k|          if (sep != '\0' && *bp == sep) ++bp;
  ------------------
  |  Branch (607:15): [True: 1.08k, False: 1.01k]
  |  Branch (607:30): [True: 10, False: 1.07k]
  ------------------
  608|  2.10k|          const char* cp = ParseInt(bp, 2, 0, 59, &seconds);
  609|  2.10k|          if (cp != nullptr && cp - bp == 2) dp = cp;
  ------------------
  |  Branch (609:15): [True: 827, False: 1.27k]
  |  Branch (609:32): [True: 495, False: 332]
  ------------------
  610|  2.10k|        }
  611|  4.66k|        *offset = ((hours * 60 + minutes) * 60) + seconds;
  612|  4.66k|        if (first == '-') *offset = -*offset;
  ------------------
  |  Branch (612:13): [True: 3.51k, False: 1.14k]
  ------------------
  613|  4.66k|      } else {
  614|     44|        dp = nullptr;
  615|     44|      }
  616|  4.71k|    } else if (first == 'Z' || first == 'z') {  // Zulu
  ------------------
  |  Branch (616:16): [True: 678, False: 1.01k]
  |  Branch (616:32): [True: 956, False: 59]
  ------------------
  617|  1.63k|      *offset = 0;
  618|  1.63k|    } else {
  619|     59|      dp = nullptr;
  620|     59|    }
  621|  6.40k|  }
  622|  6.40k|  return dp;
  623|  6.40k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_19ParseZoneEPKcPNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  625|    899|const char* ParseZone(const char* dp, std::string* zone) {
  626|    899|  zone->clear();
  627|    899|  if (dp != nullptr) {
  ------------------
  |  Branch (627:7): [True: 899, False: 0]
  ------------------
  628|  2.57k|    while (*dp != '\0' && !isspace(*dp)) zone->push_back(*dp++);
  ------------------
  |  Branch (628:12): [True: 2.27k, False: 297]
  |  Branch (628:27): [True: 1.67k, False: 602]
  ------------------
  629|    899|    if (zone->empty()) dp = nullptr;
  ------------------
  |  Branch (629:9): [True: 21, False: 878]
  ------------------
  630|    899|  }
  631|    899|  return dp;
  632|    899|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_115ParseSubSecondsEPKcPNSt3__16chrono8durationIlNS4_5ratioILl1ELl1000000000000000EEEEE:
  634|  1.36k|const char* ParseSubSeconds(const char* dp, detail::femtoseconds* subseconds) {
  635|  1.36k|  if (dp != nullptr) {
  ------------------
  |  Branch (635:7): [True: 1.36k, False: 0]
  ------------------
  636|  1.36k|    std::int_fast64_t v = 0;
  637|  1.36k|    std::int_fast64_t exp = 0;
  638|  1.36k|    const char* const bp = dp;
  639|  3.75k|    while (const char* cp = strchr(kDigits, *dp)) {
  ------------------
  |  Branch (639:24): [True: 2.44k, False: 1.31k]
  ------------------
  640|  2.44k|      int d = static_cast<int>(cp - kDigits);
  641|  2.44k|      if (d >= 10) break;
  ------------------
  |  Branch (641:11): [True: 50, False: 2.39k]
  ------------------
  642|  2.39k|      if (exp < 15) {
  ------------------
  |  Branch (642:11): [True: 2.07k, False: 324]
  ------------------
  643|  2.07k|        exp += 1;
  644|  2.07k|        v *= 10;
  645|  2.07k|        v += d;
  646|  2.07k|      }
  647|  2.39k|      ++dp;
  648|  2.39k|    }
  649|  1.36k|    if (dp != bp) {
  ------------------
  |  Branch (649:9): [True: 1.35k, False: 8]
  ------------------
  650|  1.35k|      v *= kExp10[15 - exp];
  651|  1.35k|      *subseconds = detail::femtoseconds(v);
  652|  1.35k|    } else {
  653|      8|      dp = nullptr;
  654|      8|    }
  655|  1.36k|  }
  656|  1.36k|  return dp;
  657|  1.36k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_17ParseTMEPKcS3_P2tm:
  660|  1.72k|const char* ParseTM(const char* dp, const char* fmt, std::tm* tm) {
  661|  1.72k|  if (dp != nullptr) {
  ------------------
  |  Branch (661:7): [True: 1.72k, False: 0]
  ------------------
  662|  1.72k|    dp = strptime(dp, fmt, tm);
  663|  1.72k|  }
  664|  1.72k|  return dp;
  665|  1.72k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18FromWeekEiNS0_7weekdayEPlP2tm:
  670|    293|bool FromWeek(int week_num, weekday week_start, year_t* year, std::tm* tm) {
  671|    293|  const civil_year y(*year % 400);
  672|    293|  civil_day cd = prev_weekday(y, week_start);  // week 0
  673|    293|  cd = next_weekday(cd - 1, FromTmWday(tm->tm_wday)) + (week_num * 7);
  674|    293|  if (const year_t shift = cd.year() - y.year()) {
  ------------------
  |  Branch (674:20): [True: 173, False: 120]
  ------------------
  675|    173|    if (shift > 0) {
  ------------------
  |  Branch (675:9): [True: 37, False: 136]
  ------------------
  676|     37|      if (*year > std::numeric_limits<year_t>::max() - shift) return false;
  ------------------
  |  Branch (676:11): [True: 1, False: 36]
  ------------------
  677|    136|    } else {
  678|    136|      if (*year < std::numeric_limits<year_t>::min() - shift) return false;
  ------------------
  |  Branch (678:11): [True: 1, False: 135]
  ------------------
  679|    136|    }
  680|    171|    *year += shift;
  681|    171|  }
  682|    291|  tm->tm_mon = cd.month() - 1;
  683|    291|  tm->tm_mday = cd.day();
  684|    291|  return true;
  685|    293|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_110FromTmWdayEi:
  100|    293|weekday FromTmWday(int tm_wday) {
  101|    293|  switch (tm_wday) {
  ------------------
  |  Branch (101:11): [True: 293, False: 0]
  ------------------
  102|     11|    case 0:
  ------------------
  |  Branch (102:5): [True: 11, False: 282]
  ------------------
  103|     11|      return weekday::sunday;
  104|     11|    case 1:
  ------------------
  |  Branch (104:5): [True: 11, False: 282]
  ------------------
  105|     11|      return weekday::monday;
  106|      1|    case 2:
  ------------------
  |  Branch (106:5): [True: 1, False: 292]
  ------------------
  107|      1|      return weekday::tuesday;
  108|      8|    case 3:
  ------------------
  |  Branch (108:5): [True: 8, False: 285]
  ------------------
  109|      8|      return weekday::wednesday;
  110|    256|    case 4:
  ------------------
  |  Branch (110:5): [True: 256, False: 37]
  ------------------
  111|    256|      return weekday::thursday;
  112|      3|    case 5:
  ------------------
  |  Branch (112:5): [True: 3, False: 290]
  ------------------
  113|      3|      return weekday::friday;
  114|      3|    case 6:
  ------------------
  |  Branch (114:5): [True: 3, False: 290]
  ------------------
  115|      3|      return weekday::saturday;
  116|    293|  }
  117|      0|  return weekday::sunday; /*NOTREACHED*/
  118|    293|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18ParseIntIiEEPKcS4_iT_S5_PS5_:
  237|  54.8k|const char* ParseInt(const char* dp, int width, T min, T max, T* vp) {
  238|  54.8k|  if (dp != nullptr) {
  ------------------
  |  Branch (238:7): [True: 54.0k, False: 873]
  ------------------
  239|  54.0k|    const T kmin = std::numeric_limits<T>::min();
  240|  54.0k|    bool erange = false;
  241|  54.0k|    bool neg = false;
  242|  54.0k|    T value = 0;
  243|  54.0k|    if (*dp == '-') {
  ------------------
  |  Branch (243:9): [True: 2.28k, False: 51.7k]
  ------------------
  244|  2.28k|      neg = true;
  245|  2.28k|      if (width <= 0 || --width != 0) {
  ------------------
  |  Branch (245:11): [True: 212, False: 2.07k]
  |  Branch (245:25): [True: 2.07k, False: 0]
  ------------------
  246|  2.28k|        ++dp;
  247|  2.28k|      } else {
  248|      0|        dp = nullptr;  // width was 1
  249|      0|      }
  250|  2.28k|    }
  251|  54.0k|    if (const char* const bp = dp) {
  ------------------
  |  Branch (251:27): [True: 54.0k, False: 0]
  ------------------
  252|   313k|      while (const char* cp = strchr(kDigits, *dp)) {
  ------------------
  |  Branch (252:26): [True: 292k, False: 20.5k]
  ------------------
  253|   292k|        int d = static_cast<int>(cp - kDigits);
  254|   292k|        if (d >= 10) break;
  ------------------
  |  Branch (254:13): [True: 1.78k, False: 290k]
  ------------------
  255|   290k|        if (value < kmin / 10) {
  ------------------
  |  Branch (255:13): [True: 18.0k, False: 272k]
  ------------------
  256|  18.0k|          erange = true;
  257|  18.0k|          break;
  258|  18.0k|        }
  259|   272k|        value *= 10;
  260|   272k|        if (value < kmin + d) {
  ------------------
  |  Branch (260:13): [True: 575, False: 272k]
  ------------------
  261|    575|          erange = true;
  262|    575|          break;
  263|    575|        }
  264|   272k|        value -= d;
  265|   272k|        dp += 1;
  266|   272k|        if (width > 0 && --width == 0) break;
  ------------------
  |  Branch (266:13): [True: 26.6k, False: 245k]
  |  Branch (266:26): [True: 13.0k, False: 13.5k]
  ------------------
  267|   272k|      }
  268|  54.0k|      if (dp != bp && !erange && (neg || value != kmin)) {
  ------------------
  |  Branch (268:11): [True: 52.8k, False: 1.15k]
  |  Branch (268:23): [True: 34.2k, False: 18.5k]
  |  Branch (268:35): [True: 2.25k, False: 32.0k]
  |  Branch (268:42): [True: 31.7k, False: 224]
  ------------------
  269|  34.0k|        if (!neg || value != 0) {
  ------------------
  |  Branch (269:13): [True: 31.7k, False: 2.25k]
  |  Branch (269:21): [True: 1.11k, False: 1.13k]
  ------------------
  270|  32.9k|          if (!neg) value = -value;  // make positive
  ------------------
  |  Branch (270:15): [True: 31.7k, False: 1.11k]
  ------------------
  271|  32.9k|          if (min <= value && value <= max) {
  ------------------
  |  Branch (271:15): [True: 31.7k, False: 1.12k]
  |  Branch (271:31): [True: 26.6k, False: 5.18k]
  ------------------
  272|  26.6k|            *vp = value;
  273|  26.6k|          } else {
  274|  6.30k|            dp = nullptr;
  275|  6.30k|          }
  276|  32.9k|        } else {
  277|  1.13k|          dp = nullptr;
  278|  1.13k|        }
  279|  34.0k|      } else {
  280|  19.9k|        dp = nullptr;
  281|  19.9k|      }
  282|  54.0k|    }
  283|  54.0k|  }
  284|  54.8k|  return dp;
  285|  54.8k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18ParseIntIlEEPKcS4_iT_S5_PS5_:
  237|  3.72k|const char* ParseInt(const char* dp, int width, T min, T max, T* vp) {
  238|  3.72k|  if (dp != nullptr) {
  ------------------
  |  Branch (238:7): [True: 3.72k, False: 0]
  ------------------
  239|  3.72k|    const T kmin = std::numeric_limits<T>::min();
  240|  3.72k|    bool erange = false;
  241|  3.72k|    bool neg = false;
  242|  3.72k|    T value = 0;
  243|  3.72k|    if (*dp == '-') {
  ------------------
  |  Branch (243:9): [True: 1.77k, False: 1.95k]
  ------------------
  244|  1.77k|      neg = true;
  245|  1.77k|      if (width <= 0 || --width != 0) {
  ------------------
  |  Branch (245:11): [True: 1.71k, False: 60]
  |  Branch (245:25): [True: 60, False: 0]
  ------------------
  246|  1.77k|        ++dp;
  247|  1.77k|      } else {
  248|      0|        dp = nullptr;  // width was 1
  249|      0|      }
  250|  1.77k|    }
  251|  3.72k|    if (const char* const bp = dp) {
  ------------------
  |  Branch (251:27): [True: 3.72k, False: 0]
  ------------------
  252|  34.5k|      while (const char* cp = strchr(kDigits, *dp)) {
  ------------------
  |  Branch (252:26): [True: 33.5k, False: 966]
  ------------------
  253|  33.5k|        int d = static_cast<int>(cp - kDigits);
  254|  33.5k|        if (d >= 10) break;
  ------------------
  |  Branch (254:13): [True: 2.37k, False: 31.1k]
  ------------------
  255|  31.1k|        if (value < kmin / 10) {
  ------------------
  |  Branch (255:13): [True: 155, False: 31.0k]
  ------------------
  256|    155|          erange = true;
  257|    155|          break;
  258|    155|        }
  259|  31.0k|        value *= 10;
  260|  31.0k|        if (value < kmin + d) {
  ------------------
  |  Branch (260:13): [True: 3, False: 31.0k]
  ------------------
  261|      3|          erange = true;
  262|      3|          break;
  263|      3|        }
  264|  31.0k|        value -= d;
  265|  31.0k|        dp += 1;
  266|  31.0k|        if (width > 0 && --width == 0) break;
  ------------------
  |  Branch (266:13): [True: 969, False: 30.0k]
  |  Branch (266:26): [True: 231, False: 738]
  ------------------
  267|  31.0k|      }
  268|  3.72k|      if (dp != bp && !erange && (neg || value != kmin)) {
  ------------------
  |  Branch (268:11): [True: 3.63k, False: 90]
  |  Branch (268:23): [True: 3.47k, False: 158]
  |  Branch (268:35): [True: 1.75k, False: 1.72k]
  |  Branch (268:42): [True: 1.71k, False: 3]
  ------------------
  269|  3.47k|        if (!neg || value != 0) {
  ------------------
  |  Branch (269:13): [True: 1.71k, False: 1.75k]
  |  Branch (269:21): [True: 1.75k, False: 5]
  ------------------
  270|  3.47k|          if (!neg) value = -value;  // make positive
  ------------------
  |  Branch (270:15): [True: 1.71k, False: 1.75k]
  ------------------
  271|  3.47k|          if (min <= value && value <= max) {
  ------------------
  |  Branch (271:15): [True: 3.47k, False: 0]
  |  Branch (271:31): [True: 3.47k, False: 0]
  ------------------
  272|  3.47k|            *vp = value;
  273|  3.47k|          } else {
  274|      0|            dp = nullptr;
  275|      0|          }
  276|  3.47k|        } else {
  277|      5|          dp = nullptr;
  278|      5|        }
  279|  3.47k|      } else {
  280|    251|        dp = nullptr;
  281|    251|      }
  282|  3.72k|    }
  283|  3.72k|  }
  284|  3.72k|  return dp;
  285|  3.72k|}

_ZN4cctz10TimeZoneIf3UTCEv:
   21|      1|std::unique_ptr<TimeZoneIf> TimeZoneIf::UTC() {
   22|      1|  return TimeZoneInfo::UTC();
   23|      1|}
_ZN4cctz10TimeZoneIf4MakeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   25|  1.40k|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.40k|  if (name.compare(0, 5, "libc:") == 0) {
  ------------------
  |  Branch (30:7): [True: 208, False: 1.19k]
  ------------------
   31|    208|    return TimeZoneLibC::Make(name.substr(5));
   32|    208|  }
   33|       |
   34|       |  // Otherwise use the "zoneinfo" implementation.
   35|  1.19k|  return TimeZoneInfo::Make(name);
   36|  1.40k|}
_ZN4cctz10TimeZoneIfD2Ev:
   39|    645|TimeZoneIf::~TimeZoneIf() {}

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

_ZN4cctz9time_zone4Impl3UTCEv:
   45|    196|time_zone time_zone::Impl::UTC() {
   46|    196|  return time_zone(UTCImpl());
   47|    196|}
_ZN4cctz9time_zone4Impl12LoadTimeZoneERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPS0_:
   49|  9.50k|bool time_zone::Impl::LoadTimeZone(const std::string& name, time_zone* tz) {
   50|  9.50k|  const Impl* const utc_impl = UTCImpl();
   51|       |
   52|       |  // Check for UTC (which is never a key in time_zone_map).
   53|  9.50k|  auto offset = seconds::zero();
   54|  9.50k|  if (FixedOffsetFromName(name, &offset) && offset == seconds::zero()) {
  ------------------
  |  Branch (54:7): [True: 2.00k, False: 7.50k]
  |  Branch (54:7): [True: 1.59k, False: 7.91k]
  |  Branch (54:45): [True: 1.59k, False: 409]
  ------------------
   55|  1.59k|    *tz = time_zone(utc_impl);
   56|  1.59k|    return true;
   57|  1.59k|  }
   58|       |
   59|       |  // Check whether the time zone has already been loaded.
   60|  7.91k|  {
   61|  7.91k|    std::lock_guard<std::mutex> lock(TimeZoneMutex());
   62|  7.91k|    if (time_zone_map != nullptr) {
  ------------------
  |  Branch (62:9): [True: 7.91k, False: 1]
  ------------------
   63|  7.91k|      TimeZoneImplByName::const_iterator itr = time_zone_map->find(name);
   64|  7.91k|      if (itr != time_zone_map->end()) {
  ------------------
  |  Branch (64:11): [True: 6.51k, False: 1.40k]
  ------------------
   65|  6.51k|        *tz = time_zone(itr->second);
   66|  6.51k|        return itr->second != utc_impl;
   67|  6.51k|      }
   68|  7.91k|    }
   69|  7.91k|  }
   70|       |
   71|       |  // Load the new time zone (outside the lock).
   72|  1.40k|  std::unique_ptr<const Impl> new_impl(new Impl(name));
   73|       |
   74|       |  // Add the new time zone to the map.
   75|  1.40k|  std::lock_guard<std::mutex> lock(TimeZoneMutex());
   76|  1.40k|  if (time_zone_map == nullptr) time_zone_map = new TimeZoneImplByName;
  ------------------
  |  Branch (76:7): [True: 1, False: 1.40k]
  ------------------
   77|  1.40k|  if (!new_impl->zone_) {
  ------------------
  |  Branch (77:7): [True: 645, False: 759]
  ------------------
   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|    645|    auto itr = time_zone_map->find(name);
   82|    645|    const Impl* impl = (itr != time_zone_map->end()) ? itr->second : utc_impl;
  ------------------
  |  Branch (82:24): [True: 0, False: 645]
  ------------------
   83|    645|    *tz = time_zone(impl);
   84|    645|    return impl != utc_impl;
   85|    645|  }
   86|    759|  const Impl*& impl = (*time_zone_map)[name];
   87|    759|  if (impl == nullptr) {  // this thread won any load race
  ------------------
  |  Branch (87:7): [True: 759, False: 0]
  ------------------
   88|    759|    impl = new_impl.release();
   89|    759|  }
   90|    759|  *tz = time_zone(impl);
   91|    759|  return impl != utc_impl;
   92|  1.40k|}
_ZN4cctz9time_zone4ImplC2Ev:
  109|      1|time_zone::Impl::Impl() : name_("UTC"), zone_(TimeZoneIf::UTC()) {}
_ZN4cctz9time_zone4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  112|  1.40k|    : name_(name), zone_(TimeZoneIf::Make(name_)) {}
_ZN4cctz9time_zone4Impl7UTCImplEv:
  114|  9.70k|const time_zone::Impl* time_zone::Impl::UTCImpl() {
  115|  9.70k|  static const Impl* utc_impl = new Impl;
  116|  9.70k|  return utc_impl;
  117|  9.70k|}
time_zone_impl.cc:_ZN4cctz12_GLOBAL__N_113TimeZoneMutexEv:
   36|  9.31k|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.31k|  static std::mutex* time_zone_mutex = new std::mutex;
   40|  9.31k|  return *time_zone_mutex;
   41|  9.31k|}

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

_ZN4cctz12TimeZoneInfo17GetTransitionTypeElbRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPh:
  273|    359|                                     std::uint_least8_t* index) {
  274|    359|  std::size_t type_index = 0;
  275|    359|  std::size_t abbr_index = abbreviations_.size();
  276|    517|  for (; type_index != transition_types_.size(); ++type_index) {
  ------------------
  |  Branch (276:10): [True: 517, False: 0]
  ------------------
  277|    517|    const TransitionType& tt(transition_types_[type_index]);
  278|    517|    const char* tt_abbr = &abbreviations_[tt.abbr_index];
  279|    517|    if (tt_abbr == abbr) abbr_index = tt.abbr_index;
  ------------------
  |  Branch (279:9): [True: 359, False: 158]
  ------------------
  280|    517|    if (tt.utc_offset == utc_offset && tt.is_dst == is_dst) {
  ------------------
  |  Branch (280:9): [True: 365, False: 152]
  |  Branch (280:40): [True: 363, False: 2]
  ------------------
  281|    363|      if (abbr_index == tt.abbr_index) break;  // reuse
  ------------------
  |  Branch (281:11): [True: 359, False: 4]
  ------------------
  282|    363|    }
  283|    517|  }
  284|    359|  if (type_index > 255 || abbr_index > 255) {
  ------------------
  |  Branch (284:7): [True: 0, False: 359]
  |  Branch (284:27): [True: 0, False: 359]
  ------------------
  285|       |    // No index space (8 bits) available for a new type or abbreviation.
  286|      0|    return false;
  287|      0|  }
  288|    359|  if (type_index == transition_types_.size()) {
  ------------------
  |  Branch (288:7): [True: 0, False: 359]
  ------------------
  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|    359|  *index = static_cast<std::uint_least8_t>(type_index);
  299|    359|  return true;
  300|    359|}
_ZNK4cctz12TimeZoneInfo16EquivTransitionsEhh:
  306|     91|                                    std::uint_fast8_t tt2_index) const {
  307|     91|  if (tt1_index == tt2_index) return true;
  ------------------
  |  Branch (307:7): [True: 91, 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|    225|bool TimeZoneInfo::ExtendTransitions() {
  319|    225|  extended_ = false;
  320|    225|  if (future_spec_.empty()) return true;  // last transition prevails
  ------------------
  |  Branch (320:7): [True: 0, False: 225]
  ------------------
  321|       |
  322|    225|  PosixTimeZone posix;
  323|    225|  if (!ParsePosixSpec(future_spec_, &posix)) return false;
  ------------------
  |  Branch (323:7): [True: 0, False: 225]
  ------------------
  324|       |
  325|       |  // Find transition type for the future std specification.
  326|    225|  std::uint_least8_t std_ti;
  327|    225|  if (!GetTransitionType(posix.std_offset, false, posix.std_abbr, &std_ti))
  ------------------
  |  Branch (327:7): [True: 0, False: 225]
  ------------------
  328|      0|    return false;
  329|       |
  330|    225|  if (posix.dst_abbr.empty()) {  // std only
  ------------------
  |  Branch (330:7): [True: 91, False: 134]
  ------------------
  331|       |    // The future specification should match the last transition, and
  332|       |    // that means that handling the future will fall out naturally.
  333|     91|    return EquivTransitions(transitions_.back().type_index, std_ti);
  334|     91|  }
  335|       |
  336|       |  // Find transition type for the future dst specification.
  337|    134|  std::uint_least8_t dst_ti;
  338|    134|  if (!GetTransitionType(posix.dst_offset, true, posix.dst_abbr, &dst_ti))
  ------------------
  |  Branch (338:7): [True: 0, False: 134]
  ------------------
  339|      0|    return false;
  340|       |
  341|    134|  if (AllYearDST(posix)) {  // dst only
  ------------------
  |  Branch (341:7): [True: 0, False: 134]
  ------------------
  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|    134|  if (transitions_.back().unix_time < 0) return false;
  ------------------
  |  Branch (353:7): [True: 0, False: 134]
  ------------------
  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|    134|  transitions_.reserve(transitions_.size() + 2 + 401 * 2);
  362|    134|  extended_ = true;
  363|       |
  364|    134|  const Transition& last(transitions_.back());
  365|    134|  const std::int_fast64_t last_time = last.unix_time;
  366|    134|  const TransitionType& last_tt(transition_types_[last.type_index]);
  367|    134|  last_year_ = LocalTime(last_time, last_tt).cs.year();
  368|    134|  bool leap_year = IsLeap(last_year_);
  369|    134|  const civil_second jan1(last_year_);
  370|    134|  std::int_fast64_t jan1_time = jan1 - civil_second();
  371|    134|  int jan1_weekday = ToPosixWeekday(get_weekday(jan1));
  372|       |
  373|    134|  Transition dst = {0, dst_ti, civil_second(), civil_second()};
  374|    134|  Transition std = {0, std_ti, civil_second(), civil_second()};
  375|  53.8k|  for (const year_t limit = last_year_ + 401;; ++last_year_) {
  376|  53.8k|    auto dst_trans_off = TransOffset(leap_year, jan1_weekday, posix.dst_start);
  377|  53.8k|    auto std_trans_off = TransOffset(leap_year, jan1_weekday, posix.dst_end);
  378|  53.8k|    dst.unix_time = jan1_time + dst_trans_off - posix.std_offset;
  379|  53.8k|    std.unix_time = jan1_time + std_trans_off - posix.dst_offset;
  380|  53.8k|    const auto* ta = dst.unix_time < std.unix_time ? &dst : &std;
  ------------------
  |  Branch (380:22): [True: 53.8k, False: 0]
  ------------------
  381|  53.8k|    const auto* tb = dst.unix_time < std.unix_time ? &std : &dst;
  ------------------
  |  Branch (381:22): [True: 53.8k, False: 0]
  ------------------
  382|  53.8k|    if (last_time < tb->unix_time) {
  ------------------
  |  Branch (382:9): [True: 53.7k, False: 134]
  ------------------
  383|  53.7k|      if (last_time < ta->unix_time) transitions_.push_back(*ta);
  ------------------
  |  Branch (383:11): [True: 53.7k, False: 0]
  ------------------
  384|  53.7k|      transitions_.push_back(*tb);
  385|  53.7k|    }
  386|  53.8k|    if (last_year_ == limit) break;
  ------------------
  |  Branch (386:9): [True: 134, False: 53.7k]
  ------------------
  387|  53.7k|    jan1_time += kSecsPerYear[leap_year];
  388|  53.7k|    jan1_weekday = (jan1_weekday + kDaysPerYear[leap_year]) % 7;
  389|  53.7k|    leap_year = !leap_year && IsLeap(last_year_ + 1);
  ------------------
  |  Branch (389:17): [True: 40.7k, False: 12.9k]
  |  Branch (389:31): [True: 12.9k, False: 27.7k]
  ------------------
  390|  53.7k|  }
  391|       |
  392|    134|  return true;
  393|    134|}
_ZN4cctz12TimeZoneInfo17ResetToBuiltinUTCERKNSt3__16chrono8durationIlNS1_5ratioILl1ELl1EEEEE:
  670|    327|bool TimeZoneInfo::ResetToBuiltinUTC(const seconds& offset) {
  671|    327|  transition_types_.resize(1);
  672|    327|  TransitionType& tt(transition_types_.back());
  673|    327|  tt.utc_offset = static_cast<std::int_least32_t>(offset.count());
  674|    327|  tt.is_dst = false;
  675|    327|  tt.abbr_index = 0;
  676|       |
  677|       |  // We temporarily add some redundant, contemporary (2015 through 2025)
  678|       |  // transitions for performance reasons.  See TimeZoneInfo::LocalTime().
  679|       |  // TODO: Fix the performance issue and remove the extra transitions.
  680|    327|  transitions_.clear();
  681|    327|  transitions_.reserve(12);
  682|    327|  for (const std::int_fast64_t unix_time : {
  ------------------
  |  Branch (682:42): [True: 3.92k, False: 327]
  ------------------
  683|    327|           -(1LL << 59),  // a "first half" transition
  684|    327|           1420070400LL,  // 2015-01-01T00:00:00+00:00
  685|    327|           1451606400LL,  // 2016-01-01T00:00:00+00:00
  686|    327|           1483228800LL,  // 2017-01-01T00:00:00+00:00
  687|    327|           1514764800LL,  // 2018-01-01T00:00:00+00:00
  688|    327|           1546300800LL,  // 2019-01-01T00:00:00+00:00
  689|    327|           1577836800LL,  // 2020-01-01T00:00:00+00:00
  690|    327|           1609459200LL,  // 2021-01-01T00:00:00+00:00
  691|    327|           1640995200LL,  // 2022-01-01T00:00:00+00:00
  692|    327|           1672531200LL,  // 2023-01-01T00:00:00+00:00
  693|    327|           1704067200LL,  // 2024-01-01T00:00:00+00:00
  694|    327|           1735689600LL,  // 2025-01-01T00:00:00+00:00
  695|  3.92k|       }) {
  696|  3.92k|    Transition& tr(*transitions_.emplace(transitions_.end()));
  697|  3.92k|    tr.unix_time = unix_time;
  698|  3.92k|    tr.type_index = 0;
  699|  3.92k|    tr.civil_sec = LocalTime(tr.unix_time, tt).cs;
  700|  3.92k|    tr.prev_civil_sec = tr.civil_sec - 1;
  701|  3.92k|  }
  702|       |
  703|    327|  default_transition_type_ = 0;
  704|    327|  abbreviations_ = FixedOffsetToAbbr(offset);
  705|    327|  abbreviations_.append(1, '\0');
  706|    327|  future_spec_.clear();  // never needed for a fixed-offset zone
  707|    327|  extended_ = false;
  708|       |
  709|    327|  tt.civil_max = LocalTime(seconds::max().count(), tt).cs;
  710|    327|  tt.civil_min = LocalTime(seconds::min().count(), tt).cs;
  711|       |
  712|    327|  transitions_.shrink_to_fit();
  713|    327|  return true;
  714|    327|}
_ZN4cctz12TimeZoneInfo4LoadEPNS_14ZoneInfoSourceE:
  716|    226|bool TimeZoneInfo::Load(ZoneInfoSource* zip) {
  717|       |  // Read and validate the header.
  718|    226|  tzhead tzh;
  719|    226|  if (zip->Read(&tzh, sizeof(tzh)) != sizeof(tzh))
  ------------------
  |  Branch (719:7): [True: 0, False: 226]
  ------------------
  720|      0|    return false;
  721|    226|  if (strncmp(tzh.tzh_magic, TZ_MAGIC, sizeof(tzh.tzh_magic)) != 0)
  ------------------
  |  |   27|    226|#define TZ_MAGIC "TZif"
  ------------------
  |  Branch (721:7): [True: 1, False: 225]
  ------------------
  722|      1|    return false;
  723|    225|  Header hdr;
  724|    225|  if (!hdr.Build(tzh))
  ------------------
  |  Branch (724:7): [True: 0, False: 225]
  ------------------
  725|      0|    return false;
  726|    225|  std::size_t time_len = 4;
  727|    225|  if (tzh.tzh_version[0] != '\0') {
  ------------------
  |  Branch (727:7): [True: 225, False: 0]
  ------------------
  728|       |    // Skip the 4-byte data.
  729|    225|    if (zip->Skip(hdr.DataLength(time_len)) != 0)
  ------------------
  |  Branch (729:9): [True: 0, False: 225]
  ------------------
  730|      0|      return false;
  731|       |    // Read and validate the header for the 8-byte data.
  732|    225|    if (zip->Read(&tzh, sizeof(tzh)) != sizeof(tzh))
  ------------------
  |  Branch (732:9): [True: 0, False: 225]
  ------------------
  733|      0|      return false;
  734|    225|    if (strncmp(tzh.tzh_magic, TZ_MAGIC, sizeof(tzh.tzh_magic)) != 0)
  ------------------
  |  |   27|    225|#define TZ_MAGIC "TZif"
  ------------------
  |  Branch (734:9): [True: 0, False: 225]
  ------------------
  735|      0|      return false;
  736|    225|    if (tzh.tzh_version[0] == '\0')
  ------------------
  |  Branch (736:9): [True: 0, False: 225]
  ------------------
  737|      0|      return false;
  738|    225|    if (!hdr.Build(tzh))
  ------------------
  |  Branch (738:9): [True: 0, False: 225]
  ------------------
  739|      0|      return false;
  740|    225|    time_len = 8;
  741|    225|  }
  742|    225|  if (hdr.typecnt == 0)
  ------------------
  |  Branch (742:7): [True: 0, False: 225]
  ------------------
  743|      0|    return false;
  744|    225|  if (hdr.leapcnt != 0) {
  ------------------
  |  Branch (744:7): [True: 0, False: 225]
  ------------------
  745|       |    // This code assumes 60-second minutes so we do not want
  746|       |    // the leap-second encoded zoneinfo. We could reverse the
  747|       |    // compensation, but the "right" encoding is rarely used
  748|       |    // so currently we simply reject such data.
  749|      0|    return false;
  750|      0|  }
  751|    225|  if (hdr.ttisstdcnt != 0 && hdr.ttisstdcnt != hdr.typecnt)
  ------------------
  |  Branch (751:7): [True: 136, False: 89]
  |  Branch (751:30): [True: 0, False: 136]
  ------------------
  752|      0|    return false;
  753|    225|  if (hdr.ttisutcnt != 0 && hdr.ttisutcnt != hdr.typecnt)
  ------------------
  |  Branch (753:7): [True: 91, False: 134]
  |  Branch (753:29): [True: 0, False: 91]
  ------------------
  754|      0|    return false;
  755|       |
  756|       |  // Bound the header counts before sizing tbuf so that a hostile TZif blob
  757|       |  // cannot force a very large zero-filled allocation from a tiny input.
  758|    225|  if (hdr.timecnt > TZ_MAX_TIMES)
  ------------------
  |  |   94|    225|# define TZ_MAX_TIMES 2000
  ------------------
  |  Branch (758:7): [True: 0, False: 225]
  ------------------
  759|      0|    return false;
  760|    225|  if (hdr.typecnt > TZ_MAX_TYPES)
  ------------------
  |  |   99|    225|# define TZ_MAX_TYPES 256 /* Limited to 256 by Internet RFC 9636.  */
  ------------------
  |  Branch (760:7): [True: 0, False: 225]
  ------------------
  761|      0|    return false;
  762|    225|  if (hdr.charcnt > TZ_MAX_CHARS)
  ------------------
  |  |  104|    225|# define TZ_MAX_CHARS 256	/* Maximum number of abbreviation characters */
  ------------------
  |  Branch (762:7): [True: 0, False: 225]
  ------------------
  763|      0|    return false;
  764|       |
  765|       |  // Read the data into a local buffer.
  766|    225|  std::size_t len = hdr.DataLength(time_len);
  767|    225|  std::vector<char> tbuf(len);
  768|    225|  if (zip->Read(tbuf.data(), len) != len)
  ------------------
  |  Branch (768:7): [True: 0, False: 225]
  ------------------
  769|      0|    return false;
  770|    225|  const char* bp = tbuf.data();
  771|       |
  772|       |  // Decode and validate the transitions.
  773|    225|  transitions_.reserve(hdr.timecnt + 2);
  774|    225|  transitions_.resize(hdr.timecnt);
  775|  17.3k|  for (std::size_t i = 0; i != hdr.timecnt; ++i) {
  ------------------
  |  Branch (775:27): [True: 17.1k, False: 225]
  ------------------
  776|  17.1k|    transitions_[i].unix_time = (time_len == 4) ? Decode32(bp) : Decode64(bp);
  ------------------
  |  Branch (776:33): [True: 0, False: 17.1k]
  ------------------
  777|  17.1k|    bp += time_len;
  778|       |    // A valid zoneinfo file keeps transition times far from the int64 limits.
  779|       |    // A hostile one can place them at the extremes, where the reverse-conversion
  780|       |    // arithmetic in MakeTime() (tr.unix_time +/- a sub-day civil delta, see
  781|       |    // MakeSkipped()/MakeRepeated()) overflows. Bound them to +/-(1<<59), the
  782|       |    // times used by the no-op transitions added below.
  783|  17.1k|    if (transitions_[i].unix_time < -(1LL << 59) ||
  ------------------
  |  Branch (783:9): [True: 0, False: 17.1k]
  ------------------
  784|  17.1k|        transitions_[i].unix_time > (1LL << 59))
  ------------------
  |  Branch (784:9): [True: 0, False: 17.1k]
  ------------------
  785|      0|      return false;  // out of range
  786|  17.1k|  }
  787|    225|  bool seen_type_0 = false;
  788|  17.3k|  for (std::size_t i = 0; i != hdr.timecnt; ++i) {
  ------------------
  |  Branch (788:27): [True: 17.1k, False: 225]
  ------------------
  789|  17.1k|    transitions_[i].type_index = Decode8(bp++);
  790|  17.1k|    if (transitions_[i].type_index >= hdr.typecnt)
  ------------------
  |  Branch (790:9): [True: 0, False: 17.1k]
  ------------------
  791|      0|      return false;
  792|  17.1k|    if (transitions_[i].type_index == 0)
  ------------------
  |  Branch (792:9): [True: 5.62k, False: 11.5k]
  ------------------
  793|  5.62k|      seen_type_0 = true;
  794|  17.1k|  }
  795|       |
  796|       |  // Decode and validate the transition types.
  797|    225|  transition_types_.reserve(hdr.typecnt + 2);
  798|    225|  transition_types_.resize(hdr.typecnt);
  799|    878|  for (std::size_t i = 0; i != hdr.typecnt; ++i) {
  ------------------
  |  Branch (799:27): [True: 653, False: 225]
  ------------------
  800|    653|    transition_types_[i].utc_offset =
  801|    653|        static_cast<std::int_least32_t>(Decode32(bp));
  802|    653|    if (transition_types_[i].utc_offset >= kSecsPerDay ||
  ------------------
  |  Branch (802:9): [True: 0, False: 653]
  ------------------
  803|    653|        transition_types_[i].utc_offset <= -kSecsPerDay)
  ------------------
  |  Branch (803:9): [True: 0, False: 653]
  ------------------
  804|      0|      return false;
  805|    653|    bp += 4;
  806|    653|    transition_types_[i].is_dst = (Decode8(bp++) != 0);
  807|    653|    transition_types_[i].abbr_index = Decode8(bp++);
  808|    653|    if (transition_types_[i].abbr_index >= hdr.charcnt)
  ------------------
  |  Branch (808:9): [True: 0, False: 653]
  ------------------
  809|      0|      return false;
  810|    653|  }
  811|       |
  812|       |  // Determine the before-first-transition type.
  813|    225|  default_transition_type_ = 0;
  814|    225|  if (seen_type_0 && hdr.timecnt != 0) {
  ------------------
  |  Branch (814:7): [True: 134, False: 91]
  |  Branch (814:22): [True: 134, False: 0]
  ------------------
  815|    134|    std::size_t index = 0;
  816|    134|    if (transition_types_[0].is_dst) {
  ------------------
  |  Branch (816:9): [True: 0, False: 134]
  ------------------
  817|      0|      index = transitions_[0].type_index;
  818|      0|      while (index != 0 && transition_types_[index].is_dst)
  ------------------
  |  Branch (818:14): [True: 0, False: 0]
  |  Branch (818:28): [True: 0, False: 0]
  ------------------
  819|      0|        --index;
  820|      0|    }
  821|    134|    while (index != hdr.typecnt && transition_types_[index].is_dst)
  ------------------
  |  Branch (821:12): [True: 134, False: 0]
  |  Branch (821:36): [True: 0, False: 134]
  ------------------
  822|      0|      ++index;
  823|    134|    if (index != hdr.typecnt)
  ------------------
  |  Branch (823:9): [True: 134, False: 0]
  ------------------
  824|    134|      default_transition_type_ = static_cast<std::uint_fast8_t>(index);
  825|    134|  }
  826|       |
  827|       |  // Copy all the abbreviations. The area holds NUL-terminated strings, and
  828|       |  // LocalTime() hands out a pointer into it, so the final abbreviation has
  829|       |  // to be terminated within the area itself. Otherwise an abbreviation runs
  830|       |  // on into whatever ExtendTransitions() later appends. (hdr.charcnt != 0
  831|       |  // because every abbr_index was validated to be less than it.)
  832|    225|  if (bp[hdr.charcnt - 1] != '\0')
  ------------------
  |  Branch (832:7): [True: 0, False: 225]
  ------------------
  833|      0|    return false;
  834|    225|  abbreviations_.reserve(hdr.charcnt + 10);
  835|    225|  abbreviations_.assign(bp, hdr.charcnt);
  836|    225|  bp += hdr.charcnt;
  837|       |
  838|       |  // Skip the unused portions. We've already dispensed with leap-second
  839|       |  // encoded zoneinfo. The ttisstd/ttisgmt indicators only apply when
  840|       |  // interpreting a POSIX spec that does not include start/end rules, and
  841|       |  // that isn't the case here (see "zic -p").
  842|    225|  bp += (time_len + 4) * hdr.leapcnt;  // leap-time + TAI-UTC
  843|    225|  bp += 1 * hdr.ttisstdcnt;            // UTC/local indicators
  844|    225|  bp += 1 * hdr.ttisutcnt;             // standard/wall indicators
  845|    225|  assert(bp == tbuf.data() + tbuf.size());
  ------------------
  |  Branch (845:3): [True: 225, False: 0]
  ------------------
  846|       |
  847|    225|  future_spec_.clear();
  848|    225|  if (tzh.tzh_version[0] != '\0') {
  ------------------
  |  Branch (848:7): [True: 225, False: 0]
  ------------------
  849|       |    // Snarf up the NL-enclosed future POSIX spec. Note
  850|       |    // that version '3' files utilize an extended format.
  851|    225|    auto get_char = [](ZoneInfoSource* azip) -> int {
  852|    225|      unsigned char ch;  // all non-EOF results are positive
  853|    225|      return (azip->Read(&ch, 1) == 1) ? ch : EOF;
  854|    225|    };
  855|    225|    if (get_char(zip) != '\n')
  ------------------
  |  Branch (855:9): [True: 0, False: 225]
  ------------------
  856|      0|      return false;
  857|  4.05k|    for (int c = get_char(zip); c != '\n'; c = get_char(zip)) {
  ------------------
  |  Branch (857:33): [True: 3.83k, False: 225]
  ------------------
  858|  3.83k|      if (c == EOF)
  ------------------
  |  Branch (858:11): [True: 0, False: 3.83k]
  ------------------
  859|      0|        return false;
  860|  3.83k|      future_spec_.push_back(static_cast<char>(c));
  861|  3.83k|    }
  862|    225|  }
  863|       |
  864|       |  // We don't check for EOF so that we're forwards compatible.
  865|       |
  866|       |  // If we did not find version information during the standard loading
  867|       |  // process (as of tzh_version '3' that is unsupported), then ask the
  868|       |  // ZoneInfoSource for any out-of-bound version string it may be privy to.
  869|    225|  if (version_.empty()) {
  ------------------
  |  Branch (869:7): [True: 225, False: 0]
  ------------------
  870|    225|    version_ = zip->Version();
  871|    225|  }
  872|       |
  873|       |  // Ensure that there is always a transition in the first half of the
  874|       |  // time line (the second half is handled below) so that the signed
  875|       |  // difference between a civil_second and the civil_second of its
  876|       |  // previous transition is always representable, without overflow.
  877|    225|  if (transitions_.empty() || transitions_.front().unix_time >= 0) {
  ------------------
  |  Branch (877:7): [True: 89, False: 136]
  |  Branch (877:31): [True: 89, False: 47]
  ------------------
  878|    178|    Transition& tr(*transitions_.emplace(transitions_.begin()));
  879|    178|    tr.unix_time = -(1LL << 59);  // -18267312070-10-26T17:01:52+00:00
  880|    178|    tr.type_index = default_transition_type_;
  881|    178|  }
  882|       |
  883|       |  // Extend the transitions using the future specification.
  884|    225|  if (!ExtendTransitions()) return false;
  ------------------
  |  Branch (884:7): [True: 0, False: 225]
  ------------------
  885|       |
  886|       |  // Ensure that there is always a transition in the second half of the
  887|       |  // time line (the first half is handled above) so that the signed
  888|       |  // difference between a civil_second and the civil_second of its
  889|       |  // previous transition is always representable, without overflow.
  890|    225|  const Transition& last(transitions_.back());
  891|    225|  if (last.unix_time < 0) {
  ------------------
  |  Branch (891:7): [True: 89, False: 136]
  ------------------
  892|     89|    assert(!extended_);
  ------------------
  |  Branch (892:5): [True: 89, False: 0]
  ------------------
  893|     89|    const std::uint_fast8_t type_index = last.type_index;
  894|     89|    Transition& tr(*transitions_.emplace(transitions_.end()));
  895|     89|    tr.unix_time = 2147483647;  // 2038-01-19T03:14:07+00:00
  896|     89|    tr.type_index = type_index;
  897|     89|  }
  898|       |
  899|       |  // Compute the local civil time for each transition and the preceding
  900|       |  // second. These will be used for reverse conversions in MakeTime().
  901|    225|  const TransitionType* ttp = &transition_types_[default_transition_type_];
  902|   125k|  for (std::size_t i = 0; i != transitions_.size(); ++i) {
  ------------------
  |  Branch (902:27): [True: 124k, False: 225]
  ------------------
  903|   124k|    Transition& tr(transitions_[i]);
  904|   124k|    tr.prev_civil_sec = LocalTime(tr.unix_time, *ttp).cs - 1;
  905|   124k|    ttp = &transition_types_[tr.type_index];
  906|   124k|    tr.civil_sec = LocalTime(tr.unix_time, *ttp).cs;
  907|   124k|    if (i != 0) {
  ------------------
  |  Branch (907:9): [True: 124k, False: 225]
  ------------------
  908|       |      // Check that offset changes don't cross each other. No one
  909|       |      // does this in practice, and we depend on increasing absolute
  910|       |      // and civil times in BreakTime() and MakeTime() respectively.
  911|   124k|      if (!Transition::ByUnixTime()(transitions_[i - 1], tr) ||
  ------------------
  |  Branch (911:11): [True: 0, False: 124k]
  |  Branch (911:11): [True: 0, False: 124k]
  ------------------
  912|   124k|          !Transition::ByCivilTime()(transitions_[i - 1], tr)) {
  ------------------
  |  Branch (912:11): [True: 0, False: 124k]
  ------------------
  913|      0|        return false;  // out of order
  914|      0|      }
  915|   124k|    }
  916|   124k|  }
  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|    653|  for (auto& tt : transition_types_) {
  ------------------
  |  Branch (920:17): [True: 653, False: 225]
  ------------------
  921|    653|    tt.civil_max = LocalTime(seconds::max().count(), tt).cs;
  922|    653|    tt.civil_min = LocalTime(seconds::min().count(), tt).cs;
  923|    653|  }
  924|       |
  925|    225|  transitions_.shrink_to_fit();
  926|    225|  return true;
  927|    225|}
_ZN4cctz12TimeZoneInfo4LoadERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  929|  1.19k|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.19k|  auto offset = seconds::zero();
  935|  1.19k|  if (FixedOffsetFromName(name, &offset)) {
  ------------------
  |  Branch (935:7): [True: 326, False: 870]
  ------------------
  936|    326|    return ResetToBuiltinUTC(offset);
  937|    326|  }
  938|       |
  939|       |  // Find and use a ZoneInfoSource to load the named zone.
  940|    870|  auto zip = cctz_extension::zone_info_source_factory(
  941|    870|      name, [](const std::string& n) -> std::unique_ptr<ZoneInfoSource> {
  942|    870|        if (auto z = FileZoneInfoSource::Open(n)) return z;
  943|    870|        if (auto z = AndroidZoneInfoSource::Open(n)) return z;
  944|    870|        if (auto z = FuchsiaZoneInfoSource::Open(n)) return z;
  945|    870|        return nullptr;
  946|    870|      });
  947|    870|  return zip != nullptr && Load(zip.get());
  ------------------
  |  Branch (947:10): [True: 226, False: 644]
  |  Branch (947:28): [True: 225, False: 1]
  ------------------
  948|  1.19k|}
_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.19k|std::unique_ptr<TimeZoneInfo> TimeZoneInfo::Make(const std::string& name) {
  957|  1.19k|  auto tz = std::unique_ptr<TimeZoneInfo>(new TimeZoneInfo);
  958|  1.19k|  if (!tz->Load(name)) tz.reset();  // fallback to UTC
  ------------------
  |  Branch (958:7): [True: 645, False: 551]
  ------------------
  959|  1.19k|  return tz;
  960|  1.19k|}
_ZNK4cctz12TimeZoneInfo9LocalTimeElRKNS_14TransitionTypeE:
  964|   256k|    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|   256k|  return {(civil_second() + unix_time) + tt.utc_offset,
  969|   256k|          tt.utc_offset, tt.is_dst, &abbreviations_[tt.abbr_index]};
  970|   256k|}
_ZNK4cctz12TimeZoneInfo9LocalTimeElRKNS_10TransitionE:
  974|  6.92k|    std::int_fast64_t unix_time, const Transition& tr) const {
  975|  6.92k|  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|  6.92k|  return {tr.civil_sec + (unix_time - tr.unix_time),  // TODO: Optimize.
  979|  6.92k|          tt.utc_offset, tt.is_dst, &abbreviations_[tt.abbr_index]};
  980|  6.92k|}
_ZNK4cctz12TimeZoneInfo9TimeLocalERKNS_6detail10civil_timeINS1_10second_tagEEEl:
  984|  1.63k|                                                year_t c4_shift) const {
  985|  1.63k|  assert(last_year_ - 400 < cs.year() && cs.year() <= last_year_);
  ------------------
  |  Branch (985:3): [True: 1.63k, False: 0]
  |  Branch (985:3): [True: 1.63k, False: 0]
  |  Branch (985:3): [True: 1.63k, False: 0]
  ------------------
  986|  1.63k|  time_zone::civil_lookup cl = MakeTime(cs);
  987|  1.63k|  if (c4_shift > seconds::max().count() / kSecsPer400Years) {
  ------------------
  |  Branch (987:7): [True: 167, False: 1.46k]
  ------------------
  988|    167|    cl.pre = cl.trans = cl.post = time_point<seconds>::max();
  989|  1.46k|  } else {
  990|  1.46k|    const auto offset = seconds(c4_shift * kSecsPer400Years);
  991|  1.46k|    const auto limit = time_point<seconds>::max() - offset;
  992|  4.39k|    for (auto* tp : {&cl.pre, &cl.trans, &cl.post}) {
  ------------------
  |  Branch (992:19): [True: 4.39k, False: 1.46k]
  ------------------
  993|  4.39k|      if (*tp > limit) {
  ------------------
  |  Branch (993:11): [True: 27, False: 4.37k]
  ------------------
  994|     27|        *tp = time_point<seconds>::max();
  995|  4.37k|      } else {
  996|  4.37k|        *tp += offset;
  997|  4.37k|      }
  998|  4.39k|    }
  999|  1.46k|  }
 1000|  1.63k|  return cl;
 1001|  1.63k|}
_ZNK4cctz12TimeZoneInfo9BreakTimeERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
 1004|  9.61k|    const time_point<seconds>& tp) const {
 1005|  9.61k|  std::int_fast64_t unix_time = ToUnixSeconds(tp);
 1006|  9.61k|  const std::size_t timecnt = transitions_.size();
 1007|  9.61k|  assert(timecnt != 0);  // We always add a transition.
  ------------------
  |  Branch (1007:3): [True: 9.61k, False: 0]
  ------------------
 1008|       |
 1009|  9.61k|  if (unix_time < transitions_[0].unix_time) {
  ------------------
  |  Branch (1009:7): [True: 1.20k, False: 8.40k]
  ------------------
 1010|  1.20k|    return LocalTime(unix_time, transition_types_[default_transition_type_]);
 1011|  1.20k|  }
 1012|  8.40k|  if (unix_time >= transitions_[timecnt - 1].unix_time) {
  ------------------
  |  Branch (1012:7): [True: 2.76k, False: 5.63k]
  ------------------
 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.76k|    if (extended_) {
  ------------------
  |  Branch (1016:9): [True: 1.48k, False: 1.28k]
  ------------------
 1017|  1.48k|      const std::int_fast64_t diff =
 1018|  1.48k|          unix_time - transitions_[timecnt - 1].unix_time;
 1019|  1.48k|      const year_t shift = diff / kSecsPer400Years + 1;
 1020|  1.48k|      const auto d = seconds(shift * kSecsPer400Years);
 1021|  1.48k|      time_zone::absolute_lookup al = BreakTime(tp - d);
 1022|  1.48k|      al.cs = YearShift(al.cs, shift * 400);
 1023|  1.48k|      return al;
 1024|  1.48k|    }
 1025|  1.28k|    return LocalTime(unix_time, transitions_[timecnt - 1]);
 1026|  2.76k|  }
 1027|       |
 1028|  5.63k|  const std::size_t hint = local_time_hint_.load(std::memory_order_relaxed);
 1029|  5.63k|  if (0 < hint && hint < timecnt) {
  ------------------
  |  Branch (1029:7): [True: 5.32k, False: 306]
  |  Branch (1029:19): [True: 5.32k, False: 0]
  ------------------
 1030|  5.32k|    if (transitions_[hint - 1].unix_time <= unix_time) {
  ------------------
  |  Branch (1030:9): [True: 4.41k, False: 909]
  ------------------
 1031|  4.41k|      if (unix_time < transitions_[hint].unix_time) {
  ------------------
  |  Branch (1031:11): [True: 3.49k, False: 927]
  ------------------
 1032|  3.49k|        return LocalTime(unix_time, transitions_[hint - 1]);
 1033|  3.49k|      }
 1034|  4.41k|    }
 1035|  5.32k|  }
 1036|       |
 1037|  2.14k|  const Transition target = {unix_time, 0, civil_second(), civil_second()};
 1038|  2.14k|  const Transition* begin = &transitions_[0];
 1039|  2.14k|  const Transition* tr = std::upper_bound(begin, begin + timecnt, target,
 1040|  2.14k|                                          Transition::ByUnixTime());
 1041|  2.14k|  local_time_hint_.store(static_cast<std::size_t>(tr - begin),
 1042|  2.14k|                         std::memory_order_relaxed);
 1043|  2.14k|  return LocalTime(unix_time, *--tr);
 1044|  5.63k|}
_ZNK4cctz12TimeZoneInfo8MakeTimeERKNS_6detail10civil_timeINS1_10second_tagEEE:
 1046|  14.2k|time_zone::civil_lookup TimeZoneInfo::MakeTime(const civil_second& cs) const {
 1047|  14.2k|  const std::size_t timecnt = transitions_.size();
 1048|  14.2k|  assert(timecnt != 0);  // We always add a transition.
  ------------------
  |  Branch (1048:3): [True: 14.2k, False: 0]
  ------------------
 1049|       |
 1050|       |  // Find the first transition after our target civil time.
 1051|  14.2k|  const Transition* tr = nullptr;
 1052|  14.2k|  const Transition* begin = &transitions_[0];
 1053|  14.2k|  const Transition* end = begin + timecnt;
 1054|  14.2k|  if (cs < begin->civil_sec) {
  ------------------
  |  Branch (1054:7): [True: 1.46k, False: 12.7k]
  ------------------
 1055|  1.46k|    tr = begin;
 1056|  12.7k|  } else if (cs >= transitions_[timecnt - 1].civil_sec) {
  ------------------
  |  Branch (1056:14): [True: 3.05k, False: 9.72k]
  ------------------
 1057|  3.05k|    tr = end;
 1058|  9.72k|  } else {
 1059|  9.72k|    const std::size_t hint = time_local_hint_.load(std::memory_order_relaxed);
 1060|  9.72k|    if (0 < hint && hint < timecnt) {
  ------------------
  |  Branch (1060:9): [True: 9.19k, False: 530]
  |  Branch (1060:21): [True: 9.19k, False: 0]
  ------------------
 1061|  9.19k|      if (transitions_[hint - 1].civil_sec <= cs) {
  ------------------
  |  Branch (1061:11): [True: 7.52k, False: 1.66k]
  ------------------
 1062|  7.52k|        if (cs < transitions_[hint].civil_sec) {
  ------------------
  |  Branch (1062:13): [True: 5.86k, False: 1.66k]
  ------------------
 1063|  5.86k|          tr = begin + hint;
 1064|  5.86k|        }
 1065|  7.52k|      }
 1066|  9.19k|    }
 1067|  9.72k|    if (tr == nullptr) {
  ------------------
  |  Branch (1067:9): [True: 3.85k, False: 5.86k]
  ------------------
 1068|  3.85k|      const Transition target = {0, 0, cs, civil_second()};
 1069|  3.85k|      tr = std::upper_bound(begin, end, target, Transition::ByCivilTime());
 1070|  3.85k|      time_local_hint_.store(static_cast<std::size_t>(tr - begin),
 1071|  3.85k|                             std::memory_order_relaxed);
 1072|  3.85k|    }
 1073|  9.72k|  }
 1074|       |
 1075|  14.2k|  if (tr == begin) {
  ------------------
  |  Branch (1075:7): [True: 1.46k, False: 12.7k]
  ------------------
 1076|  1.46k|    if (tr->prev_civil_sec >= cs) {
  ------------------
  |  Branch (1076:9): [True: 1.46k, False: 3]
  ------------------
 1077|       |      // Before first transition, so use the default offset.
 1078|  1.46k|      const TransitionType& tt(transition_types_[default_transition_type_]);
 1079|  1.46k|      if (cs < tt.civil_min) return MakeUnique(time_point<seconds>::min());
  ------------------
  |  Branch (1079:11): [True: 156, False: 1.30k]
  ------------------
 1080|  1.30k|      return MakeUnique(cs - (civil_second() + tt.utc_offset));
 1081|  1.46k|    }
 1082|       |    // tr->prev_civil_sec < cs < tr->civil_sec
 1083|      3|    return MakeSkipped(*tr, cs);
 1084|  1.46k|  }
 1085|       |
 1086|  12.7k|  if (tr == end) {
  ------------------
  |  Branch (1086:7): [True: 3.05k, False: 9.72k]
  ------------------
 1087|  3.05k|    if (cs > (--tr)->prev_civil_sec) {
  ------------------
  |  Branch (1087:9): [True: 3.04k, False: 11]
  ------------------
 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.04k|      if (extended_ && cs.year() > last_year_) {
  ------------------
  |  Branch (1091:11): [True: 1.65k, False: 1.39k]
  |  Branch (1091:24): [True: 1.63k, False: 17]
  ------------------
 1092|  1.63k|        const year_t shift = (cs.year() - last_year_ - 1) / 400 + 1;
 1093|  1.63k|        return TimeLocal(YearShift(cs, shift * -400), shift);
 1094|  1.63k|      }
 1095|  1.41k|      const TransitionType& tt(transition_types_[tr->type_index]);
 1096|  1.41k|      if (cs > tt.civil_max) return MakeUnique(time_point<seconds>::max());
  ------------------
  |  Branch (1096:11): [True: 62, False: 1.34k]
  ------------------
 1097|  1.34k|      return MakeUnique(tr->unix_time + (cs - tr->civil_sec));
 1098|  1.41k|    }
 1099|       |    // tr->civil_sec <= cs <= tr->prev_civil_sec
 1100|     11|    return MakeRepeated(*tr, cs);
 1101|  3.05k|  }
 1102|       |
 1103|  9.72k|  if (tr->prev_civil_sec < cs) {
  ------------------
  |  Branch (1103:7): [True: 9, False: 9.71k]
  ------------------
 1104|       |    // tr->prev_civil_sec < cs < tr->civil_sec
 1105|      9|    return MakeSkipped(*tr, cs);
 1106|      9|  }
 1107|       |
 1108|  9.71k|  if (cs <= (--tr)->prev_civil_sec) {
  ------------------
  |  Branch (1108:7): [True: 19, False: 9.69k]
  ------------------
 1109|       |    // tr->civil_sec <= cs <= tr->prev_civil_sec
 1110|     19|    return MakeRepeated(*tr, cs);
 1111|     19|  }
 1112|       |
 1113|       |  // In between transitions.
 1114|  9.69k|  return MakeUnique(tr->unix_time + (cs - tr->civil_sec));
 1115|  9.71k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110AllYearDSTERKNS_13PosixTimeZoneE:
  189|    134|bool AllYearDST(const PosixTimeZone& posix) {
  190|    134|  if (posix.dst_start.date.fmt != PosixTransition::N) return false;
  ------------------
  |  Branch (190:7): [True: 134, 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|  40.8k|inline bool IsLeap(year_t year) {
   69|  40.8k|  return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
  ------------------
  |  Branch (69:10): [True: 13.4k, False: 27.4k]
  |  Branch (69:30): [True: 12.8k, False: 536]
  |  Branch (69:51): [True: 134, False: 402]
  ------------------
   70|  40.8k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_114ToPosixWeekdayENS_6detail7weekdayE:
   95|    134|inline int ToPosixWeekday(weekday wd) {
   96|    134|  switch (wd) {
  ------------------
  |  Branch (96:11): [True: 134, False: 0]
  ------------------
   97|      0|    case weekday::sunday:
  ------------------
  |  Branch (97:5): [True: 0, False: 134]
  ------------------
   98|      0|      return 0;
   99|      0|    case weekday::monday:
  ------------------
  |  Branch (99:5): [True: 0, False: 134]
  ------------------
  100|      0|      return 1;
  101|      0|    case weekday::tuesday:
  ------------------
  |  Branch (101:5): [True: 0, False: 134]
  ------------------
  102|      0|      return 2;
  103|      0|    case weekday::wednesday:
  ------------------
  |  Branch (103:5): [True: 0, False: 134]
  ------------------
  104|      0|      return 3;
  105|    134|    case weekday::thursday:
  ------------------
  |  Branch (105:5): [True: 134, False: 0]
  ------------------
  106|    134|      return 4;
  107|      0|    case weekday::friday:
  ------------------
  |  Branch (107:5): [True: 0, False: 134]
  ------------------
  108|      0|      return 5;
  109|      0|    case weekday::saturday:
  ------------------
  |  Branch (109:5): [True: 0, False: 134]
  ------------------
  110|      0|      return 6;
  111|    134|  }
  112|      0|  return 0; /*NOTREACHED*/
  113|    134|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_111TransOffsetEbiRKNS_15PosixTransitionE:
  204|   107k|                              const PosixTransition& pt) {
  205|   107k|  std::int_fast64_t days = 0;
  206|   107k|  switch (pt.date.fmt) {
  ------------------
  |  Branch (206:11): [True: 107k, False: 0]
  ------------------
  207|      0|    case PosixTransition::J: {
  ------------------
  |  Branch (207:5): [True: 0, False: 107k]
  ------------------
  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: 107k]
  ------------------
  213|      0|      days = pt.date.n.day;
  214|      0|      break;
  215|      0|    }
  216|   107k|    case PosixTransition::M: {
  ------------------
  |  Branch (216:5): [True: 107k, False: 0]
  ------------------
  217|   107k|      const bool last_week = (pt.date.m.week == 5);
  218|   107k|      days = kMonthOffsets[leap_year][pt.date.m.month + last_week];
  219|   107k|      const std::int_fast64_t weekday = (jan1_weekday + days) % 7;
  220|   107k|      if (last_week) {
  ------------------
  |  Branch (220:11): [True: 106k, False: 1.60k]
  ------------------
  221|   106k|        days -= (weekday + 7 - 1 - pt.date.m.weekday) % 7 + 1;
  222|   106k|      } else {
  223|  1.60k|        days += (pt.date.m.weekday + 7 - weekday) % 7;
  224|  1.60k|        days += (pt.date.m.week - 1) * 7;
  225|  1.60k|      }
  226|   107k|      break;
  227|      0|    }
  228|   107k|  }
  229|   107k|  return (days * kSecsPerDay) + pt.time.offset;
  230|   107k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_16Header5BuildERK6tzhead:
  157|    450|bool Header::Build(const tzhead& tzh) {
  158|    450|  std::int_fast32_t v;
  159|    450|  if ((v = Decode32(tzh.tzh_timecnt)) < 0) return false;
  ------------------
  |  Branch (159:7): [True: 0, False: 450]
  ------------------
  160|    450|  timecnt = static_cast<std::size_t>(v);
  161|    450|  if ((v = Decode32(tzh.tzh_typecnt)) < 0) return false;
  ------------------
  |  Branch (161:7): [True: 0, False: 450]
  ------------------
  162|    450|  typecnt = static_cast<std::size_t>(v);
  163|    450|  if ((v = Decode32(tzh.tzh_charcnt)) < 0) return false;
  ------------------
  |  Branch (163:7): [True: 0, False: 450]
  ------------------
  164|    450|  charcnt = static_cast<std::size_t>(v);
  165|    450|  if ((v = Decode32(tzh.tzh_leapcnt)) < 0) return false;
  ------------------
  |  Branch (165:7): [True: 0, False: 450]
  ------------------
  166|    450|  leapcnt = static_cast<std::size_t>(v);
  167|    450|  if ((v = Decode32(tzh.tzh_ttisstdcnt)) < 0) return false;
  ------------------
  |  Branch (167:7): [True: 0, False: 450]
  ------------------
  168|    450|  ttisstdcnt = static_cast<std::size_t>(v);
  169|    450|  if ((v = Decode32(tzh.tzh_ttisutcnt)) < 0) return false;
  ------------------
  |  Branch (169:7): [True: 0, False: 450]
  ------------------
  170|    450|  ttisutcnt = static_cast<std::size_t>(v);
  171|    450|  return true;
  172|    450|}
time_zone_info.cc:_ZNK4cctz12_GLOBAL__N_16Header10DataLengthEm:
  176|    450|std::size_t Header::DataLength(std::size_t time_len) const {
  177|    450|  std::size_t len = 0;
  178|    450|  len += (time_len + 1) * timecnt;  // unix_time + type_index
  179|    450|  len += (4 + 1 + 1) * typecnt;     // utc_offset + is_dst + abbr_index
  180|    450|  len += 1 * charcnt;               // abbreviations
  181|    450|  len += (time_len + 4) * leapcnt;  // leap-time + TAI-UTC
  182|    450|  len += 1 * ttisstdcnt;            // UTC/local indicators
  183|    450|  len += 1 * ttisutcnt;             // standard/wall indicators
  184|    450|  return len;
  185|    450|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_18Decode32EPKc:
  126|  3.35k|std::int_fast32_t Decode32(const char* cp) {
  127|  3.35k|  std::uint_fast32_t v = 0;
  128|  16.7k|  for (int i = 0; i != (32 / 8); ++i) v = (v << 8) | Decode8(cp++);
  ------------------
  |  Branch (128:19): [True: 13.4k, False: 3.35k]
  ------------------
  129|  3.35k|  const std::int_fast32_t s32max = 0x7fffffff;
  130|  3.35k|  const auto s32maxU = static_cast<std::uint_fast32_t>(s32max);
  131|  3.35k|  if (v <= s32maxU) return static_cast<std::int_fast32_t>(v);
  ------------------
  |  Branch (131:7): [True: 3.30k, False: 47]
  ------------------
  132|     47|  return static_cast<std::int_fast32_t>(v - s32maxU - 1) - s32max - 1;
  133|  3.35k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_18Decode64EPKc:
  135|  17.1k|std::int_fast64_t Decode64(const char* cp) {
  136|  17.1k|  std::uint_fast64_t v = 0;
  137|   154k|  for (int i = 0; i != (64 / 8); ++i) v = (v << 8) | Decode8(cp++);
  ------------------
  |  Branch (137:19): [True: 137k, False: 17.1k]
  ------------------
  138|  17.1k|  const std::int_fast64_t s64max = 0x7fffffffffffffff;
  139|  17.1k|  const auto s64maxU = static_cast<std::uint_fast64_t>(s64max);
  140|  17.1k|  if (v <= s64maxU) return static_cast<std::int_fast64_t>(v);
  ------------------
  |  Branch (140:7): [True: 16.4k, False: 646]
  ------------------
  141|    646|  return static_cast<std::int_fast64_t>(v - s64maxU - 1) - s64max - 1;
  142|  17.1k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_17Decode8EPKc:
  116|   168k|inline std::uint_fast8_t Decode8(const char* cp) {
  117|   168k|  return static_cast<std::uint_fast8_t>(*cp) & 0xff;
  118|   168k|}
time_zone_info.cc:_ZZN4cctz12TimeZoneInfo4LoadEPNS_14ZoneInfoSourceEENK3$_0clES2_:
  851|  4.28k|    auto get_char = [](ZoneInfoSource* azip) -> int {
  852|  4.28k|      unsigned char ch;  // all non-EOF results are positive
  853|  4.28k|      return (azip->Read(&ch, 1) == 1) ? ch : EOF;
  ------------------
  |  Branch (853:14): [True: 4.28k, False: 0]
  ------------------
  854|  4.28k|    };
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_19YearShiftERKNS_6detail10civil_timeINS1_10second_tagEEEl:
  263|  3.11k|inline civil_second YearShift(const civil_second& cs, year_t shift) {
  264|  3.11k|  return civil_second(cs.year() + shift, cs.month(), cs.day(),
  265|  3.11k|                      cs.hour(), cs.minute(), cs.second());
  266|  3.11k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110MakeUniqueERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
  232|  12.5k|inline time_zone::civil_lookup MakeUnique(const time_point<seconds>& tp) {
  233|  12.5k|  time_zone::civil_lookup cl;
  234|  12.5k|  cl.kind = time_zone::civil_lookup::UNIQUE;
  235|  12.5k|  cl.pre = cl.trans = cl.post = tp;
  236|  12.5k|  return cl;
  237|  12.5k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110MakeUniqueEl:
  239|  12.3k|inline time_zone::civil_lookup MakeUnique(std::int_fast64_t unix_time) {
  240|  12.3k|  return MakeUnique(FromUnixSeconds(unix_time));
  241|  12.3k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_111MakeSkippedERKNS_10TransitionERKNS_6detail10civil_timeINS4_10second_tagEEE:
  244|     12|                                           const civil_second& cs) {
  245|     12|  time_zone::civil_lookup cl;
  246|     12|  cl.kind = time_zone::civil_lookup::SKIPPED;
  247|     12|  cl.pre = FromUnixSeconds(tr.unix_time - 1 + (cs - tr.prev_civil_sec));
  248|     12|  cl.trans = FromUnixSeconds(tr.unix_time);
  249|     12|  cl.post = FromUnixSeconds(tr.unix_time - (tr.civil_sec - cs));
  250|     12|  return cl;
  251|     12|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_112MakeRepeatedERKNS_10TransitionERKNS_6detail10civil_timeINS4_10second_tagEEE:
  254|     30|                                            const civil_second& cs) {
  255|     30|  time_zone::civil_lookup cl;
  256|     30|  cl.kind = time_zone::civil_lookup::REPEATED;
  257|     30|  cl.pre = FromUnixSeconds(tr.unix_time - 1 - (tr.prev_civil_sec - cs));
  258|     30|  cl.trans = FromUnixSeconds(tr.unix_time);
  259|     30|  cl.post = FromUnixSeconds(tr.unix_time + (cs - tr.civil_sec));
  260|     30|  return cl;
  261|     30|}
time_zone_info.cc:_ZZN4cctz12TimeZoneInfo4LoadERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clES9_:
  941|    870|      name, [](const std::string& n) -> std::unique_ptr<ZoneInfoSource> {
  942|    870|        if (auto z = FileZoneInfoSource::Open(n)) return z;
  ------------------
  |  Branch (942:18): [True: 226, False: 644]
  ------------------
  943|    644|        if (auto z = AndroidZoneInfoSource::Open(n)) return z;
  ------------------
  |  Branch (943:18): [True: 0, False: 644]
  ------------------
  944|    644|        if (auto z = FuchsiaZoneInfoSource::Open(n)) return z;
  ------------------
  |  Branch (944:18): [True: 0, False: 644]
  ------------------
  945|    644|        return nullptr;
  946|    644|      });
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSource4OpenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  500|    870|    const std::string& name) {
  501|       |  // Use of the "file:" prefix is intended for testing purposes only.
  502|    870|  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
  ------------------
  |  Branch (502:27): [True: 17, False: 853]
  ------------------
  503|       |
  504|       |  // Reject unsafe paths (e.g., "../../etc/passwd").
  505|    870|  if (UnsafePath(name, pos)) {
  ------------------
  |  Branch (505:7): [True: 17, False: 853]
  ------------------
  506|     17|    return nullptr;
  507|     17|  }
  508|       |
  509|       |  // Map the time-zone name to a path name.
  510|    853|  std::string path;
  511|    853|  if (pos == name.size() || name[pos] != '/') {
  ------------------
  |  Branch (511:7): [True: 14, False: 839]
  |  Branch (511:29): [True: 813, False: 26]
  ------------------
  512|    827|    const char* tzdir = "/usr/share/zoneinfo";
  513|    827|    char* tzdir_env = nullptr;
  514|       |#if defined(_MSC_VER)
  515|       |    _dupenv_s(&tzdir_env, nullptr, "TZDIR");
  516|       |#else
  517|    827|    tzdir_env = std::getenv("TZDIR");
  518|    827|#endif
  519|    827|    if (tzdir_env && *tzdir_env) tzdir = tzdir_env;
  ------------------
  |  Branch (519:9): [True: 0, False: 827]
  |  Branch (519:22): [True: 0, False: 0]
  ------------------
  520|    827|    path += tzdir;
  521|    827|    path += '/';
  522|       |#if defined(_MSC_VER)
  523|       |    free(tzdir_env);
  524|       |#endif
  525|    827|  }
  526|    853|  path.append(name, pos, std::string::npos);
  527|       |
  528|       |  // Open the zoneinfo file.
  529|    853|  auto fp = FOpen(path.c_str());
  530|    853|  if (fp == nullptr) return nullptr;
  ------------------
  |  Branch (530:7): [True: 627, False: 226]
  ------------------
  531|    226|  return std::unique_ptr<ZoneInfoSource>(new FileZoneInfoSource(std::move(fp)));
  532|    853|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110UnsafePathERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEm:
  455|  1.51k|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|   101k|  for (auto i = pos; (i = name.find("..", i)) != std::string::npos; i += 2) {
  ------------------
  |  Branch (458:22): [True: 99.6k, False: 1.48k]
  ------------------
  459|  99.6k|    if ((i == pos || IsPathSeparator(name[i - 1])) &&
  ------------------
  |  Branch (459:10): [True: 132, False: 99.4k]
  |  Branch (459:22): [True: 54.6k, False: 44.7k]
  ------------------
  460|  54.8k|        (i == name.size() - 2 || IsPathSeparator(name[i + 2]))) {
  ------------------
  |  Branch (460:10): [True: 24, False: 54.8k]
  |  Branch (460:34): [True: 10, False: 54.7k]
  ------------------
  461|     34|      return true;
  462|     34|    }
  463|  99.6k|  }
  464|  1.48k|  return false;
  465|  1.51k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_115IsPathSeparatorEc:
  446|   154k|inline bool IsPathSeparator(char c) {
  447|       |#if defined(_WIN32)
  448|       |  return c == '/' || c == '\\';
  449|       |#else
  450|   154k|  return c == '/';
  451|   154k|#endif
  452|   154k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_15FOpenEPKc:
  400|  5.21k|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.21k|  const int fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
  417|  5.21k|  if (fd >= 0) {
  ------------------
  |  Branch (417:7): [True: 272, False: 4.94k]
  ------------------
  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|    272|    auto is_regular = [](int stat_fd) {
  430|    272|      struct stat st;
  431|    272|      return fstat(stat_fd, &st) == 0 && S_ISREG(st.st_mode);
  432|    272|    };
  433|    272|#endif
  434|    272|    if (is_regular(fd)) {
  ------------------
  |  Branch (434:9): [True: 226, False: 46]
  ------------------
  435|    226|      FILE* fp = fdopen(fd, "rb");
  436|    226|      if (fp != nullptr) return FilePtr(fp, fclose);
  ------------------
  |  Branch (436:11): [True: 226, False: 0]
  ------------------
  437|    226|    }
  438|     46|    close(fd);
  439|     46|  }
  440|  4.98k|  return FilePtr(nullptr, fclose);
  441|  5.21k|#endif
  442|  5.21k|}
time_zone_info.cc:_ZZN4cctz12_GLOBAL__N_15FOpenEPKcENKUliE_clEi:
  429|    272|    auto is_regular = [](int stat_fd) {
  430|    272|      struct stat st;
  431|    272|      return fstat(stat_fd, &st) == 0 && S_ISREG(st.st_mode);
  ------------------
  |  Branch (431:14): [True: 272, False: 0]
  |  Branch (431:42): [True: 226, False: 46]
  ------------------
  432|    272|    };
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSourceC2ENSt3__110unique_ptrI8_IO_FILEPFiPS4_EEEm:
  492|    226|      : fp_(std::move(fp)), len_(len) {}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSource4ReadEPvm:
  472|  4.95k|  std::size_t Read(void* ptr, std::size_t size) override {
  473|  4.95k|    size = std::min(size, len_);
  474|  4.95k|    std::size_t nread = fread(ptr, 1, size, fp_.get());
  475|  4.95k|    len_ -= nread;
  476|  4.95k|    return nread;
  477|  4.95k|  }
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSource4SkipEm:
  478|    225|  int Skip(std::size_t offset) override {
  479|    225|    offset = std::min(offset, len_);
  480|    225|    int rc = fseek(fp_.get(), static_cast<long>(offset), SEEK_CUR);
  481|    225|    if (rc == 0) len_ -= offset;
  ------------------
  |  Branch (481:9): [True: 225, False: 0]
  ------------------
  482|    225|    return rc;
  483|    225|  }
time_zone_info.cc:_ZNK4cctz12_GLOBAL__N_118FileZoneInfoSource7VersionEv:
  484|    225|  std::string Version() const override {
  485|       |    // TODO: It would nice if the zoneinfo data included the tzdb version.
  486|    225|    return std::string();
  487|    225|  }
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_121AndroidZoneInfoSource4OpenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  547|    644|    const std::string& name) {
  548|       |  // Use of the "file:" prefix is intended for testing purposes only.
  549|    644|  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
  ------------------
  |  Branch (549:27): [True: 17, False: 627]
  ------------------
  550|       |
  551|       |  // See Android's libc/tzcode/bionic.cpp for additional information.
  552|    644|  for (const char* tzdata : {"/apex/com.android.tzdata/etc/tz/tzdata",
  ------------------
  |  Branch (552:27): [True: 1.93k, False: 644]
  ------------------
  553|    644|                             "/data/misc/zoneinfo/current/tzdata",
  554|  1.93k|                             "/system/usr/share/zoneinfo/tzdata"}) {
  555|  1.93k|    auto fp = FOpen(tzdata);
  556|  1.93k|    if (fp == nullptr) continue;
  ------------------
  |  Branch (556:9): [True: 1.93k, False: 0]
  ------------------
  557|       |
  558|      0|    char hbuf[24];  // covers header.zonetab_offset too
  559|      0|    if (fread(hbuf, 1, sizeof(hbuf), fp.get()) != sizeof(hbuf)) continue;
  ------------------
  |  Branch (559:9): [True: 0, False: 0]
  ------------------
  560|      0|    if (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 (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 (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|       |      // 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 (fseek(fp.get(), static_cast<long>(start), SEEK_SET) != 0) break;
  ------------------
  |  Branch (583:13): [True: 0, False: 0]
  ------------------
  584|      0|        return std::unique_ptr<ZoneInfoSource>(new AndroidZoneInfoSource(
  585|      0|            std::move(fp), static_cast<std::size_t>(length), vers));
  586|      0|      }
  587|      0|    }
  588|      0|  }
  589|       |
  590|    644|  return nullptr;
  591|    644|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_121FuchsiaZoneInfoSource4OpenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  613|    644|    const std::string& name) {
  614|       |  // Use of the "file:" prefix is intended for testing purposes only.
  615|    644|  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
  ------------------
  |  Branch (615:27): [True: 17, False: 627]
  ------------------
  616|       |
  617|       |  // Reject unsafe paths (e.g., "../../etc/passwd").
  618|    644|  if (UnsafePath(name, pos)) {
  ------------------
  |  Branch (618:7): [True: 17, False: 627]
  ------------------
  619|     17|    return nullptr;
  620|     17|  }
  621|       |
  622|       |  // Prefixes where a Fuchsia component might find zoneinfo files,
  623|       |  // in descending order of preference.
  624|    627|  const auto kTzdataPrefixes = {
  625|       |      // The tzdata from `config-data`.
  626|    627|      "/config/data/tzdata/",
  627|       |      // The tzdata bundled in the component's package.
  628|    627|      "/pkg/data/tzdata/",
  629|       |      // General data storage.
  630|    627|      "/data/tzdata/",
  631|       |      // The recommended path for routed-in tzdata files.
  632|       |      // See for details:
  633|       |      // https://fuchsia.dev/fuchsia-src/concepts/process/namespaces?hl=en#typical_directory_structure
  634|    627|      "/config/tzdata/",
  635|    627|  };
  636|    627|  const auto kEmptyPrefix = {""};
  637|    627|  const bool name_absolute = (pos != name.size() && name[pos] == '/');
  ------------------
  |  Branch (637:31): [True: 613, False: 14]
  |  Branch (637:53): [True: 26, False: 587]
  ------------------
  638|    627|  const auto prefixes = name_absolute ? kEmptyPrefix : kTzdataPrefixes;
  ------------------
  |  Branch (638:25): [True: 26, False: 601]
  ------------------
  639|       |
  640|       |  // Fuchsia builds place zoneinfo files at "<prefix><format><name>".
  641|  2.43k|  for (const std::string prefix : prefixes) {
  ------------------
  |  Branch (641:33): [True: 2.43k, False: 627]
  ------------------
  642|  2.43k|    std::string path = prefix;
  643|  2.43k|    if (!prefix.empty()) path += "zoneinfo/tzif2/";  // format
  ------------------
  |  Branch (643:9): [True: 2.40k, False: 26]
  ------------------
  644|  2.43k|    path.append(name, pos, std::string::npos);
  645|       |
  646|  2.43k|    auto fp = FOpen(path.c_str());
  647|  2.43k|    if (fp == nullptr) continue;
  ------------------
  |  Branch (647:9): [True: 2.43k, False: 0]
  ------------------
  648|       |
  649|      0|    std::string version;
  650|      0|    if (!prefix.empty()) {
  ------------------
  |  Branch (650:9): [True: 0, False: 0]
  ------------------
  651|       |      // Fuchsia builds place the version in "<prefix>revision.txt".
  652|      0|      std::ifstream version_stream(prefix + "revision.txt");
  653|      0|      if (version_stream.is_open()) {
  ------------------
  |  Branch (653:11): [True: 0, False: 0]
  ------------------
  654|       |        // revision.txt should contain no newlines, but to be
  655|       |        // defensive we read just the first line.
  656|      0|        std::getline(version_stream, version);
  657|      0|      }
  658|      0|    }
  659|       |
  660|      0|    return std::unique_ptr<ZoneInfoSource>(
  661|      0|        new FuchsiaZoneInfoSource(std::move(fp), std::move(version)));
  662|  2.43k|  }
  663|       |
  664|    627|  return nullptr;
  665|    627|}

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

_ZN4cctz12TimeZoneLibC4MakeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  194|    208|std::unique_ptr<TimeZoneLibC> TimeZoneLibC::Make(const std::string& name) {
  195|    208|  return std::unique_ptr<TimeZoneLibC>(new TimeZoneLibC(name));
  196|    208|}
_ZNK4cctz12TimeZoneLibC9BreakTimeERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
  199|  1.47k|    const time_point<seconds>& tp) const {
  200|  1.47k|  time_zone::absolute_lookup al;
  201|  1.47k|  al.offset = 0;
  202|  1.47k|  al.is_dst = false;
  203|  1.47k|  al.abbr = "-00";
  204|       |
  205|  1.47k|  const std::int_fast64_t s = ToUnixSeconds(tp);
  206|       |
  207|       |  // If std::time_t cannot hold the input we saturate the output.
  208|  1.47k|  if (s < std::numeric_limits<std::time_t>::min()) {
  ------------------
  |  Branch (208:7): [True: 0, False: 1.47k]
  ------------------
  209|      0|    al.cs = civil_second::min();
  210|      0|    return al;
  211|      0|  }
  212|  1.47k|  if (s > std::numeric_limits<std::time_t>::max()) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1.47k]
  ------------------
  213|      0|    al.cs = civil_second::max();
  214|      0|    return al;
  215|      0|  }
  216|       |
  217|  1.47k|  const std::time_t t = static_cast<std::time_t>(s);
  218|  1.47k|  std::tm tm;
  219|  1.47k|  std::tm* tmp = local_ ? local_time(&t, &tm) : gm_time(&t, &tm);
  ------------------
  |  Branch (219:18): [True: 423, False: 1.05k]
  ------------------
  220|       |
  221|       |  // If std::tm cannot hold the result we saturate the output.
  222|  1.47k|  if (tmp == nullptr) {
  ------------------
  |  Branch (222:7): [True: 414, False: 1.06k]
  ------------------
  223|    414|    al.cs = (s < 0) ? civil_second::min() : civil_second::max();
  ------------------
  |  Branch (223:13): [True: 199, False: 215]
  ------------------
  224|    414|    return al;
  225|    414|  }
  226|       |
  227|  1.06k|  const year_t year = tmp->tm_year + year_t{1900};
  228|  1.06k|  al.cs = civil_second(year, tmp->tm_mon + 1, tmp->tm_mday,
  229|  1.06k|                       tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
  230|  1.06k|  al.offset = static_cast<int>(tm_gmtoff(*tmp));
  231|  1.06k|  al.abbr = local_ ? tm_zone(*tmp) : "UTC";  // as expected by cctz
  ------------------
  |  Branch (231:13): [True: 298, False: 763]
  ------------------
  232|  1.06k|  al.is_dst = tmp->tm_isdst > 0;
  233|  1.06k|  return al;
  234|  1.47k|}
_ZNK4cctz12TimeZoneLibC8MakeTimeERKNS_6detail10civil_timeINS1_10second_tagEEE:
  236|  2.10k|time_zone::civil_lookup TimeZoneLibC::MakeTime(const civil_second& cs) const {
  237|  2.10k|  if (!local_) {
  ------------------
  |  Branch (237:7): [True: 1.50k, False: 602]
  ------------------
  238|       |    // If time_point<seconds> cannot hold the result we saturate.
  239|  1.50k|    static const civil_second min_tp_cs =
  240|  1.50k|        civil_second() + ToUnixSeconds(time_point<seconds>::min());
  241|  1.50k|    static const civil_second max_tp_cs =
  242|  1.50k|        civil_second() + ToUnixSeconds(time_point<seconds>::max());
  243|  1.50k|    const time_point<seconds> tp =
  244|  1.50k|        (cs < min_tp_cs)
  ------------------
  |  Branch (244:9): [True: 113, False: 1.38k]
  ------------------
  245|  1.50k|            ? time_point<seconds>::min()
  246|  1.50k|            : (cs > max_tp_cs) ? time_point<seconds>::max()
  ------------------
  |  Branch (246:15): [True: 115, False: 1.27k]
  ------------------
  247|  1.38k|                               : FromUnixSeconds(cs - civil_second());
  248|  1.50k|    return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  249|  1.50k|  }
  250|       |
  251|       |  // If tm_year cannot hold the requested year we saturate the result.
  252|    602|  if (cs.year() < 0) {
  ------------------
  |  Branch (252:7): [True: 381, False: 221]
  ------------------
  253|    381|    if (cs.year() < std::numeric_limits<int>::min() + year_t{1900}) {
  ------------------
  |  Branch (253:9): [True: 85, False: 296]
  ------------------
  254|     85|      const time_point<seconds> tp = time_point<seconds>::min();
  255|     85|      return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  256|     85|    }
  257|    381|  } else {
  258|    221|    if (cs.year() - year_t{1900} > std::numeric_limits<int>::max()) {
  ------------------
  |  Branch (258:9): [True: 39, False: 182]
  ------------------
  259|     39|      const time_point<seconds> tp = time_point<seconds>::max();
  260|     39|      return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  261|     39|    }
  262|    221|  }
  263|       |
  264|       |  // We probe with "is_dst" values of 0 and 1 to try to distinguish unique
  265|       |  // civil seconds from skipped or repeated ones.  This is not always possible
  266|       |  // however, as the "dst" flag does not change over some offset transitions.
  267|       |  // We are also subject to the vagaries of mktime() implementations. For
  268|       |  // example, some implementations treat "tm_isdst" as a demand (useless),
  269|       |  // and some as a disambiguator (useful).
  270|    478|  std::time_t t0, t1;
  271|    478|  std::tm tm0, tm1;
  272|    478|  if (make_time(cs, 0, &t0, &tm0) && make_time(cs, 1, &t1, &tm1)) {
  ------------------
  |  Branch (272:7): [True: 478, False: 0]
  |  Branch (272:38): [True: 477, False: 1]
  ------------------
  273|    477|    if (tm0.tm_isdst == tm1.tm_isdst) {
  ------------------
  |  Branch (273:9): [True: 477, False: 0]
  ------------------
  274|       |      // The civil time was singular (pre == trans == post).
  275|    477|      const time_point<seconds> tp = FromUnixSeconds(tm0.tm_isdst ? t1 : t0);
  ------------------
  |  Branch (275:54): [True: 0, False: 477]
  ------------------
  276|    477|      return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  277|    477|    }
  278|       |
  279|      0|    tm_gmtoff_t offset = tm_gmtoff(tm0);
  280|      0|    if (t0 < t1) {  // negative DST
  ------------------
  |  Branch (280:9): [True: 0, False: 0]
  ------------------
  281|      0|      std::swap(t0, t1);
  282|      0|      offset = tm_gmtoff(tm1);
  283|      0|    }
  284|       |
  285|      0|    const std::time_t tt = find_trans(t1, t0, offset);
  286|      0|    const time_point<seconds> trans = FromUnixSeconds(tt);
  287|       |
  288|      0|    if (tm0.tm_isdst) {
  ------------------
  |  Branch (288:9): [True: 0, False: 0]
  ------------------
  289|       |      // The civil time did not exist (pre >= trans > post).
  290|      0|      const time_point<seconds> pre = FromUnixSeconds(t0);
  291|      0|      const time_point<seconds> post = FromUnixSeconds(t1);
  292|      0|      return {time_zone::civil_lookup::SKIPPED, pre, trans, post};
  293|      0|    }
  294|       |
  295|       |    // The civil time was ambiguous (pre < trans <= post).
  296|      0|    const time_point<seconds> pre = FromUnixSeconds(t1);
  297|      0|    const time_point<seconds> post = FromUnixSeconds(t0);
  298|      0|    return {time_zone::civil_lookup::REPEATED, pre, trans, post};
  299|      0|  }
  300|       |
  301|       |  // make_time() failed somehow so we saturate the result.
  302|      1|  const time_point<seconds> tp = (cs < civil_second())
  ------------------
  |  Branch (302:34): [True: 1, False: 0]
  ------------------
  303|      1|                                     ? time_point<seconds>::min()
  304|      1|                                     : time_point<seconds>::max();
  305|      1|  return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  306|    478|}
_ZN4cctz12TimeZoneLibCC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  327|    208|    : local_(name == "localtime") {}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_110local_timeEPKlP2tm:
  129|    426|inline std::tm* local_time(const std::time_t *timep, std::tm *result) {
  130|       |#if defined(_WIN32) || defined(_WIN64)
  131|       |    return localtime_s(result, timep) ? nullptr : result;
  132|       |#else
  133|    426|    return localtime_r(timep, result);
  134|    426|#endif
  135|    426|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_17gm_timeEPKlP2tm:
  121|  1.05k|inline std::tm* gm_time(const std::time_t *timep, std::tm *result) {
  122|       |#if defined(_WIN32) || defined(_WIN64)
  123|       |    return gmtime_s(result, timep) ? nullptr : result;
  124|       |#else
  125|  1.05k|    return gmtime_r(timep, result);
  126|  1.05k|#endif
  127|  1.05k|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_19make_timeERKNS_6detail10civil_timeINS1_10second_tagEEEiPlP2tm:
  141|    956|               std::tm* tm) {
  142|    956|  tm->tm_year = static_cast<int>(cs.year() - year_t{1900});
  143|    956|  tm->tm_mon = cs.month() - 1;
  144|    956|  tm->tm_mday = cs.day();
  145|    956|  tm->tm_hour = cs.hour();
  146|    956|  tm->tm_min = cs.minute();
  147|    956|  tm->tm_sec = cs.second();
  148|    956|  tm->tm_isdst = is_dst;
  149|    956|  *t = std::mktime(tm);
  150|    956|  if (*t == std::time_t{-1}) {
  ------------------
  |  Branch (150:7): [True: 3, False: 953]
  ------------------
  151|      3|    std::tm tm2;
  152|      3|    const std::tm* tmp = local_time(t, &tm2);
  153|      3|    if (tmp == nullptr || tmp->tm_year != tm->tm_year ||
  ------------------
  |  Branch (153:9): [True: 0, False: 3]
  |  Branch (153:27): [True: 1, False: 2]
  ------------------
  154|      2|        tmp->tm_mon != tm->tm_mon || tmp->tm_mday != tm->tm_mday ||
  ------------------
  |  Branch (154:9): [True: 0, False: 2]
  |  Branch (154:38): [True: 0, False: 2]
  ------------------
  155|      2|        tmp->tm_hour != tm->tm_hour || tmp->tm_min != tm->tm_min ||
  ------------------
  |  Branch (155:9): [True: 0, False: 2]
  |  Branch (155:40): [True: 0, False: 2]
  ------------------
  156|      2|        tmp->tm_sec != tm->tm_sec) {
  ------------------
  |  Branch (156:9): [True: 0, False: 2]
  ------------------
  157|       |      // A true error (not just one second before the epoch).
  158|      1|      return false;
  159|      1|    }
  160|      3|  }
  161|    955|  return true;
  162|    956|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_19tm_gmtoffI2tmEEDtdtfp_9tm_gmtoffERKT_:
   92|  1.06k|auto tm_gmtoff(const T& tm) -> decltype(tm.tm_gmtoff) {
   93|  1.06k|  return tm.tm_gmtoff;
   94|  1.06k|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_17tm_zoneI2tmEEDtdtfp_7tm_zoneERKT_:
  110|    298|auto tm_zone(const T& tm) -> decltype(tm.tm_zone) {
  111|    298|  return tm.tm_zone;
  112|    298|}

_ZNK4cctz9time_zone6lookupERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
   53|  9.60k|    const time_point<seconds>& tp) const {
   54|  9.60k|  return effective_impl().BreakTime(tp);
   55|  9.60k|}
_ZNK4cctz9time_zone6lookupERKNS_6detail10civil_timeINS1_10second_tagEEE:
   57|  14.7k|time_zone::civil_lookup time_zone::lookup(const civil_second& cs) const {
   58|  14.7k|  return effective_impl().MakeTime(cs);
   59|  14.7k|}
_ZNK4cctz9time_zone14effective_implEv:
   79|  24.3k|const time_zone::Impl& time_zone::effective_impl() const {
   80|  24.3k|  if (impl_ == nullptr) {
  ------------------
  |  Branch (80:7): [True: 0, False: 24.3k]
  ------------------
   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|  24.3k|  return *impl_;
   86|  24.3k|}
_ZN4cctz14load_time_zoneERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPNS_9time_zoneE:
   88|  9.50k|bool load_time_zone(const std::string& name, time_zone* tz) {
   89|  9.50k|  return time_zone::Impl::LoadTimeZone(name, tz);
   90|  9.50k|}
_ZN4cctz13utc_time_zoneEv:
   92|    196|time_zone utc_time_zone() {
   93|    196|  return time_zone::Impl::UTC();  // avoid name lookup
   94|    196|}

_ZN4cctz14ParsePosixSpecERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPNS_13PosixTimeZoneE:
  135|    225|bool ParsePosixSpec(const std::string& spec, PosixTimeZone* res) {
  136|    225|  const char* p = spec.c_str();
  137|    225|  if (*p == ':') return false;
  ------------------
  |  Branch (137:7): [True: 0, False: 225]
  ------------------
  138|       |
  139|    225|  p = ParseAbbr(p, &res->std_abbr);
  140|    225|  p = ParseOffset(p, 0, 24, -1, &res->std_offset);
  141|    225|  if (p == nullptr) return false;
  ------------------
  |  Branch (141:7): [True: 0, False: 225]
  ------------------
  142|    225|  if (*p == '\0') return true;
  ------------------
  |  Branch (142:7): [True: 91, False: 134]
  ------------------
  143|       |
  144|    134|  p = ParseAbbr(p, &res->dst_abbr);
  145|    134|  if (p == nullptr) return false;
  ------------------
  |  Branch (145:7): [True: 0, False: 134]
  ------------------
  146|    134|  res->dst_offset = res->std_offset + (60 * 60);  // default
  147|    134|  if (*p != ',') p = ParseOffset(p, 0, 24, -1, &res->dst_offset);
  ------------------
  |  Branch (147:7): [True: 0, False: 134]
  ------------------
  148|       |
  149|    134|  p = ParseDateTime(p, &res->dst_start);
  150|    134|  p = ParseDateTime(p, &res->dst_end);
  151|       |
  152|    134|  return p != nullptr && *p == '\0';
  ------------------
  |  Branch (152:10): [True: 134, False: 0]
  |  Branch (152:26): [True: 134, False: 0]
  ------------------
  153|    134|}
time_zone_posix.cc:_ZN4cctz12_GLOBAL__N_19ParseAbbrEPKcPNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
   46|    359|const char* ParseAbbr(const char* p, std::string* abbr) {
   47|    359|  const char* op = p;
   48|    359|  if (*p == '<') {  // special zoneinfo <...> form
  ------------------
  |  Branch (48:7): [True: 2, False: 357]
  ------------------
   49|      2|    if (*++p == '>' || *p == '\0') return nullptr;  // no "<>"
  ------------------
  |  Branch (49:9): [True: 0, False: 2]
  |  Branch (49:24): [True: 0, False: 2]
  ------------------
   50|      6|    while (*++p != '>') {
  ------------------
  |  Branch (50:12): [True: 4, False: 2]
  ------------------
   51|      4|      if (*p == '\0') return nullptr;
  ------------------
  |  Branch (51:11): [True: 0, False: 4]
  ------------------
   52|      4|    }
   53|      2|    abbr->assign(op + 1, static_cast<std::size_t>(p - op) - 1);
   54|      2|    return ++p;
   55|      2|  }
   56|  1.56k|  while (*p != '\0') {
  ------------------
  |  Branch (56:10): [True: 1.56k, False: 0]
  ------------------
   57|  1.56k|    if (strchr("-+,", *p)) break;
  ------------------
  |  Branch (57:9): [True: 196, False: 1.36k]
  ------------------
   58|  1.36k|    if (strchr(kDigits, *p)) break;
  ------------------
  |  Branch (58:9): [True: 161, False: 1.20k]
  ------------------
   59|  1.20k|    ++p;
   60|  1.20k|  }
   61|    357|  if (p - op < 3) return nullptr;
  ------------------
  |  Branch (61:7): [True: 0, False: 357]
  ------------------
   62|    357|  abbr->assign(op, static_cast<std::size_t>(p - op));
   63|    357|  return p;
   64|    357|}
time_zone_posix.cc:_ZN4cctz12_GLOBAL__N_111ParseOffsetEPKciiiPl:
   68|    376|                        std::int_fast32_t* offset) {
   69|    376|  if (p == nullptr) return nullptr;
  ------------------
  |  Branch (69:7): [True: 0, False: 376]
  ------------------
   70|    376|  if (*p == '+' || *p == '-') {
  ------------------
  |  Branch (70:7): [True: 0, False: 376]
  |  Branch (70:20): [True: 64, False: 312]
  ------------------
   71|     64|    if (*p++ == '-') sign = -sign;
  ------------------
  |  Branch (71:9): [True: 64, False: 0]
  ------------------
   72|     64|  }
   73|    376|  int hours = 0;
   74|    376|  int minutes = 0;
   75|    376|  int seconds = 0;
   76|       |
   77|    376|  p = ParseInt(p, min_hour, max_hour, &hours);
   78|    376|  if (p == nullptr) return nullptr;
  ------------------
  |  Branch (78:7): [True: 0, False: 376]
  ------------------
   79|    376|  if (*p == ':') {
  ------------------
  |  Branch (79:7): [True: 0, False: 376]
  ------------------
   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|    376|  *offset = sign * ((((hours * 60) + minutes) * 60) + seconds);
   88|    376|  return p;
   89|    376|}
time_zone_posix.cc:_ZN4cctz12_GLOBAL__N_18ParseIntEPKciiPi:
   28|  1.18k|const char* ParseInt(const char* p, int min, int max, int* vp) {
   29|  1.18k|  int value = 0;
   30|  1.18k|  const char* op = p;
   31|  1.18k|  const int kMaxInt = std::numeric_limits<int>::max();
   32|  2.51k|  for (; const char* dp = strchr(kDigits, *p); ++p) {
  ------------------
  |  Branch (32:22): [True: 1.55k, False: 955]
  ------------------
   33|  1.55k|    int d = static_cast<int>(dp - kDigits);
   34|  1.55k|    if (d >= 10) break;  // '\0'
  ------------------
  |  Branch (34:9): [True: 225, False: 1.33k]
  ------------------
   35|  1.33k|    if (value > kMaxInt / 10) return nullptr;
  ------------------
  |  Branch (35:9): [True: 0, False: 1.33k]
  ------------------
   36|  1.33k|    value *= 10;
   37|  1.33k|    if (value > kMaxInt - d) return nullptr;
  ------------------
  |  Branch (37:9): [True: 0, False: 1.33k]
  ------------------
   38|  1.33k|    value += d;
   39|  1.33k|  }
   40|  1.18k|  if (p == op || value < min || value > max) return nullptr;
  ------------------
  |  Branch (40:7): [True: 0, False: 1.18k]
  |  Branch (40:18): [True: 0, False: 1.18k]
  |  Branch (40:33): [True: 0, False: 1.18k]
  ------------------
   41|  1.18k|  *vp = value;
   42|  1.18k|  return p;
   43|  1.18k|}
time_zone_posix.cc:_ZN4cctz12_GLOBAL__N_113ParseDateTimeEPKcPNS_15PosixTransitionE:
   92|    268|const char* ParseDateTime(const char* p, PosixTransition* res) {
   93|    268|  if (p != nullptr) {
  ------------------
  |  Branch (93:7): [True: 268, False: 0]
  ------------------
   94|    268|    if (*p != ',') return nullptr;
  ------------------
  |  Branch (94:9): [True: 0, False: 268]
  ------------------
   95|    268|    if (*++p == 'M') {
  ------------------
  |  Branch (95:9): [True: 268, False: 0]
  ------------------
   96|    268|      int month = 0;
   97|    268|      if ((p = ParseInt(p + 1, 1, 12, &month)) != nullptr) {
  ------------------
  |  Branch (97:11): [True: 268, False: 0]
  ------------------
   98|    268|        if (*p != '.') return nullptr;
  ------------------
  |  Branch (98:13): [True: 0, False: 268]
  ------------------
   99|    268|        int week = 0;
  100|    268|        if ((p = ParseInt(p + 1, 1, 5, &week)) != nullptr) {
  ------------------
  |  Branch (100:13): [True: 268, False: 0]
  ------------------
  101|    268|          if (*p != '.') return nullptr;
  ------------------
  |  Branch (101:15): [True: 0, False: 268]
  ------------------
  102|    268|          int weekday = 0;
  103|    268|          if ((p = ParseInt(p + 1, 0, 6, &weekday)) != nullptr) {
  ------------------
  |  Branch (103:15): [True: 268, False: 0]
  ------------------
  104|    268|            res->date.fmt = PosixTransition::M;
  105|    268|            res->date.m.month = static_cast<std::int_fast8_t>(month);
  106|    268|            res->date.m.week = static_cast<std::int_fast8_t>(week);
  107|    268|            res->date.m.weekday = static_cast<std::int_fast8_t>(weekday);
  108|    268|          }
  109|    268|        }
  110|    268|      }
  111|    268|    } 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|    268|    if (p != nullptr) {
  ------------------
  |  Branch (124:9): [True: 268, False: 0]
  ------------------
  125|    268|      res->time.offset = 2 * 60 * 60;  // default offset is 02:00:00
  126|    268|      if (*p == '/') p = ParseOffset(p + 1, -167, 167, 1, &res->time.offset);
  ------------------
  |  Branch (126:11): [True: 151, False: 117]
  ------------------
  127|    268|    }
  128|    268|  }
  129|    268|  return p;
  130|    268|}

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

