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

_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2Ellllll:
  359|  16.9k|      : civil_time(impl::n_sec(y, m, d, hh, mm, ss)) {}
_ZN4cctz6detail4impl5n_secEllllll:
  213|   224k|                         diff_t ss) noexcept {
  214|       |  // Optimization for when (non-constexpr) fields are already normalized.
  215|   224k|  if (0 <= ss && ss < 60) {
  ------------------
  |  Branch (215:7): [True: 186k, False: 38.5k]
  |  Branch (215:18): [True: 180k, False: 5.84k]
  ------------------
  216|   180k|    const second_t nss = static_cast<second_t>(ss);
  217|   180k|    if (0 <= mm && mm < 60) {
  ------------------
  |  Branch (217:9): [True: 174k, False: 5.92k]
  |  Branch (217:20): [True: 45.3k, False: 128k]
  ------------------
  218|  45.3k|      const minute_t nmm = static_cast<minute_t>(mm);
  219|  45.3k|      if (0 <= hh && hh < 24) {
  ------------------
  |  Branch (219:11): [True: 45.3k, False: 0]
  |  Branch (219:22): [True: 45.1k, False: 121]
  ------------------
  220|  45.1k|        const hour_t nhh = static_cast<hour_t>(hh);
  221|  45.1k|        if (1 <= d && d <= 28 && 1 <= m && m <= 12) {
  ------------------
  |  Branch (221:13): [True: 39.7k, False: 5.49k]
  |  Branch (221:23): [True: 27.5k, False: 12.2k]
  |  Branch (221:34): [True: 27.4k, False: 10]
  |  Branch (221:44): [True: 27.3k, False: 103]
  ------------------
  222|  27.3k|          const day_t nd = static_cast<day_t>(d);
  223|  27.3k|          const month_t nm = static_cast<month_t>(m);
  224|  27.3k|          return fields(y, nm, nd, nhh, nmm, nss);
  225|  27.3k|        }
  226|  17.8k|        return n_mon(y, m, d, 0, nhh, nmm, nss);
  227|  45.1k|      }
  228|    121|      return n_hour(y, m, d, hh / 24, hh % 24, nmm, nss);
  229|  45.3k|    }
  230|   134k|    return n_min(y, m, d, hh, mm / 60, mm % 60, nss);
  231|   180k|  }
  232|  44.3k|  diff_t cm = ss / 60;
  233|  44.3k|  ss %= 60;
  234|  44.3k|  if (ss < 0) {
  ------------------
  |  Branch (234:7): [True: 38.5k, False: 5.84k]
  ------------------
  235|  38.5k|    cm -= 1;
  236|  38.5k|    ss += 60;
  237|  38.5k|  }
  238|  44.3k|  return n_min(y, m, d, hh, mm / 60 + cm / 60, mm % 60 + cm % 60,
  239|  44.3k|               static_cast<second_t>(ss));
  240|   224k|}
_ZN4cctz6detail6fieldsC2Elaaaaa:
   56|   349k|      : y(year), m(month), d(day), hh(hour), mm(minute), ss(second) {}
_ZN4cctz6detail4impl5n_monEllllaaa:
  180|   197k|                         hour_t hh, minute_t mm, second_t ss) noexcept {
  181|   197k|  if (m != 12) {
  ------------------
  |  Branch (181:7): [True: 193k, False: 3.23k]
  ------------------
  182|   193k|    y += m / 12;
  183|   193k|    m %= 12;
  184|   193k|    if (m <= 0) {
  ------------------
  |  Branch (184:9): [True: 5.79k, False: 188k]
  ------------------
  185|  5.79k|      y -= 1;
  186|  5.79k|      m += 12;
  187|  5.79k|    }
  188|   193k|  }
  189|   197k|  return n_day(y, static_cast<month_t>(m), d, cd, hh, mm, ss);
  190|   197k|}
_ZN4cctz6detail4impl5n_dayElallaaa:
  114|   201k|                         hour_t hh, minute_t mm, second_t ss) noexcept {
  115|   201k|  year_t ey = y % 400;
  116|   201k|  const year_t oey = ey;
  117|   201k|  ey += (cd / 146097) * 400;
  118|   201k|  cd %= 146097;
  119|   201k|  if (cd < 0) {
  ------------------
  |  Branch (119:7): [True: 7.69k, False: 193k]
  ------------------
  120|  7.69k|    ey -= 400;
  121|  7.69k|    cd += 146097;
  122|  7.69k|  }
  123|   201k|  ey += (d / 146097) * 400;
  124|   201k|  d = d % 146097 + cd;
  125|   201k|  if (d > 0) {
  ------------------
  |  Branch (125:7): [True: 195k, False: 5.52k]
  ------------------
  126|   195k|    if (d > 146097) {
  ------------------
  |  Branch (126:9): [True: 1.29k, False: 194k]
  ------------------
  127|  1.29k|      ey += 400;
  128|  1.29k|      d -= 146097;
  129|  1.29k|    }
  130|   195k|  } else {
  131|  5.52k|    if (d > -365) {
  ------------------
  |  Branch (131:9): [True: 5.52k, 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|  5.52k|      ey -= 1;
  135|  5.52k|      d += days_per_year(ey, m);
  136|  5.52k|    } else {
  137|      0|      ey -= 400;
  138|      0|      d += 146097;
  139|      0|    }
  140|  5.52k|  }
  141|   201k|  if (d > 365) {
  ------------------
  |  Branch (141:7): [True: 88.2k, False: 112k]
  ------------------
  142|  88.2k|    int yi = year_index(ey, m);  // Index into Gregorian 400 year cycle.
  143|   202k|    for (;;) {
  144|   202k|      int n = days_per_century(yi);
  145|   202k|      if (d <= n) break;
  ------------------
  |  Branch (145:11): [True: 88.2k, False: 114k]
  ------------------
  146|   114k|      d -= n;
  147|   114k|      ey += 100;
  148|   114k|      yi += 100;
  149|   114k|      if (yi >= 400) yi -= 400;
  ------------------
  |  Branch (149:11): [True: 50.6k, False: 63.7k]
  ------------------
  150|   114k|    }
  151|  1.18M|    for (;;) {
  152|  1.18M|      int n = days_per_4years(yi);
  153|  1.18M|      if (d <= n) break;
  ------------------
  |  Branch (153:11): [True: 88.2k, False: 1.10M]
  ------------------
  154|  1.10M|      d -= n;
  155|  1.10M|      ey += 4;
  156|  1.10M|      yi += 4;
  157|  1.10M|      if (yi >= 400) yi -= 400;
  ------------------
  |  Branch (157:11): [True: 21.6k, False: 1.07M]
  ------------------
  158|  1.10M|    }
  159|   225k|    for (;;) {
  160|   225k|      int n = days_per_year(ey, m);
  161|   225k|      if (d <= n) break;
  ------------------
  |  Branch (161:11): [True: 88.2k, False: 136k]
  ------------------
  162|   136k|      d -= n;
  163|   136k|      ++ey;
  164|   136k|    }
  165|  88.2k|  }
  166|   201k|  if (d > 28) {
  ------------------
  |  Branch (166:7): [True: 139k, False: 61.3k]
  ------------------
  167|   690k|    for (;;) {
  168|   690k|      int n = days_per_month(ey, m);
  169|   690k|      if (d <= n) break;
  ------------------
  |  Branch (169:11): [True: 139k, False: 550k]
  ------------------
  170|   550k|      d -= n;
  171|   550k|      if (++m > 12) {
  ------------------
  |  Branch (171:11): [True: 7.13k, False: 543k]
  ------------------
  172|  7.13k|        ++ey;
  173|  7.13k|        m = 1;
  174|  7.13k|      }
  175|   550k|    }
  176|   139k|  }
  177|   201k|  return fields(y + (ey - oey), m, static_cast<day_t>(d), hh, mm, ss);
  178|   201k|}
_ZN4cctz6detail4impl13days_per_yearEla:
   91|   230k|CONSTEXPR_F int days_per_year(year_t y, month_t m) noexcept {
   92|   230k|  return is_leap_year(y + (m > 2)) ? 366 : 365;
  ------------------
  |  Branch (92:10): [True: 46.9k, False: 183k]
  ------------------
   93|   230k|}
_ZN4cctz6detail4impl12is_leap_yearEl:
   78|   323k|CONSTEXPR_F bool is_leap_year(year_t y) noexcept {
   79|   323k|  return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0);
  ------------------
  |  Branch (79:10): [True: 69.0k, False: 254k]
  |  Branch (79:25): [True: 62.1k, False: 6.94k]
  |  Branch (79:41): [True: 4.86k, False: 2.07k]
  ------------------
   80|   323k|}
_ZN4cctz6detail4impl10year_indexEla:
   81|  88.2k|CONSTEXPR_F int year_index(year_t y, month_t m) noexcept {
   82|  88.2k|  const int yi = static_cast<int>((y + (m > 2)) % 400);
   83|  88.2k|  return yi < 0 ? yi + 400 : yi;
  ------------------
  |  Branch (83:10): [True: 6.93k, False: 81.2k]
  ------------------
   84|  88.2k|}
_ZN4cctz6detail4impl16days_per_centuryEi:
   85|   202k|CONSTEXPR_F int days_per_century(int yi) noexcept {
   86|   202k|  return 36524 + (yi == 0 || yi > 300);
  ------------------
  |  Branch (86:19): [True: 540, False: 202k]
  |  Branch (86:30): [True: 85.9k, False: 116k]
  ------------------
   87|   202k|}
_ZN4cctz6detail4impl15days_per_4yearsEi:
   88|  1.18M|CONSTEXPR_F int days_per_4years(int yi) noexcept {
   89|  1.18M|  return 1460 + (yi == 0 || yi > 300 || (yi - 1) % 100 < 96);
  ------------------
  |  Branch (89:18): [True: 917, False: 1.18M]
  |  Branch (89:29): [True: 439k, False: 748k]
  |  Branch (89:41): [True: 710k, False: 37.8k]
  ------------------
   90|  1.18M|}
_ZN4cctz6detail4impl14days_per_monthEla:
  106|   690k|CONSTEXPR_F int days_per_month(year_t y, month_t m) noexcept {
  107|   690k|  CONSTEXPR_D int k_days_per_month[1 + 12] = {
  ------------------
  |  |   25|   690k|#define CONSTEXPR_D constexpr  // data
  ------------------
  108|   690k|      -1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31  // non leap year
  109|   690k|  };
  110|   690k|  return k_days_per_month[m] + (m == 2 && is_leap_year(y));
  ------------------
  |  Branch (110:33): [True: 85.7k, False: 604k]
  |  Branch (110:43): [True: 19.4k, False: 66.2k]
  ------------------
  111|   690k|}
_ZN4cctz6detail4impl6n_hourElllllaa:
  192|   179k|                          diff_t hh, minute_t mm, second_t ss) noexcept {
  193|   179k|  cd += hh / 24;
  194|   179k|  hh %= 24;
  195|   179k|  if (hh < 0) {
  ------------------
  |  Branch (195:7): [True: 4.27k, False: 175k]
  ------------------
  196|  4.27k|    cd -= 1;
  197|  4.27k|    hh += 24;
  198|  4.27k|  }
  199|   179k|  return n_mon(y, m, d, cd, static_cast<hour_t>(hh), mm, ss);
  200|   179k|}
_ZN4cctz6detail4impl5n_minElllllla:
  202|   179k|                         diff_t mm, second_t ss) noexcept {
  203|   179k|  ch += mm / 60;
  204|   179k|  mm %= 60;
  205|   179k|  if (mm < 0) {
  ------------------
  |  Branch (205:7): [True: 38.7k, False: 140k]
  ------------------
  206|  38.7k|    ch -= 1;
  207|  38.7k|    mm += 60;
  208|  38.7k|  }
  209|   179k|  return n_hour(y, m, d, hh / 24 + ch / 24, hh % 24 + ch % 24,
  210|   179k|                static_cast<minute_t>(mm), ss);
  211|   179k|}
_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2ENS0_6fieldsE:
  446|   224k|  explicit CONSTEXPR_M civil_time(fields f) noexcept : f_(align(T{}, f)) {}
