static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)

{

    int i, ncol, r, g, b;

    uint32_t *pal = ctx->pal + 256 - ctx->free_colours;



    if (!ctx->free_colours)

        return 0;



    ncol = arith_get_number(acoder, ctx->free_colours + 1);

    for (i = 0; i < ncol; i++) {

        r = arith_get_bits(acoder, 8);

        g = arith_get_bits(acoder, 8);

        b = arith_get_bits(acoder, 8);

        *pal++ = (0xFF << 24) | (r << 16) | (g << 8) | b;

    }



    return !!ncol;

}

static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)

{

    int i, ncol, r, g, b;

    uint32_t *pal = ctx->pal + 256 - ctx->free_colours;



    if (!ctx->free_colours)

        return 0;



    ncol = arith_get_number(acoder, ctx->free_colours + 1);

    for (i = 0; i < ncol; i++) {

        r = arith_get_bits(acoder, 8);

        g = arith_get_bits(acoder, 8);

        b = arith_get_bits(acoder, 8);

        *pal++ = (0xFF << 24) | (r << 16) | (g << 8) | b;

    }



    return !!ncol;

}

        *pal++ = (0xFF << 24) | (r << 16) | (g << 8) | b;
static int FUNC_0(MSS12Context *VAR_0, ArithCoder *VAR_1)

{

    int VAR_2, VAR_3, VAR_4, VAR_5, VAR_6;

    uint32_t *pal = VAR_0->pal + 256 - VAR_0->free_colours;



    if (!VAR_0->free_colours)

        return 0;



    VAR_3 = arith_get_number(VAR_1, VAR_0->free_colours + 1);

    for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) {

        VAR_4 = arith_get_bits(VAR_1, 8);

        VAR_5 = arith_get_bits(VAR_1, 8);

        VAR_6 = arith_get_bits(VAR_1, 8);

        *pal++ = (0xFF << 24) | (VAR_4 << 16) | (VAR_5 << 8) | VAR_6;

    }



    return !!VAR_3;

}

static int FUNC_0(MSS12Context *VAR_0, ArithCoder *VAR_1)
{ int VAR_2, VAR_3, VAR_4, VAR_5, VAR_6; uint32_t *pal = VAR_0->pal + 256 - VAR_0->free_colours; if (!VAR_0->free_colours)
return 0; VAR_3 = arith_get_number(VAR_1, VAR_0->free_colours + 1); for (VAR_2 = 0; VAR_2 < VAR_3; VAR_2++) { VAR_4 = arith_get_bits(VAR_1, 8); VAR_5 = arith_get_bits(VAR_1, 8); VAR_6 = arith_get_bits(VAR_1, 8); *pal++ = (0xFF << 24) | (VAR_4 << 16) | (VAR_5 << 8) | VAR_6; } return !!VAR_3; }