static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
                      int append)
{
    int buflen;
    /** when the frame data does not need to be concatenated, the input buffer
        is resetted and additional bits from the previous frame are copyed
        and skipped later so that a fast byte copy is possible */
    if (!append) {
        s->frame_offset = get_bits_count(gb) & 7;
        s->num_saved_bits = s->frame_offset;
        init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
    buflen = (s->num_saved_bits + len + 8) >> 3;
    if (len <= 0 || buflen > MAX_FRAMESIZE) {
        avpriv_request_sample(s->avctx, "Too small input buffer");
    s->num_saved_bits += len;
    if (!append) {
        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3),
                     s->num_saved_bits);
    } else {
        int align = 8 - (get_bits_count(gb) & 7);
        align = FFMIN(align, len);
        put_bits(&s->pb, align, get_bits(gb, align));
        len -= align;
        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), len);
    skip_bits_long(gb, len);
    {
        PutBitContext tmp = s->pb;
        flush_put_bits(&tmp);
    init_get_bits(&s->gb, s->frame_data, s->num_saved_bits);
    skip_bits(&s->gb, s->frame_offset);
static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len,
                      int append)
{
    int buflen;
    


    if (!append) {
        s->frame_offset = get_bits_count(gb) & 7;
        s->num_saved_bits = s->frame_offset;
        init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
    buflen = (s->num_saved_bits + len + 8) >> 3;
    if (len <= 0 || buflen > MAX_FRAMESIZE) {
        avpriv_request_sample(s->avctx, "Too small input buffer");
    s->num_saved_bits += len;
    if (!append) {
        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3),
                     s->num_saved_bits);
    } else {
        int align = 8 - (get_bits_count(gb) & 7);
        align = FFMIN(align, len);
        put_bits(&s->pb, align, get_bits(gb, align));
        len -= align;
        avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), len);
    skip_bits_long(gb, len);
    {
        PutBitContext tmp = s->pb;
        flush_put_bits(&tmp);
    init_get_bits(&s->gb, s->frame_data, s->num_saved_bits);
    skip_bits(&s->gb, s->frame_offset);
static void FUNC_0(WMAProDecodeCtx *VAR_0, GetBitContext* VAR_1, int VAR_2,
                      int VAR_3)
{
    int VAR_4;
    


    if (!VAR_3) {
        VAR_0->frame_offset = get_bits_count(VAR_1) & 7;
        VAR_0->num_saved_bits = VAR_0->frame_offset;
        init_put_bits(&VAR_0->pb, VAR_0->frame_data, MAX_FRAMESIZE);
    VAR_4 = (VAR_0->num_saved_bits + VAR_2 + 8) >> 3;
    if (VAR_2 <= 0 || VAR_4 > MAX_FRAMESIZE) {
        avpriv_request_sample(VAR_0->avctx, "Too small input buffer");
    VAR_0->num_saved_bits += VAR_2;
    if (!VAR_3) {
        avpriv_copy_bits(&VAR_0->pb, VAR_1->buffer + (get_bits_count(VAR_1) >> 3),
                     VAR_0->num_saved_bits);
    } else {
        int VAR_5 = 8 - (get_bits_count(VAR_1) & 7);
        VAR_5 = FFMIN(VAR_5, VAR_2);
        put_bits(&VAR_0->pb, VAR_5, get_bits(VAR_1, VAR_5));
        VAR_2 -= VAR_5;
        avpriv_copy_bits(&VAR_0->pb, VAR_1->buffer + (get_bits_count(VAR_1) >> 3), VAR_2);
    skip_bits_long(VAR_1, VAR_2);
    {
        PutBitContext tmp = VAR_0->pb;
        flush_put_bits(&tmp);
    init_get_bits(&VAR_0->VAR_1, VAR_0->frame_data, VAR_0->num_saved_bits);
    skip_bits(&VAR_0->VAR_1, VAR_0->frame_offset);
static void FUNC_0(WMAProDecodeCtx *VAR_0, GetBitContext* VAR_1, int VAR_2,
int VAR_3)
{ int VAR_4; if (!VAR_3) { VAR_0->frame_offset = get_bits_count(VAR_1) & 7; VAR_0->num_saved_bits = VAR_0->frame_offset; init_put_bits(&VAR_0->pb, VAR_0->frame_data, MAX_FRAMESIZE); VAR_4 = (VAR_0->num_saved_bits + VAR_2 + 8) >> 3; if (VAR_2 <= 0 || VAR_4 > MAX_FRAMESIZE) { avpriv_request_sample(VAR_0->avctx, "Too small input buffer"); VAR_0->num_saved_bits += VAR_2; if (!VAR_3) { avpriv_copy_bits(&VAR_0->pb, VAR_1->buffer + (get_bits_count(VAR_1) >> 3),
VAR_0->num_saved_bits); } else { int VAR_5 = 8 - (get_bits_count(VAR_1) & 7); VAR_5 = FFMIN(VAR_5, VAR_2); put_bits(&VAR_0->pb, VAR_5, get_bits(VAR_1, VAR_5)); VAR_2 -= VAR_5; avpriv_copy_bits(&VAR_0->pb, VAR_1->buffer + (get_bits_count(VAR_1) >> 3), VAR_2); skip_bits_long(VAR_1, VAR_2); { PutBitContext tmp = VAR_0->pb; flush_put_bits(&tmp); init_get_bits(&VAR_0->VAR_1, VAR_0->frame_data, VAR_0->num_saved_bits); skip_bits(&VAR_0->VAR_1, VAR_0->frame_offset);