static void update_max_chunk_size(BDRVDMGState *s, uint32_t chunk,

                                  uint32_t *max_compressed_size,

                                  uint32_t *max_sectors_per_chunk)

{

    uint32_t compressed_size = 0;

    uint32_t uncompressed_sectors = 0;



    switch (s->types[chunk]) {

    case 0x80000005: /* zlib compressed */

    case 0x80000006: /* bzip2 compressed */

        compressed_size = s->lengths[chunk];

        uncompressed_sectors = s->sectorcounts[chunk];

        break;

    case 1: /* copy */

        uncompressed_sectors = (s->lengths[chunk] + 511) / 512;

        break;

    case 2: /* zero */

        uncompressed_sectors = s->sectorcounts[chunk];

        break;

    }



    if (compressed_size > *max_compressed_size) {

        *max_compressed_size = compressed_size;

    }

    if (uncompressed_sectors > *max_sectors_per_chunk) {

        *max_sectors_per_chunk = uncompressed_sectors;

    }

}

static void update_max_chunk_size(BDRVDMGState *s, uint32_t chunk,

                                  uint32_t *max_compressed_size,

                                  uint32_t *max_sectors_per_chunk)

{

    uint32_t compressed_size = 0;

    uint32_t uncompressed_sectors = 0;



    switch (s->types[chunk]) {

    case 0x80000005: 

    case 0x80000006: 

        compressed_size = s->lengths[chunk];

        uncompressed_sectors = s->sectorcounts[chunk];

        break;

    case 1: 

        uncompressed_sectors = (s->lengths[chunk] + 511) / 512;

        break;

    case 2: 

        uncompressed_sectors = s->sectorcounts[chunk];

        break;

    }



    if (compressed_size > *max_compressed_size) {

        *max_compressed_size = compressed_size;

    }

    if (uncompressed_sectors > *max_sectors_per_chunk) {

        *max_sectors_per_chunk = uncompressed_sectors;

    }

}

static void FUNC_0(BDRVDMGState *VAR_0, uint32_t VAR_1,

                                  uint32_t *VAR_2,

                                  uint32_t *VAR_3)

{

    uint32_t compressed_size = 0;

    uint32_t uncompressed_sectors = 0;



    switch (VAR_0->types[VAR_1]) {

    case 0x80000005: 

    case 0x80000006: 

        compressed_size = VAR_0->lengths[VAR_1];

        uncompressed_sectors = VAR_0->sectorcounts[VAR_1];

        break;

    case 1: 

        uncompressed_sectors = (VAR_0->lengths[VAR_1] + 511) / 512;

        break;

    case 2: 

        uncompressed_sectors = VAR_0->sectorcounts[VAR_1];

        break;

    }



    if (compressed_size > *VAR_2) {

        *VAR_2 = compressed_size;

    }

    if (uncompressed_sectors > *VAR_3) {

        *VAR_3 = uncompressed_sectors;

    }

}

static void FUNC_0(BDRVDMGState *VAR_0, uint32_t VAR_1,
uint32_t *VAR_2,
uint32_t *VAR_3)
{ uint32_t compressed_size = 0; uint32_t uncompressed_sectors = 0; switch (VAR_0->types[VAR_1]) { case 0x80000005:
case 0x80000006:
compressed_size = VAR_0->lengths[VAR_1]; uncompressed_sectors = VAR_0->sectorcounts[VAR_1]; break; case 1:
uncompressed_sectors = (VAR_0->lengths[VAR_1] + 511) / 512; break; case 2:
uncompressed_sectors = VAR_0->sectorcounts[VAR_1]; break; } if (compressed_size > *VAR_2) { *VAR_2 = compressed_size; } if (uncompressed_sectors > *VAR_3) { *VAR_3 = uncompressed_sectors; } }