static int jpeg2000_read_bitstream_packets(Jpeg2000DecoderContext *s)

{

    int ret = 0;

    int tileno;



    for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++) {

        Jpeg2000Tile *tile = s->tile + tileno;



        if (ret = init_tile(s, tileno))

            return ret;



        s->g = tile->tile_part[0].tpg;

        if (ret = jpeg2000_decode_packets(s, tile))

            return ret;

    }



    return 0;

}

static int jpeg2000_read_bitstream_packets(Jpeg2000DecoderContext *s)

{

    int ret = 0;

    int tileno;



    for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++) {

        Jpeg2000Tile *tile = s->tile + tileno;



        if (ret = init_tile(s, tileno))

            return ret;



        s->g = tile->tile_part[0].tpg;

        if (ret = jpeg2000_decode_packets(s, tile))

            return ret;

    }



    return 0;

}

static int FUNC_0(Jpeg2000DecoderContext *VAR_0)

{

    int VAR_1 = 0;

    int VAR_2;



    for (VAR_2 = 0; VAR_2 < VAR_0->numXtiles * VAR_0->numYtiles; VAR_2++) {

        Jpeg2000Tile *tile = VAR_0->tile + VAR_2;



        if (VAR_1 = init_tile(VAR_0, VAR_2))

            return VAR_1;



        VAR_0->g = tile->tile_part[0].tpg;

        if (VAR_1 = jpeg2000_decode_packets(VAR_0, tile))

            return VAR_1;

    }



    return 0;

}

static int FUNC_0(Jpeg2000DecoderContext *VAR_0)
{ int VAR_1 = 0; int VAR_2; for (VAR_2 = 0; VAR_2 < VAR_0->numXtiles * VAR_0->numYtiles; VAR_2++) { Jpeg2000Tile *tile = VAR_0->tile + VAR_2; if (VAR_1 = init_tile(VAR_0, VAR_2))
return VAR_1; VAR_0->g = tile->tile_part[0].tpg; if (VAR_1 = jpeg2000_decode_packets(VAR_0, tile))
return VAR_1; } return 0; }