static int webvtt_event_to_ass(AVBPrint *buf, const char *p)

{

    int i, again, skip = 0;



    while (*p) {



        for (i = 0; i < FF_ARRAY_ELEMS(webvtt_tag_replace); i++) {

            const char *from = webvtt_tag_replace[i].from;

            const size_t len = strlen(from);

            if (!strncmp(p, from, len)) {

                av_bprintf(buf, "%s", webvtt_tag_replace[i].to);

                p += len;

                again = 1;

                break;

            }

        }

        if (!*p)

            break;



        if (again) {

            again = 0;

            skip = 0;

            continue;

        }

        if (*p == '<')

            skip = 1;

        else if (*p == '>')

            skip = 0;

        else if (p[0] == '\n' && p[1])

            av_bprintf(buf, "\\N");

        else if (!skip && *p != '\r')

            av_bprint_chars(buf, *p, 1);

        p++;

    }

    return 0;

}

static int webvtt_event_to_ass(AVBPrint *buf, const char *p)

{

    int i, again, skip = 0;



    while (*p) {



        for (i = 0; i < FF_ARRAY_ELEMS(webvtt_tag_replace); i++) {

            const char *from = webvtt_tag_replace[i].from;

            const size_t len = strlen(from);

            if (!strncmp(p, from, len)) {

                av_bprintf(buf, "%s", webvtt_tag_replace[i].to);

                p += len;

                again = 1;

                break;

            }

        }

        if (!*p)

            break;



        if (again) {

            again = 0;

            skip = 0;

            continue;

        }

        if (*p == '<')

            skip = 1;

        else if (*p == '>')

            skip = 0;

        else if (p[0] == '\n' && p[1])

            av_bprintf(buf, "\\N");

        else if (!skip && *p != '\r')

            av_bprint_chars(buf, *p, 1);

        p++;

    }

    return 0;

}

    int i, again, skip = 0;
static int FUNC_0(AVBPrint *VAR_0, const char *VAR_1)

{

    int VAR_2, VAR_3, VAR_4 = 0;



    while (*VAR_1) {



        for (VAR_2 = 0; VAR_2 < FF_ARRAY_ELEMS(webvtt_tag_replace); VAR_2++) {

            const char *from = webvtt_tag_replace[VAR_2].from;

            const size_t len = strlen(from);

            if (!strncmp(VAR_1, from, len)) {

                av_bprintf(VAR_0, "%s", webvtt_tag_replace[VAR_2].to);

                VAR_1 += len;

                VAR_3 = 1;

                break;

            }

        }

        if (!*VAR_1)

            break;



        if (VAR_3) {

            VAR_3 = 0;

            VAR_4 = 0;

            continue;

        }

        if (*VAR_1 == '<')

            VAR_4 = 1;

        else if (*VAR_1 == '>')

            VAR_4 = 0;

        else if (VAR_1[0] == '\n' && VAR_1[1])

            av_bprintf(VAR_0, "\\N");

        else if (!VAR_4 && *VAR_1 != '\r')

            av_bprint_chars(VAR_0, *VAR_1, 1);

        VAR_1++;

    }

    return 0;

}

static int FUNC_0(AVBPrint *VAR_0, const char *VAR_1)
{ int VAR_2, VAR_3, VAR_4 = 0; while (*VAR_1) { for (VAR_2 = 0; VAR_2 < FF_ARRAY_ELEMS(webvtt_tag_replace); VAR_2++) { const char *from = webvtt_tag_replace[VAR_2].from; const size_t len = strlen(from); if (!strncmp(VAR_1, from, len)) { av_bprintf(VAR_0, "%s", webvtt_tag_replace[VAR_2].to); VAR_1 += len; VAR_3 = 1; break; } } if (!*VAR_1)
break; if (VAR_3) { VAR_3 = 0; VAR_4 = 0; continue; } if (*VAR_1 == '<')
VAR_4 = 1; else if (*VAR_1 == '>')
VAR_4 = 0; else if (VAR_1[0] == '\n' && VAR_1[1])
av_bprintf(VAR_0, "\\N"); else if (!VAR_4 && *VAR_1 != '\r')
av_bprint_chars(VAR_0, *VAR_1, 1); VAR_1++; } return 0; }