_ZN4cctz6detail5alignENS0_10second_tagENS0_6fieldsE:
  332|   224k|CONSTEXPR_F fields align(second_tag, fields f) noexcept {
  333|   224k|  return f;
  334|   224k|}
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE4yearEv:
  392|   449k|  CONSTEXPR_M year_t year() const noexcept { return f_.y; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE5monthEv:
  393|   106k|  CONSTEXPR_M int month() const noexcept { return f_.m; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE3dayEv:
  394|  39.8k|  CONSTEXPR_M int day() const noexcept { return f_.d; }
_ZN4cctz6detailplENS0_10civil_timeINS0_7day_tagEEEl:
  424|    622|  friend CONSTEXPR_F civil_time operator+(civil_time a, diff_t n) noexcept {
  425|    622|    return civil_time(step(T{}, a.f_, n));
  426|    622|  }
_ZN4cctz6detailmiENS0_10civil_timeINS0_7day_tagEEEl:
  430|  3.36k|  friend CONSTEXPR_F civil_time operator-(civil_time a, diff_t n) noexcept {
  431|  3.36k|    return n != (std::numeric_limits<diff_t>::min)()
  ------------------
  |  Branch (431:12): [True: 3.36k, False: 0]
  ------------------
  432|  3.36k|               ? civil_time(step(T{}, a.f_, -n))
  433|  3.36k|               : civil_time(step(T{}, step(T{}, a.f_, -(n + 1)), 1));
  434|  3.36k|  }
_ZN4cctz6detail4stepENS0_10second_tagENS0_6fieldsEl:
  247|   204k|CONSTEXPR_F fields step(second_tag, fields f, diff_t n) noexcept {
  248|   204k|  return impl::n_sec(f.y, f.m, f.d, f.hh, f.mm + n / 60, f.ss + n % 60);
  249|   204k|}
_ZN4cctz6detail4stepENS0_7day_tagENS0_6fieldsEl:
  256|  3.98k|CONSTEXPR_F fields step(day_tag, fields f, diff_t n) noexcept {
  257|  3.98k|  return impl::n_day(f.y, f.m, f.d, n, f.hh, f.mm, f.ss);
  258|  3.98k|}
_ZN4cctz6detail4impl9scale_addElll:
  271|  36.3k|CONSTEXPR_F diff_t scale_add(diff_t v, diff_t f, diff_t a) noexcept {
  272|  36.3k|  return (v < 0) ? ((v + 1) * f + a) - f : ((v - 1) * f + a) + f;
  ------------------
  |  Branch (272:10): [True: 5.78k, False: 30.6k]
  ------------------
  273|  36.3k|}
_ZN4cctz6detail4impl7ymd_ordElaa:
  277|  29.7k|CONSTEXPR_F diff_t ymd_ord(year_t y, month_t m, day_t d) noexcept {
  278|  29.7k|  const diff_t eyear = (m <= 2) ? y - 1 : y;
  ------------------
  |  Branch (278:24): [True: 9.02k, False: 20.7k]
  ------------------
  279|  29.7k|  const diff_t era = (eyear >= 0 ? eyear : eyear - 399) / 400;
  ------------------
  |  Branch (279:23): [True: 17.5k, False: 12.2k]
  ------------------
  280|  29.7k|  const diff_t yoe = eyear - era * 400;
  281|  29.7k|  const diff_t doy = (153 * (m + (m > 2 ? -3 : 9)) + 2) / 5 + d - 1;
  ------------------
  |  Branch (281:35): [True: 20.7k, False: 9.02k]
  ------------------
  282|  29.7k|  const diff_t doe = yoe * 365 + yoe / 4 - yoe / 100 + doy;
  283|  29.7k|  return era * 146097 + doe - 719468;
  284|  29.7k|}
_ZN4cctz6detail4impl14day_differenceElaalaa:
  292|  14.8k|                                  year_t y2, month_t m2, day_t d2) noexcept {
  293|  14.8k|  const diff_t a_c4_off = y1 % 400;
  294|  14.8k|  const diff_t b_c4_off = y2 % 400;
  295|  14.8k|  diff_t c4_diff = (y1 - a_c4_off) - (y2 - b_c4_off);
  296|  14.8k|  diff_t delta = ymd_ord(a_c4_off, m1, d1) - ymd_ord(b_c4_off, m2, d2);
  297|  14.8k|  if (c4_diff > 0 && delta < 0) {
  ------------------
  |  Branch (297:7): [True: 7.29k, False: 7.57k]
  |  Branch (297:22): [True: 484, False: 6.81k]
  ------------------
  298|    484|    delta += 2 * 146097;
  299|    484|    c4_diff -= 2 * 400;
  300|  14.3k|  } else if (c4_diff < 0 && delta > 0) {
  ------------------
  |  Branch (300:14): [True: 1.87k, False: 12.5k]
  |  Branch (300:29): [True: 10, False: 1.86k]
  ------------------
  301|     10|    delta -= 2 * 146097;
  302|     10|    c4_diff += 2 * 400;
  303|     10|  }
  304|  14.8k|  return (c4_diff / 400 * 146097) + delta;
  305|  14.8k|}
_ZN4cctz6detail10differenceENS0_7day_tagENS0_6fieldsES2_:
  316|  14.8k|CONSTEXPR_F diff_t difference(day_tag, fields f1, fields f2) noexcept {
  317|  14.8k|  return impl::day_difference(f1.y, f1.m, f1.d, f2.y, f2.m, f2.d);
  318|  14.8k|}
_ZN4cctz6detail10differenceENS0_8hour_tagENS0_6fieldsES2_:
  319|  12.1k|CONSTEXPR_F diff_t difference(hour_tag, fields f1, fields f2) noexcept {
  320|  12.1k|  return impl::scale_add(difference(day_tag{}, f1, f2), 24, (f1.hh - f2.hh));
  321|  12.1k|}
_ZN4cctz6detail10differenceENS0_10minute_tagENS0_6fieldsES2_:
  322|  12.1k|CONSTEXPR_F diff_t difference(minute_tag, fields f1, fields f2) noexcept {
  323|  12.1k|  return impl::scale_add(difference(hour_tag{}, f1, f2), 60, (f1.mm - f2.mm));
  324|  12.1k|}
_ZN4cctz6detail10differenceENS0_10second_tagENS0_6fieldsES2_:
  325|  12.1k|CONSTEXPR_F diff_t difference(second_tag, fields f1, fields f2) noexcept {
  326|  12.1k|  return impl::scale_add(difference(minute_tag{}, f1, f2), 60, f1.ss - f2.ss);
  327|  12.1k|}
_ZN4cctz6detail5alignENS0_7day_tagENS0_6fieldsE:
  341|  12.5k|CONSTEXPR_F fields align(day_tag, fields f) noexcept {
  342|  12.5k|  return fields{f.y, f.m, f.d, 0, 0, 0};
  343|  12.5k|}
_ZN4cctz6detail5alignENS0_8year_tagENS0_6fieldsE:
  347|  3.05k|CONSTEXPR_F fields align(year_tag, fields f) noexcept {
  348|  3.05k|  return fields{f.y, 1, 1, 0, 0, 0};
  349|  3.05k|}
_ZN4cctz6detail11get_weekdayERKNS0_10civil_timeINS0_10second_tagEEE:
  522|  11.2k|CONSTEXPR_F weekday get_weekday(const civil_second& cs) noexcept {
  523|  11.2k|  CONSTEXPR_D weekday k_weekday_by_mon_off[13] = {
  ------------------
  |  |   25|  11.2k|#define CONSTEXPR_D constexpr  // data
  ------------------
  524|  11.2k|      weekday::monday,    weekday::tuesday,  weekday::wednesday,
  525|  11.2k|      weekday::thursday,  weekday::friday,   weekday::saturday,
  526|  11.2k|      weekday::sunday,    weekday::monday,   weekday::tuesday,
  527|  11.2k|      weekday::wednesday, weekday::thursday, weekday::friday,
  528|  11.2k|      weekday::saturday,
  529|  11.2k|  };
  530|  11.2k|  CONSTEXPR_D int k_weekday_offsets[1 + 12] = {
  ------------------
  |  |   25|  11.2k|#define CONSTEXPR_D constexpr  // data
  ------------------
  531|  11.2k|      -1, 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4,
  532|  11.2k|  };
  533|  11.2k|  year_t wd = 2400 + (cs.year() % 400) - (cs.month() < 3);
  534|  11.2k|  wd += wd / 4 - wd / 100 + wd / 400;
  535|  11.2k|  wd += k_weekday_offsets[cs.month()] + cs.day();
  536|  11.2k|  return k_weekday_by_mon_off[wd % 7 + 6];
  537|  11.2k|}
_ZN4cctz6detail12next_weekdayENS0_10civil_timeINS0_7day_tagEEENS0_7weekdayE:
  541|    311|CONSTEXPR_F civil_day next_weekday(civil_day cd, weekday wd) noexcept {
  542|    311|  CONSTEXPR_D weekday k_weekdays_forw[14] = {
  ------------------
  |  |   25|    311|#define CONSTEXPR_D constexpr  // data
  ------------------
  543|    311|      weekday::monday,    weekday::tuesday,  weekday::wednesday,
  544|    311|      weekday::thursday,  weekday::friday,   weekday::saturday,
  545|    311|      weekday::sunday,    weekday::monday,   weekday::tuesday,
  546|    311|      weekday::wednesday, weekday::thursday, weekday::friday,
  547|    311|      weekday::saturday,  weekday::sunday,
  548|    311|  };
  549|    311|  weekday base = get_weekday(cd);
  550|  1.95k|  for (int i = 0;; ++i) {
  551|  1.95k|    if (base == k_weekdays_forw[i]) {
  ------------------
  |  Branch (551:9): [True: 311, False: 1.64k]
  ------------------
  552|  1.44k|      for (int j = i + 1;; ++j) {
  553|  1.44k|        if (wd == k_weekdays_forw[j]) {
  ------------------
  |  Branch (553:13): [True: 311, False: 1.13k]
  ------------------
  554|    311|          return cd + (j - i);
  555|    311|        }
  556|  1.44k|      }
  557|    311|    }
  558|  1.95k|  }
  559|    311|}
_ZN4cctz6detail12prev_weekdayENS0_10civil_timeINS0_7day_tagEEENS0_7weekdayE:
  561|  3.05k|CONSTEXPR_F civil_day prev_weekday(civil_day cd, weekday wd) noexcept {
  562|  3.05k|  CONSTEXPR_D weekday k_weekdays_back[14] = {
  ------------------
  |  |   25|  3.05k|#define CONSTEXPR_D constexpr  // data
  ------------------
  563|  3.05k|      weekday::sunday,   weekday::saturday,  weekday::friday,
  564|  3.05k|      weekday::thursday, weekday::wednesday, weekday::tuesday,
  565|  3.05k|      weekday::monday,   weekday::sunday,    weekday::saturday,
  566|  3.05k|      weekday::friday,   weekday::thursday,  weekday::wednesday,
  567|  3.05k|      weekday::tuesday,  weekday::monday,
  568|  3.05k|  };
  569|  3.05k|  weekday base = get_weekday(cd);
  570|  12.0k|  for (int i = 0;; ++i) {
  571|  12.0k|    if (base == k_weekdays_back[i]) {
  ------------------
  |  Branch (571:9): [True: 3.05k, False: 9.02k]
  ------------------
  572|  12.6k|      for (int j = i + 1;; ++j) {
  573|  12.6k|        if (wd == k_weekdays_back[j]) {
  ------------------
  |  Branch (573:13): [True: 3.05k, False: 9.55k]
  ------------------
  574|  3.05k|          return cd - (j - i);
  575|  3.05k|        }
  576|  12.6k|      }
  577|  3.05k|    }
  578|  12.0k|  }
  579|  3.05k|}
_ZN4cctz6detail11get_yeardayERKNS0_10civil_timeINS0_10second_tagEEE:
  581|  7.80k|CONSTEXPR_F int get_yearday(const civil_second& cs) noexcept {
  582|  7.80k|  CONSTEXPR_D int k_month_offsets[1 + 12] = {
  ------------------
  |  |   25|  7.80k|#define CONSTEXPR_D constexpr  // data
  ------------------
  583|  7.80k|      -1, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334,
  584|  7.80k|  };
  585|  7.80k|  const int feb29 = (cs.month() > 2 && impl::is_leap_year(cs.year()));
  ------------------
  |  Branch (585:22): [True: 7.35k, False: 449]
  |  Branch (585:40): [True: 644, False: 6.71k]
  ------------------
  586|  7.80k|  return k_month_offsets[cs.month()] + feb29 + cs.day();
  587|  7.80k|}
_ZNK4cctz6detail10civil_timeINS0_7day_tagEE4yearEv:
  392|  3.05k|  CONSTEXPR_M year_t year() const noexcept { return f_.y; }
_ZNK4cctz6detail10civil_timeINS0_7day_tagEE5monthEv:
  393|  3.05k|  CONSTEXPR_M int month() const noexcept { return f_.m; }
_ZNK4cctz6detail10civil_timeINS0_7day_tagEE3dayEv:
  394|  3.05k|  CONSTEXPR_M int day() const noexcept { return f_.d; }
_ZN4cctz6detail10civil_timeINS0_7day_tagEEC2Ellllll:
  359|  2.74k|      : civil_time(impl::n_sec(y, m, d, hh, mm, ss)) {}
_ZN4cctz6detail10civil_timeINS0_7day_tagEEC2ENS0_6fieldsE:
  446|  12.5k|  explicit CONSTEXPR_M civil_time(fields f) noexcept : f_(align(T{}, f)) {}
_ZN4cctz6detailmiENS0_10civil_timeINS0_7day_tagEEES3_:
  435|  2.74k|  friend CONSTEXPR_F diff_t operator-(civil_time lhs, civil_time rhs) noexcept {
  436|  2.74k|    return difference(T{}, lhs.f_, rhs.f_);
  437|  2.74k|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2INS0_7day_tagEEERKNS1_IT_EEPNSt3__19enable_ifIXsr3std10is_base_ofIS2_S6_EE5valueEvE4typeE:
  375|  3.36k|      : civil_time(ct.f_) {}
_ZN4cctz6detail10civil_timeINS0_8year_tagEEC2INS0_7day_tagEEERKNS1_IT_EEPNSt3__19enable_ifIXsr3std10is_base_ofIS6_S2_EE5valueEvE4typeE:
  379|  2.74k|      : civil_time(ct.f_) {}
_ZN4cctz6detail10civil_timeINS0_8year_tagEEC2ENS0_6fieldsE:
  446|  3.05k|  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|  3.05k|      : civil_time(ct.f_) {}
_ZN4cctz6detail10civil_timeINS0_7day_tagEEC2INS0_10second_tagEEERKNS1_IT_EEPNSt3__19enable_ifIXsr3std10is_base_ofIS6_S2_EE5valueEvE4typeE:
  379|  2.74k|      : civil_time(ct.f_) {}
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE4hourEv:
  395|  13.3k|  CONSTEXPR_M int hour() const noexcept { return f_.hh; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE6minuteEv:
  396|  12.7k|  CONSTEXPR_M int minute() const noexcept { return f_.mm; }
_ZNK4cctz6detail10civil_timeINS0_10second_tagEE6secondEv:
  397|  15.1k|  CONSTEXPR_M int second() const noexcept { return f_.ss; }
_ZN4cctz6detail10civil_timeINS0_8year_tagEEC2Ellllll:
  359|    311|      : civil_time(impl::n_sec(y, m, d, hh, mm, ss)) {}
_ZNK4cctz6detail10civil_timeINS0_8year_tagEE4yearEv:
  392|    311|  CONSTEXPR_M year_t year() const noexcept { return f_.y; }
_ZN4cctz6detailgtINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  494|  5.77k|                           const civil_time<T2>& rhs) noexcept {
  495|  5.77k|  return rhs < lhs;
  496|  5.77k|}
_ZN4cctz6detailplENS0_10civil_timeINS0_10second_tagEEEl:
  424|   160k|  friend CONSTEXPR_F civil_time operator+(civil_time a, diff_t n) noexcept {
  425|   160k|    return civil_time(step(T{}, a.f_, n));
  426|   160k|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEE3maxEv:
  382|    331|  static CONSTEXPR_F auto (max)() -> civil_time {
  383|    331|    const auto max_year = (std::numeric_limits<std::int_least64_t>::max)();
  384|    331|    return civil_time(max_year, 12, 31, 23, 59, 59);
  385|    331|  }
_ZN4cctz6detailltINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  469|   129k|                           const civil_time<T2>& rhs) noexcept {
  470|   129k|  return (lhs.year() < rhs.year() ||
  ------------------
  |  Branch (470:11): [True: 61.5k, False: 67.8k]
  ------------------
  471|  67.8k|          (lhs.year() == rhs.year() &&
  ------------------
  |  Branch (471:12): [True: 22.9k, False: 44.9k]
  ------------------
  472|  22.9k|           (lhs.month() < rhs.month() ||
  ------------------
  |  Branch (472:13): [True: 19.8k, False: 3.06k]
  ------------------
  473|  3.06k|            (lhs.month() == rhs.month() &&
  ------------------
  |  Branch (473:14): [True: 991, False: 2.07k]
  ------------------
  474|    991|             (lhs.day() < rhs.day() ||
  ------------------
  |  Branch (474:15): [True: 218, False: 773]
  ------------------
  475|    773|              (lhs.day() == rhs.day() &&
  ------------------
  |  Branch (475:16): [True: 509, False: 264]
  ------------------
  476|    509|               (lhs.hour() < rhs.hour() ||
  ------------------
  |  Branch (476:17): [True: 81, False: 428]
  ------------------
  477|    428|                (lhs.hour() == rhs.hour() &&
  ------------------
  |  Branch (477:18): [True: 323, False: 105]
  ------------------
  478|    323|                 (lhs.minute() < rhs.minute() ||
  ------------------
  |  Branch (478:19): [True: 38, False: 285]
  ------------------
  479|    285|                  (lhs.minute() == rhs.minute() &&
  ------------------
  |  Branch (479:20): [True: 135, False: 150]
  ------------------
  480|    135|                   (lhs.second() < rhs.second())))))))))));
  ------------------
  |  Branch (480:20): [True: 39, False: 96]
  ------------------
  481|   129k|}
_ZN4cctz6detail10civil_timeINS0_10second_tagEE3minEv:
  386|    224|  static CONSTEXPR_F auto (min)() -> civil_time {
  387|    224|    const auto min_year = (std::numeric_limits<std::int_least64_t>::min)();
  388|    224|    return civil_time(min_year, 1, 1, 0, 0, 0);
  389|    224|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEEmIEl:
  403|  4.97k|  CONSTEXPR_M civil_time& operator-=(diff_t n) noexcept {
  404|  4.97k|    return *this = *this - n;
  405|  4.97k|  }
_ZN4cctz6detailmiENS0_10civil_timeINS0_10second_tagEEEl:
  430|  43.8k|  friend CONSTEXPR_F civil_time operator-(civil_time a, diff_t n) noexcept {
  431|  43.8k|    return n != (std::numeric_limits<diff_t>::min)()
  ------------------
  |  Branch (431:12): [True: 43.8k, False: 0]
  ------------------
  432|  43.8k|               ? civil_time(step(T{}, a.f_, -n))
  433|  43.8k|               : civil_time(step(T{}, step(T{}, a.f_, -(n + 1)), 1));
  434|  43.8k|  }
_ZN4cctz6detailmiENS0_10civil_timeINS0_10second_tagEEES3_:
  435|  12.1k|  friend CONSTEXPR_F diff_t operator-(civil_time lhs, civil_time rhs) noexcept {
  436|  12.1k|    return difference(T{}, lhs.f_, rhs.f_);
  437|  12.1k|  }
_ZN4cctz6detail10civil_timeINS0_10second_tagEEC2Ev:
  361|   105k|  CONSTEXPR_M civil_time() noexcept : f_{1970, 1, 1, 0, 0, 0} {}
_ZN4cctz6detailgeINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  489|  12.4k|                            const civil_time<T2>& rhs) noexcept {
  490|  12.4k|  return !(lhs < rhs);
  491|  12.4k|}
_ZN4cctz6detailleINS0_10second_tagES2_EEbRKNS0_10civil_timeIT_EERKNS3_IT0_EE:
  484|  16.4k|                            const civil_time<T2>& rhs) noexcept {
  485|  16.4k|  return !(rhs < lhs);
  486|  16.4k|}

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

_ZN4cctz19FixedOffsetFromNameERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEPNS0_6chrono8durationIlNS0_5ratioILl1ELl1EEEEE:
   50|  8.93k|bool FixedOffsetFromName(const std::string& name, seconds* offset) {
   51|  8.93k|  if (name == "UTC" || name == "UTC0") {
  ------------------
  |  Branch (51:7): [True: 1.27k, False: 7.65k]
  |  Branch (51:24): [True: 3, False: 7.65k]
  ------------------
   52|  1.28k|    *offset = seconds::zero();
   53|  1.28k|    return true;
   54|  1.28k|  }
   55|       |
   56|  7.65k|  const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1;
   57|  7.65k|  const char* const ep = kFixedZonePrefix + prefix_len;
   58|  7.65k|  if (name.size() != prefix_len + 9)  // <prefix>+99:99:99
  ------------------
  |  Branch (58:7): [True: 6.90k, False: 744]
  ------------------
   59|  6.90k|    return false;
   60|    744|  if (!std::equal(kFixedZonePrefix, ep, name.begin()))
  ------------------
  |  Branch (60:7): [True: 61, False: 683]
  ------------------
   61|     61|    return false;
   62|    683|  const char* np = name.data() + prefix_len;
   63|    683|  if (np[0] != '+' && np[0] != '-')
  ------------------
  |  Branch (63:7): [True: 368, False: 315]
  |  Branch (63:23): [True: 20, False: 348]
  ------------------
   64|     20|    return false;
   65|    663|  if (np[3] != ':' || np[6] != ':')  // see note below about large offsets
  ------------------
  |  Branch (65:7): [True: 18, False: 645]
  |  Branch (65:23): [True: 2, False: 643]
  ------------------
   66|     20|    return false;
   67|       |
   68|    643|  int hours = Parse02d(np + 1);
   69|    643|  if (hours == -1) return false;
  ------------------
  |  Branch (69:7): [True: 2, False: 641]
  ------------------
   70|    641|  int mins = Parse02d(np + 4);
   71|    641|  if (mins == -1) return false;
  ------------------
  |  Branch (71:7): [True: 6, False: 635]
  ------------------
   72|    635|  int secs = Parse02d(np + 7);
   73|    635|  if (secs == -1) return false;
  ------------------
  |  Branch (73:7): [True: 6, False: 629]
  ------------------
   74|       |
   75|    629|  secs += ((hours * 60) + mins) * 60;
   76|    629|  if (secs > 24 * 60 * 60) return false;  // outside supported offset range
  ------------------
  |  Branch (76:7): [True: 6, False: 623]
  ------------------
   77|    623|  *offset = seconds(secs * (np[0] == '-' ? -1 : 1));  // "-" means west
  ------------------
  |  Branch (77:29): [True: 322, False: 301]
  ------------------
   78|    623|  return true;
   79|    629|}
_ZN4cctz17FixedOffsetToNameERKNSt3__16chrono8durationIlNS0_5ratioILl1ELl1EEEEE:
   81|    270|std::string FixedOffsetToName(const seconds& offset) {
   82|    270|  if (offset == seconds::zero()) return "UTC";
  ------------------
  |  Branch (82:7): [True: 1, False: 269]
  ------------------
   83|    269|  if (offset < std::chrono::hours(-24) || offset > std::chrono::hours(24)) {
  ------------------
  |  Branch (83:7): [True: 0, False: 269]
  |  Branch (83:7): [True: 0, False: 269]
  |  Branch (83:43): [True: 0, False: 269]
  ------------------
   84|       |    // We don't support fixed-offset zones more than 24 hours
   85|       |    // away from UTC to avoid complications in rendering such
   86|       |    // offsets and to (somewhat) limit the total number of zones.
   87|      0|    return "UTC";
   88|      0|  }
   89|    269|  int offset_seconds = static_cast<int>(offset.count());
   90|    269|  const char sign = (offset_seconds < 0 ? '-' : '+');
  ------------------
  |  Branch (90:22): [True: 144, False: 125]
  ------------------
   91|    269|  int offset_minutes = offset_seconds / 60;
   92|    269|  offset_seconds %= 60;
   93|    269|  if (sign == '-') {
  ------------------
  |  Branch (93:7): [True: 144, False: 125]
  ------------------
   94|    144|    if (offset_seconds > 0) {
  ------------------
  |  Branch (94:9): [True: 0, False: 144]
  ------------------
   95|      0|      offset_seconds -= 60;
   96|      0|      offset_minutes += 1;
   97|      0|    }
   98|    144|    offset_seconds = -offset_seconds;
   99|    144|    offset_minutes = -offset_minutes;
  100|    144|  }
  101|    269|  int offset_hours = offset_minutes / 60;
  102|    269|  offset_minutes %= 60;
  103|    269|  const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1;
  104|    269|  char buf[prefix_len + sizeof("-24:00:00")];
  105|    269|  char* ep = std::copy_n(kFixedZonePrefix, prefix_len, buf);
  106|    269|  *ep++ = sign;
  107|    269|  ep = Format02d(ep, offset_hours);
  108|    269|  *ep++ = ':';
  109|    269|  ep = Format02d(ep, offset_minutes);
  110|    269|  *ep++ = ':';
  111|    269|  ep = Format02d(ep, offset_seconds);
  112|    269|  *ep++ = '\0';
  113|    269|  assert(ep == buf + sizeof(buf));
  ------------------
  |  Branch (113:3): [True: 269, False: 0]
  ------------------
  114|    269|  return buf;
  115|    269|}
_ZN4cctz17FixedOffsetToAbbrERKNSt3__16chrono8durationIlNS0_5ratioILl1ELl1EEEEE:
  117|    270|std::string FixedOffsetToAbbr(const seconds& offset) {
  118|    270|  std::string abbr = FixedOffsetToName(offset);
  119|    270|  const std::size_t prefix_len = sizeof(kFixedZonePrefix) - 1;
  120|    270|  if (abbr.size() == prefix_len + 9) {         // <prefix>+99:99:99
  ------------------
  |  Branch (120:7): [True: 269, False: 1]
  ------------------
  121|    269|    abbr.erase(0, prefix_len);                 // +99:99:99
  122|    269|    abbr.erase(6, 1);                          // +99:9999
  123|    269|    abbr.erase(3, 1);                          // +999999
  124|    269|    if (abbr[5] == '0' && abbr[6] == '0') {    // +999900
  ------------------
  |  Branch (124:9): [True: 110, False: 159]
  |  Branch (124:27): [True: 47, False: 63]
  ------------------
  125|     47|      abbr.erase(5, 2);                        // +9999
  126|     47|      if (abbr[3] == '0' && abbr[4] == '0') {  // +9900
  ------------------
  |  Branch (126:11): [True: 10, False: 37]
  |  Branch (126:29): [True: 2, False: 8]
  ------------------
  127|      2|        abbr.erase(3, 2);                      // +99
  128|      2|      }
  129|     47|    }
  130|    269|  }
  131|    270|  return abbr;
  132|    270|}
time_zone_fixed.cc:_ZN4cctz12_GLOBAL__N_18Parse02dEPKc:
   38|  1.91k|int Parse02d(const char* p) {
   39|  1.91k|  if (const char* ap = std::strchr(kDigits, *p)) {
  ------------------
  |  Branch (39:19): [True: 1.90k, False: 10]
  ------------------
   40|  1.90k|    int v = static_cast<int>(ap - kDigits);
   41|  1.90k|    if (const char* bp = std::strchr(kDigits, *++p)) {
  ------------------
  |  Branch (41:21): [True: 1.90k, False: 4]
  ------------------
   42|  1.90k|      return (v * 10) + static_cast<int>(bp - kDigits);
   43|  1.90k|    }
   44|  1.90k|  }
   45|     14|  return -1;
   46|  1.91k|}
time_zone_fixed.cc:_ZN4cctz12_GLOBAL__N_19Format02dEPci:
   32|    807|char* Format02d(char* p, int v) {
   33|    807|  *p++ = kDigits[(v / 10) % 10];
   34|    807|  *p++ = kDigits[v % 10];
   35|    807|  return p;
   36|    807|}

_ZN4cctz6detail6formatERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_6chrono10time_pointINSA_12system_clockENSA_8durationIlNS1_5ratioILl1ELl1EEEEEEERKNSD_IlNSE_ILl1ELl1000000000000000EEEEERKNS_9time_zoneE:
  327|  7.80k|                   const detail::femtoseconds& fs, const time_zone& tz) {
  328|  7.80k|  std::string result;
  329|  7.80k|  result.reserve(2 * format.size());  // A guess for the result size.
  330|  7.80k|  const time_zone::absolute_lookup al = tz.lookup(tp);
  331|  7.80k|  const std::tm tm = ToTM(al);
  332|       |
  333|       |  // Scratch buffer for internal conversions.
  334|  7.80k|  char buf[6 + (kDigits10_64 + 2)];  // enough for longest conversion (%F)
  335|  7.80k|  char* const ep = buf + sizeof(buf);
  336|  7.80k|  char* bp;  // works back from ep
  337|       |
  338|       |  // Maintain three, disjoint subsequences that span format.
  339|       |  //   [format.begin() ... pending) : already formatted into result
  340|       |  //   [pending ... cur) : formatting pending, but no special cases
  341|       |  //   [cur ... format.end()) : unexamined
  342|       |  // Initially, everything is in the unexamined part.
  343|  7.80k|  const char* pending = format.data();
  344|  7.80k|  const char* cur = pending;
  345|  7.80k|  const char* const end = pending + format.size();
  346|       |
  347|   123k|  while (cur != end) {  // while something is unexamined
  ------------------
  |  Branch (347:10): [True: 115k, False: 7.80k]
  ------------------
  348|       |    // Moves cur to the next percent sign.
  349|   115k|    const char* start = cur;
  350|  31.6M|    while (cur != end && *cur != '%') {
  ------------------
  |  Branch (350:12): [True: 31.6M, False: 695]
  |  Branch (350:26): [True: 31.5M, False: 114k]
  ------------------
  351|  31.5M|      if (*cur == '\0' && pending != start) {
  ------------------
  |  Branch (351:11): [True: 1.28M, False: 30.2M]
  |  Branch (351:27): [True: 10.7k, False: 1.27M]
  ------------------
  352|  10.7k|        FormatTM(&result, std::string(pending, cur), tm);
  353|  10.7k|        pending = start = cur;
  354|  10.7k|      }
  355|  31.5M|      ++cur;
  356|  31.5M|    }
  357|       |
  358|       |    // If the new pending text is all ordinary, copy it out.
  359|   115k|    if (cur != start && pending == start) {
  ------------------
  |  Branch (359:9): [True: 71.9k, False: 43.3k]
  |  Branch (359:25): [True: 21.6k, False: 50.3k]
  ------------------
  360|  21.6k|      result.append(pending, cur);
  361|  21.6k|      pending = start = cur;
  362|  21.6k|    }
  363|       |
  364|       |    // Span the sequential percent signs.
  365|   115k|    const char* const percent = cur;
  366|   252k|    while (cur != end && *cur == '%') ++cur;
  ------------------
  |  Branch (366:12): [True: 251k, False: 803]
  |  Branch (366:26): [True: 137k, False: 114k]
  ------------------
  367|       |
  368|       |    // If the new pending text is all percents, copy out one
  369|       |    // percent for every matched pair, then skip those pairs.
  370|   115k|    if (cur != start && pending == start) {
  ------------------
  |  Branch (370:9): [True: 114k, False: 315]
  |  Branch (370:25): [True: 63.3k, False: 51.6k]
  ------------------
  371|  63.3k|      std::size_t escaped = static_cast<std::size_t>(cur - pending) / 2;
  372|  63.3k|      result.append(pending, escaped);
  373|  63.3k|      pending += escaped * 2;
  374|       |      // Also copy out a single trailing percent.
  375|  63.3k|      if (pending != cur && cur == end) {
  ------------------
  |  Branch (375:11): [True: 61.9k, False: 1.38k]
  |  Branch (375:29): [True: 52, False: 61.9k]
  ------------------
  376|     52|        result.push_back(*pending++);
  377|     52|      }
  378|  63.3k|    }
  379|       |
  380|       |    // Loop unless we have an unescaped percent.
  381|   115k|    if (cur == end || (cur - percent) % 2 == 0) continue;
  ------------------
  |  Branch (381:9): [True: 803, False: 114k]
  |  Branch (381:23): [True: 3.43k, False: 111k]
  ------------------
  382|       |
  383|       |    // Simple specifiers that we handle ourselves.
  384|   111k|    if (*cur == '\0' || strchr("YmdeFUuWwHMSTzZs%", *cur)) {
  ------------------
  |  Branch (384:9): [True: 809, False: 110k]
  |  Branch (384:25): [True: 15.2k, False: 95.0k]
  ------------------
  385|  16.0k|      FormatTM(&result, std::string(pending, cur - 1), tm);
  386|  16.0k|      switch (*cur) {
  ------------------
  |  Branch (386:15): [True: 16.0k, False: 0]
  ------------------
  387|    809|        case '\0':
  ------------------
  |  Branch (387:9): [True: 809, False: 15.2k]
  ------------------
  388|       |          // Because we allow NULs in the format string, we must give
  389|       |          // some meaning to the "%\0" specifier.  We choose the common
  390|       |          // (but undefined) strftime() behavior of echoing unknown
  391|       |          // specifiers.
  392|    809|          result.push_back('%');
  393|    809|          result.push_back('\0');
  394|    809|          break;
  395|  1.03k|        case 'Y':
  ------------------
  |  Branch (395:9): [True: 1.03k, False: 14.9k]
  ------------------
  396|       |          // This avoids the tm.tm_year overflow problem for %Y, however
  397|       |          // tm.tm_year will still be used by other specifiers like %D.
  398|  1.03k|          bp = Format64(ep, 0, al.cs.year());
  399|  1.03k|          result.append(bp, ep);
  400|  1.03k|          break;
  401|     91|        case 'm':
  ------------------
  |  Branch (401:9): [True: 91, False: 15.9k]
  ------------------
  402|     91|          bp = Format02d(ep, al.cs.month());
  403|     91|          result.append(bp, ep);
  404|     91|          break;
  405|    280|        case 'd':
  ------------------
  |  Branch (405:9): [True: 280, False: 15.7k]
  ------------------
  406|    832|        case 'e':
  ------------------
  |  Branch (406:9): [True: 552, False: 15.4k]
  ------------------
  407|    832|          bp = Format02d(ep, al.cs.day());
  408|    832|          if (*cur == 'e' && *bp == '0') *bp = ' ';  // for Windows
  ------------------
  |  Branch (408:15): [True: 552, False: 280]
  |  Branch (408:30): [True: 219, False: 333]
  ------------------
  409|    832|          result.append(bp, ep);
  410|    832|          break;
  411|    568|        case 'F':
  ------------------
  |  Branch (411:9): [True: 568, False: 15.4k]
  ------------------
  412|    568|          bp = Format02d(ep, al.cs.day());
  413|    568|          *--bp = '-';
  414|    568|          bp = Format02d(bp, al.cs.month());
  415|    568|          *--bp = '-';
  416|    568|          bp = Format64(bp, 0, al.cs.year());
  417|    568|          result.append(bp, ep);
  418|    568|          break;
  419|    708|        case 'U':
  ------------------
  |  Branch (419:9): [True: 708, False: 15.3k]
  ------------------
  420|    708|          bp = Format02d(ep, ToWeek(civil_day(al.cs), weekday::sunday));
  421|    708|          result.append(bp, ep);
  422|    708|          break;
  423|    876|        case 'u':
  ------------------
  |  Branch (423:9): [True: 876, False: 15.1k]
  ------------------
  424|    876|          bp = Format64(ep, 0, tm.tm_wday ? tm.tm_wday : 7);
  ------------------
  |  Branch (424:32): [True: 659, False: 217]
  ------------------
  425|    876|          result.append(bp, ep);
  426|    876|          break;
  427|  2.03k|        case 'W':
  ------------------
  |  Branch (427:9): [True: 2.03k, False: 13.9k]
  ------------------
  428|  2.03k|          bp = Format02d(ep, ToWeek(civil_day(al.cs), weekday::monday));
  429|  2.03k|          result.append(bp, ep);
  430|  2.03k|          break;
  431|    199|        case 'w':
  ------------------
  |  Branch (431:9): [True: 199, False: 15.8k]
  ------------------
  432|    199|          bp = Format64(ep, 0, tm.tm_wday);
  433|    199|          result.append(bp, ep);
  434|    199|          break;
  435|    260|        case 'H':
  ------------------
  |  Branch (435:9): [True: 260, False: 15.7k]
  ------------------
  436|    260|          bp = Format02d(ep, al.cs.hour());
  437|    260|          result.append(bp, ep);
  438|    260|          break;
  439|    396|        case 'M':
  ------------------
  |  Branch (439:9): [True: 396, False: 15.6k]
  ------------------
  440|    396|          bp = Format02d(ep, al.cs.minute());
  441|    396|          result.append(bp, ep);
  442|    396|          break;
  443|    583|        case 'S':
  ------------------
  |  Branch (443:9): [True: 583, False: 15.4k]
  ------------------
  444|    583|          bp = Format02d(ep, al.cs.second());
  445|    583|          result.append(bp, ep);
  446|    583|          break;
  447|    257|        case 'T':
  ------------------
  |  Branch (447:9): [True: 257, False: 15.7k]
  ------------------
  448|    257|          bp = Format02d(ep, al.cs.second());
  449|    257|          *--bp = ':';
  450|    257|          bp = Format02d(bp, al.cs.minute());
  451|    257|          *--bp = ':';
  452|    257|          bp = Format02d(bp, al.cs.hour());
  453|    257|          result.append(bp, ep);
  454|    257|          break;
  455|  3.94k|        case 'z':
  ------------------
  |  Branch (455:9): [True: 3.94k, False: 12.0k]
  ------------------
  456|  3.94k|          bp = FormatOffset(ep, al.offset, "");
  457|  3.94k|          result.append(bp, ep);
  458|  3.94k|          break;
  459|  2.80k|        case 'Z':
  ------------------
  |  Branch (459:9): [True: 2.80k, False: 13.2k]
  ------------------
  460|  2.80k|          result.append(al.abbr);
  461|  2.80k|          break;
  462|    621|        case 's':
  ------------------
  |  Branch (462:9): [True: 621, False: 15.3k]
  ------------------
  463|    621|          bp = Format64(ep, 0, ToUnixSeconds(tp));
  464|    621|          result.append(bp, ep);
  465|    621|          break;
  466|      0|        case '%':
  ------------------
  |  Branch (466:9): [True: 0, False: 16.0k]
  ------------------
  467|      0|          result.push_back('%');
  468|      0|          break;
  469|  16.0k|      }
  470|  16.0k|      pending = ++cur;
  471|  16.0k|      continue;
  472|  16.0k|    }
  473|       |
  474|       |    // More complex specifiers that we handle ourselves.
  475|  95.0k|    if (*cur == ':' && cur + 1 != end) {
  ------------------
  |  Branch (475:9): [True: 18.2k, False: 76.7k]
  |  Branch (475:24): [True: 18.2k, False: 7]
  ------------------
  476|  18.2k|      if (*(cur + 1) == 'z') {
  ------------------
  |  Branch (476:11): [True: 3.42k, False: 14.8k]
  ------------------
  477|       |        // Formats %:z.
  478|  3.42k|        FormatTM(&result, std::string(pending, cur - 1), tm);
  479|  3.42k|        bp = FormatOffset(ep, al.offset, ":");
  480|  3.42k|        result.append(bp, ep);
  481|  3.42k|        pending = cur += 2;
  482|  3.42k|        continue;
  483|  3.42k|      }
  484|  14.8k|      if (*(cur + 1) == ':' && cur + 2 != end) {
  ------------------
  |  Branch (484:11): [True: 8.96k, False: 5.85k]
  |  Branch (484:32): [True: 8.95k, False: 5]
  ------------------
  485|  8.95k|        if (*(cur + 2) == 'z') {
  ------------------
  |  Branch (485:13): [True: 1.85k, False: 7.10k]
  ------------------
  486|       |          // Formats %::z.
  487|  1.85k|          FormatTM(&result, std::string(pending, cur - 1), tm);
  488|  1.85k|          bp = FormatOffset(ep, al.offset, ":*");
  489|  1.85k|          result.append(bp, ep);
  490|  1.85k|          pending = cur += 3;
  491|  1.85k|          continue;
  492|  1.85k|        }
  493|  7.10k|        if (*(cur + 2) == ':' && cur + 3 != end) {
  ------------------
  |  Branch (493:13): [True: 5.09k, False: 2.01k]
  |  Branch (493:34): [True: 5.09k, False: 2]
  ------------------
  494|  5.09k|          if (*(cur + 3) == 'z') {
  ------------------
  |  Branch (494:15): [True: 3.16k, False: 1.93k]
  ------------------
  495|       |            // Formats %:::z.
  496|  3.16k|            FormatTM(&result, std::string(pending, cur - 1), tm);
  497|  3.16k|            bp = FormatOffset(ep, al.offset, ":*:");
  498|  3.16k|            result.append(bp, ep);
  499|  3.16k|            pending = cur += 4;
  500|  3.16k|            continue;
  501|  3.16k|          }
  502|  5.09k|        }
  503|  7.10k|      }
  504|  14.8k|    }
  505|       |
  506|       |    // Loop if there is no E modifier.
  507|  86.5k|    if (*cur != 'E' || ++cur == end) continue;
  ------------------
  |  Branch (507:9): [True: 36.4k, False: 50.1k]
  |  Branch (507:24): [True: 13, False: 50.1k]
  ------------------
  508|       |
  509|       |    // Format our extensions.
  510|  50.1k|    if (*cur == 'T') {
  ------------------
  |  Branch (510:9): [True: 1.44k, False: 48.6k]
  ------------------
  511|       |      // Formats %ET.
  512|  1.44k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  513|  1.44k|      result.append("T");
  514|  1.44k|      pending = ++cur;
  515|  48.6k|    } else if (*cur == 'z') {
  ------------------
  |  Branch (515:16): [True: 6.84k, False: 41.8k]
  ------------------
  516|       |      // Formats %Ez.
  517|  6.84k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  518|  6.84k|      bp = FormatOffset(ep, al.offset, ":");
  519|  6.84k|      result.append(bp, ep);
  520|  6.84k|      pending = ++cur;
  521|  41.8k|    } else if (*cur == '*' && cur + 1 != end && *(cur + 1) == 'z') {
  ------------------
  |  Branch (521:16): [True: 13.0k, False: 28.7k]
  |  Branch (521:31): [True: 13.0k, False: 8]
  |  Branch (521:49): [True: 3.13k, False: 9.93k]
  ------------------
  522|       |      // Formats %E*z.
  523|  3.13k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  524|  3.13k|      bp = FormatOffset(ep, al.offset, ":*");
  525|  3.13k|      result.append(bp, ep);
  526|  3.13k|      pending = cur += 2;
  527|  38.6k|    } else if (*cur == '*' && cur + 1 != end &&
  ------------------
  |  Branch (527:16): [True: 9.94k, False: 28.7k]
  |  Branch (527:31): [True: 9.93k, False: 8]
  ------------------
  528|  9.93k|               (*(cur + 1) == 'S' || *(cur + 1) == 'f')) {
  ------------------
  |  Branch (528:17): [True: 2.13k, False: 7.79k]
  |  Branch (528:38): [True: 6.72k, False: 1.07k]
  ------------------
  529|       |      // Formats %E*S or %E*F.
  530|  8.86k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  531|  8.86k|      char* cp = ep;
  532|  8.86k|      bp = Format64(cp, 15, fs.count());
  533|   141k|      while (cp != bp && cp[-1] == '0') --cp;
  ------------------
  |  Branch (533:14): [True: 132k, False: 8.86k]
  |  Branch (533:26): [True: 132k, False: 0]
  ------------------
  534|  8.86k|      switch (*(cur + 1)) {
  ------------------
  |  Branch (534:15): [True: 8.86k, False: 0]
  ------------------
  535|  2.13k|        case 'S':
  ------------------
  |  Branch (535:9): [True: 2.13k, False: 6.72k]
  ------------------
  536|  2.13k|          if (cp != bp) *--bp = '.';
  ------------------
  |  Branch (536:15): [True: 0, False: 2.13k]
  ------------------
  537|  2.13k|          bp = Format02d(bp, al.cs.second());
  538|  2.13k|          break;
  539|  6.72k|        case 'f':
  ------------------
  |  Branch (539:9): [True: 6.72k, False: 2.13k]
  ------------------
  540|  6.72k|          if (cp == bp) *--bp = '0';
  ------------------
  |  Branch (540:15): [True: 6.72k, False: 0]
  ------------------
  541|  6.72k|          break;
  542|  8.86k|      }
  543|  8.86k|      result.append(bp, cp);
  544|  8.86k|      pending = cur += 2;
  545|  29.8k|    } else if (*cur == '4' && cur + 1 != end && *(cur + 1) == 'Y') {
  ------------------
  |  Branch (545:16): [True: 3.76k, False: 26.0k]
  |  Branch (545:31): [True: 3.76k, False: 4]
  |  Branch (545:49): [True: 2.32k, False: 1.44k]
  ------------------
  546|       |      // Formats %E4Y.
  547|  2.32k|      FormatTM(&result, std::string(pending, cur - 2), tm);
  548|  2.32k|      bp = Format64(ep, 4, al.cs.year());
  549|  2.32k|      result.append(bp, ep);
  550|  2.32k|      pending = cur += 2;
  551|  27.4k|    } else if (std::isdigit(*cur)) {
  ------------------
  |  Branch (551:16): [True: 20.0k, False: 7.42k]
  ------------------
  552|       |      // Possibly found %E#S or %E#f.
  553|  20.0k|      int n = 0;
  554|  20.0k|      if (const char* np = ParseInt(cur, 0, 0, 1024, &n)) {
  ------------------
  |  Branch (554:23): [True: 7.33k, False: 12.7k]
  ------------------
  555|  7.33k|        if (*np == 'S' || *np == 'f') {
  ------------------
  |  Branch (555:13): [True: 1.02k, False: 6.31k]
  |  Branch (555:27): [True: 2.67k, False: 3.64k]
  ------------------
  556|       |          // Formats %E#S or %E#f.
  557|  3.69k|          FormatTM(&result, std::string(pending, cur - 2), tm);
  558|  3.69k|          bp = ep;
  559|  3.69k|          if (n > 0) {
  ------------------
  |  Branch (559:15): [True: 2.65k, False: 1.04k]
  ------------------
  560|  2.65k|            if (n > kDigits10_64) n = kDigits10_64;
  ------------------
  |  Branch (560:17): [True: 373, False: 2.27k]
  ------------------
  561|  2.65k|            bp = Format64(bp, n, (n > 15) ? fs.count() * kExp10[n - 15]
  ------------------
  |  Branch (561:34): [True: 395, False: 2.25k]
  ------------------
  562|  2.65k|                                          : fs.count() / kExp10[15 - n]);
  563|  2.65k|            if (*np == 'S') *--bp = '.';
  ------------------
  |  Branch (563:17): [True: 726, False: 1.92k]
  ------------------
  564|  2.65k|          }
  565|  3.69k|          if (*np == 'S') bp = Format02d(bp, al.cs.second());
  ------------------
  |  Branch (565:15): [True: 1.02k, False: 2.67k]
  ------------------
  566|  3.69k|          result.append(bp, ep);
  567|  3.69k|          pending = cur = ++np;
  568|  3.69k|        }
  569|  7.33k|      }
  570|  20.0k|    }
  571|  50.1k|  }
  572|       |
  573|       |  // Formats any remaining data.
  574|  7.80k|  FormatTM(&result, std::string(pending, end), tm);
  575|       |
  576|  7.80k|  return result;
  577|  7.80k|}
