static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
                   uint8_t *properties)
{
    Jpeg2000CodingStyle tmp;
    int compno, ret;
    if (bytestream2_get_bytes_left(&s->g) < 5)
    tmp.csty = bytestream2_get_byteu(&s->g);
    // get progression order
    tmp.prog_order = bytestream2_get_byteu(&s->g);
    tmp.nlayers    = bytestream2_get_be16u(&s->g);
    tmp.mct        = bytestream2_get_byteu(&s->g); // multiple component transformation
    if ((ret = get_cox(s, &tmp)) < 0)
        return ret;
    for (compno = 0; compno < s->ncomponents; compno++)
        if (!(properties[compno] & HAD_COC))
            memcpy(c + compno, &tmp, sizeof(tmp));
    return 0;
static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
                   uint8_t *properties)
{
    Jpeg2000CodingStyle tmp;
    int compno, ret;
    if (bytestream2_get_bytes_left(&s->g) < 5)
    tmp.csty = bytestream2_get_byteu(&s->g);
    
    tmp.prog_order = bytestream2_get_byteu(&s->g);
    tmp.nlayers    = bytestream2_get_be16u(&s->g);
    tmp.mct        = bytestream2_get_byteu(&s->g); 
    if ((ret = get_cox(s, &tmp)) < 0)
        return ret;
    for (compno = 0; compno < s->ncomponents; compno++)
        if (!(properties[compno] & HAD_COC))
            memcpy(c + compno, &tmp, sizeof(tmp));
    return 0;
static int FUNC_0(Jpeg2000DecoderContext *VAR_0, Jpeg2000CodingStyle *VAR_1,
                   uint8_t *VAR_2)
{
    Jpeg2000CodingStyle tmp;
    int VAR_3, VAR_4;
    if (bytestream2_get_bytes_left(&VAR_0->g) < 5)
    tmp.csty = bytestream2_get_byteu(&VAR_0->g);
    
    tmp.prog_order = bytestream2_get_byteu(&VAR_0->g);
    tmp.nlayers    = bytestream2_get_be16u(&VAR_0->g);
    tmp.mct        = bytestream2_get_byteu(&VAR_0->g); 
    if ((VAR_4 = get_cox(VAR_0, &tmp)) < 0)
        return VAR_4;
    for (VAR_3 = 0; VAR_3 < VAR_0->ncomponents; VAR_3++)
        if (!(VAR_2[VAR_3] & HAD_COC))
            memcpy(VAR_1 + VAR_3, &tmp, sizeof(tmp));
    return 0;
static int FUNC_0(Jpeg2000DecoderContext *VAR_0, Jpeg2000CodingStyle *VAR_1,
uint8_t *VAR_2)
{ Jpeg2000CodingStyle tmp; int VAR_3, VAR_4; if (bytestream2_get_bytes_left(&VAR_0->g) < 5)
tmp.csty = bytestream2_get_byteu(&VAR_0->g); tmp.prog_order = bytestream2_get_byteu(&VAR_0->g); tmp.nlayers    = bytestream2_get_be16u(&VAR_0->g); tmp.mct        = bytestream2_get_byteu(&VAR_0->g); if ((VAR_4 = get_cox(VAR_0, &tmp)) < 0)
return VAR_4; for (VAR_3 = 0; VAR_3 < VAR_0->ncomponents; VAR_3++) if (!(VAR_2[VAR_3] & HAD_COC))
memcpy(VAR_1 + VAR_3, &tmp, sizeof(tmp)); return 0;