static int read_dialogue(ASSContext *ass, AVBPrint *dst, const uint8_t *p,

                         int64_t *start, int *duration)

{

    int pos;

    int64_t end;

    int hh1, mm1, ss1, ms1;

    int hh2, mm2, ss2, ms2;



    if (sscanf(p, "Dialogue: %*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d,%n",

               &hh1, &mm1, &ss1, &ms1,

               &hh2, &mm2, &ss2, &ms2, &pos) >= 8) {



        /* This is not part of the sscanf itself in order to handle an actual

         * number (which would be the Layer) or the form "Marked=N" (which is

         * the old SSA field, now replaced by Layer, and will be lead to Layer

         * being 0 here). */

        const int layer = atoi(p + 10);



        end    = (hh2*3600LL + mm2*60LL + ss2) * 100LL + ms2;

        *start = (hh1*3600LL + mm1*60LL + ss1) * 100LL + ms1;

        *duration = end - *start;



        av_bprint_clear(dst);

        av_bprintf(dst, "%u,%d,%s", ass->readorder++, layer, p + pos);



        /* right strip the buffer */

        while (dst->len > 0 &&

               dst->str[dst->len - 1] == '\r' ||

               dst->str[dst->len - 1] == '\n')

            dst->str[--dst->len] = 0;

        return 0;

    }

    return -1;

}

static int read_dialogue(ASSContext *ass, AVBPrint *dst, const uint8_t *p,

                         int64_t *start, int *duration)

{

    int pos;

    int64_t end;

    int hh1, mm1, ss1, ms1;

    int hh2, mm2, ss2, ms2;



    if (sscanf(p, "Dialogue: %*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d,%n",

               &hh1, &mm1, &ss1, &ms1,

               &hh2, &mm2, &ss2, &ms2, &pos) >= 8) {



        







        const int layer = atoi(p + 10);



        end    = (hh2*3600LL + mm2*60LL + ss2) * 100LL + ms2;

        *start = (hh1*3600LL + mm1*60LL + ss1) * 100LL + ms1;

        *duration = end - *start;



        av_bprint_clear(dst);

        av_bprintf(dst, "%u,%d,%s", ass->readorder++, layer, p + pos);



        

        while (dst->len > 0 &&

               dst->str[dst->len - 1] == '\r' ||

               dst->str[dst->len - 1] == '\n')

            dst->str[--dst->len] = 0;

        return 0;

    }

    return -1;

}

    int pos;                &hh2, &mm2, &ss2, &ms2, &pos) >= 8) {
static int FUNC_0(ASSContext *VAR_0, AVBPrint *VAR_1, const uint8_t *VAR_2,

                         int64_t *VAR_3, int *VAR_4)

{

    int VAR_5;

    int64_t end;

    int VAR_6, VAR_7, VAR_8, VAR_9;

    int VAR_10, VAR_11, VAR_12, VAR_13;



    if (sscanf(VAR_2, "Dialogue: %*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d,%n",

               &VAR_6, &VAR_7, &VAR_8, &VAR_9,

               &VAR_10, &VAR_11, &VAR_12, &VAR_13, &VAR_5) >= 8) {



        







        const int VAR_14 = atoi(VAR_2 + 10);



        end    = (VAR_10*3600LL + VAR_11*60LL + VAR_12) * 100LL + VAR_13;

        *VAR_3 = (VAR_6*3600LL + VAR_7*60LL + VAR_8) * 100LL + VAR_9;

        *VAR_4 = end - *VAR_3;



        av_bprint_clear(VAR_1);

        av_bprintf(VAR_1, "%u,%d,%s", VAR_0->readorder++, VAR_14, VAR_2 + VAR_5);



        

        while (VAR_1->len > 0 &&

               VAR_1->str[VAR_1->len - 1] == '\r' ||

               VAR_1->str[VAR_1->len - 1] == '\n')

            VAR_1->str[--VAR_1->len] = 0;

        return 0;

    }

    return -1;

}

static int FUNC_0(ASSContext *VAR_0, AVBPrint *VAR_1, const uint8_t *VAR_2,
int64_t *VAR_3, int *VAR_4)
{ int VAR_5; int64_t end; int VAR_6, VAR_7, VAR_8, VAR_9; int VAR_10, VAR_11, VAR_12, VAR_13; if (sscanf(VAR_2, "Dialogue: %*[^,],%d:%d:%d%*c%d,%d:%d:%d%*c%d,%n",
&VAR_6, &VAR_7, &VAR_8, &VAR_9,
&VAR_10, &VAR_11, &VAR_12, &VAR_13, &VAR_5) >= 8) { const int VAR_14 = atoi(VAR_2 + 10); end    = (VAR_10*3600LL + VAR_11*60LL + VAR_12) * 100LL + VAR_13; *VAR_3 = (VAR_6*3600LL + VAR_7*60LL + VAR_8) * 100LL + VAR_9; *VAR_4 = end - *VAR_3; av_bprint_clear(VAR_1); av_bprintf(VAR_1, "%u,%d,%s", VAR_0->readorder++, VAR_14, VAR_2 + VAR_5); while (VAR_1->len > 0 &&
VAR_1->str[VAR_1->len - 1] == '\r' ||
VAR_1->str[VAR_1->len - 1] == '\n')
VAR_1->str[--VAR_1->len] = 0; return 0; } return -1; }