_ZN4cctz6detail5parseERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_RKNS_9time_zoneEPNS1_6chrono10time_pointINSD_12system_clockENSD_8durationIlNS1_5ratioILl1ELl1EEEEEEEPNSG_IlNSH_ILl1ELl1000000000000000EEEEEPS7_:
  694|  7.80k|           detail::femtoseconds* fs, std::string* err) {
  695|       |  // The unparsed input.  Even though we allow NULs in input, and
  696|       |  // match them against corresponding NULs in format, we depend on
  697|       |  // *edata being a NUL so that we can call strptime().  This also
  698|       |  // makes our handling of input easier.
  699|  7.80k|  const char* data = input.c_str();  // NUL terminated
  700|  7.80k|  const char* const edata = data + input.size();
  701|       |
  702|       |  // Skips leading whitespace.
  703|  8.19k|  while (std::isspace(*data)) ++data;
  ------------------
  |  Branch (703:10): [True: 391, False: 7.80k]
  ------------------
  704|       |
  705|  7.80k|  const year_t kyearmax = std::numeric_limits<year_t>::max();
  706|  7.80k|  const year_t kyearmin = std::numeric_limits<year_t>::min();
  707|       |
  708|       |  // Sets default values for unspecified fields.
  709|  7.80k|  bool saw_year = false;
  710|  7.80k|  year_t year = 1970;
  711|  7.80k|  std::tm tm{};
  712|  7.80k|  tm.tm_year = 1970 - 1900;
  713|  7.80k|  tm.tm_mon = 1 - 1;  // Jan
  714|  7.80k|  tm.tm_mday = 1;
  715|  7.80k|  tm.tm_hour = 0;
  716|  7.80k|  tm.tm_min = 0;
  717|  7.80k|  tm.tm_sec = 0;
  718|  7.80k|  tm.tm_wday = 4;  // Thu
  719|  7.80k|  tm.tm_yday = 0;
  720|  7.80k|  tm.tm_isdst = 0;
  721|  7.80k|  auto subseconds = detail::femtoseconds::zero();
  722|  7.80k|  bool saw_offset = false;
  723|  7.80k|  int offset = 0;  // No offset from passed tz.
  724|  7.80k|  std::string zone = "UTC";
  725|       |
  726|       |  // Even though we allow NULs in format, and match them against
  727|       |  // corresponding NULs in input, we simplify its handling by also
  728|       |  // ensuring that *efmt is a NUL.
  729|  7.80k|  const char* fmt = format.c_str();  // NUL terminated
  730|  7.80k|  const char* const efmt = fmt + format.size();
  731|  7.80k|  bool twelve_hour = false;
  732|  7.80k|  bool afternoon = false;
  733|  7.80k|  int week_num = -1;
  734|  7.80k|  weekday week_start = weekday::sunday;
  735|       |
  736|  7.80k|  bool saw_percent_s = false;
  737|  7.80k|  std::int_fast64_t percent_s = 0;
  738|       |
  739|       |  // Steps through format, one specifier at a time.
  740|  33.9k|  while (data != nullptr && fmt != efmt) {
  ------------------
  |  Branch (740:10): [True: 31.6k, False: 2.33k]
  |  Branch (740:29): [True: 26.1k, False: 5.47k]
  ------------------
  741|  26.1k|    if (std::isspace(*fmt)) {
  ------------------
  |  Branch (741:9): [True: 1.06k, False: 25.0k]
  ------------------
  742|  2.20k|      while (std::isspace(*data)) ++data;
  ------------------
  |  Branch (742:14): [True: 1.13k, False: 1.06k]
  ------------------
  743|  1.26k|      while (std::isspace(*++fmt)) continue;
  ------------------
  |  Branch (743:14): [True: 198, False: 1.06k]
  ------------------
  744|  1.06k|      continue;
  745|  1.06k|    }
  746|       |
  747|  25.0k|    if (*fmt != '%') {
  ------------------
  |  Branch (747:9): [True: 1.67k, False: 23.4k]
  ------------------
  748|  1.67k|      if (data != edata && *data == *fmt) {
  ------------------
  |  Branch (748:11): [True: 1.57k, False: 99]
  |  Branch (748:28): [True: 1.49k, False: 78]
  ------------------
  749|  1.49k|        ++data;
  750|  1.49k|        ++fmt;
  751|  1.49k|      } else {
  752|    177|        data = nullptr;
  753|    177|      }
  754|  1.67k|      continue;
  755|  1.67k|    }
  756|       |
  757|  23.4k|    const char* const percent = fmt;
  758|  23.4k|    if (++fmt == efmt) {
  ------------------
  |  Branch (758:9): [True: 8, False: 23.3k]
  ------------------
  759|      8|      data = nullptr;
  760|      8|      continue;
  761|      8|    }
  762|  23.3k|    switch (*fmt++) {
  ------------------
  |  Branch (762:13): [True: 22.8k, False: 576]
  ------------------
  763|      1|      case '\0':
  ------------------
  |  Branch (763:7): [True: 1, False: 23.3k]
  ------------------
  764|       |        // Because we allow NULs in the format string, we must give
  765|       |        // some meaning to the "%\0" specifier.  We choose the common
  766|       |        // (but undefined) strptime() behavior of failing on unknown
  767|       |        // specifiers.
  768|      1|        data = nullptr;
  769|      1|        continue;
  770|  1.67k|      case 'Y':
  ------------------
  |  Branch (770:7): [True: 1.67k, False: 21.7k]
  ------------------
  771|       |        // Symmetrically with format(), directly handing %Y avoids the
  772|       |        // tm.tm_year overflow problem.  However, tm.tm_year will still be
  773|       |        // used by other specifiers like %D.
  774|  1.67k|        data = ParseInt(data, 0, kyearmin, kyearmax, &year);
  775|  1.67k|        if (data != nullptr) saw_year = true;
  ------------------
  |  Branch (775:13): [True: 1.59k, False: 81]
  ------------------
  776|  1.67k|        continue;
  777|    320|      case 'm':
  ------------------
  |  Branch (777:7): [True: 320, False: 23.0k]
  ------------------
  778|    320|        data = ParseInt(data, 2, 1, 12, &tm.tm_mon);
  779|    320|        if (data != nullptr) tm.tm_mon -= 1;
  ------------------
  |  Branch (779:13): [True: 288, False: 32]
  ------------------
  780|    320|        week_num = -1;
  781|    320|        continue;
  782|    122|      case 'd':
  ------------------
  |  Branch (782:7): [True: 122, False: 23.2k]
  ------------------
  783|    455|      case 'e':
  ------------------
  |  Branch (783:7): [True: 333, False: 23.0k]
  ------------------
  784|    455|        data = ParseInt(data, 2, 1, 31, &tm.tm_mday);
  785|    455|        week_num = -1;
  786|    455|        continue;
  787|    654|      case 'F':
  ------------------
  |  Branch (787:7): [True: 654, False: 22.7k]
  ------------------
  788|    654|        data = ParseInt(data, 0, kyearmin, kyearmax, &year);
  789|    654|        if (data != nullptr) {
  ------------------
  |  Branch (789:13): [True: 576, False: 78]
  ------------------
  790|    576|          saw_year = true;
  791|    576|          data = (*data == '-' ? data + 1 : nullptr);
  ------------------
  |  Branch (791:19): [True: 341, False: 235]
  ------------------
  792|    576|        }
  793|    654|        data = ParseInt(data, 2, 1, 12, &tm.tm_mon);
  794|    654|        if (data != nullptr) {
  ------------------
  |  Branch (794:13): [True: 307, False: 347]
  ------------------
  795|    307|          tm.tm_mon -= 1;
  796|    307|          data = (*data == '-' ? data + 1 : nullptr);
  ------------------
  |  Branch (796:19): [True: 291, False: 16]
  ------------------
  797|    307|        }
  798|    654|        data = ParseInt(data, 2, 1, 31, &tm.tm_mday);
  799|    654|        week_num = -1;
  800|    654|        continue;
  801|    499|      case 'U':
  ------------------
  |  Branch (801:7): [True: 499, False: 22.8k]
  ------------------
  802|    499|        data = ParseInt(data, 0, 0, 53, &week_num);
  803|    499|        week_start = weekday::sunday;
  804|    499|        continue;
  805|    327|      case 'W':
  ------------------
  |  Branch (805:7): [True: 327, False: 23.0k]
  ------------------
  806|    327|        data = ParseInt(data, 0, 0, 53, &week_num);
  807|    327|        week_start = weekday::monday;
  808|    327|        continue;
  809|    238|      case 'u':
  ------------------
  |  Branch (809:7): [True: 238, False: 23.1k]
  ------------------
  810|    238|        data = ParseInt(data, 0, 1, 7, &tm.tm_wday);
  811|    238|        if (data != nullptr) tm.tm_wday %= 7;
  ------------------
  |  Branch (811:13): [True: 53, False: 185]
  ------------------
  812|    238|        continue;
  813|    268|      case 'w':
  ------------------
  |  Branch (813:7): [True: 268, False: 23.1k]
  ------------------
  814|    268|        data = ParseInt(data, 0, 0, 6, &tm.tm_wday);
  815|    268|        continue;
  816|    381|      case 'H':
  ------------------
  |  Branch (816:7): [True: 381, False: 23.0k]
  ------------------
  817|    381|        data = ParseInt(data, 2, 0, 23, &tm.tm_hour);
  818|    381|        twelve_hour = false;
  819|    381|        continue;
  820|    451|      case 'M':
  ------------------
  |  Branch (820:7): [True: 451, False: 22.9k]
  ------------------
  821|    451|        data = ParseInt(data, 2, 0, 59, &tm.tm_min);
  822|    451|        continue;
  823|    371|      case 'S':
  ------------------
  |  Branch (823:7): [True: 371, False: 23.0k]
  ------------------
  824|    371|        data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  825|    371|        continue;
  826|    837|      case 'T':
  ------------------
  |  Branch (826:7): [True: 837, False: 22.5k]
  ------------------
  827|    837|        data = ParseInt(data, 2, 0, 23, &tm.tm_hour);
  828|    837|        twelve_hour = false;
  829|    837|        data = (data != nullptr && *data == ':' ? data + 1 : nullptr);
  ------------------
  |  Branch (829:17): [True: 803, False: 34]
  |  Branch (829:36): [True: 782, False: 21]
  ------------------
  830|    837|        data = ParseInt(data, 2, 0, 59, &tm.tm_min);
  831|    837|        data = (data != nullptr && *data == ':' ? data + 1 : nullptr);
  ------------------
  |  Branch (831:17): [True: 750, False: 87]
  |  Branch (831:36): [True: 715, False: 35]
  ------------------
  832|    837|        data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  833|    837|        continue;
  834|     48|      case 'I':
  ------------------
  |  Branch (834:7): [True: 48, False: 23.3k]
  ------------------
  835|     71|      case 'l':
  ------------------
  |  Branch (835:7): [True: 23, False: 23.3k]
  ------------------
  836|     73|      case 'r':  // probably uses %I
  ------------------
  |  Branch (836:7): [True: 2, False: 23.3k]
  ------------------
  837|     73|        twelve_hour = true;
  838|     73|        break;
  839|     16|      case 'R':  // uses %H
  ------------------
  |  Branch (839:7): [True: 16, False: 23.3k]
  ------------------
  840|     17|      case 'c':  // probably uses %H
  ------------------
  |  Branch (840:7): [True: 1, False: 23.3k]
  ------------------
  841|     37|      case 'X':  // probably uses %H
  ------------------
  |  Branch (841:7): [True: 20, False: 23.3k]
  ------------------
  842|     37|        twelve_hour = false;
  843|     37|        break;
  844|  2.80k|      case 'z':
  ------------------
  |  Branch (844:7): [True: 2.80k, False: 20.5k]
  ------------------
  845|  2.80k|        data = ParseOffset(data, "", &offset);
  846|  2.80k|        if (data != nullptr) saw_offset = true;
  ------------------
  |  Branch (846:13): [True: 2.74k, False: 59]
  ------------------
  847|  2.80k|        continue;
  848|    692|      case 'Z':  // ignored; zone abbreviations are ambiguous
  ------------------
  |  Branch (848:7): [True: 692, False: 22.7k]
  ------------------
  849|    692|        data = ParseZone(data, &zone);
  850|    692|        continue;
  851|    578|      case 's':
  ------------------
  |  Branch (851:7): [True: 578, False: 22.8k]
  ------------------
  852|    578|        data = ParseInt(data, 0,
  853|    578|                        std::numeric_limits<std::int_fast64_t>::min(),
  854|    578|                        std::numeric_limits<std::int_fast64_t>::max(),
  855|    578|                        &percent_s);
  856|    578|        if (data != nullptr) saw_percent_s = true;
  ------------------
  |  Branch (856:13): [True: 501, False: 77]
  ------------------
  857|    578|        continue;
  858|  1.06k|      case ':':
  ------------------
  |  Branch (858:7): [True: 1.06k, False: 22.3k]
  ------------------
  859|  1.06k|        if (fmt[0] == 'z' ||
  ------------------
  |  Branch (859:13): [True: 565, False: 495]
  ------------------
  860|    495|            (fmt[0] == ':' &&
  ------------------
  |  Branch (860:14): [True: 480, False: 15]
  ------------------
  861|  1.02k|             (fmt[1] == 'z' || (fmt[1] == ':' && fmt[2] == 'z')))) {
  ------------------
  |  Branch (861:15): [True: 394, False: 86]
  |  Branch (861:33): [True: 73, False: 13]
  |  Branch (861:50): [True: 62, False: 11]
  ------------------
  862|  1.02k|          data = ParseOffset(data, ":", &offset);
  863|  1.02k|          if (data != nullptr) saw_offset = true;
  ------------------
  |  Branch (863:15): [True: 1.00k, False: 20]
  ------------------
  864|  1.02k|          fmt += (fmt[0] == 'z') ? 1 : (fmt[1] == 'z') ? 2 : 3;
  ------------------
  |  Branch (864:18): [True: 565, False: 456]
  |  Branch (864:40): [True: 394, False: 62]
  ------------------
  865|  1.02k|          continue;
  866|  1.02k|        }
  867|     39|        break;
  868|     68|      case '%':
  ------------------
  |  Branch (868:7): [True: 68, False: 23.3k]
  ------------------
  869|     68|        data = (*data == '%' ? data + 1 : nullptr);
  ------------------
  |  Branch (869:17): [True: 66, False: 2]
  ------------------
  870|     68|        continue;
  871|  10.9k|      case 'E':
  ------------------
  |  Branch (871:7): [True: 10.9k, False: 12.4k]
  ------------------
  872|  10.9k|        if (fmt[0] == 'T') {
  ------------------
  |  Branch (872:13): [True: 385, False: 10.5k]
  ------------------
  873|    385|          if (*data == 'T' || *data == 't') {
  ------------------
  |  Branch (873:15): [True: 194, False: 191]
  |  Branch (873:31): [True: 182, False: 9]
  ------------------
  874|    376|            ++data;
  875|    376|            ++fmt;
  876|    376|          } else {
  877|      9|            data = nullptr;
  878|      9|          }
  879|    385|          continue;
  880|    385|        }
  881|  10.5k|        if (fmt[0] == 'z' || (fmt[0] == '*' && fmt[1] == 'z')) {
  ------------------
  |  Branch (881:13): [True: 2.82k, False: 7.73k]
  |  Branch (881:31): [True: 6.07k, False: 1.66k]
  |  Branch (881:48): [True: 1.00k, False: 5.06k]
  ------------------
  882|  3.83k|          data = ParseOffset(data, ":", &offset);
  883|  3.83k|          if (data != nullptr) saw_offset = true;
  ------------------
  |  Branch (883:15): [True: 3.82k, False: 13]
  ------------------
  884|  3.83k|          fmt += (fmt[0] == 'z') ? 1 : 2;
  ------------------
  |  Branch (884:18): [True: 2.82k, False: 1.00k]
  ------------------
  885|  3.83k|          continue;
  886|  3.83k|        }
  887|  6.72k|        if (fmt[0] == '*' && fmt[1] == 'S') {
  ------------------
  |  Branch (887:13): [True: 5.06k, False: 1.66k]
  |  Branch (887:30): [True: 355, False: 4.70k]
  ------------------
  888|    355|          data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  889|    355|          if (data != nullptr && *data == '.') {
  ------------------
  |  Branch (889:15): [True: 342, False: 13]
  |  Branch (889:34): [True: 10, False: 332]
  ------------------
  890|     10|            data = ParseSubSeconds(data + 1, &subseconds);
  891|     10|          }
  892|    355|          fmt += 2;
  893|    355|          continue;
  894|    355|        }
  895|  6.36k|        if (fmt[0] == '*' && fmt[1] == 'f') {
  ------------------
  |  Branch (895:13): [True: 4.70k, False: 1.66k]
  |  Branch (895:30): [True: 4.67k, False: 31]
  ------------------
  896|  4.67k|          if (data != nullptr && std::isdigit(*data)) {
  ------------------
  |  Branch (896:15): [True: 4.67k, False: 0]
  |  Branch (896:34): [True: 1.77k, False: 2.90k]
  ------------------
  897|  1.77k|            data = ParseSubSeconds(data, &subseconds);
  898|  1.77k|          }
  899|  4.67k|          fmt += 2;
  900|  4.67k|          continue;
  901|  4.67k|        }
  902|  1.69k|        if (fmt[0] == '4' && fmt[1] == 'Y') {
  ------------------
  |  Branch (902:13): [True: 544, False: 1.14k]
  |  Branch (902:30): [True: 211, False: 333]
  ------------------
  903|    211|          const char* bp = data;
  904|    211|          data = ParseInt(data, 4, year_t{-999}, year_t{9999}, &year);
  905|    211|          if (data != nullptr) {
  ------------------
  |  Branch (905:15): [True: 200, False: 11]
  ------------------
  906|    200|            if (data - bp == 4) {
  ------------------
  |  Branch (906:17): [True: 159, False: 41]
  ------------------
  907|    159|              saw_year = true;
  908|    159|            } else {
  909|     41|              data = nullptr;  // stopped too soon
  910|     41|            }
  911|    200|          }
  912|    211|          fmt += 2;
  913|    211|          continue;
  914|    211|        }
  915|  1.48k|        if (std::isdigit(*fmt)) {
  ------------------
  |  Branch (915:13): [True: 1.38k, False: 95]
  ------------------
  916|  1.38k|          int n = 0;  // value ignored
  917|  1.38k|          if (const char* np = ParseInt(fmt, 0, 0, 1024, &n)) {
  ------------------
  |  Branch (917:27): [True: 1.26k, False: 119]
  ------------------
  918|  1.26k|            if (*np == 'S') {
  ------------------
  |  Branch (918:17): [True: 364, False: 903]
  ------------------
  919|    364|              data = ParseInt(data, 2, 0, 60, &tm.tm_sec);
  920|    364|              if (data != nullptr && *data == '.') {
  ------------------
  |  Branch (920:19): [True: 348, False: 16]
  |  Branch (920:38): [True: 10, False: 338]
  ------------------
  921|     10|                data = ParseSubSeconds(data + 1, &subseconds);
  922|     10|              }
  923|    364|              fmt = ++np;
  924|    364|              continue;
  925|    364|            }
  926|    903|            if (*np == 'f') {
  ------------------
  |  Branch (926:17): [True: 860, False: 43]
  ------------------
  927|    860|              if (data != nullptr && std::isdigit(*data)) {
  ------------------
  |  Branch (927:19): [True: 860, False: 0]
  |  Branch (927:38): [True: 183, False: 677]
  ------------------
  928|    183|                data = ParseSubSeconds(data, &subseconds);
  929|    183|              }
  930|    860|              fmt = ++np;
  931|    860|              continue;
  932|    860|            }
  933|    903|          }
  934|  1.38k|        }
  935|    257|        if (*fmt == 'c') twelve_hour = false;  // probably uses %H
  ------------------
  |  Branch (935:13): [True: 1, False: 256]
  ------------------
  936|    257|        if (*fmt == 'X') twelve_hour = false;  // probably uses %H
  ------------------
  |  Branch (936:13): [True: 1, False: 256]
  ------------------
  937|    257|        if (*fmt != '\0') ++fmt;
  ------------------
  |  Branch (937:13): [True: 247, False: 10]
  ------------------
  938|    257|        break;
  939|     84|      case 'O':
  ------------------
  |  Branch (939:7): [True: 84, False: 23.3k]
  ------------------
  940|     84|        if (*fmt == 'H') twelve_hour = false;
  ------------------
  |  Branch (940:13): [True: 50, False: 34]
  ------------------
  941|     84|        if (*fmt == 'I') twelve_hour = true;
  ------------------
  |  Branch (941:13): [True: 21, False: 63]
  ------------------
  942|     84|        if (*fmt != '\0') ++fmt;
  ------------------
  |  Branch (942:13): [True: 81, False: 3]
  ------------------
  943|     84|        break;
  944|  23.3k|    }
  945|       |
  946|       |    // Parses the current specifier.
  947|  1.06k|    const char* const orig_data = data;
  948|  1.06k|    std::string spec(percent, fmt);
  949|  1.06k|    data = ParseTM(data, spec.c_str(), &tm);
  950|       |
  951|       |    // If we successfully parsed %p we need to remember whether the result
  952|       |    // was AM or PM so that we can adjust tm_hour before time_zone::lookup().
  953|       |    // So reparse the input with a known AM hour, and check if it is shifted
  954|       |    // to a PM hour.
  955|  1.06k|    if (spec == "%p" && data != nullptr) {
  ------------------
  |  Branch (955:9): [True: 125, False: 941]
  |  Branch (955:25): [True: 121, False: 4]
  ------------------
  956|    121|      std::string test_input = "1";
  957|    121|      test_input.append(orig_data, data);
  958|    121|      std::tm tmp{};
  959|    121|      ParseTM(test_input.c_str(), "%I%p", &tmp);
  960|    121|      afternoon = (tmp.tm_hour == 13);
  961|    121|    }
  962|  1.06k|  }
  963|       |
  964|       |  // Adjust a 12-hour tm_hour value if it should be in the afternoon.
  965|  7.80k|  if (twelve_hour && afternoon && tm.tm_hour < 12) {
  ------------------
  |  Branch (965:7): [True: 38, False: 7.76k]
  |  Branch (965:22): [True: 6, False: 32]
  |  Branch (965:35): [True: 5, False: 1]
  ------------------
  966|      5|    tm.tm_hour += 12;
  967|      5|  }
  968|       |
  969|  7.80k|  if (data == nullptr) {
  ------------------
  |  Branch (969:7): [True: 2.33k, False: 5.47k]
  ------------------
  970|  2.33k|    if (err != nullptr) *err = "Failed to parse input";
  ------------------
  |  Branch (970:9): [True: 0, False: 2.33k]
  ------------------
  971|  2.33k|    return false;
  972|  2.33k|  }
  973|       |
  974|       |  // Skip any remaining whitespace.
  975|  5.67k|  while (std::isspace(*data)) ++data;
  ------------------
  |  Branch (975:10): [True: 199, False: 5.47k]
  ------------------
  976|       |
  977|       |  // parse() must consume the entire input string.
  978|  5.47k|  if (data != edata) {
  ------------------
  |  Branch (978:7): [True: 238, False: 5.23k]
  ------------------
  979|    238|    if (err != nullptr) *err = "Illegal trailing data in input string";
  ------------------
  |  Branch (979:9): [True: 0, False: 238]
  ------------------
  980|    238|    return false;
  981|    238|  }
  982|       |
  983|       |  // If we saw %s then we ignore anything else and return that time.
  984|  5.23k|  if (saw_percent_s) {
  ------------------
  |  Branch (984:7): [True: 252, False: 4.98k]
  ------------------
  985|    252|    *sec = FromUnixSeconds(percent_s);
  986|    252|    *fs = detail::femtoseconds::zero();
  987|    252|    return true;
  988|    252|  }
  989|       |
  990|       |  // If we saw %z, %Ez, or %E*z then we want to interpret the parsed fields
  991|       |  // in UTC and then shift by that offset.  Otherwise we want to interpret
  992|       |  // the fields directly in the passed time_zone.
  993|  4.98k|  time_zone ptz = saw_offset ? utc_time_zone() : tz;
  ------------------
  |  Branch (993:19): [True: 187, False: 4.79k]
  ------------------
  994|       |
  995|       |  // Allows a leap second of 60 to normalize forward to the following ":00".
  996|  4.98k|  if (tm.tm_sec == 60) {
  ------------------
  |  Branch (996:7): [True: 27, False: 4.95k]
  ------------------
  997|     27|    tm.tm_sec -= 1;
  998|     27|    offset -= 1;
  999|     27|    subseconds = detail::femtoseconds::zero();
 1000|     27|  }
 1001|       |
 1002|  4.98k|  if (!saw_year) {
  ------------------
  |  Branch (1002:7): [True: 3.48k, False: 1.49k]
  ------------------
 1003|  3.48k|    year = year_t{tm.tm_year};
 1004|  3.48k|    if (year > kyearmax - 1900) {
  ------------------
  |  Branch (1004:9): [True: 0, False: 3.48k]
  ------------------
 1005|       |      // Platform-dependent, maybe unreachable.
 1006|      0|      if (err != nullptr) *err = "Out-of-range year";
  ------------------
  |  Branch (1006:11): [True: 0, False: 0]
  ------------------
 1007|      0|      return false;
 1008|      0|    }
 1009|  3.48k|    year += 1900;
 1010|  3.48k|  }
 1011|       |
 1012|       |  // Compute year, tm.tm_mon and tm.tm_mday if we parsed a week number.
 1013|  4.98k|  if (week_num != -1) {
  ------------------
  |  Branch (1013:7): [True: 311, False: 4.67k]
  ------------------
 1014|    311|    if (!FromWeek(week_num, week_start, &year, &tm)) {
  ------------------
  |  Branch (1014:9): [True: 2, False: 309]
  ------------------
 1015|      2|      if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1015:11): [True: 0, False: 2]
  ------------------
 1016|      2|      return false;
 1017|      2|    }
 1018|    311|  }
 1019|       |
 1020|  4.98k|  const int month = tm.tm_mon + 1;
 1021|  4.98k|  civil_second cs(year, month, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
 1022|       |
 1023|       |  // parse() should not allow normalization. Due to the restricted field
 1024|       |  // ranges above (see ParseInt()), the only possibility is for days to roll
 1025|       |  // into months. That is, parsing "Sep 31" should not produce "Oct 1".
 1026|  4.98k|  if (cs.month() != month || cs.day() != tm.tm_mday) {
  ------------------
  |  Branch (1026:7): [True: 2, False: 4.97k]
  |  Branch (1026:30): [True: 0, False: 4.97k]
  ------------------
 1027|      2|    if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1027:9): [True: 0, False: 2]
  ------------------
 1028|      2|    return false;
 1029|      2|  }
 1030|       |
 1031|       |  // Accounts for the offset adjustment before converting to absolute time.
 1032|  4.97k|  if ((offset < 0 && cs > civil_second::max() + offset) ||
  ------------------
  |  Branch (1032:7): [True: 1, False: 4.97k]
  |  Branch (1032:8): [True: 102, False: 4.87k]
  |  Branch (1032:22): [True: 0, False: 102]
  ------------------
 1033|  4.97k|      (offset > 0 && cs < civil_second::min() + offset)) {
  ------------------
  |  Branch (1033:8): [True: 79, False: 4.89k]
  |  Branch (1033:22): [True: 1, False: 78]
  ------------------
 1034|      1|    if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1034:9): [True: 0, False: 1]
  ------------------
 1035|      1|    return false;
 1036|      1|  }
 1037|  4.97k|  cs -= offset;
 1038|       |
 1039|  4.97k|  const auto tp = ptz.lookup(cs).pre;
 1040|       |  // Checks for overflow/underflow and returns an error as necessary.
 1041|  4.97k|  if (tp == time_point<seconds>::max()) {
  ------------------
  |  Branch (1041:7): [True: 349, False: 4.62k]
  ------------------
 1042|    349|    const auto al = ptz.lookup(time_point<seconds>::max());
 1043|    349|    if (cs > al.cs) {
  ------------------
  |  Branch (1043:9): [True: 198, False: 151]
  ------------------
 1044|    198|      if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1044:11): [True: 0, False: 198]
  ------------------
 1045|    198|      return false;
 1046|    198|    }
 1047|    349|  }
 1048|  4.77k|  if (tp == time_point<seconds>::min()) {
  ------------------
  |  Branch (1048:7): [True: 298, False: 4.48k]
  ------------------
 1049|    298|    const auto al = ptz.lookup(time_point<seconds>::min());
 1050|    298|    if (cs < al.cs) {
  ------------------
  |  Branch (1050:9): [True: 153, False: 145]
  ------------------
 1051|    153|      if (err != nullptr) *err = "Out-of-range field";
  ------------------
  |  Branch (1051:11): [True: 0, False: 153]
  ------------------
 1052|    153|      return false;
 1053|    153|    }
 1054|    298|  }
 1055|       |
 1056|  4.62k|  *sec = tp;
 1057|  4.62k|  *fs = subseconds;
 1058|  4.62k|  return true;
 1059|  4.77k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_14ToTMERKNS_9time_zone15absolute_lookupE:
  109|  7.80k|std::tm ToTM(const time_zone::absolute_lookup& al) {
  110|  7.80k|  std::tm tm{};
  111|  7.80k|  tm.tm_sec = al.cs.second();
  112|  7.80k|  tm.tm_min = al.cs.minute();
  113|  7.80k|  tm.tm_hour = al.cs.hour();
  114|  7.80k|  tm.tm_mday = al.cs.day();
  115|  7.80k|  tm.tm_mon = al.cs.month() - 1;
  116|       |
  117|       |  // Saturate tm.tm_year in cases of over/underflow.
  118|  7.80k|  if (al.cs.year() < std::numeric_limits<int>::min() + 1900) {
  ------------------
  |  Branch (118:7): [True: 0, False: 7.80k]
  ------------------
  119|      0|    tm.tm_year = std::numeric_limits<int>::min();
  120|  7.80k|  } else if (al.cs.year() - 1900 > std::numeric_limits<int>::max()) {
  ------------------
  |  Branch (120:14): [True: 588, False: 7.21k]
  ------------------
  121|    588|    tm.tm_year = std::numeric_limits<int>::max();
  122|  7.21k|  } else {
  123|  7.21k|    tm.tm_year = static_cast<int>(al.cs.year() - 1900);
  124|  7.21k|  }
  125|       |
  126|  7.80k|  tm.tm_wday = ToTmWday(get_weekday(al.cs));
  127|  7.80k|  tm.tm_yday = get_yearday(al.cs) - 1;
  128|  7.80k|  tm.tm_isdst = al.is_dst ? 1 : 0;
  ------------------
  |  Branch (128:17): [True: 623, False: 7.18k]
  ------------------
  129|  7.80k|  return tm;
  130|  7.80k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18ToTmWdayENS0_7weekdayE:
   68|  7.80k|int ToTmWday(weekday wd) {
   69|  7.80k|  switch (wd) {
  ------------------
  |  Branch (69:11): [True: 7.80k, False: 0]
  ------------------
   70|    466|    case weekday::sunday:
  ------------------
  |  Branch (70:5): [True: 466, False: 7.33k]
  ------------------
   71|    466|      return 0;
   72|    382|    case weekday::monday:
  ------------------
  |  Branch (72:5): [True: 382, False: 7.42k]
  ------------------
   73|    382|      return 1;
   74|  5.26k|    case weekday::tuesday:
  ------------------
  |  Branch (74:5): [True: 5.26k, False: 2.54k]
  ------------------
   75|  5.26k|      return 2;
   76|    427|    case weekday::wednesday:
  ------------------
  |  Branch (76:5): [True: 427, False: 7.37k]
  ------------------
   77|    427|      return 3;
   78|    491|    case weekday::thursday:
  ------------------
  |  Branch (78:5): [True: 491, False: 7.31k]
  ------------------
   79|    491|      return 4;
   80|    356|    case weekday::friday:
  ------------------
  |  Branch (80:5): [True: 356, False: 7.44k]
  ------------------
   81|    356|      return 5;
   82|    420|    case weekday::saturday:
  ------------------
  |  Branch (82:5): [True: 420, False: 7.38k]
  ------------------
   83|    420|      return 6;
   84|  7.80k|  }
   85|      0|  return 0; /*NOTREACHED*/
   86|  7.80k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18FormatTMEPNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEERKS8_RK2tm:
  212|  69.2k|void FormatTM(std::string* out, const std::string& fmt, const std::tm& tm) {
  213|       |  // We assume that 16 times the length of the format string will
  214|       |  // be sufficient to store the result.  The extreme case appears
  215|       |  // to be "%c" (2 chars), which, in the POSIX locale, produces
  216|       |  // "Thu Jan 1 00:00:00 1970" (24 chars).
  217|  69.2k|  auto out_size = out->size();
  218|  69.2k|  auto buf_size = (16 * fmt.size()) + 1;
  219|  69.2k|  out->resize(out_size + buf_size);
  220|  69.2k|  auto len = strftime(&(*out)[out_size], buf_size, fmt.c_str(), &tm);
  221|  69.2k|  out->resize(out_size + len);
  222|  69.2k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18Format64EPcil:
  144|  17.1k|char* Format64(char* ep, int width, std::int_fast64_t v) {
  145|  17.1k|  bool neg = false;
  146|  17.1k|  if (v < 0) {
  ------------------
  |  Branch (146:7): [True: 625, False: 16.5k]
  ------------------
  147|    625|    --width;
  148|    625|    neg = true;
  149|    625|    if (v == std::numeric_limits<std::int_fast64_t>::min()) {
  ------------------
  |  Branch (149:9): [True: 0, False: 625]
  ------------------
  150|       |      // Avoid negating minimum value.
  151|      0|      std::int_fast64_t last_digit = -(v % 10);
  152|      0|      v /= 10;
  153|      0|      if (last_digit < 0) {
  ------------------
  |  Branch (153:11): [True: 0, False: 0]
  ------------------
  154|      0|        ++v;
  155|      0|        last_digit += 10;
  156|      0|      }
  157|      0|      --width;
  158|      0|      *--ep = kDigits[last_digit];
  159|      0|    }
  160|    625|    v = -v;
  161|    625|  }
  162|  50.0k|  do {
  163|  50.0k|    --width;
  164|  50.0k|    *--ep = kDigits[v % 10];
  165|  50.0k|  } while (v /= 10);
  ------------------
  |  Branch (165:12): [True: 32.9k, False: 17.1k]
  ------------------
  166|   156k|  while (--width >= 0) *--ep = '0';  // zero pad
  ------------------
  |  Branch (166:10): [True: 139k, False: 17.1k]
  ------------------
  167|  17.1k|  if (neg) *--ep = '-';
  ------------------
  |  Branch (167:7): [True: 625, False: 16.5k]
  ------------------
  168|  17.1k|  return ep;
  169|  17.1k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_19Format02dEPci:
  172|  57.8k|char* Format02d(char* ep, int v) {
  173|  57.8k|  *--ep = kDigits[v % 10];
  174|  57.8k|  *--ep = kDigits[(v / 10) % 10];
  175|  57.8k|  return ep;
  176|  57.8k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_16ToWeekERKNS0_10civil_timeINS0_7day_tagEEENS0_7weekdayE:
  134|  2.74k|int ToWeek(const civil_day& cd, weekday week_start) {
  135|  2.74k|  const civil_day d(cd.year() % 400, cd.month(), cd.day());
  136|  2.74k|  return static_cast<int>((d - prev_weekday(civil_year(d), week_start)) / 7);
  137|  2.74k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_112FormatOffsetEPciPKc:
  179|  22.3k|char* FormatOffset(char* ep, int offset, const char* mode) {
  180|       |  // TODO: Follow the RFC3339 "Unknown Local Offset Convention" and
  181|       |  // generate a "negative zero" when we're formatting a zero offset
  182|       |  // as the result of a failed load_time_zone().
  183|  22.3k|  char sign = '+';
  184|  22.3k|  if (offset < 0) {
  ------------------
  |  Branch (184:7): [True: 3.93k, False: 18.4k]
  ------------------
  185|  3.93k|    offset = -offset;  // bounded by 24h so no overflow
  186|  3.93k|    sign = '-';
  187|  3.93k|  }
  188|  22.3k|  const int seconds = offset % 60;
  189|  22.3k|  const int minutes = (offset /= 60) % 60;
  190|  22.3k|  const int hours = offset /= 60;
  191|  22.3k|  const char sep = mode[0];
  192|  22.3k|  const bool ext = (sep != '\0' && mode[1] == '*');
  ------------------
  |  Branch (192:21): [True: 18.4k, False: 3.94k]
  |  Branch (192:36): [True: 8.14k, False: 10.2k]
  ------------------
  193|  22.3k|  const bool ccc = (ext && mode[2] == ':');
  ------------------
  |  Branch (193:21): [True: 8.14k, False: 14.2k]
  |  Branch (193:28): [True: 3.16k, False: 4.98k]
  ------------------
  194|  22.3k|  if (ext && (!ccc || seconds != 0)) {
  ------------------
  |  Branch (194:7): [True: 8.14k, False: 14.2k]
  |  Branch (194:15): [True: 4.98k, False: 3.16k]
  |  Branch (194:23): [True: 555, False: 2.60k]
  ------------------
  195|  5.54k|    ep = Format02d(ep, seconds);
  196|  5.54k|    *--ep = sep;
  197|  16.8k|  } else {
  198|       |    // If we're not rendering seconds, sub-minute negative offsets
  199|       |    // should get a positive sign (e.g., offset=-10s => "+00:00").
  200|  16.8k|    if (hours == 0 && minutes == 0) sign = '+';
  ------------------
  |  Branch (200:9): [True: 11.7k, False: 5.07k]
  |  Branch (200:23): [True: 10.6k, False: 1.06k]
  ------------------
  201|  16.8k|  }
  202|  22.3k|  if (!ccc || minutes != 0 || seconds != 0) {
  ------------------
  |  Branch (202:7): [True: 19.2k, False: 3.16k]
  |  Branch (202:15): [True: 559, False: 2.60k]
  |  Branch (202:31): [True: 204, False: 2.39k]
  ------------------
  203|  19.9k|    ep = Format02d(ep, minutes);
  204|  19.9k|    if (sep != '\0') *--ep = sep;
  ------------------
  |  Branch (204:9): [True: 16.0k, False: 3.94k]
  ------------------
  205|  19.9k|  }
  206|  22.3k|  ep = Format02d(ep, hours);
  207|  22.3k|  *--ep = sign;
  208|  22.3k|  return ep;
  209|  22.3k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_111ParseOffsetEPKcS3_Pi:
  581|  7.66k|const char* ParseOffset(const char* dp, const char* mode, int* offset) {
  582|  7.66k|  if (dp != nullptr) {
  ------------------
  |  Branch (582:7): [True: 7.66k, False: 0]
  ------------------
  583|  7.66k|    const char first = *dp++;
  584|  7.66k|    if (first == '+' || first == '-') {
  ------------------
  |  Branch (584:9): [True: 1.93k, False: 5.73k]
  |  Branch (584:25): [True: 4.23k, False: 1.49k]
  ------------------
  585|  6.16k|      char sep = mode[0];
  586|  6.16k|      int hours = 0;
  587|  6.16k|      int minutes = 0;
  588|  6.16k|      int seconds = 0;
  589|  6.16k|      const char* ap = ParseInt(dp, 2, 0, 23, &hours);
  590|  6.16k|      if (ap != nullptr && ap - dp == 2) {
  ------------------
  |  Branch (590:11): [True: 6.14k, False: 27]
  |  Branch (590:28): [True: 6.12k, False: 11]
  ------------------
  591|  6.12k|        dp = ap;
  592|  6.12k|        if (sep != '\0' && *ap == sep) ++ap;
  ------------------
  |  Branch (592:13): [True: 3.78k, False: 2.34k]
  |  Branch (592:28): [True: 9, False: 3.77k]
  ------------------
  593|  6.12k|        const char* bp = ParseInt(ap, 2, 0, 59, &minutes);
  594|  6.12k|        if (bp != nullptr && bp - ap == 2) {
  ------------------
  |  Branch (594:13): [True: 3.87k, False: 2.25k]
  |  Branch (594:30): [True: 2.81k, False: 1.06k]
  ------------------
  595|  2.81k|          dp = bp;
  596|  2.81k|          if (sep != '\0' && *bp == sep) ++bp;
  ------------------
  |  Branch (596:15): [True: 1.71k, False: 1.09k]
  |  Branch (596:30): [True: 10, False: 1.70k]
  ------------------
  597|  2.81k|          const char* cp = ParseInt(bp, 2, 0, 59, &seconds);
  598|  2.81k|          if (cp != nullptr && cp - bp == 2) dp = cp;
  ------------------
  |  Branch (598:15): [True: 1.24k, False: 1.56k]
  |  Branch (598:32): [True: 798, False: 450]
  ------------------
  599|  2.81k|        }
  600|  6.12k|        *offset = ((hours * 60 + minutes) * 60) + seconds;
  601|  6.12k|        if (first == '-') *offset = -*offset;
  ------------------
  |  Branch (601:13): [True: 4.21k, False: 1.91k]
  ------------------
  602|  6.12k|      } else {
  603|     38|        dp = nullptr;
  604|     38|      }
  605|  6.16k|    } else if (first == 'Z' || first == 'z') {  // Zulu
  ------------------
  |  Branch (605:16): [True: 411, False: 1.08k]
  |  Branch (605:32): [True: 1.03k, False: 54]
  ------------------
  606|  1.44k|      *offset = 0;
  607|  1.44k|    } else {
  608|     54|      dp = nullptr;
  609|     54|    }
  610|  7.66k|  }
  611|  7.66k|  return dp;
  612|  7.66k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_19ParseZoneEPKcPNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  614|    692|const char* ParseZone(const char* dp, std::string* zone) {
  615|    692|  zone->clear();
  616|    692|  if (dp != nullptr) {
  ------------------
  |  Branch (616:7): [True: 692, False: 0]
  ------------------
  617|  1.95M|    while (*dp != '\0' && !std::isspace(*dp)) zone->push_back(*dp++);
  ------------------
  |  Branch (617:12): [True: 1.95M, False: 129]
  |  Branch (617:27): [True: 1.95M, False: 563]
  ------------------
  618|    692|    if (zone->empty()) dp = nullptr;
  ------------------
  |  Branch (618:9): [True: 20, False: 672]
  ------------------
  619|    692|  }
  620|    692|  return dp;
  621|    692|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_115ParseSubSecondsEPKcPNSt3__16chrono8durationIlNS4_5ratioILl1ELl1000000000000000EEEEE:
  623|  1.97k|const char* ParseSubSeconds(const char* dp, detail::femtoseconds* subseconds) {
  624|  1.97k|  if (dp != nullptr) {
  ------------------
  |  Branch (624:7): [True: 1.97k, False: 0]
  ------------------
  625|  1.97k|    std::int_fast64_t v = 0;
  626|  1.97k|    std::int_fast64_t exp = 0;
  627|  1.97k|    const char* const bp = dp;
  628|  5.31k|    while (const char* cp = strchr(kDigits, *dp)) {
  ------------------
  |  Branch (628:24): [True: 3.38k, False: 1.92k]
  ------------------
  629|  3.38k|      int d = static_cast<int>(cp - kDigits);
  630|  3.38k|      if (d >= 10) break;
  ------------------
  |  Branch (630:11): [True: 48, False: 3.34k]
  ------------------
  631|  3.34k|      if (exp < 15) {
  ------------------
  |  Branch (631:11): [True: 3.01k, False: 328]
  ------------------
  632|  3.01k|        exp += 1;
  633|  3.01k|        v *= 10;
  634|  3.01k|        v += d;
  635|  3.01k|      }
  636|  3.34k|      ++dp;
  637|  3.34k|    }
  638|  1.97k|    if (dp != bp) {
  ------------------
  |  Branch (638:9): [True: 1.96k, False: 8]
  ------------------
  639|  1.96k|      v *= kExp10[15 - exp];
  640|  1.96k|      *subseconds = detail::femtoseconds(v);
  641|  1.96k|    } else {
  642|      8|      dp = nullptr;
  643|      8|    }
  644|  1.97k|  }
  645|  1.97k|  return dp;
  646|  1.97k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_17ParseTMEPKcS3_P2tm:
  649|  1.18k|const char* ParseTM(const char* dp, const char* fmt, std::tm* tm) {
  650|  1.18k|  if (dp != nullptr) {
  ------------------
  |  Branch (650:7): [True: 1.18k, False: 0]
  ------------------
  651|  1.18k|    dp = strptime(dp, fmt, tm);
  652|  1.18k|  }
  653|  1.18k|  return dp;
  654|  1.18k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18FromWeekEiNS0_7weekdayEPlP2tm:
  659|    311|bool FromWeek(int week_num, weekday week_start, year_t* year, std::tm* tm) {
  660|    311|  const civil_year y(*year % 400);
  661|    311|  civil_day cd = prev_weekday(y, week_start);  // week 0
  662|    311|  cd = next_weekday(cd - 1, FromTmWday(tm->tm_wday)) + (week_num * 7);
  663|    311|  if (const year_t shift = cd.year() - y.year()) {
  ------------------
  |  Branch (663:20): [True: 194, False: 117]
  ------------------
  664|    194|    if (shift > 0) {
  ------------------
  |  Branch (664:9): [True: 60, False: 134]
  ------------------
  665|     60|      if (*year > std::numeric_limits<year_t>::max() - shift) return false;
  ------------------
  |  Branch (665:11): [True: 1, False: 59]
  ------------------
  666|    134|    } else {
  667|    134|      if (*year < std::numeric_limits<year_t>::min() - shift) return false;
  ------------------
  |  Branch (667:11): [True: 1, False: 133]
  ------------------
  668|    134|    }
  669|    192|    *year += shift;
  670|    192|  }
  671|    309|  tm->tm_mon = cd.month() - 1;
  672|    309|  tm->tm_mday = cd.day();
  673|    309|  return true;
  674|    311|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_110FromTmWdayEi:
   89|    311|weekday FromTmWday(int tm_wday) {
   90|    311|  switch (tm_wday) {
  ------------------
  |  Branch (90:11): [True: 311, False: 0]
  ------------------
   91|      9|    case 0:
  ------------------
  |  Branch (91:5): [True: 9, False: 302]
  ------------------
   92|      9|      return weekday::sunday;
   93|      6|    case 1:
  ------------------
  |  Branch (93:5): [True: 6, False: 305]
  ------------------
   94|      6|      return weekday::monday;
   95|      1|    case 2:
  ------------------
  |  Branch (95:5): [True: 1, False: 310]
  ------------------
   96|      1|      return weekday::tuesday;
   97|      8|    case 3:
  ------------------
  |  Branch (97:5): [True: 8, False: 303]
  ------------------
   98|      8|      return weekday::wednesday;
   99|    276|    case 4:
  ------------------
  |  Branch (99:5): [True: 276, False: 35]
  ------------------
  100|    276|      return weekday::thursday;
  101|      3|    case 5:
  ------------------
  |  Branch (101:5): [True: 3, False: 308]
  ------------------
  102|      3|      return weekday::friday;
  103|      8|    case 6:
  ------------------
  |  Branch (103:5): [True: 8, False: 303]
  ------------------
  104|      8|      return weekday::saturday;
  105|    311|  }
  106|      0|  return weekday::sunday; /*NOTREACHED*/
  107|    311|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18ParseIntIiEEPKcS4_iT_S5_PS5_:
  226|  44.4k|const char* ParseInt(const char* dp, int width, T min, T max, T* vp) {
  227|  44.4k|  if (dp != nullptr) {
  ------------------
  |  Branch (227:7): [True: 43.5k, False: 853]
  ------------------
  228|  43.5k|    const T kmin = std::numeric_limits<T>::min();
  229|  43.5k|    bool erange = false;
  230|  43.5k|    bool neg = false;
  231|  43.5k|    T value = 0;
  232|  43.5k|    if (*dp == '-') {
  ------------------
  |  Branch (232:9): [True: 2.43k, False: 41.1k]
  ------------------
  233|  2.43k|      neg = true;
  234|  2.43k|      if (width <= 0 || --width != 0) {
  ------------------
  |  Branch (234:11): [True: 196, False: 2.23k]
  |  Branch (234:25): [True: 2.23k, False: 0]
  ------------------
  235|  2.43k|        ++dp;
  236|  2.43k|      } else {
  237|      0|        dp = nullptr;  // width was 1
  238|      0|      }
  239|  2.43k|    }
  240|  43.5k|    if (const char* const bp = dp) {
  ------------------
  |  Branch (240:27): [True: 43.5k, False: 0]
  ------------------
  241|   192k|      while (const char* cp = strchr(kDigits, *dp)) {
  ------------------
  |  Branch (241:26): [True: 170k, False: 22.1k]
  ------------------
  242|   170k|        int d = static_cast<int>(cp - kDigits);
  243|   170k|        if (d >= 10) break;
  ------------------
  |  Branch (243:13): [True: 1.66k, False: 169k]
  ------------------
  244|   169k|        if (value < kmin / 10) {
  ------------------
  |  Branch (244:13): [True: 3.06k, False: 166k]
  ------------------
  245|  3.06k|          erange = true;
  246|  3.06k|          break;
  247|  3.06k|        }
  248|   166k|        value *= 10;
  249|   166k|        if (value < kmin + d) {
  ------------------
  |  Branch (249:13): [True: 1.03k, False: 165k]
  ------------------
  250|  1.03k|          erange = true;
  251|  1.03k|          break;
  252|  1.03k|        }
  253|   165k|        value -= d;
  254|   165k|        dp += 1;
  255|   165k|        if (width > 0 && --width == 0) break;
  ------------------
  |  Branch (255:13): [True: 32.6k, False: 132k]
  |  Branch (255:26): [True: 15.6k, False: 17.0k]
  ------------------
  256|   165k|      }
  257|  43.5k|      if (dp != bp && !erange && (neg || value != kmin)) {
  ------------------
  |  Branch (257:11): [True: 41.9k, False: 1.58k]
  |  Branch (257:23): [True: 37.8k, False: 4.10k]
  |  Branch (257:35): [True: 2.40k, False: 35.4k]
  |  Branch (257:42): [True: 32.7k, False: 2.74k]
  ------------------
  258|  35.1k|        if (!neg || value != 0) {
  ------------------
  |  Branch (258:13): [True: 32.7k, False: 2.40k]
  |  Branch (258:21): [True: 801, False: 1.60k]
  ------------------
  259|  33.5k|          if (!neg) value = -value;  // make positive
  ------------------
  |  Branch (259:15): [True: 32.7k, False: 801]
  ------------------
  260|  33.5k|          if (min <= value && value <= max) {
  ------------------
  |  Branch (260:15): [True: 32.7k, False: 810]
  |  Branch (260:31): [True: 25.8k, False: 6.91k]
  ------------------
  261|  25.8k|            *vp = value;
  262|  25.8k|          } else {
  263|  7.72k|            dp = nullptr;
  264|  7.72k|          }
  265|  33.5k|        } else {
  266|  1.60k|          dp = nullptr;
  267|  1.60k|        }
  268|  35.1k|      } else {
  269|  8.42k|        dp = nullptr;
  270|  8.42k|      }
  271|  43.5k|    }
  272|  43.5k|  }
  273|  44.4k|  return dp;
  274|  44.4k|}
time_zone_format.cc:_ZN4cctz6detail12_GLOBAL__N_18ParseIntIlEEPKcS4_iT_S5_PS5_:
  226|  3.11k|const char* ParseInt(const char* dp, int width, T min, T max, T* vp) {
  227|  3.11k|  if (dp != nullptr) {
  ------------------
  |  Branch (227:7): [True: 3.11k, False: 0]
  ------------------
  228|  3.11k|    const T kmin = std::numeric_limits<T>::min();
  229|  3.11k|    bool erange = false;
  230|  3.11k|    bool neg = false;
  231|  3.11k|    T value = 0;
  232|  3.11k|    if (*dp == '-') {
  ------------------
  |  Branch (232:9): [True: 1.42k, False: 1.69k]
  ------------------
  233|  1.42k|      neg = true;
  234|  1.42k|      if (width <= 0 || --width != 0) {
  ------------------
  |  Branch (234:11): [True: 1.39k, False: 33]
  |  Branch (234:25): [True: 33, False: 0]
  ------------------
  235|  1.42k|        ++dp;
  236|  1.42k|      } else {
  237|      0|        dp = nullptr;  // width was 1
  238|      0|      }
  239|  1.42k|    }
  240|  3.11k|    if (const char* const bp = dp) {
  ------------------
  |  Branch (240:27): [True: 3.11k, False: 0]
  ------------------
  241|  30.5k|      while (const char* cp = strchr(kDigits, *dp)) {
  ------------------
  |  Branch (241:26): [True: 29.7k, False: 762]
  ------------------
  242|  29.7k|        int d = static_cast<int>(cp - kDigits);
  243|  29.7k|        if (d >= 10) break;
  ------------------
  |  Branch (243:13): [True: 2.03k, False: 27.7k]
  ------------------
  244|  27.7k|        if (value < kmin / 10) {
  ------------------
  |  Branch (244:13): [True: 162, False: 27.5k]
  ------------------
  245|    162|          erange = true;
  246|    162|          break;
  247|    162|        }
  248|  27.5k|        value *= 10;
  249|  27.5k|        if (value < kmin + d) {
  ------------------
  |  Branch (249:13): [True: 3, False: 27.5k]
  ------------------
  250|      3|          erange = true;
  251|      3|          break;
  252|      3|        }
  253|  27.5k|        value -= d;
  254|  27.5k|        dp += 1;
  255|  27.5k|        if (width > 0 && --width == 0) break;
  ------------------
  |  Branch (255:13): [True: 688, False: 26.9k]
  |  Branch (255:26): [True: 159, False: 529]
  ------------------
  256|  27.5k|      }
  257|  3.11k|      if (dp != bp && !erange && (neg || value != kmin)) {
  ------------------
  |  Branch (257:11): [True: 3.04k, False: 75]
  |  Branch (257:23): [True: 2.87k, False: 165]
  |  Branch (257:35): [True: 1.41k, False: 1.46k]
  |  Branch (257:42): [True: 1.46k, False: 3]
  ------------------
  258|  2.87k|        if (!neg || value != 0) {
  ------------------
  |  Branch (258:13): [True: 1.46k, False: 1.41k]
  |  Branch (258:21): [True: 1.41k, False: 4]
  ------------------
  259|  2.87k|          if (!neg) value = -value;  // make positive
  ------------------
  |  Branch (259:15): [True: 1.46k, False: 1.41k]
  ------------------
  260|  2.87k|          if (min <= value && value <= max) {
  ------------------
  |  Branch (260:15): [True: 2.87k, False: 0]
  |  Branch (260:31): [True: 2.87k, False: 0]
  ------------------
  261|  2.87k|            *vp = value;
  262|  2.87k|          } else {
  263|      0|            dp = nullptr;
  264|      0|          }
  265|  2.87k|        } else {
  266|      4|          dp = nullptr;
  267|      4|        }
  268|  2.87k|      } else {
  269|    243|        dp = nullptr;
  270|    243|      }
  271|  3.11k|    }
  272|  3.11k|  }
  273|  3.11k|  return dp;
  274|  3.11k|}

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

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

_ZN4cctz9time_zone4Impl3UTCEv:
   45|    187|time_zone time_zone::Impl::UTC() {
   46|    187|  return time_zone(UTCImpl());
   47|    187|}
_ZN4cctz9time_zone4Impl12LoadTimeZoneERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEPS0_:
   49|  8.19k|bool time_zone::Impl::LoadTimeZone(const std::string& name, time_zone* tz) {
   50|  8.19k|  const Impl* const utc_impl = UTCImpl();
   51|       |
   52|       |  // Check for UTC (which is never a key in time_zone_map).
   53|  8.19k|  auto offset = seconds::zero();
   54|  8.19k|  if (FixedOffsetFromName(name, &offset) && offset == seconds::zero()) {
  ------------------
  |  Branch (54:7): [True: 1.63k, False: 6.56k]
  |  Branch (54:7): [True: 1.28k, False: 6.91k]
  |  Branch (54:45): [True: 1.28k, False: 353]
  ------------------
   55|  1.28k|    *tz = time_zone(utc_impl);
   56|  1.28k|    return true;
   57|  1.28k|  }
   58|       |
   59|       |  // Check whether the time zone has already been loaded.
   60|  6.91k|  {
   61|  6.91k|    std::lock_guard<std::mutex> lock(TimeZoneMutex());
   62|  6.91k|    if (time_zone_map != nullptr) {
  ------------------
  |  Branch (62:9): [True: 6.91k, False: 1]
  ------------------
   63|  6.91k|      TimeZoneImplByName::const_iterator itr = time_zone_map->find(name);
   64|  6.91k|      if (itr != time_zone_map->end()) {
  ------------------
  |  Branch (64:11): [True: 5.99k, False: 922]
  ------------------
   65|  5.99k|        *tz = time_zone(itr->second);
   66|  5.99k|        return itr->second != utc_impl;
   67|  5.99k|      }
   68|  6.91k|    }
   69|  6.91k|  }
   70|       |
   71|       |  // Load the new time zone (outside the lock).
   72|    923|  std::unique_ptr<const Impl> new_impl(new Impl(name));
   73|       |
   74|       |  // Add the new time zone to the map.
   75|    923|  std::lock_guard<std::mutex> lock(TimeZoneMutex());
   76|    923|  if (time_zone_map == nullptr) time_zone_map = new TimeZoneImplByName;
  ------------------
  |  Branch (76:7): [True: 1, False: 922]
  ------------------
   77|    923|  const Impl*& impl = (*time_zone_map)[name];
   78|    923|  if (impl == nullptr) {  // this thread won any load race
  ------------------
  |  Branch (78:7): [True: 923, False: 0]
  ------------------
   79|    923|    impl = new_impl->zone_ ? new_impl.release() : utc_impl;
  ------------------
  |  Branch (79:12): [True: 544, False: 379]
  ------------------
   80|    923|  }
   81|    923|  *tz = time_zone(impl);
   82|    923|  return impl != utc_impl;
   83|  6.91k|}
_ZN4cctz9time_zone4ImplC2Ev:
  100|      1|time_zone::Impl::Impl() : name_("UTC"), zone_(TimeZoneIf::UTC()) {}
_ZN4cctz9time_zone4ImplC2ERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  103|    923|    : name_(name), zone_(TimeZoneIf::Make(name_)) {}
_ZN4cctz9time_zone4Impl7UTCImplEv:
  105|  8.38k|const time_zone::Impl* time_zone::Impl::UTCImpl() {
  106|  8.38k|  static const Impl* utc_impl = new Impl;
  107|  8.38k|  return utc_impl;
  108|  8.38k|}
time_zone_impl.cc:_ZN4cctz12_GLOBAL__N_113TimeZoneMutexEv:
   36|  7.83k|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|  7.83k|  static std::mutex* time_zone_mutex = new std::mutex;
   40|  7.83k|  return *time_zone_mutex;
   41|  7.83k|}

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

_ZN4cctz12TimeZoneInfo17GetTransitionTypeElbRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPh:
  263|    125|                                     std::uint_least8_t* index) {
  264|    125|  std::size_t type_index = 0;
  265|    125|  std::size_t abbr_index = abbreviations_.size();
  266|    199|  for (; type_index != transition_types_.size(); ++type_index) {
  ------------------
  |  Branch (266:10): [True: 199, False: 0]
  ------------------
  267|    199|    const TransitionType& tt(transition_types_[type_index]);
  268|    199|    const char* tt_abbr = &abbreviations_[tt.abbr_index];
  269|    199|    if (tt_abbr == abbr) abbr_index = tt.abbr_index;
  ------------------
  |  Branch (269:9): [True: 125, False: 74]
  ------------------
  270|    199|    if (tt.utc_offset == utc_offset && tt.is_dst == is_dst) {
  ------------------
  |  Branch (270:9): [True: 134, False: 65]
  |  Branch (270:40): [True: 131, False: 3]
  ------------------
  271|    131|      if (abbr_index == tt.abbr_index) break;  // reuse
  ------------------
  |  Branch (271:11): [True: 125, False: 6]
  ------------------
  272|    131|    }
  273|    199|  }
  274|    125|  if (type_index > 255 || abbr_index > 255) {
  ------------------
  |  Branch (274:7): [True: 0, False: 125]
  |  Branch (274:27): [True: 0, False: 125]
  ------------------
  275|       |    // No index space (8 bits) available for a new type or abbreviation.
  276|      0|    return false;
  277|      0|  }
  278|    125|  if (type_index == transition_types_.size()) {
  ------------------
  |  Branch (278:7): [True: 0, False: 125]
  ------------------
  279|      0|    TransitionType& tt(*transition_types_.emplace(transition_types_.end()));
  280|      0|    tt.utc_offset = static_cast<std::int_least32_t>(utc_offset);
  281|      0|    tt.is_dst = is_dst;
  282|      0|    if (abbr_index == abbreviations_.size()) {
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|      abbreviations_.append(abbr);
  284|      0|      abbreviations_.append(1, '\0');
  285|      0|    }
  286|      0|    tt.abbr_index = static_cast<std::uint_least8_t>(abbr_index);
  287|      0|  }
  288|    125|  *index = static_cast<std::uint_least8_t>(type_index);
  289|    125|  return true;
  290|    125|}
_ZNK4cctz12TimeZoneInfo16EquivTransitionsEhh:
  296|     49|                                    std::uint_fast8_t tt2_index) const {
  297|     49|  if (tt1_index == tt2_index) return true;
  ------------------
  |  Branch (297:7): [True: 49, False: 0]
  ------------------
  298|      0|  const TransitionType& tt1(transition_types_[tt1_index]);
  299|      0|  const TransitionType& tt2(transition_types_[tt2_index]);
  300|      0|  if (tt1.utc_offset != tt2.utc_offset) return false;
  ------------------
  |  Branch (300:7): [True: 0, False: 0]
  ------------------
  301|      0|  if (tt1.is_dst != tt2.is_dst) return false;
  ------------------
  |  Branch (301:7): [True: 0, False: 0]
  ------------------
  302|      0|  if (tt1.abbr_index != tt2.abbr_index) return false;
  ------------------
  |  Branch (302:7): [True: 0, False: 0]
  ------------------
  303|      0|  return true;
  304|      0|}
_ZN4cctz12TimeZoneInfo17ExtendTransitionsEv:
  308|     87|bool TimeZoneInfo::ExtendTransitions() {
  309|     87|  extended_ = false;
  310|     87|  if (future_spec_.empty()) return true;  // last transition prevails
  ------------------
  |  Branch (310:7): [True: 0, False: 87]
  ------------------
  311|       |
  312|     87|  PosixTimeZone posix;
  313|     87|  if (!ParsePosixSpec(future_spec_, &posix)) return false;
  ------------------
  |  Branch (313:7): [True: 0, False: 87]
  ------------------
  314|       |
  315|       |  // Find transition type for the future std specification.
  316|     87|  std::uint_least8_t std_ti;
  317|     87|  if (!GetTransitionType(posix.std_offset, false, posix.std_abbr, &std_ti))
  ------------------
  |  Branch (317:7): [True: 0, False: 87]
  ------------------
  318|      0|    return false;
  319|       |
  320|     87|  if (posix.dst_abbr.empty()) {  // std only
  ------------------
  |  Branch (320:7): [True: 49, False: 38]
  ------------------
  321|       |    // The future specification should match the last transition, and
  322|       |    // that means that handling the future will fall out naturally.
  323|     49|    return EquivTransitions(transitions_.back().type_index, std_ti);
  324|     49|  }
  325|       |
  326|       |  // Find transition type for the future dst specification.
  327|     38|  std::uint_least8_t dst_ti;
  328|     38|  if (!GetTransitionType(posix.dst_offset, true, posix.dst_abbr, &dst_ti))
  ------------------
  |  Branch (328:7): [True: 0, False: 38]
  ------------------
  329|      0|    return false;
  330|       |
  331|     38|  if (AllYearDST(posix)) {  // dst only
  ------------------
  |  Branch (331:7): [True: 0, False: 38]
  ------------------
  332|       |    // The future specification should match the last transition, and
  333|       |    // that means that handling the future will fall out naturally.
  334|      0|    return EquivTransitions(transitions_.back().type_index, dst_ti);
  335|      0|  }
  336|       |
  337|       |  // Extend the transitions for an additional 401 years using the future
  338|       |  // specification. Years beyond those can be handled by mapping back to
  339|       |  // a cycle-equivalent year within that range. Note that we need 401
  340|       |  // (well, at least the first transition in the 401st year) so that the
  341|       |  // end of the 400th year is mapped back to an extended year. And first
  342|       |  // we may also need two additional transitions for the current year.
  343|     38|  transitions_.reserve(transitions_.size() + 2 + 401 * 2);
  344|     38|  extended_ = true;
  345|       |
  346|     38|  const Transition& last(transitions_.back());
  347|     38|  const std::int_fast64_t last_time = last.unix_time;
  348|     38|  const TransitionType& last_tt(transition_types_[last.type_index]);
  349|     38|  last_year_ = LocalTime(last_time, last_tt).cs.year();
  350|     38|  bool leap_year = IsLeap(last_year_);
  351|     38|  const civil_second jan1(last_year_);
  352|     38|  std::int_fast64_t jan1_time = jan1 - civil_second();
  353|     38|  int jan1_weekday = ToPosixWeekday(get_weekday(jan1));
  354|       |
  355|     38|  Transition dst = {0, dst_ti, civil_second(), civil_second()};
  356|     38|  Transition std = {0, std_ti, civil_second(), civil_second()};
  357|  15.2k|  for (const year_t limit = last_year_ + 401;; ++last_year_) {
  358|  15.2k|    auto dst_trans_off = TransOffset(leap_year, jan1_weekday, posix.dst_start);
  359|  15.2k|    auto std_trans_off = TransOffset(leap_year, jan1_weekday, posix.dst_end);
  360|  15.2k|    dst.unix_time = jan1_time + dst_trans_off - posix.std_offset;
  361|  15.2k|    std.unix_time = jan1_time + std_trans_off - posix.dst_offset;
  362|  15.2k|    const auto* ta = dst.unix_time < std.unix_time ? &dst : &std;
  ------------------
  |  Branch (362:22): [True: 15.2k, False: 0]
  ------------------
  363|  15.2k|    const auto* tb = dst.unix_time < std.unix_time ? &std : &dst;
  ------------------
  |  Branch (363:22): [True: 15.2k, False: 0]
  ------------------
  364|  15.2k|    if (last_time < tb->unix_time) {
  ------------------
  |  Branch (364:9): [True: 15.2k, False: 38]
  ------------------
  365|  15.2k|      if (last_time < ta->unix_time) transitions_.push_back(*ta);
  ------------------
  |  Branch (365:11): [True: 15.2k, False: 0]
  ------------------
  366|  15.2k|      transitions_.push_back(*tb);
  367|  15.2k|    }
  368|  15.2k|    if (last_year_ == limit) break;
  ------------------
  |  Branch (368:9): [True: 38, False: 15.2k]
  ------------------
  369|  15.2k|    jan1_time += kSecsPerYear[leap_year];
  370|  15.2k|    jan1_weekday = (jan1_weekday + kDaysPerYear[leap_year]) % 7;
  371|  15.2k|    leap_year = !leap_year && IsLeap(last_year_ + 1);
  ------------------
  |  Branch (371:17): [True: 11.5k, False: 3.68k]
  |  Branch (371:31): [True: 3.68k, False: 7.86k]
  ------------------
  372|  15.2k|  }
  373|       |
  374|     38|  return true;
  375|     38|}
_ZN4cctz12TimeZoneInfo17ResetToBuiltinUTCERKNSt3__16chrono8durationIlNS1_5ratioILl1ELl1EEEEE:
  583|    270|bool TimeZoneInfo::ResetToBuiltinUTC(const seconds& offset) {
  584|    270|  transition_types_.resize(1);
  585|    270|  TransitionType& tt(transition_types_.back());
  586|    270|  tt.utc_offset = static_cast<std::int_least32_t>(offset.count());
  587|    270|  tt.is_dst = false;
  588|    270|  tt.abbr_index = 0;
  589|       |
  590|       |  // We temporarily add some redundant, contemporary (2015 through 2025)
  591|       |  // transitions for performance reasons.  See TimeZoneInfo::LocalTime().
  592|       |  // TODO: Fix the performance issue and remove the extra transitions.
  593|    270|  transitions_.clear();
  594|    270|  transitions_.reserve(12);
  595|    270|  for (const std::int_fast64_t unix_time : {
  ------------------
  |  Branch (595:42): [True: 3.24k, False: 270]
  ------------------
  596|    270|           -(1LL << 59),  // a "first half" transition
  597|    270|           1420070400LL,  // 2015-01-01T00:00:00+00:00
  598|    270|           1451606400LL,  // 2016-01-01T00:00:00+00:00
  599|    270|           1483228800LL,  // 2017-01-01T00:00:00+00:00
  600|    270|           1514764800LL,  // 2018-01-01T00:00:00+00:00
  601|    270|           1546300800LL,  // 2019-01-01T00:00:00+00:00
  602|    270|           1577836800LL,  // 2020-01-01T00:00:00+00:00
  603|    270|           1609459200LL,  // 2021-01-01T00:00:00+00:00
  604|    270|           1640995200LL,  // 2022-01-01T00:00:00+00:00
  605|    270|           1672531200LL,  // 2023-01-01T00:00:00+00:00
  606|    270|           1704067200LL,  // 2024-01-01T00:00:00+00:00
  607|    270|           1735689600LL,  // 2025-01-01T00:00:00+00:00
  608|  3.24k|       }) {
  609|  3.24k|    Transition& tr(*transitions_.emplace(transitions_.end()));
  610|  3.24k|    tr.unix_time = unix_time;
  611|  3.24k|    tr.type_index = 0;
  612|  3.24k|    tr.civil_sec = LocalTime(tr.unix_time, tt).cs;
  613|  3.24k|    tr.prev_civil_sec = tr.civil_sec - 1;
  614|  3.24k|  }
  615|       |
  616|    270|  default_transition_type_ = 0;
  617|    270|  abbreviations_ = FixedOffsetToAbbr(offset);
  618|    270|  abbreviations_.append(1, '\0');
  619|    270|  future_spec_.clear();  // never needed for a fixed-offset zone
  620|    270|  extended_ = false;
  621|       |
  622|    270|  tt.civil_max = LocalTime(seconds::max().count(), tt).cs;
  623|    270|  tt.civil_min = LocalTime(seconds::min().count(), tt).cs;
  624|       |
  625|    270|  transitions_.shrink_to_fit();
  626|    270|  return true;
  627|    270|}
_ZN4cctz12TimeZoneInfo4LoadEPNS_14ZoneInfoSourceE:
  629|    108|bool TimeZoneInfo::Load(ZoneInfoSource* zip) {
  630|       |  // Read and validate the header.
  631|    108|  tzhead tzh;
  632|    108|  if (zip->Read(&tzh, sizeof(tzh)) != sizeof(tzh))
  ------------------
  |  Branch (632:7): [True: 20, False: 88]
  ------------------
  633|     20|    return false;
  634|     88|  if (strncmp(tzh.tzh_magic, TZ_MAGIC, sizeof(tzh.tzh_magic)) != 0)
  ------------------
  |  |   27|     88|#define TZ_MAGIC "TZif"
  ------------------
  |  Branch (634:7): [True: 1, False: 87]
  ------------------
  635|      1|    return false;
  636|     87|  Header hdr;
  637|     87|  if (!hdr.Build(tzh))
  ------------------
  |  Branch (637:7): [True: 0, False: 87]
  ------------------
  638|      0|    return false;
  639|     87|  std::size_t time_len = 4;
  640|     87|  if (tzh.tzh_version[0] != '\0') {
  ------------------
  |  Branch (640:7): [True: 87, False: 0]
  ------------------
  641|       |    // Skip the 4-byte data.
  642|     87|    if (zip->Skip(hdr.DataLength(time_len)) != 0)
  ------------------
  |  Branch (642:9): [True: 0, False: 87]
  ------------------
  643|      0|      return false;
  644|       |    // Read and validate the header for the 8-byte data.
  645|     87|    if (zip->Read(&tzh, sizeof(tzh)) != sizeof(tzh))
  ------------------
  |  Branch (645:9): [True: 0, False: 87]
  ------------------
  646|      0|      return false;
  647|     87|    if (strncmp(tzh.tzh_magic, TZ_MAGIC, sizeof(tzh.tzh_magic)) != 0)
  ------------------
  |  |   27|     87|#define TZ_MAGIC "TZif"
  ------------------
  |  Branch (647:9): [True: 0, False: 87]
  ------------------
  648|      0|      return false;
  649|     87|    if (tzh.tzh_version[0] == '\0')
  ------------------
  |  Branch (649:9): [True: 0, False: 87]
  ------------------
  650|      0|      return false;
  651|     87|    if (!hdr.Build(tzh))
  ------------------
  |  Branch (651:9): [True: 0, False: 87]
  ------------------
  652|      0|      return false;
  653|     87|    time_len = 8;
  654|     87|  }
  655|     87|  if (hdr.typecnt == 0)
  ------------------
  |  Branch (655:7): [True: 0, False: 87]
  ------------------
  656|      0|    return false;
  657|     87|  if (hdr.leapcnt != 0) {
  ------------------
  |  Branch (657:7): [True: 0, False: 87]
  ------------------
  658|       |    // This code assumes 60-second minutes so we do not want
  659|       |    // the leap-second encoded zoneinfo. We could reverse the
  660|       |    // compensation, but the "right" encoding is rarely used
  661|       |    // so currently we simply reject such data.
  662|      0|    return false;
  663|      0|  }
  664|     87|  if (hdr.ttisstdcnt != 0 && hdr.ttisstdcnt != hdr.typecnt)
  ------------------
  |  Branch (664:7): [True: 41, False: 46]
  |  Branch (664:30): [True: 0, False: 41]
  ------------------
  665|      0|    return false;
  666|     87|  if (hdr.ttisutcnt != 0 && hdr.ttisutcnt != hdr.typecnt)
  ------------------
  |  Branch (666:7): [True: 29, False: 58]
  |  Branch (666:29): [True: 0, False: 29]
  ------------------
  667|      0|    return false;
  668|       |
  669|       |  // Read the data into a local buffer.
  670|     87|  std::size_t len = hdr.DataLength(time_len);
  671|     87|  std::vector<char> tbuf(len);
  672|     87|  if (zip->Read(tbuf.data(), len) != len)
  ------------------
  |  Branch (672:7): [True: 0, False: 87]
  ------------------
  673|      0|    return false;
  674|     87|  const char* bp = tbuf.data();
  675|       |
  676|       |  // Decode and validate the transitions.
  677|     87|  transitions_.reserve(hdr.timecnt + 2);
  678|     87|  transitions_.resize(hdr.timecnt);
  679|  5.11k|  for (std::size_t i = 0; i != hdr.timecnt; ++i) {
  ------------------
  |  Branch (679:27): [True: 5.02k, False: 87]
  ------------------
  680|  5.02k|    transitions_[i].unix_time = (time_len == 4) ? Decode32(bp) : Decode64(bp);
  ------------------
  |  Branch (680:33): [True: 0, False: 5.02k]
  ------------------
  681|  5.02k|    bp += time_len;
  682|  5.02k|    if (i != 0) {
  ------------------
  |  Branch (682:9): [True: 4.98k, False: 41]
  ------------------
  683|       |      // Check that the transitions are ordered by time (as zic guarantees).
  684|  4.98k|      if (!Transition::ByUnixTime()(transitions_[i - 1], transitions_[i]))
  ------------------
  |  Branch (684:11): [True: 0, False: 4.98k]
  ------------------
  685|      0|        return false;  // out of order
  686|  4.98k|    }
  687|  5.02k|  }
  688|     87|  bool seen_type_0 = false;
  689|  5.11k|  for (std::size_t i = 0; i != hdr.timecnt; ++i) {
  ------------------
  |  Branch (689:27): [True: 5.02k, False: 87]
  ------------------
  690|  5.02k|    transitions_[i].type_index = Decode8(bp++);
  691|  5.02k|    if (transitions_[i].type_index >= hdr.typecnt)
  ------------------
  |  Branch (691:9): [True: 0, False: 5.02k]
  ------------------
  692|      0|      return false;
  693|  5.02k|    if (transitions_[i].type_index == 0)
  ------------------
  |  Branch (693:9): [True: 1.80k, False: 3.21k]
  ------------------
  694|  1.80k|      seen_type_0 = true;
  695|  5.02k|  }
  696|       |
  697|       |  // Decode and validate the transition types.
  698|     87|  transition_types_.reserve(hdr.typecnt + 2);
  699|     87|  transition_types_.resize(hdr.typecnt);
  700|    326|  for (std::size_t i = 0; i != hdr.typecnt; ++i) {
  ------------------
  |  Branch (700:27): [True: 239, False: 87]
  ------------------
  701|    239|    transition_types_[i].utc_offset =
  702|    239|        static_cast<std::int_least32_t>(Decode32(bp));
  703|    239|    if (transition_types_[i].utc_offset >= kSecsPerDay ||
  ------------------
  |  Branch (703:9): [True: 0, False: 239]
  ------------------
  704|    239|        transition_types_[i].utc_offset <= -kSecsPerDay)
  ------------------
  |  Branch (704:9): [True: 0, False: 239]
  ------------------
  705|      0|      return false;
  706|    239|    bp += 4;
  707|    239|    transition_types_[i].is_dst = (Decode8(bp++) != 0);
  708|    239|    transition_types_[i].abbr_index = Decode8(bp++);
  709|    239|    if (transition_types_[i].abbr_index >= hdr.charcnt)
  ------------------
  |  Branch (709:9): [True: 0, False: 239]
  ------------------
  710|      0|      return false;
  711|    239|  }
  712|       |
  713|       |  // Determine the before-first-transition type.
  714|     87|  default_transition_type_ = 0;
  715|     87|  if (seen_type_0 && hdr.timecnt != 0) {
  ------------------
  |  Branch (715:7): [True: 38, False: 49]
  |  Branch (715:22): [True: 38, False: 0]
  ------------------
  716|     38|    std::uint_fast8_t index = 0;
  717|     38|    if (transition_types_[0].is_dst) {
  ------------------
  |  Branch (717:9): [True: 0, False: 38]
  ------------------
  718|      0|      index = transitions_[0].type_index;
  719|      0|      while (index != 0 && transition_types_[index].is_dst)
  ------------------
  |  Branch (719:14): [True: 0, False: 0]
  |  Branch (719:28): [True: 0, False: 0]
  ------------------
  720|      0|        --index;
  721|      0|    }
  722|     38|    while (index != hdr.typecnt && transition_types_[index].is_dst)
  ------------------
  |  Branch (722:12): [True: 38, False: 0]
  |  Branch (722:36): [True: 0, False: 38]
  ------------------
  723|      0|      ++index;
  724|     38|    if (index != hdr.typecnt)
  ------------------
  |  Branch (724:9): [True: 38, False: 0]
  ------------------
  725|     38|      default_transition_type_ = index;
  726|     38|  }
  727|       |
  728|       |  // Copy all the abbreviations.
  729|     87|  abbreviations_.reserve(hdr.charcnt + 10);
  730|     87|  abbreviations_.assign(bp, hdr.charcnt);
  731|     87|  bp += hdr.charcnt;
  732|       |
  733|       |  // Skip the unused portions. We've already dispensed with leap-second
  734|       |  // encoded zoneinfo. The ttisstd/ttisgmt indicators only apply when
  735|       |  // interpreting a POSIX spec that does not include start/end rules, and
  736|       |  // that isn't the case here (see "zic -p").
  737|     87|  bp += (time_len + 4) * hdr.leapcnt;  // leap-time + TAI-UTC
  738|     87|  bp += 1 * hdr.ttisstdcnt;            // UTC/local indicators
  739|     87|  bp += 1 * hdr.ttisutcnt;             // standard/wall indicators
  740|     87|  assert(bp == tbuf.data() + tbuf.size());
  ------------------
  |  Branch (740:3): [True: 87, False: 0]
  ------------------
  741|       |
  742|     87|  future_spec_.clear();
  743|     87|  if (tzh.tzh_version[0] != '\0') {
  ------------------
  |  Branch (743:7): [True: 87, False: 0]
  ------------------
  744|       |    // Snarf up the NL-enclosed future POSIX spec. Note
  745|       |    // that version '3' files utilize an extended format.
  746|     87|    auto get_char = [](ZoneInfoSource* azip) -> int {
  747|     87|      unsigned char ch;  // all non-EOF results are positive
  748|     87|      return (azip->Read(&ch, 1) == 1) ? ch : EOF;
  749|     87|    };
  750|     87|    if (get_char(zip) != '\n')
  ------------------
  |  Branch (750:9): [True: 0, False: 87]
  ------------------
  751|      0|      return false;
  752|  1.27k|    for (int c = get_char(zip); c != '\n'; c = get_char(zip)) {
  ------------------
  |  Branch (752:33): [True: 1.18k, False: 87]
  ------------------
  753|  1.18k|      if (c == EOF)
  ------------------
  |  Branch (753:11): [True: 0, False: 1.18k]
  ------------------
  754|      0|        return false;
  755|  1.18k|      future_spec_.push_back(static_cast<char>(c));
  756|  1.18k|    }
  757|     87|  }
  758|       |
  759|       |  // We don't check for EOF so that we're forwards compatible.
  760|       |
  761|       |  // If we did not find version information during the standard loading
  762|       |  // process (as of tzh_version '3' that is unsupported), then ask the
  763|       |  // ZoneInfoSource for any out-of-bound version string it may be privy to.
  764|     87|  if (version_.empty()) {
  ------------------
  |  Branch (764:7): [True: 87, False: 0]
  ------------------
  765|     87|    version_ = zip->Version();
  766|     87|  }
  767|       |
  768|       |  // Ensure that there is always a transition in the first half of the
  769|       |  // time line (the second half is handled below) so that the signed
  770|       |  // difference between a civil_second and the civil_second of its
  771|       |  // previous transition is always representable, without overflow.
  772|     87|  if (transitions_.empty() || transitions_.front().unix_time >= 0) {
  ------------------
  |  Branch (772:7): [True: 46, False: 41]
  |  Branch (772:31): [True: 27, False: 14]
  ------------------
  773|     73|    Transition& tr(*transitions_.emplace(transitions_.begin()));
  774|     73|    tr.unix_time = -(1LL << 59);  // -18267312070-10-26T17:01:52+00:00
  775|     73|    tr.type_index = default_transition_type_;
  776|     73|  }
  777|       |
  778|       |  // Extend the transitions using the future specification.
  779|     87|  if (!ExtendTransitions()) return false;
  ------------------
  |  Branch (779:7): [True: 0, False: 87]
  ------------------
  780|       |
  781|       |  // Ensure that there is always a transition in the second half of the
  782|       |  // time line (the first half is handled above) so that the signed
  783|       |  // difference between a civil_second and the civil_second of its
  784|       |  // previous transition is always representable, without overflow.
  785|     87|  const Transition& last(transitions_.back());
  786|     87|  if (last.unix_time < 0) {
  ------------------
  |  Branch (786:7): [True: 46, False: 41]
  ------------------
  787|     46|    const std::uint_fast8_t type_index = last.type_index;
  788|     46|    Transition& tr(*transitions_.emplace(transitions_.end()));
  789|     46|    tr.unix_time = 2147483647;  // 2038-01-19T03:14:07+00:00
  790|     46|    tr.type_index = type_index;
  791|     46|  }
  792|       |
  793|       |  // Compute the local civil time for each transition and the preceding
  794|       |  // second. These will be used for reverse conversions in MakeTime().
  795|     87|  const TransitionType* ttp = &transition_types_[default_transition_type_];
  796|  35.7k|  for (std::size_t i = 0; i != transitions_.size(); ++i) {
  ------------------
  |  Branch (796:27): [True: 35.6k, False: 87]
  ------------------
  797|  35.6k|    Transition& tr(transitions_[i]);
  798|  35.6k|    tr.prev_civil_sec = LocalTime(tr.unix_time, *ttp).cs - 1;
  799|  35.6k|    ttp = &transition_types_[tr.type_index];
  800|  35.6k|    tr.civil_sec = LocalTime(tr.unix_time, *ttp).cs;
  801|  35.6k|    if (i != 0) {
  ------------------
  |  Branch (801:9): [True: 35.5k, False: 87]
  ------------------
  802|       |      // Check that the transitions are ordered by civil time. Essentially
  803|       |      // this means that an offset change cannot cross another such change.
  804|       |      // No one does this in practice, and we depend on it in MakeTime().
  805|  35.5k|      if (!Transition::ByCivilTime()(transitions_[i - 1], tr))
  ------------------
  |  Branch (805:11): [True: 0, False: 35.5k]
  ------------------
  806|      0|        return false;  // out of order
  807|  35.5k|    }
  808|  35.6k|  }
  809|       |
  810|       |  // Compute the maximum/minimum civil times that can be converted to a
  811|       |  // time_point<seconds> for each of the zone's transition types.
  812|    239|  for (auto& tt : transition_types_) {
  ------------------
  |  Branch (812:17): [True: 239, False: 87]
  ------------------
  813|    239|    tt.civil_max = LocalTime(seconds::max().count(), tt).cs;
  814|    239|    tt.civil_min = LocalTime(seconds::min().count(), tt).cs;
  815|    239|  }
  816|       |
  817|     87|  transitions_.shrink_to_fit();
  818|     87|  return true;
  819|     87|}
_ZN4cctz12TimeZoneInfo4LoadERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  821|    735|bool TimeZoneInfo::Load(const std::string& name) {
  822|       |  // We can ensure that the loading of UTC or any other fixed-offset
  823|       |  // zone never fails because the simple, fixed-offset state can be
  824|       |  // internally generated. Note that this depends on our choice to not
  825|       |  // accept leap-second encoded ("right") zoneinfo.
  826|    735|  auto offset = seconds::zero();
  827|    735|  if (FixedOffsetFromName(name, &offset)) {
  ------------------
  |  Branch (827:7): [True: 269, False: 466]
  ------------------
  828|    269|    return ResetToBuiltinUTC(offset);
  829|    269|  }
  830|       |
  831|       |  // Find and use a ZoneInfoSource to load the named zone.
  832|    466|  auto zip = cctz_extension::zone_info_source_factory(
  833|    466|      name, [](const std::string& n) -> std::unique_ptr<ZoneInfoSource> {
  834|    466|        if (auto z = FileZoneInfoSource::Open(n)) return z;
  835|    466|        if (auto z = AndroidZoneInfoSource::Open(n)) return z;
  836|    466|        if (auto z = FuchsiaZoneInfoSource::Open(n)) return z;
  837|    466|        return nullptr;
  838|    466|      });
  839|    466|  return zip != nullptr && Load(zip.get());
  ------------------
  |  Branch (839:10): [True: 108, False: 358]
  |  Branch (839:28): [True: 87, False: 21]
  ------------------
  840|    735|}
_ZN4cctz12TimeZoneInfo3UTCEv:
  842|      1|std::unique_ptr<TimeZoneInfo> TimeZoneInfo::UTC() {
  843|      1|  auto tz = std::unique_ptr<TimeZoneInfo>(new TimeZoneInfo);
  844|      1|  tz->ResetToBuiltinUTC(seconds::zero());
  845|      1|  return tz;
  846|      1|}
_ZN4cctz12TimeZoneInfo4MakeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  848|    735|std::unique_ptr<TimeZoneInfo> TimeZoneInfo::Make(const std::string& name) {
  849|    735|  auto tz = std::unique_ptr<TimeZoneInfo>(new TimeZoneInfo);
  850|    735|  if (!tz->Load(name)) tz.reset();  // fallback to UTC
  ------------------
  |  Branch (850:7): [True: 379, False: 356]
  ------------------
  851|    735|  return tz;
  852|    735|}
_ZNK4cctz12TimeZoneInfo9LocalTimeElRKNS_14TransitionTypeE:
  856|  76.6k|    std::int_fast64_t unix_time, const TransitionType& tt) const {
  857|       |  // A civil time in "+offset" looks like (time+offset) in UTC.
  858|       |  // Note: We perform two additions in the civil_second domain to
  859|       |  // sidestep the chance of overflow in (unix_time + tt.utc_offset).
  860|  76.6k|  return {(civil_second() + unix_time) + tt.utc_offset,
  861|  76.6k|          tt.utc_offset, tt.is_dst, &abbreviations_[tt.abbr_index]};
  862|  76.6k|}
_ZNK4cctz12TimeZoneInfo9LocalTimeElRKNS_10TransitionE:
  866|  6.07k|    std::int_fast64_t unix_time, const Transition& tr) const {
  867|  6.07k|  const TransitionType& tt = transition_types_[tr.type_index];
  868|       |  // Note: (unix_time - tr.unix_time) will never overflow as we
  869|       |  // have ensured that there is always a "nearby" transition.
  870|  6.07k|  return {tr.civil_sec + (unix_time - tr.unix_time),  // TODO: Optimize.
  871|  6.07k|          tt.utc_offset, tt.is_dst, &abbreviations_[tt.abbr_index]};
  872|  6.07k|}
_ZNK4cctz12TimeZoneInfo9TimeLocalERKNS_6detail10civil_timeINS1_10second_tagEEEl:
  876|  1.41k|                                                year_t c4_shift) const {
  877|  1.41k|  assert(last_year_ - 400 < cs.year() && cs.year() <= last_year_);
  ------------------
  |  Branch (877:3): [True: 1.41k, False: 0]
  |  Branch (877:3): [True: 1.41k, False: 0]
  |  Branch (877:3): [True: 1.41k, False: 0]
  ------------------
  878|  1.41k|  time_zone::civil_lookup cl = MakeTime(cs);
  879|  1.41k|  if (c4_shift > seconds::max().count() / kSecsPer400Years) {
  ------------------
  |  Branch (879:7): [True: 133, False: 1.27k]
  ------------------
  880|    133|    cl.pre = cl.trans = cl.post = time_point<seconds>::max();
  881|  1.27k|  } else {
  882|  1.27k|    const auto offset = seconds(c4_shift * kSecsPer400Years);
  883|  1.27k|    const auto limit = time_point<seconds>::max() - offset;
  884|  3.83k|    for (auto* tp : {&cl.pre, &cl.trans, &cl.post}) {
  ------------------
  |  Branch (884:19): [True: 3.83k, False: 1.27k]
  ------------------
  885|  3.83k|      if (*tp > limit) {
  ------------------
  |  Branch (885:11): [True: 24, False: 3.81k]
  ------------------
  886|     24|        *tp = time_point<seconds>::max();
  887|  3.81k|      } else {
  888|  3.81k|        *tp += offset;
  889|  3.81k|      }
  890|  3.83k|    }
  891|  1.27k|  }
  892|  1.41k|  return cl;
  893|  1.41k|}
_ZNK4cctz12TimeZoneInfo9BreakTimeERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
  896|  8.46k|    const time_point<seconds>& tp) const {
  897|  8.46k|  std::int_fast64_t unix_time = ToUnixSeconds(tp);
  898|  8.46k|  const std::size_t timecnt = transitions_.size();
  899|  8.46k|  assert(timecnt != 0);  // We always add a transition.
  ------------------
  |  Branch (899:3): [True: 8.46k, False: 0]
  ------------------
  900|       |
  901|  8.46k|  if (unix_time < transitions_[0].unix_time) {
  ------------------
  |  Branch (901:7): [True: 1.11k, False: 7.34k]
  ------------------
  902|  1.11k|    return LocalTime(unix_time, transition_types_[default_transition_type_]);
  903|  1.11k|  }
  904|  7.34k|  if (unix_time >= transitions_[timecnt - 1].unix_time) {
  ------------------
  |  Branch (904:7): [True: 2.42k, False: 4.92k]
  ------------------
  905|       |    // After the last transition. If we extended the transitions using
  906|       |    // future_spec_, shift back to a supported year using the 400-year
  907|       |    // cycle of calendaric equivalence and then compensate accordingly.
  908|  2.42k|    if (extended_) {
  ------------------
  |  Branch (908:9): [True: 1.27k, False: 1.15k]
  ------------------
  909|  1.27k|      const std::int_fast64_t diff =
  910|  1.27k|          unix_time - transitions_[timecnt - 1].unix_time;
  911|  1.27k|      const year_t shift = diff / kSecsPer400Years + 1;
  912|  1.27k|      const auto d = seconds(shift * kSecsPer400Years);
  913|  1.27k|      time_zone::absolute_lookup al = BreakTime(tp - d);
  914|  1.27k|      al.cs = YearShift(al.cs, shift * 400);
  915|  1.27k|      return al;
  916|  1.27k|    }
  917|  1.15k|    return LocalTime(unix_time, transitions_[timecnt - 1]);
  918|  2.42k|  }
  919|       |
  920|  4.92k|  const std::size_t hint = local_time_hint_.load(std::memory_order_relaxed);
  921|  4.92k|  if (0 < hint && hint < timecnt) {
  ------------------
  |  Branch (921:7): [True: 4.75k, False: 169]
  |  Branch (921:19): [True: 4.75k, False: 0]
  ------------------
  922|  4.75k|    if (transitions_[hint - 1].unix_time <= unix_time) {
  ------------------
  |  Branch (922:9): [True: 3.93k, False: 814]
  ------------------
  923|  3.93k|      if (unix_time < transitions_[hint].unix_time) {
  ------------------
  |  Branch (923:11): [True: 3.11k, False: 820]
  ------------------
  924|  3.11k|        return LocalTime(unix_time, transitions_[hint - 1]);
  925|  3.11k|      }
  926|  3.93k|    }
  927|  4.75k|  }
  928|       |
  929|  1.80k|  const Transition target = {unix_time, 0, civil_second(), civil_second()};
  930|  1.80k|  const Transition* begin = &transitions_[0];
  931|  1.80k|  const Transition* tr = std::upper_bound(begin, begin + timecnt, target,
  932|  1.80k|                                          Transition::ByUnixTime());
  933|  1.80k|  local_time_hint_.store(static_cast<std::size_t>(tr - begin),
  934|  1.80k|                         std::memory_order_relaxed);
  935|  1.80k|  return LocalTime(unix_time, *--tr);
  936|  4.92k|}
_ZNK4cctz12TimeZoneInfo8MakeTimeERKNS_6detail10civil_timeINS1_10second_tagEEE:
  938|  12.4k|time_zone::civil_lookup TimeZoneInfo::MakeTime(const civil_second& cs) const {
  939|  12.4k|  const std::size_t timecnt = transitions_.size();
  940|  12.4k|  assert(timecnt != 0);  // We always add a transition.
  ------------------
  |  Branch (940:3): [True: 12.4k, False: 0]
  ------------------
  941|       |
  942|       |  // Find the first transition after our target civil time.
  943|  12.4k|  const Transition* tr = nullptr;
  944|  12.4k|  const Transition* begin = &transitions_[0];
  945|  12.4k|  const Transition* end = begin + timecnt;
  946|  12.4k|  if (cs < begin->civil_sec) {
  ------------------
  |  Branch (946:7): [True: 1.33k, False: 11.0k]
  ------------------
  947|  1.33k|    tr = begin;
  948|  11.0k|  } else if (cs >= transitions_[timecnt - 1].civil_sec) {
  ------------------
  |  Branch (948:14): [True: 2.68k, False: 8.41k]
  ------------------
  949|  2.68k|    tr = end;
  950|  8.41k|  } else {
  951|  8.41k|    const std::size_t hint = time_local_hint_.load(std::memory_order_relaxed);
  952|  8.41k|    if (0 < hint && hint < timecnt) {
  ------------------
  |  Branch (952:9): [True: 8.08k, False: 325]
  |  Branch (952:21): [True: 8.08k, False: 0]
  ------------------
  953|  8.08k|      if (transitions_[hint - 1].civil_sec <= cs) {
  ------------------
  |  Branch (953:11): [True: 6.65k, False: 1.43k]
  ------------------
  954|  6.65k|        if (cs < transitions_[hint].civil_sec) {
  ------------------
  |  Branch (954:13): [True: 5.19k, False: 1.45k]
  ------------------
  955|  5.19k|          tr = begin + hint;
  956|  5.19k|        }
  957|  6.65k|      }
  958|  8.08k|    }
  959|  8.41k|    if (tr == nullptr) {
  ------------------
  |  Branch (959:9): [True: 3.21k, False: 5.19k]
  ------------------
  960|  3.21k|      const Transition target = {0, 0, cs, civil_second()};
  961|  3.21k|      tr = std::upper_bound(begin, end, target, Transition::ByCivilTime());
  962|  3.21k|      time_local_hint_.store(static_cast<std::size_t>(tr - begin),
  963|  3.21k|                             std::memory_order_relaxed);
  964|  3.21k|    }
  965|  8.41k|  }
  966|       |
  967|  12.4k|  if (tr == begin) {
  ------------------
  |  Branch (967:7): [True: 1.33k, False: 11.0k]
  ------------------
  968|  1.33k|    if (tr->prev_civil_sec >= cs) {
  ------------------
  |  Branch (968:9): [True: 1.33k, False: 1]
  ------------------
  969|       |      // Before first transition, so use the default offset.
  970|  1.33k|      const TransitionType& tt(transition_types_[default_transition_type_]);
  971|  1.33k|      if (cs < tt.civil_min) return MakeUnique(time_point<seconds>::min());
  ------------------
  |  Branch (971:11): [True: 153, False: 1.17k]
  ------------------
  972|  1.17k|      return MakeUnique(cs - (civil_second() + tt.utc_offset));
  973|  1.33k|    }
  974|       |    // tr->prev_civil_sec < cs < tr->civil_sec
  975|      1|    return MakeSkipped(*tr, cs);
  976|  1.33k|  }
  977|       |
  978|  11.0k|  if (tr == end) {
  ------------------
  |  Branch (978:7): [True: 2.68k, False: 8.41k]
  ------------------
  979|  2.68k|    if (cs > (--tr)->prev_civil_sec) {
  ------------------
  |  Branch (979:9): [True: 2.68k, False: 8]
  ------------------
  980|       |      // After the last transition. If we extended the transitions using
  981|       |      // future_spec_, shift back to a supported year using the 400-year
  982|       |      // cycle of calendaric equivalence and then compensate accordingly.
  983|  2.68k|      if (extended_ && cs.year() > last_year_) {
  ------------------
  |  Branch (983:11): [True: 1.42k, False: 1.25k]
  |  Branch (983:24): [True: 1.41k, False: 11]
  ------------------
  984|  1.41k|        const year_t shift = (cs.year() - last_year_ - 1) / 400 + 1;
  985|  1.41k|        return TimeLocal(YearShift(cs, shift * -400), shift);
  986|  1.41k|      }
  987|  1.26k|      const TransitionType& tt(transition_types_[tr->type_index]);
  988|  1.26k|      if (cs > tt.civil_max) return MakeUnique(time_point<seconds>::max());
  ------------------
  |  Branch (988:11): [True: 57, False: 1.21k]
  ------------------
  989|  1.21k|      return MakeUnique(tr->unix_time + (cs - tr->civil_sec));
  990|  1.26k|    }
  991|       |    // tr->civil_sec <= cs <= tr->prev_civil_sec
  992|      8|    return MakeRepeated(*tr, cs);
  993|  2.68k|  }
  994|       |
  995|  8.41k|  if (tr->prev_civil_sec < cs) {
  ------------------
  |  Branch (995:7): [True: 9, False: 8.40k]
  ------------------
  996|       |    // tr->prev_civil_sec < cs < tr->civil_sec
  997|      9|    return MakeSkipped(*tr, cs);
  998|      9|  }
  999|       |
 1000|  8.40k|  if (cs <= (--tr)->prev_civil_sec) {
  ------------------
  |  Branch (1000:7): [True: 19, False: 8.38k]
  ------------------
 1001|       |    // tr->civil_sec <= cs <= tr->prev_civil_sec
 1002|     19|    return MakeRepeated(*tr, cs);
 1003|     19|  }
 1004|       |
 1005|       |  // In between transitions.
 1006|  8.38k|  return MakeUnique(tr->unix_time + (cs - tr->civil_sec));
 1007|  8.40k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110AllYearDSTERKNS_13PosixTimeZoneE:
  179|     38|bool AllYearDST(const PosixTimeZone& posix) {
  180|     38|  if (posix.dst_start.date.fmt != PosixTransition::N) return false;
  ------------------
  |  Branch (180:7): [True: 38, False: 0]
  ------------------
  181|      0|  if (posix.dst_start.date.n.day != 0) return false;
  ------------------
  |  Branch (181:7): [True: 0, False: 0]
  ------------------
  182|      0|  if (posix.dst_start.time.offset != 0) return false;
  ------------------
  |  Branch (182:7): [True: 0, False: 0]
  ------------------
  183|       |
  184|      0|  if (posix.dst_end.date.fmt != PosixTransition::J) return false;
  ------------------
  |  Branch (184:7): [True: 0, False: 0]
  ------------------
  185|      0|  if (posix.dst_end.date.j.day != kDaysPerYear[0]) return false;
  ------------------
  |  Branch (185:7): [True: 0, False: 0]
  ------------------
  186|      0|  const auto offset = posix.std_offset - posix.dst_offset;
  187|      0|  if (posix.dst_end.time.offset + offset != kSecsPerDay) return false;
  ------------------
  |  Branch (187:7): [True: 0, False: 0]
  ------------------
  188|       |
  189|      0|  return true;
  190|      0|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_16IsLeapEl:
   58|  11.5k|inline bool IsLeap(year_t year) {
   59|  11.5k|  return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
  ------------------
  |  Branch (59:10): [True: 3.80k, False: 7.79k]
  |  Branch (59:30): [True: 3.64k, False: 152]
  |  Branch (59:51): [True: 38, False: 114]
  ------------------
   60|  11.5k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_114ToPosixWeekdayENS_6detail7weekdayE:
   85|     38|inline int ToPosixWeekday(weekday wd) {
   86|     38|  switch (wd) {
  ------------------
  |  Branch (86:11): [True: 38, False: 0]
  ------------------
   87|      0|    case weekday::sunday:
  ------------------
  |  Branch (87:5): [True: 0, False: 38]
  ------------------
   88|      0|      return 0;
   89|      0|    case weekday::monday:
  ------------------
  |  Branch (89:5): [True: 0, False: 38]
  ------------------
   90|      0|      return 1;
   91|      0|    case weekday::tuesday:
  ------------------
  |  Branch (91:5): [True: 0, False: 38]
  ------------------
   92|      0|      return 2;
   93|      0|    case weekday::wednesday:
  ------------------
  |  Branch (93:5): [True: 0, False: 38]
  ------------------
   94|      0|      return 3;
   95|     38|    case weekday::thursday:
  ------------------
  |  Branch (95:5): [True: 38, False: 0]
  ------------------
   96|     38|      return 4;
   97|      0|    case weekday::friday:
  ------------------
  |  Branch (97:5): [True: 0, False: 38]
  ------------------
   98|      0|      return 5;
   99|      0|    case weekday::saturday:
  ------------------
  |  Branch (99:5): [True: 0, False: 38]
  ------------------
  100|      0|      return 6;
  101|     38|  }
  102|      0|  return 0; /*NOTREACHED*/
  103|     38|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_111TransOffsetEbiRKNS_15PosixTransitionE:
  194|  30.5k|                              const PosixTransition& pt) {
  195|  30.5k|  std::int_fast64_t days = 0;
  196|  30.5k|  switch (pt.date.fmt) {
  ------------------
  |  Branch (196:11): [True: 30.5k, False: 0]
  ------------------
  197|      0|    case PosixTransition::J: {
  ------------------
  |  Branch (197:5): [True: 0, False: 30.5k]
  ------------------
  198|      0|      days = pt.date.j.day;
  199|      0|      if (!leap_year || days < kMonthOffsets[1][3]) days -= 1;
  ------------------
  |  Branch (199:11): [True: 0, False: 0]
  |  Branch (199:25): [True: 0, False: 0]
  ------------------
  200|      0|      break;
  201|      0|    }
  202|      0|    case PosixTransition::N: {
  ------------------
  |  Branch (202:5): [True: 0, False: 30.5k]
  ------------------
  203|      0|      days = pt.date.n.day;
  204|      0|      break;
  205|      0|    }
  206|  30.5k|    case PosixTransition::M: {
  ------------------
  |  Branch (206:5): [True: 30.5k, False: 0]
  ------------------
  207|  30.5k|      const bool last_week = (pt.date.m.week == 5);
  208|  30.5k|      days = kMonthOffsets[leap_year][pt.date.m.month + last_week];
  209|  30.5k|      const std::int_fast64_t weekday = (jan1_weekday + days) % 7;
  210|  30.5k|      if (last_week) {
  ------------------
  |  Branch (210:11): [True: 28.9k, False: 1.60k]
  ------------------
  211|  28.9k|        days -= (weekday + 7 - 1 - pt.date.m.weekday) % 7 + 1;
  212|  28.9k|      } else {
  213|  1.60k|        days += (pt.date.m.weekday + 7 - weekday) % 7;
  214|  1.60k|        days += (pt.date.m.week - 1) * 7;
  215|  1.60k|      }
  216|  30.5k|      break;
  217|      0|    }
  218|  30.5k|  }
  219|  30.5k|  return (days * kSecsPerDay) + pt.time.offset;
  220|  30.5k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_16Header5BuildERK6tzhead:
  147|    174|bool Header::Build(const tzhead& tzh) {
  148|    174|  std::int_fast32_t v;
  149|    174|  if ((v = Decode32(tzh.tzh_timecnt)) < 0) return false;
  ------------------
  |  Branch (149:7): [True: 0, False: 174]
  ------------------
  150|    174|  timecnt = static_cast<std::size_t>(v);
  151|    174|  if ((v = Decode32(tzh.tzh_typecnt)) < 0) return false;
  ------------------
  |  Branch (151:7): [True: 0, False: 174]
  ------------------
  152|    174|  typecnt = static_cast<std::size_t>(v);
  153|    174|  if ((v = Decode32(tzh.tzh_charcnt)) < 0) return false;
  ------------------
  |  Branch (153:7): [True: 0, False: 174]
  ------------------
  154|    174|  charcnt = static_cast<std::size_t>(v);
  155|    174|  if ((v = Decode32(tzh.tzh_leapcnt)) < 0) return false;
  ------------------
  |  Branch (155:7): [True: 0, False: 174]
  ------------------
  156|    174|  leapcnt = static_cast<std::size_t>(v);
  157|    174|  if ((v = Decode32(tzh.tzh_ttisstdcnt)) < 0) return false;
  ------------------
  |  Branch (157:7): [True: 0, False: 174]
  ------------------
  158|    174|  ttisstdcnt = static_cast<std::size_t>(v);
  159|    174|  if ((v = Decode32(tzh.tzh_ttisutcnt)) < 0) return false;
  ------------------
  |  Branch (159:7): [True: 0, False: 174]
  ------------------
  160|    174|  ttisutcnt = static_cast<std::size_t>(v);
  161|    174|  return true;
  162|    174|}
time_zone_info.cc:_ZNK4cctz12_GLOBAL__N_16Header10DataLengthEm:
  166|    174|std::size_t Header::DataLength(std::size_t time_len) const {
  167|    174|  std::size_t len = 0;
  168|    174|  len += (time_len + 1) * timecnt;  // unix_time + type_index
  169|    174|  len += (4 + 1 + 1) * typecnt;     // utc_offset + is_dst + abbr_index
  170|    174|  len += 1 * charcnt;               // abbreviations
  171|    174|  len += (time_len + 4) * leapcnt;  // leap-time + TAI-UTC
  172|    174|  len += 1 * ttisstdcnt;            // UTC/local indicators
  173|    174|  len += 1 * ttisutcnt;             // standard/wall indicators
  174|    174|  return len;
  175|    174|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_18Decode32EPKc:
  116|  1.28k|std::int_fast32_t Decode32(const char* cp) {
  117|  1.28k|  std::uint_fast32_t v = 0;
  118|  6.41k|  for (int i = 0; i != (32 / 8); ++i) v = (v << 8) | Decode8(cp++);
  ------------------
  |  Branch (118:19): [True: 5.13k, False: 1.28k]
  ------------------
  119|  1.28k|  const std::int_fast32_t s32max = 0x7fffffff;
  120|  1.28k|  const auto s32maxU = static_cast<std::uint_fast32_t>(s32max);
  121|  1.28k|  if (v <= s32maxU) return static_cast<std::int_fast32_t>(v);
  ------------------
  |  Branch (121:7): [True: 1.26k, False: 22]
  ------------------
  122|     22|  return static_cast<std::int_fast32_t>(v - s32maxU - 1) - s32max - 1;
  123|  1.28k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_18Decode64EPKc:
  125|  5.02k|std::int_fast64_t Decode64(const char* cp) {
  126|  5.02k|  std::uint_fast64_t v = 0;
  127|  45.2k|  for (int i = 0; i != (64 / 8); ++i) v = (v << 8) | Decode8(cp++);
  ------------------
  |  Branch (127:19): [True: 40.1k, False: 5.02k]
  ------------------
  128|  5.02k|  const std::int_fast64_t s64max = 0x7fffffffffffffff;
  129|  5.02k|  const auto s64maxU = static_cast<std::uint_fast64_t>(s64max);
  130|  5.02k|  if (v <= s64maxU) return static_cast<std::int_fast64_t>(v);
  ------------------
  |  Branch (130:7): [True: 4.84k, False: 179]
  ------------------
  131|    179|  return static_cast<std::int_fast64_t>(v - s64maxU - 1) - s64max - 1;
  132|  5.02k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_17Decode8EPKc:
  106|  50.8k|inline std::uint_fast8_t Decode8(const char* cp) {
  107|  50.8k|  return static_cast<std::uint_fast8_t>(*cp) & 0xff;
  108|  50.8k|}
time_zone_info.cc:_ZZN4cctz12TimeZoneInfo4LoadEPNS_14ZoneInfoSourceEENK3$_0clES2_:
  746|  1.35k|    auto get_char = [](ZoneInfoSource* azip) -> int {
  747|  1.35k|      unsigned char ch;  // all non-EOF results are positive
  748|  1.35k|      return (azip->Read(&ch, 1) == 1) ? ch : EOF;
  ------------------
  |  Branch (748:14): [True: 1.35k, False: 0]
  ------------------
  749|  1.35k|    };
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_19YearShiftERKNS_6detail10civil_timeINS1_10second_tagEEEl:
  253|  2.68k|inline civil_second YearShift(const civil_second& cs, year_t shift) {
  254|  2.68k|  return civil_second(cs.year() + shift, cs.month(), cs.day(),
  255|  2.68k|                      cs.hour(), cs.minute(), cs.second());
  256|  2.68k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110MakeUniqueERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
  222|  10.9k|inline time_zone::civil_lookup MakeUnique(const time_point<seconds>& tp) {
  223|  10.9k|  time_zone::civil_lookup cl;
  224|  10.9k|  cl.kind = time_zone::civil_lookup::UNIQUE;
  225|  10.9k|  cl.pre = cl.trans = cl.post = tp;
  226|  10.9k|  return cl;
  227|  10.9k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_110MakeUniqueEl:
  229|  10.7k|inline time_zone::civil_lookup MakeUnique(std::int_fast64_t unix_time) {
  230|  10.7k|  return MakeUnique(FromUnixSeconds(unix_time));
  231|  10.7k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_111MakeSkippedERKNS_10TransitionERKNS_6detail10civil_timeINS4_10second_tagEEE:
  234|     10|                                           const civil_second& cs) {
  235|     10|  time_zone::civil_lookup cl;
  236|     10|  cl.kind = time_zone::civil_lookup::SKIPPED;
  237|     10|  cl.pre = FromUnixSeconds(tr.unix_time - 1 + (cs - tr.prev_civil_sec));
  238|     10|  cl.trans = FromUnixSeconds(tr.unix_time);
  239|     10|  cl.post = FromUnixSeconds(tr.unix_time - (tr.civil_sec - cs));
  240|     10|  return cl;
  241|     10|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_112MakeRepeatedERKNS_10TransitionERKNS_6detail10civil_timeINS4_10second_tagEEE:
  244|     27|                                            const civil_second& cs) {
  245|     27|  time_zone::civil_lookup cl;
  246|     27|  cl.kind = time_zone::civil_lookup::REPEATED;
  247|     27|  cl.pre = FromUnixSeconds(tr.unix_time - 1 - (tr.prev_civil_sec - cs));
  248|     27|  cl.trans = FromUnixSeconds(tr.unix_time);
  249|     27|  cl.post = FromUnixSeconds(tr.unix_time + (cs - tr.civil_sec));
  250|     27|  return cl;
  251|     27|}
time_zone_info.cc:_ZZN4cctz12TimeZoneInfo4LoadERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clES9_:
  833|    466|      name, [](const std::string& n) -> std::unique_ptr<ZoneInfoSource> {
  834|    466|        if (auto z = FileZoneInfoSource::Open(n)) return z;
  ------------------
  |  Branch (834:18): [True: 108, False: 358]
  ------------------
  835|    358|        if (auto z = AndroidZoneInfoSource::Open(n)) return z;
  ------------------
  |  Branch (835:18): [True: 0, False: 358]
  ------------------
  836|    358|        if (auto z = FuchsiaZoneInfoSource::Open(n)) return z;
  ------------------
  |  Branch (836:18): [True: 0, False: 358]
  ------------------
  837|    358|        return nullptr;
  838|    358|      });
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSource4OpenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  426|    466|    const std::string& name) {
  427|       |  // Use of the "file:" prefix is intended for testing purposes only.
  428|    466|  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
  ------------------
  |  Branch (428:27): [True: 8, False: 458]
  ------------------
  429|       |
  430|       |  // Map the time-zone name to a path name.
  431|    466|  std::string path;
  432|    466|  if (pos == name.size() || name[pos] != '/') {
  ------------------
  |  Branch (432:7): [True: 2, False: 464]
  |  Branch (432:29): [True: 460, False: 4]
  ------------------
  433|    462|    const char* tzdir = "/usr/share/zoneinfo";
  434|    462|    char* tzdir_env = nullptr;
  435|       |#if defined(_MSC_VER)
  436|       |    _dupenv_s(&tzdir_env, nullptr, "TZDIR");
  437|       |#else
  438|    462|    tzdir_env = std::getenv("TZDIR");
  439|    462|#endif
  440|    462|    if (tzdir_env && *tzdir_env) tzdir = tzdir_env;
  ------------------
  |  Branch (440:9): [True: 0, False: 462]
  |  Branch (440:22): [True: 0, False: 0]
  ------------------
  441|    462|    path += tzdir;
  442|    462|    path += '/';
  443|       |#if defined(_MSC_VER)
  444|       |    free(tzdir_env);
  445|       |#endif
  446|    462|  }
  447|    466|  path.append(name, pos, std::string::npos);
  448|       |
  449|       |  // Open the zoneinfo file.
  450|    466|  auto fp = FOpen(path.c_str(), "rb");
  451|    466|  if (fp == nullptr) return nullptr;
  ------------------
  |  Branch (451:7): [True: 358, False: 108]
  ------------------
  452|    108|  return std::unique_ptr<ZoneInfoSource>(new FileZoneInfoSource(std::move(fp)));
  453|    466|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_15FOpenEPKcS2_:
  382|  2.96k|inline FilePtr FOpen(const char* path, const char* mode) {
  383|       |#if defined(_MSC_VER)
  384|       |  FILE* fp;
  385|       |  if (fopen_s(&fp, path, mode) != 0) fp = nullptr;
  386|       |  return FilePtr(fp, fclose);
  387|       |#else
  388|       |  // TODO: Enable the close-on-exec flag.
  389|  2.96k|  return FilePtr(fopen(path, mode), fclose);
  390|  2.96k|#endif
  391|  2.96k|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSourceC2ENSt3__110unique_ptrI8_IO_FILEPFiPS4_EEEm:
  418|    108|      : fp_(std::move(fp)), len_(len) {}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSource4ReadEPvm:
  398|  1.64k|  std::size_t Read(void* ptr, std::size_t size) override {
  399|  1.64k|    size = std::min(size, len_);
  400|  1.64k|    std::size_t nread = fread(ptr, 1, size, fp_.get());
  401|  1.64k|    len_ -= nread;
  402|  1.64k|    return nread;
  403|  1.64k|  }
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_118FileZoneInfoSource4SkipEm:
  404|     87|  int Skip(std::size_t offset) override {
  405|     87|    offset = std::min(offset, len_);
  406|     87|    int rc = fseek(fp_.get(), static_cast<long>(offset), SEEK_CUR);
  407|     87|    if (rc == 0) len_ -= offset;
  ------------------
  |  Branch (407:9): [True: 87, False: 0]
  ------------------
  408|     87|    return rc;
  409|     87|  }
time_zone_info.cc:_ZNK4cctz12_GLOBAL__N_118FileZoneInfoSource7VersionEv:
  410|     87|  std::string Version() const override {
  411|       |    // TODO: It would nice if the zoneinfo data included the tzdb version.
  412|     87|    return std::string();
  413|     87|  }
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_121AndroidZoneInfoSource4OpenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  468|    358|    const std::string& name) {
  469|       |  // Use of the "file:" prefix is intended for testing purposes only.
  470|    358|  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
  ------------------
  |  Branch (470:27): [True: 7, False: 351]
  ------------------
  471|       |
  472|       |  // See Android's libc/tzcode/bionic.cpp for additional information.
  473|    358|  for (const char* tzdata : {"/apex/com.android.tzdata/etc/tz/tzdata",
  ------------------
  |  Branch (473:27): [True: 1.07k, False: 358]
  ------------------
  474|    358|                             "/data/misc/zoneinfo/current/tzdata",
  475|  1.07k|                             "/system/usr/share/zoneinfo/tzdata"}) {
  476|  1.07k|    auto fp = FOpen(tzdata, "rb");
  477|  1.07k|    if (fp == nullptr) continue;
  ------------------
  |  Branch (477:9): [True: 1.07k, False: 0]
  ------------------
  478|       |
  479|      0|    char hbuf[24];  // covers header.zonetab_offset too
  480|      0|    if (fread(hbuf, 1, sizeof(hbuf), fp.get()) != sizeof(hbuf)) continue;
  ------------------
  |  Branch (480:9): [True: 0, False: 0]
  ------------------
  481|      0|    if (strncmp(hbuf, "tzdata", 6) != 0) continue;
  ------------------
  |  Branch (481:9): [True: 0, False: 0]
  ------------------
  482|      0|    const char* vers = (hbuf[11] == '\0') ? hbuf + 6 : "";
  ------------------
  |  Branch (482:24): [True: 0, False: 0]
  ------------------
  483|      0|    const std::int_fast32_t index_offset = Decode32(hbuf + 12);
  484|      0|    const std::int_fast32_t data_offset = Decode32(hbuf + 16);
  485|      0|    if (index_offset < 0 || data_offset < index_offset) continue;
  ------------------
  |  Branch (485:9): [True: 0, False: 0]
  |  Branch (485:29): [True: 0, False: 0]
  ------------------
  486|      0|    if (fseek(fp.get(), static_cast<long>(index_offset), SEEK_SET) != 0)
  ------------------
  |  Branch (486:9): [True: 0, False: 0]
  ------------------
  487|      0|      continue;
  488|       |
  489|      0|    char ebuf[52];  // covers entry.unused too
  490|      0|    const std::size_t index_size =
  491|      0|        static_cast<std::size_t>(data_offset - index_offset);
  492|      0|    const std::size_t zonecnt = index_size / sizeof(ebuf);
  493|      0|    if (zonecnt * sizeof(ebuf) != index_size) continue;
  ------------------
  |  Branch (493:9): [True: 0, False: 0]
  ------------------
  494|      0|    for (std::size_t i = 0; i != zonecnt; ++i) {
  ------------------
  |  Branch (494:29): [True: 0, False: 0]
  ------------------
  495|      0|      if (fread(ebuf, 1, sizeof(ebuf), fp.get()) != sizeof(ebuf)) break;
  ------------------
  |  Branch (495:11): [True: 0, False: 0]
  ------------------
  496|      0|      const std::int_fast32_t start = data_offset + Decode32(ebuf + 40);
  497|      0|      const std::int_fast32_t length = Decode32(ebuf + 44);
  498|      0|      if (start < 0 || length < 0) break;
  ------------------
  |  Branch (498:11): [True: 0, False: 0]
  |  Branch (498:24): [True: 0, False: 0]
  ------------------
  499|      0|      ebuf[40] = '\0';  // ensure zone name is NUL terminated
  500|      0|      if (strcmp(name.c_str() + pos, ebuf) == 0) {
  ------------------
  |  Branch (500:11): [True: 0, False: 0]
  ------------------
  501|      0|        if (fseek(fp.get(), static_cast<long>(start), SEEK_SET) != 0) break;
  ------------------
  |  Branch (501:13): [True: 0, False: 0]
  ------------------
  502|      0|        return std::unique_ptr<ZoneInfoSource>(new AndroidZoneInfoSource(
  503|      0|            std::move(fp), static_cast<std::size_t>(length), vers));
  504|      0|      }
  505|      0|    }
  506|      0|  }
  507|       |
  508|    358|  return nullptr;
  509|    358|}
time_zone_info.cc:_ZN4cctz12_GLOBAL__N_121FuchsiaZoneInfoSource4OpenERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  531|    358|    const std::string& name) {
  532|       |  // Use of the "file:" prefix is intended for testing purposes only.
  533|    358|  const std::size_t pos = (name.compare(0, 5, "file:") == 0) ? 5 : 0;
  ------------------
  |  Branch (533:27): [True: 7, False: 351]
  ------------------
  534|       |
  535|       |  // Prefixes where a Fuchsia component might find zoneinfo files,
  536|       |  // in descending order of preference.
  537|    358|  const auto kTzdataPrefixes = {
  538|       |      // The tzdata from `config-data`.
  539|    358|      "/config/data/tzdata/",
  540|       |      // The tzdata bundled in the component's package.
  541|    358|      "/pkg/data/tzdata/",
  542|       |      // General data storage.
  543|    358|      "/data/tzdata/",
  544|       |      // The recommended path for routed-in tzdata files.
  545|       |      // See for details:
  546|       |      // https://fuchsia.dev/fuchsia-src/concepts/process/namespaces?hl=en#typical_directory_structure
  547|    358|      "/config/tzdata/",
  548|    358|  };
  549|    358|  const auto kEmptyPrefix = {""};
  550|    358|  const bool name_absolute = (pos != name.size() && name[pos] == '/');
  ------------------
  |  Branch (550:31): [True: 358, False: 0]
  |  Branch (550:53): [True: 3, False: 355]
  ------------------
  551|    358|  const auto prefixes = name_absolute ? kEmptyPrefix : kTzdataPrefixes;
  ------------------
  |  Branch (551:25): [True: 3, False: 355]
  ------------------
  552|       |
  553|       |  // Fuchsia builds place zoneinfo files at "<prefix><format><name>".
  554|  1.42k|  for (const std::string prefix : prefixes) {
  ------------------
  |  Branch (554:33): [True: 1.42k, False: 358]
  ------------------
  555|  1.42k|    std::string path = prefix;
  556|  1.42k|    if (!prefix.empty()) path += "zoneinfo/tzif2/";  // format
  ------------------
  |  Branch (556:9): [True: 1.42k, False: 3]
  ------------------
  557|  1.42k|    path.append(name, pos, std::string::npos);
  558|       |
  559|  1.42k|    auto fp = FOpen(path.c_str(), "rb");
  560|  1.42k|    if (fp == nullptr) continue;
  ------------------
  |  Branch (560:9): [True: 1.42k, False: 0]
  ------------------
  561|       |
  562|      0|    std::string version;
  563|      0|    if (!prefix.empty()) {
  ------------------
  |  Branch (563:9): [True: 0, False: 0]
  ------------------
  564|       |      // Fuchsia builds place the version in "<prefix>revision.txt".
  565|      0|      std::ifstream version_stream(prefix + "revision.txt");
  566|      0|      if (version_stream.is_open()) {
  ------------------
  |  Branch (566:11): [True: 0, False: 0]
  ------------------
  567|       |        // revision.txt should contain no newlines, but to be
  568|       |        // defensive we read just the first line.
  569|      0|        std::getline(version_stream, version);
  570|      0|      }
  571|      0|    }
  572|       |
  573|      0|    return std::unique_ptr<ZoneInfoSource>(
  574|      0|        new FuchsiaZoneInfoSource(std::move(fp), std::move(version)));
  575|  1.42k|  }
  576|       |
  577|    358|  return nullptr;
  578|    358|}

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

_ZN4cctz12TimeZoneLibC4MakeERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  194|    188|std::unique_ptr<TimeZoneLibC> TimeZoneLibC::Make(const std::string& name) {
  195|    188|  return std::unique_ptr<TimeZoneLibC>(new TimeZoneLibC(name));
  196|    188|}
_ZNK4cctz12TimeZoneLibC9BreakTimeERKNSt3__16chrono10time_pointINS2_12system_clockENS2_8durationIlNS1_5ratioILl1ELl1EEEEEEE:
  199|  1.26k|    const time_point<seconds>& tp) const {
  200|  1.26k|  time_zone::absolute_lookup al;
  201|  1.26k|  al.offset = 0;
  202|  1.26k|  al.is_dst = false;
  203|  1.26k|  al.abbr = "-00";
  204|       |
  205|  1.26k|  const std::int_fast64_t s = ToUnixSeconds(tp);
  206|       |
  207|       |  // If std::time_t cannot hold the input we saturate the output.
  208|  1.26k|  if (s < std::numeric_limits<std::time_t>::min()) {
  ------------------
  |  Branch (208:7): [True: 0, False: 1.26k]
  ------------------
  209|      0|    al.cs = civil_second::min();
  210|      0|    return al;
  211|      0|  }
  212|  1.26k|  if (s > std::numeric_limits<std::time_t>::max()) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1.26k]
  ------------------
  213|      0|    al.cs = civil_second::max();
  214|      0|    return al;
  215|      0|  }
  216|       |
  217|  1.26k|  const std::time_t t = static_cast<std::time_t>(s);
  218|  1.26k|  std::tm tm;
  219|  1.26k|  std::tm* tmp = local_ ? local_time(&t, &tm) : gm_time(&t, &tm);
  ------------------
  |  Branch (219:18): [True: 216, False: 1.04k]
  ------------------
  220|       |
  221|       |  // If std::tm cannot hold the result we saturate the output.
  222|  1.26k|  if (tmp == nullptr) {
  ------------------
  |  Branch (222:7): [True: 374, False: 888]
  ------------------
  223|    374|    al.cs = (s < 0) ? civil_second::min() : civil_second::max();
  ------------------
  |  Branch (223:13): [True: 145, False: 229]
  ------------------
  224|    374|    return al;
  225|    374|  }
  226|       |
  227|    888|  const year_t year = tmp->tm_year + year_t{1900};
  228|    888|  al.cs = civil_second(year, tmp->tm_mon + 1, tmp->tm_mday,
  229|    888|                       tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
  230|    888|  al.offset = static_cast<int>(tm_gmtoff(*tmp));
  231|    888|  al.abbr = local_ ? tm_zone(*tmp) : "UTC";  // as expected by cctz
  ------------------
  |  Branch (231:13): [True: 140, False: 748]
  ------------------
  232|    888|  al.is_dst = tmp->tm_isdst > 0;
  233|    888|  return al;
  234|  1.26k|}
_ZNK4cctz12TimeZoneLibC8MakeTimeERKNS_6detail10civil_timeINS1_10second_tagEEE:
  236|  1.76k|time_zone::civil_lookup TimeZoneLibC::MakeTime(const civil_second& cs) const {
  237|  1.76k|  if (!local_) {
  ------------------
  |  Branch (237:7): [True: 1.47k, False: 290]
  ------------------
  238|       |    // If time_point<seconds> cannot hold the result we saturate.
  239|  1.47k|    static const civil_second min_tp_cs =
  240|  1.47k|        civil_second() + ToUnixSeconds(time_point<seconds>::min());
  241|  1.47k|    static const civil_second max_tp_cs =
  242|  1.47k|        civil_second() + ToUnixSeconds(time_point<seconds>::max());
  243|  1.47k|    const time_point<seconds> tp =
  244|  1.47k|        (cs < min_tp_cs)
  ------------------
  |  Branch (244:9): [True: 106, False: 1.36k]
  ------------------
  245|  1.47k|            ? time_point<seconds>::min()
  246|  1.47k|            : (cs > max_tp_cs) ? time_point<seconds>::max()
  ------------------
  |  Branch (246:15): [True: 121, False: 1.24k]
  ------------------
  247|  1.36k|                               : FromUnixSeconds(cs - civil_second());
  248|  1.47k|    return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  249|  1.47k|  }
  250|       |
  251|       |  // If tm_year cannot hold the requested year we saturate the result.
  252|    290|  if (cs.year() < 0) {
  ------------------
  |  Branch (252:7): [True: 165, False: 125]
  ------------------
  253|    165|    if (cs.year() < std::numeric_limits<int>::min() + year_t{1900}) {
  ------------------
  |  Branch (253:9): [True: 38, False: 127]
  ------------------
  254|     38|      const time_point<seconds> tp = time_point<seconds>::min();
  255|     38|      return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  256|     38|    }
  257|    165|  } else {
  258|    125|    if (cs.year() - year_t{1900} > std::numeric_limits<int>::max()) {
  ------------------
  |  Branch (258:9): [True: 37, False: 88]
  ------------------
  259|     37|      const time_point<seconds> tp = time_point<seconds>::max();
  260|     37|      return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  261|     37|    }
  262|    125|  }
  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|    215|  std::time_t t0, t1;
  271|    215|  std::tm tm0, tm1;
  272|    215|  if (make_time(cs, 0, &t0, &tm0) && make_time(cs, 1, &t1, &tm1)) {
  ------------------
  |  Branch (272:7): [True: 215, False: 0]
  |  Branch (272:38): [True: 214, False: 1]
  ------------------
  273|    214|    if (tm0.tm_isdst == tm1.tm_isdst) {
  ------------------
  |  Branch (273:9): [True: 214, False: 0]
  ------------------
  274|       |      // The civil time was singular (pre == trans == post).
  275|    214|      const time_point<seconds> tp = FromUnixSeconds(tm0.tm_isdst ? t1 : t0);
  ------------------
  |  Branch (275:54): [True: 0, False: 214]
  ------------------
  276|    214|      return {time_zone::civil_lookup::UNIQUE, tp, tp, tp};
  277|    214|    }
  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|    215|}
_ZN4cctz12TimeZoneLibCC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  327|    188|    : local_(name == "localtime") {}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_110local_timeEPKlP2tm:
  129|    218|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|    218|    return localtime_r(timep, result);
  134|    218|#endif
  135|    218|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_17gm_timeEPKlP2tm:
  121|  1.04k|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.04k|    return gmtime_r(timep, result);
  126|  1.04k|#endif
  127|  1.04k|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_19make_timeERKNS_6detail10civil_timeINS1_10second_tagEEEiPlP2tm:
  141|    430|               std::tm* tm) {
  142|    430|  tm->tm_year = static_cast<int>(cs.year() - year_t{1900});
  143|    430|  tm->tm_mon = cs.month() - 1;
  144|    430|  tm->tm_mday = cs.day();
  145|    430|  tm->tm_hour = cs.hour();
  146|    430|  tm->tm_min = cs.minute();
  147|    430|  tm->tm_sec = cs.second();
  148|    430|  tm->tm_isdst = is_dst;
  149|    430|  *t = std::mktime(tm);
  150|    430|  if (*t == std::time_t{-1}) {
  ------------------
  |  Branch (150:7): [True: 2, False: 428]
  ------------------
  151|      2|    std::tm tm2;
  152|      2|    const std::tm* tmp = local_time(t, &tm2);
  153|      2|    if (tmp == nullptr || tmp->tm_year != tm->tm_year ||
  ------------------
  |  Branch (153:9): [True: 0, False: 2]
  |  Branch (153:27): [True: 1, False: 1]
  ------------------
  154|      1|        tmp->tm_mon != tm->tm_mon || tmp->tm_mday != tm->tm_mday ||
  ------------------
  |  Branch (154:9): [True: 0, False: 1]
  |  Branch (154:38): [True: 0, False: 1]
  ------------------
  155|      1|        tmp->tm_hour != tm->tm_hour || tmp->tm_min != tm->tm_min ||
  ------------------
  |  Branch (155:9): [True: 0, False: 1]
  |  Branch (155:40): [True: 0, False: 1]
  ------------------
  156|      1|        tmp->tm_sec != tm->tm_sec) {
  ------------------
  |  Branch (156:9): [True: 0, False: 1]
  ------------------
  157|       |      // A true error (not just one second before the epoch).
  158|      1|      return false;
  159|      1|    }
  160|      2|  }
  161|    429|  return true;
  162|    430|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_19tm_gmtoffI2tmEEDtdtfp_9tm_gmtoffERKT_:
   92|    888|auto tm_gmtoff(const T& tm) -> decltype(tm.tm_gmtoff) {
   93|    888|  return tm.tm_gmtoff;
   94|    888|}
time_zone_libc.cc:_ZN4cctz12_GLOBAL__N_17tm_zoneI2tmEEDtdtfp_7tm_zoneERKT_:
  110|    140|auto tm_zone(const T& tm) -> decltype(tm.tm_zone) {
  111|    140|  return tm.tm_zone;
  112|    140|}

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

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

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

