static int put_v(ByteIOContext *bc, uint64_t val)

{

    int i;

//    if (bytes_left(s)*8 < 9)

//	return -1;



    if (bytes_left(bc) < 1)

	return -1;



    val &= 0x7FFFFFFFFFFFFFFFULL; // FIXME can only encode upto 63 bits currently

    i= get_length(val);



    for (i-=7; i>0; i-=7){

	put_byte(bc, 0x80 | (val>>i));

    }



    put_byte(bc, val&0x7f);



    return 0;

}

static int put_v(ByteIOContext *bc, uint64_t val)

{

    int i;







    if (bytes_left(bc) < 1)

	return -1;



    val &= 0x7FFFFFFFFFFFFFFFULL; 

    i= get_length(val);



    for (i-=7; i>0; i-=7){

	put_byte(bc, 0x80 | (val>>i));

    }



    put_byte(bc, val&0x7f);



    return 0;

}

static int FUNC_0(ByteIOContext *VAR_0, uint64_t VAR_1)

{

    int VAR_2;







    if (bytes_left(VAR_0) < 1)

	return -1;



    VAR_1 &= 0x7FFFFFFFFFFFFFFFULL; 

    VAR_2= get_length(VAR_1);



    for (VAR_2-=7; VAR_2>0; VAR_2-=7){

	put_byte(VAR_0, 0x80 | (VAR_1>>VAR_2));

    }



    put_byte(VAR_0, VAR_1&0x7f);



    return 0;

}

static int FUNC_0(ByteIOContext *VAR_0, uint64_t VAR_1)
{ int VAR_2; if (bytes_left(VAR_0) < 1)
return -1; VAR_1 &= 0x7FFFFFFFFFFFFFFFULL; VAR_2= get_length(VAR_1); for (VAR_2-=7; VAR_2>0; VAR_2-=7){ put_byte(VAR_0, 0x80 | (VAR_1>>VAR_2)); } put_byte(VAR_0, VAR_1&0x7f); return 0; }