static void spatial_compose97i_dy_buffered(dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line){

    int y = cs->y;



    int mirror0 = mirror(y - 1, height - 1);

    int mirror1 = mirror(y + 0, height - 1);

    int mirror2 = mirror(y + 1, height - 1);

    int mirror3 = mirror(y + 2, height - 1);

    int mirror4 = mirror(y + 3, height - 1);

    int mirror5 = mirror(y + 4, height - 1);

    DWTELEM *b0= cs->b0;

    DWTELEM *b1= cs->b1;

    DWTELEM *b2= cs->b2;

    DWTELEM *b3= cs->b3;

    DWTELEM *b4= slice_buffer_get_line(sb, mirror4 * stride_line);

    DWTELEM *b5= slice_buffer_get_line(sb, mirror5 * stride_line);



{START_TIMER

    if(y>0 && y+4<height){

        vertical_compose97i(b0, b1, b2, b3, b4, b5, width);

    }else{

        if(mirror3 <= mirror5) vertical_compose97iL1(b3, b4, b5, width);

        if(mirror2 <= mirror4) vertical_compose97iH1(b2, b3, b4, width);

        if(mirror1 <= mirror3) vertical_compose97iL0(b1, b2, b3, width);

        if(mirror0 <= mirror2) vertical_compose97iH0(b0, b1, b2, width);

    }

if(width>400){

STOP_TIMER("vertical_compose97i")}}



{START_TIMER

        if(y-1>=  0) horizontal_compose97i(b0, width);

        if(mirror0 <= mirror2) horizontal_compose97i(b1, width);

if(width>400 && mirror0 <= mirror2){

STOP_TIMER("horizontal_compose97i")}}



    cs->b0=b2;

    cs->b1=b3;

    cs->b2=b4;

    cs->b3=b5;

    cs->y += 2;

}

static void spatial_compose97i_dy_buffered(dwt_compose_t *cs, slice_buffer * sb, int width, int height, int stride_line){

    int y = cs->y;



    int mirror0 = mirror(y - 1, height - 1);

    int mirror1 = mirror(y + 0, height - 1);

    int mirror2 = mirror(y + 1, height - 1);

    int mirror3 = mirror(y + 2, height - 1);

    int mirror4 = mirror(y + 3, height - 1);

    int mirror5 = mirror(y + 4, height - 1);

    DWTELEM *b0= cs->b0;

    DWTELEM *b1= cs->b1;

    DWTELEM *b2= cs->b2;

    DWTELEM *b3= cs->b3;

    DWTELEM *b4= slice_buffer_get_line(sb, mirror4 * stride_line);

    DWTELEM *b5= slice_buffer_get_line(sb, mirror5 * stride_line);



{START_TIMER

    if(y>0 && y+4<height){

        vertical_compose97i(b0, b1, b2, b3, b4, b5, width);

    }else{

        if(mirror3 <= mirror5) vertical_compose97iL1(b3, b4, b5, width);

        if(mirror2 <= mirror4) vertical_compose97iH1(b2, b3, b4, width);

        if(mirror1 <= mirror3) vertical_compose97iL0(b1, b2, b3, width);

        if(mirror0 <= mirror2) vertical_compose97iH0(b0, b1, b2, width);

    }

if(width>400){

STOP_TIMER("vertical_compose97i")}}



{START_TIMER

        if(y-1>=  0) horizontal_compose97i(b0, width);

        if(mirror0 <= mirror2) horizontal_compose97i(b1, width);

if(width>400 && mirror0 <= mirror2){

STOP_TIMER("horizontal_compose97i")}}



    cs->b0=b2;

    cs->b1=b3;

    cs->b2=b4;

    cs->b3=b5;

    cs->y += 2;

}

        if(mirror3 <= mirror5) vertical_compose97iL1(b3, b4, b5, width);         if(mirror2 <= mirror4) vertical_compose97iH1(b2, b3, b4, width);         if(mirror1 <= mirror3) vertical_compose97iL0(b1, b2, b3, width);         if(mirror0 <= mirror2) vertical_compose97iH0(b0, b1, b2, width);         if(y-1>=  0) horizontal_compose97i(b0, width);         if(mirror0 <= mirror2) horizontal_compose97i(b1, width);         if(y-1>=  0) horizontal_compose97i(b0, width);
