query, report https://gist.github.com/alesapin/c91d9ffd65471c4d8b595219a26a601a.
Full report
https://clickhouse-test-reports.s3.yandex.net/19412/cc2788af881c96701076b366259bc99525d926b1/fuzzer_asan/report.html#fail1
{
        DayNum index = findIndex(t);
        return lut[index - (lut[index].day_of_month - 1)].date;
    }
    inline DayNum toFirstDayNumOfMonth(DayNum d) const
    {
        return DayNum(d - (lut[d].day_of_month - 1));
    }
    inline DayNum toFirstDayNumOfMonth(time_t t) const
    {
        return toFirstDayNumOfMonth(toDayNum(t));
    }
    
    inline DayNum toFirstDayNumOfQuarter(DayNum d) const
    {
        DayNum index = d;
        size_t month_inside_quarter = (lut[index].month - 1) % 3;
        index -= lut[index].day_of_month;
        while (month_inside_quarter)
        {
            index -= lut[index].day_of_month;
            --month_inside_quarter;
        }
        return DayNum(index + 1);
    }
    inline DayNum toFirstDayNumOfQuarter(time_t t) const
    {
        return toFirstDayNumOfQuarter(toDayNum(t));
    }
    inline time_t toFirstDayOfQuarter(time_t t) const