static int ftp_status(FTPContext *s, char **line, const int response_codes[])

{

    int err, i, dash = 0, result = 0, code_found = 0;

    char buf[CONTROL_BUFFER_SIZE];

    AVBPrint line_buffer;



    if (line)

        av_bprint_init(&line_buffer, 0, AV_BPRINT_SIZE_AUTOMATIC);



    while (!code_found || dash) {

        if ((err = ftp_get_line(s, buf, sizeof(buf))) < 0) {

            av_bprint_finalize(&line_buffer, NULL);

            return err;

        }



        av_log(s, AV_LOG_DEBUG, "%s\n", buf);



        if (strlen(buf) < 4)

            continue;



        err = 0;

        for (i = 0; i < 3; ++i) {

            if (buf[i] < '0' || buf[i] > '9')

                continue;

            err *= 10;

            err += buf[i] - '0';

        }

        dash = !!(buf[3] == '-');



        for (i = 0; response_codes[i]; ++i) {

            if (err == response_codes[i]) {

                if (line)

                    av_bprintf(&line_buffer, "%s", buf);

                code_found = 1;

                result = err;

                break;

            }

        }

    }



    if (line)

        av_bprint_finalize(&line_buffer, line);

    return result;

}

static int ftp_status(FTPContext *s, char **line, const int response_codes[])

{

    int err, i, dash = 0, result = 0, code_found = 0;

    char buf[CONTROL_BUFFER_SIZE];

    AVBPrint line_buffer;



    if (line)

        av_bprint_init(&line_buffer, 0, AV_BPRINT_SIZE_AUTOMATIC);



    while (!code_found || dash) {

        if ((err = ftp_get_line(s, buf, sizeof(buf))) < 0) {

            av_bprint_finalize(&line_buffer, NULL);

            return err;

        }



        av_log(s, AV_LOG_DEBUG, "%s\n", buf);



        if (strlen(buf) < 4)

            continue;



        err = 0;

        for (i = 0; i < 3; ++i) {

            if (buf[i] < '0' || buf[i] > '9')

                continue;

            err *= 10;

            err += buf[i] - '0';

        }

        dash = !!(buf[3] == '-');



        for (i = 0; response_codes[i]; ++i) {

            if (err == response_codes[i]) {

                if (line)

                    av_bprintf(&line_buffer, "%s", buf);

                code_found = 1;

                result = err;

                break;

            }

        }

    }



    if (line)

        av_bprint_finalize(&line_buffer, line);

    return result;

}

            av_bprint_finalize(&line_buffer, NULL);
static int FUNC_0(FTPContext *VAR_0, char **VAR_1, const int VAR_2[])

{

    int VAR_3, VAR_4, VAR_5 = 0, VAR_6 = 0, VAR_7 = 0;

    char VAR_8[CONTROL_BUFFER_SIZE];

    AVBPrint line_buffer;



    if (VAR_1)

        av_bprint_init(&line_buffer, 0, AV_BPRINT_SIZE_AUTOMATIC);



    while (!VAR_7 || VAR_5) {

        if ((VAR_3 = ftp_get_line(VAR_0, VAR_8, sizeof(VAR_8))) < 0) {

            av_bprint_finalize(&line_buffer, NULL);

            return VAR_3;

        }



        av_log(VAR_0, AV_LOG_DEBUG, "%VAR_0\n", VAR_8);



        if (strlen(VAR_8) < 4)

            continue;



        VAR_3 = 0;

        for (VAR_4 = 0; VAR_4 < 3; ++VAR_4) {

            if (VAR_8[VAR_4] < '0' || VAR_8[VAR_4] > '9')

                continue;

            VAR_3 *= 10;

            VAR_3 += VAR_8[VAR_4] - '0';

        }

        VAR_5 = !!(VAR_8[3] == '-');



        for (VAR_4 = 0; VAR_2[VAR_4]; ++VAR_4) {

            if (VAR_3 == VAR_2[VAR_4]) {

                if (VAR_1)

                    av_bprintf(&line_buffer, "%VAR_0", VAR_8);

                VAR_7 = 1;

                VAR_6 = VAR_3;

                break;

            }

        }

    }



    if (VAR_1)

        av_bprint_finalize(&line_buffer, VAR_1);

    return VAR_6;

}

static int FUNC_0(FTPContext *VAR_0, char **VAR_1, const int VAR_2[])
{ int VAR_3, VAR_4, VAR_5 = 0, VAR_6 = 0, VAR_7 = 0; char VAR_8[CONTROL_BUFFER_SIZE]; AVBPrint line_buffer; if (VAR_1)
av_bprint_init(&line_buffer, 0, AV_BPRINT_SIZE_AUTOMATIC); while (!VAR_7 || VAR_5) { if ((VAR_3 = ftp_get_line(VAR_0, VAR_8, sizeof(VAR_8))) < 0) { av_bprint_finalize(&line_buffer, NULL); return VAR_3; } av_log(VAR_0, AV_LOG_DEBUG, "%VAR_0\n", VAR_8); if (strlen(VAR_8) < 4)
continue; VAR_3 = 0; for (VAR_4 = 0; VAR_4 < 3; ++VAR_4) { if (VAR_8[VAR_4] < '0' || VAR_8[VAR_4] > '9')
continue; VAR_3 *= 10; VAR_3 += VAR_8[VAR_4] - '0'; } VAR_5 = !!(VAR_8[3] == '-'); for (VAR_4 = 0; VAR_2[VAR_4]; ++VAR_4) { if (VAR_3 == VAR_2[VAR_4]) { if (VAR_1)
av_bprintf(&line_buffer, "%VAR_0", VAR_8); VAR_7 = 1; VAR_6 = VAR_3; break; } } } if (VAR_1)
av_bprint_finalize(&line_buffer, VAR_1); return VAR_6; }