static int cmp_intervals(const void *a, const void *b)

{

    const Interval *i1 = a;

    const Interval *i2 = b;

    int64_t ts_diff = i1->start_ts - i2->start_ts;

    int ret;



    ret = ts_diff > 0 ? 1 : ts_diff < 0 ? -1 : 0;

    return ret == 0 ? i1->index - i2->index : ret;

}

static int cmp_intervals(const void *a, const void *b)

{

    const Interval *i1 = a;

    const Interval *i2 = b;

    int64_t ts_diff = i1->start_ts - i2->start_ts;

    int ret;



    ret = ts_diff > 0 ? 1 : ts_diff < 0 ? -1 : 0;

    return ret == 0 ? i1->index - i2->index : ret;

}

    int64_t ts_diff = i1->start_ts - i2->start_ts;     int ret;     ret = ts_diff > 0 ? 1 : ts_diff < 0 ? -1 : 0;     return ret == 0 ? i1->index - i2->index : ret;
static int FUNC_0(const void *VAR_0, const void *VAR_1)

{

    const Interval *VAR_2 = VAR_0;

    const Interval *VAR_3 = VAR_1;

    int64_t ts_diff = VAR_2->start_ts - VAR_3->start_ts;

    int VAR_4;



    VAR_4 = ts_diff > 0 ? 1 : ts_diff < 0 ? -1 : 0;

    return VAR_4 == 0 ? VAR_2->index - VAR_3->index : VAR_4;

}

static int FUNC_0(const void *VAR_0, const void *VAR_1)
{ const Interval *VAR_2 = VAR_0; const Interval *VAR_3 = VAR_1; int64_t ts_diff = VAR_2->start_ts - VAR_3->start_ts; int VAR_4; VAR_4 = ts_diff > 0 ? 1 : ts_diff < 0 ? -1 : 0; return VAR_4 == 0 ? VAR_2->index - VAR_3->index : VAR_4; }