static int ftp_getc(FTPContext *s)

{

    int len;

    if (s->control_buf_ptr >= s->control_buf_end) {

        if (s->conn_control_block_flag)

            return AVERROR_EXIT;

        len = ffurl_read(s->conn_control, s->control_buffer, CONTROL_BUFFER_SIZE);

        if (len < 0) {

            return len;

        } else if (!len) {

            return -1;

        } else {

            s->control_buf_ptr = s->control_buffer;

            s->control_buf_end = s->control_buffer + len;

        }

    }

    return *s->control_buf_ptr++;

}

static int ftp_getc(FTPContext *s)

{

    int len;

    if (s->control_buf_ptr >= s->control_buf_end) {

        if (s->conn_control_block_flag)

            return AVERROR_EXIT;

        len = ffurl_read(s->conn_control, s->control_buffer, CONTROL_BUFFER_SIZE);

        if (len < 0) {

            return len;

        } else if (!len) {

            return -1;

        } else {

            s->control_buf_ptr = s->control_buffer;

            s->control_buf_end = s->control_buffer + len;

        }

    }

    return *s->control_buf_ptr++;

}

static int FUNC_0(FTPContext *VAR_0)

{

    int VAR_1;

    if (VAR_0->control_buf_ptr >= VAR_0->control_buf_end) {

        if (VAR_0->conn_control_block_flag)

            return AVERROR_EXIT;

        VAR_1 = ffurl_read(VAR_0->conn_control, VAR_0->control_buffer, CONTROL_BUFFER_SIZE);

        if (VAR_1 < 0) {

            return VAR_1;

        } else if (!VAR_1) {

            return -1;

        } else {

            VAR_0->control_buf_ptr = VAR_0->control_buffer;

            VAR_0->control_buf_end = VAR_0->control_buffer + VAR_1;

        }

    }

    return *VAR_0->control_buf_ptr++;

}

static int FUNC_0(FTPContext *VAR_0)
{ int VAR_1; if (VAR_0->control_buf_ptr >= VAR_0->control_buf_end) { if (VAR_0->conn_control_block_flag)
return AVERROR_EXIT; VAR_1 = ffurl_read(VAR_0->conn_control, VAR_0->control_buffer, CONTROL_BUFFER_SIZE); if (VAR_1 < 0) { return VAR_1; } else if (!VAR_1) { return -1; } else { VAR_0->control_buf_ptr = VAR_0->control_buffer; VAR_0->control_buf_end = VAR_0->control_buffer + VAR_1; } } return *VAR_0->control_buf_ptr++; }