static void text_console_resize(QemuConsole *s)

{

    TextCell *cells, *c, *c1;

    int w1, x, y, last_width;



    last_width = s->width;

    s->width = surface_width(s->surface) / FONT_WIDTH;

    s->height = surface_height(s->surface) / FONT_HEIGHT;



    w1 = last_width;

    if (s->width < w1)

        w1 = s->width;



    cells = g_malloc(s->width * s->total_height * sizeof(TextCell));

    for(y = 0; y < s->total_height; y++) {

        c = &cells[y * s->width];

        if (w1 > 0) {

            c1 = &s->cells[y * last_width];

            for(x = 0; x < w1; x++) {

                *c++ = *c1++;

            }

        }

        for(x = w1; x < s->width; x++) {

            c->ch = ' ';

            c->t_attrib = s->t_attrib_default;

            c++;

        }

    }

    g_free(s->cells);

    s->cells = cells;

}

static void text_console_resize(QemuConsole *s)

{

    TextCell *cells, *c, *c1;

    int w1, x, y, last_width;



    last_width = s->width;

    s->width = surface_width(s->surface) / FONT_WIDTH;

    s->height = surface_height(s->surface) / FONT_HEIGHT;



    w1 = last_width;

    if (s->width < w1)

        w1 = s->width;



    cells = g_malloc(s->width * s->total_height * sizeof(TextCell));

    for(y = 0; y < s->total_height; y++) {

        c = &cells[y * s->width];

        if (w1 > 0) {

            c1 = &s->cells[y * last_width];

            for(x = 0; x < w1; x++) {

                *c++ = *c1++;

            }

        }

        for(x = w1; x < s->width; x++) {

            c->ch = ' ';

            c->t_attrib = s->t_attrib_default;

            c++;

        }

    }

    g_free(s->cells);

    s->cells = cells;

}

    cells = g_malloc(s->width * s->total_height * sizeof(TextCell));
static void FUNC_0(QemuConsole *VAR_0)

{

    TextCell *cells, *c, *c1;

    int VAR_1, VAR_2, VAR_3, VAR_4;



    VAR_4 = VAR_0->width;

    VAR_0->width = surface_width(VAR_0->surface) / FONT_WIDTH;

    VAR_0->height = surface_height(VAR_0->surface) / FONT_HEIGHT;



    VAR_1 = VAR_4;

    if (VAR_0->width < VAR_1)

        VAR_1 = VAR_0->width;



    cells = g_malloc(VAR_0->width * VAR_0->total_height * sizeof(TextCell));

    for(VAR_3 = 0; VAR_3 < VAR_0->total_height; VAR_3++) {

        c = &cells[VAR_3 * VAR_0->width];

        if (VAR_1 > 0) {

            c1 = &VAR_0->cells[VAR_3 * VAR_4];

            for(VAR_2 = 0; VAR_2 < VAR_1; VAR_2++) {

                *c++ = *c1++;

            }

        }

        for(VAR_2 = VAR_1; VAR_2 < VAR_0->width; VAR_2++) {

            c->ch = ' ';

            c->t_attrib = VAR_0->t_attrib_default;

            c++;

        }

    }

    g_free(VAR_0->cells);

    VAR_0->cells = cells;

}

static void FUNC_0(QemuConsole *VAR_0)
{ TextCell *cells, *c, *c1; int VAR_1, VAR_2, VAR_3, VAR_4; VAR_4 = VAR_0->width; VAR_0->width = surface_width(VAR_0->surface) / FONT_WIDTH; VAR_0->height = surface_height(VAR_0->surface) / FONT_HEIGHT; VAR_1 = VAR_4; if (VAR_0->width < VAR_1)
VAR_1 = VAR_0->width; cells = g_malloc(VAR_0->width * VAR_0->total_height * sizeof(TextCell)); for(VAR_3 = 0; VAR_3 < VAR_0->total_height; VAR_3++) { c = &cells[VAR_3 * VAR_0->width]; if (VAR_1 > 0) { c1 = &VAR_0->cells[VAR_3 * VAR_4]; for(VAR_2 = 0; VAR_2 < VAR_1; VAR_2++) { *c++ = *c1++; } } for(VAR_2 = VAR_1; VAR_2 < VAR_0->width; VAR_2++) { c->ch = ' '; c->t_attrib = VAR_0->t_attrib_default; c++; } } g_free(VAR_0->cells); VAR_0->cells = cells; }