static void FUNC_0(dwt_compose_t *VAR_0, slice_buffer * VAR_1, int VAR_2, int VAR_3, int VAR_4){

    int VAR_5 = VAR_0->VAR_5;



    int VAR_6 = mirror(VAR_5 - 1, VAR_3 - 1);

    int VAR_7 = mirror(VAR_5 + 0, VAR_3 - 1);

    int VAR_8 = mirror(VAR_5 + 1, VAR_3 - 1);

    int VAR_9 = mirror(VAR_5 + 2, VAR_3 - 1);

    int VAR_10 = mirror(VAR_5 + 3, VAR_3 - 1);

    int VAR_11 = mirror(VAR_5 + 4, VAR_3 - 1);

    DWTELEM *b0= VAR_0->b0;

    DWTELEM *b1= VAR_0->b1;

    DWTELEM *b2= VAR_0->b2;

    DWTELEM *b3= VAR_0->b3;

    DWTELEM *b4= slice_buffer_get_line(VAR_1, VAR_10 * VAR_4);

    DWTELEM *b5= slice_buffer_get_line(VAR_1, VAR_11 * VAR_4);



{START_TIMER

    if(VAR_5>0 && VAR_5+4<VAR_3){

        vertical_compose97i(b0, b1, b2, b3, b4, b5, VAR_2);

    }else{

        if(VAR_9 <= VAR_11) vertical_compose97iL1(b3, b4, b5, VAR_2);

        if(VAR_8 <= VAR_10) vertical_compose97iH1(b2, b3, b4, VAR_2);

        if(VAR_7 <= VAR_9) vertical_compose97iL0(b1, b2, b3, VAR_2);

        if(VAR_6 <= VAR_8) vertical_compose97iH0(b0, b1, b2, VAR_2);

    }

if(VAR_2>400){

STOP_TIMER("vertical_compose97i")}}



{START_TIMER

        if(VAR_5-1>=  0) horizontal_compose97i(b0, VAR_2);

        if(VAR_6 <= VAR_8) horizontal_compose97i(b1, VAR_2);

if(VAR_2>400 && VAR_6 <= VAR_8){

STOP_TIMER("horizontal_compose97i")}}



    VAR_0->b0=b2;

    VAR_0->b1=b3;

    VAR_0->b2=b4;

    VAR_0->b3=b5;

    VAR_0->VAR_5 += 2;

}

static void FUNC_0(dwt_compose_t *VAR_0, slice_buffer * VAR_1, int VAR_2, int VAR_3, int VAR_4){ int VAR_5 = VAR_0->VAR_5; int VAR_6 = mirror(VAR_5 - 1, VAR_3 - 1); int VAR_7 = mirror(VAR_5 + 0, VAR_3 - 1); int VAR_8 = mirror(VAR_5 + 1, VAR_3 - 1); int VAR_9 = mirror(VAR_5 + 2, VAR_3 - 1); int VAR_10 = mirror(VAR_5 + 3, VAR_3 - 1); int VAR_11 = mirror(VAR_5 + 4, VAR_3 - 1); DWTELEM *b0= VAR_0->b0; DWTELEM *b1= VAR_0->b1; DWTELEM *b2= VAR_0->b2; DWTELEM *b3= VAR_0->b3; DWTELEM *b4= slice_buffer_get_line(VAR_1, VAR_10 * VAR_4); DWTELEM *b5= slice_buffer_get_line(VAR_1, VAR_11 * VAR_4); {START_TIMER if(VAR_5>0 && VAR_5+4<VAR_3){ vertical_compose97i(b0, b1, b2, b3, b4, b5, VAR_2); }else{ if(VAR_9 <= VAR_11) vertical_compose97iL1(b3, b4, b5, VAR_2); if(VAR_8 <= VAR_10) vertical_compose97iH1(b2, b3, b4, VAR_2); if(VAR_7 <= VAR_9) vertical_compose97iL0(b1, b2, b3, VAR_2); if(VAR_6 <= VAR_8) vertical_compose97iH0(b0, b1, b2, VAR_2); } if(VAR_2>400){ STOP_TIMER("vertical_compose97i")}} {START_TIMER if(VAR_5-1>=  0) horizontal_compose97i(b0, VAR_2); if(VAR_6 <= VAR_8) horizontal_compose97i(b1, VAR_2); if(VAR_2>400 && VAR_6 <= VAR_8){ STOP_TIMER("horizontal_compose97i")}} VAR_0->b0=b2; VAR_0->b1=b3; VAR_0->b2=b4; VAR_0->b3=b5; VAR_0->VAR_5 += 2; }