static int get_key(const char **ropts, const char *delim, char *key, unsigned key_size)

{

    unsigned key_pos = 0;

    const char *opts = *ropts;



    opts += strspn(opts, WHITESPACES);

    while (is_key_char(*opts)) {

        key[key_pos++] = *opts;

        if (key_pos == key_size)

            key_pos--;

        (opts)++;

    }

    opts += strspn(opts, WHITESPACES);

    if (!*opts || !strchr(delim, *opts))

        return AVERROR(EINVAL);

    opts++;

    key[key_pos++] = 0;

    if (key_pos == key_size)

        key[key_pos - 4] = key[key_pos - 3] = key[key_pos - 2] = '.';

    *ropts = opts;

    return 0;

}

static int get_key(const char **ropts, const char *delim, char *key, unsigned key_size)

{

    unsigned key_pos = 0;

    const char *opts = *ropts;



    opts += strspn(opts, WHITESPACES);

    while (is_key_char(*opts)) {

        key[key_pos++] = *opts;

        if (key_pos == key_size)

            key_pos--;

        (opts)++;

    }

    opts += strspn(opts, WHITESPACES);

    if (!*opts || !strchr(delim, *opts))

        return AVERROR(EINVAL);

    opts++;

    key[key_pos++] = 0;

    if (key_pos == key_size)

        key[key_pos - 4] = key[key_pos - 3] = key[key_pos - 2] = '.';

    *ropts = opts;

    return 0;

}

static int FUNC_0(const char **VAR_0, const char *VAR_1, char *VAR_2, unsigned VAR_3)

{

    unsigned VAR_4 = 0;

    const char *VAR_5 = *VAR_0;



    VAR_5 += strspn(VAR_5, WHITESPACES);

    while (is_key_char(*VAR_5)) {

        VAR_2[VAR_4++] = *VAR_5;

        if (VAR_4 == VAR_3)

            VAR_4--;

        (VAR_5)++;

    }

    VAR_5 += strspn(VAR_5, WHITESPACES);

    if (!*VAR_5 || !strchr(VAR_1, *VAR_5))

        return AVERROR(EINVAL);

    VAR_5++;

    VAR_2[VAR_4++] = 0;

    if (VAR_4 == VAR_3)

        VAR_2[VAR_4 - 4] = VAR_2[VAR_4 - 3] = VAR_2[VAR_4 - 2] = '.';

    *VAR_0 = VAR_5;

    return 0;

}

static int FUNC_0(const char **VAR_0, const char *VAR_1, char *VAR_2, unsigned VAR_3)
{ unsigned VAR_4 = 0; const char *VAR_5 = *VAR_0; VAR_5 += strspn(VAR_5, WHITESPACES); while (is_key_char(*VAR_5)) { VAR_2[VAR_4++] = *VAR_5; if (VAR_4 == VAR_3)
VAR_4--; (VAR_5)++; } VAR_5 += strspn(VAR_5, WHITESPACES); if (!*VAR_5 || !strchr(VAR_1, *VAR_5))
return AVERROR(EINVAL); VAR_5++; VAR_2[VAR_4++] = 0; if (VAR_4 == VAR_3)
VAR_2[VAR_4 - 4] = VAR_2[VAR_4 - 3] = VAR_2[VAR_4 - 2] = '.'; *VAR_0 = VAR_5; return 0; }