static void handle_char(CCaptionSubContext *ctx, char hi, char lo, int64_t pts)

{

    struct Screen *screen = get_writing_screen(ctx);

    char *row = screen->characters[ctx->cursor_row];

    int ret;



    SET_FLAG(screen->row_used,ctx->cursor_row);



    ret = write_char(ctx, row, ctx->cursor_column, hi);

    if( ret == 0 )

        ctx->cursor_column++;



    if(lo) {

        ret = write_char(ctx, row, ctx->cursor_column, lo);

        if ( ret == 0 )

            ctx->cursor_column++;

    }

    write_char(ctx, row, ctx->cursor_column, 0);



    /* reset prev command since character can repeat */

    ctx->prev_cmd[0] = 0;

    ctx->prev_cmd[1] = 0;

    if (lo)

       av_dlog(ctx, "(%c,%c)\n",hi,lo);

    else

       av_dlog(ctx, "(%c)\n",hi);

}

static void handle_char(CCaptionSubContext *ctx, char hi, char lo, int64_t pts)

{

    struct Screen *screen = get_writing_screen(ctx);

    char *row = screen->characters[ctx->cursor_row];

    int ret;



    SET_FLAG(screen->row_used,ctx->cursor_row);



    ret = write_char(ctx, row, ctx->cursor_column, hi);

    if( ret == 0 )

        ctx->cursor_column++;



    if(lo) {

        ret = write_char(ctx, row, ctx->cursor_column, lo);

        if ( ret == 0 )

            ctx->cursor_column++;

    }

    write_char(ctx, row, ctx->cursor_column, 0);



    

    ctx->prev_cmd[0] = 0;

    ctx->prev_cmd[1] = 0;

    if (lo)

       av_dlog(ctx, "(%c,%c)\n",hi,lo);

    else

       av_dlog(ctx, "(%c)\n",hi);

}

static void FUNC_0(CCaptionSubContext *VAR_0, char VAR_1, char VAR_2, int64_t VAR_3)

{

    struct Screen *VAR_4 = get_writing_screen(VAR_0);

    char *VAR_5 = VAR_4->characters[VAR_0->cursor_row];

    int VAR_6;



    SET_FLAG(VAR_4->row_used,VAR_0->cursor_row);



    VAR_6 = write_char(VAR_0, VAR_5, VAR_0->cursor_column, VAR_1);

    if( VAR_6 == 0 )

        VAR_0->cursor_column++;



    if(VAR_2) {

        VAR_6 = write_char(VAR_0, VAR_5, VAR_0->cursor_column, VAR_2);

        if ( VAR_6 == 0 )

            VAR_0->cursor_column++;

    }

    write_char(VAR_0, VAR_5, VAR_0->cursor_column, 0);



    

    VAR_0->prev_cmd[0] = 0;

    VAR_0->prev_cmd[1] = 0;

    if (VAR_2)

       av_dlog(VAR_0, "(%c,%c)\n",VAR_1,VAR_2);

    else

       av_dlog(VAR_0, "(%c)\n",VAR_1);

}

static void FUNC_0(CCaptionSubContext *VAR_0, char VAR_1, char VAR_2, int64_t VAR_3)
{ struct Screen *VAR_4 = get_writing_screen(VAR_0); char *VAR_5 = VAR_4->characters[VAR_0->cursor_row]; int VAR_6; SET_FLAG(VAR_4->row_used,VAR_0->cursor_row); VAR_6 = write_char(VAR_0, VAR_5, VAR_0->cursor_column, VAR_1); if( VAR_6 == 0 )
VAR_0->cursor_column++; if(VAR_2) { VAR_6 = write_char(VAR_0, VAR_5, VAR_0->cursor_column, VAR_2); if ( VAR_6 == 0 )
VAR_0->cursor_column++; } write_char(VAR_0, VAR_5, VAR_0->cursor_column, 0); VAR_0->prev_cmd[0] = 0; VAR_0->prev_cmd[1] = 0; if (VAR_2)
av_dlog(VAR_0, "(%c,%c)\n",VAR_1,VAR_2); else
av_dlog(VAR_0, "(%c)\n",VAR_1); }