/* Shift a (signed) quad value right (arithmetic shift right).  */
quad_t __ashrdi3(quad_t a, qshift_t shift)
/* Shift a (signed) quad value right (arithmetic shift right).  */
quad_t __ashrdi3(quad_t a, qshift_t shift)
{
    union uu aa;
    if (shift == 0) {
        return a;
    }
    aa.q = a;
    if (shift >= INT_BITS) {
        int s = (aa.sl[H] >> (INT_BITS - 1)) >> 1;
        aa.ul[L] = aa.sl[H] >> (shift - INT_BITS);
        aa.ul[H] = s;
    }
    else {
        aa.ul[L] = (aa.ul[L] >> shift) | (aa.ul[H] << (INT_BITS - shift));
        aa.sl[H] >>= shift;
    }
    return aa.q;
}