private static int ssIsqrt(int x)
    {
        if (x >= (SS_BLOCKSIZE * SS_BLOCKSIZE))
            return SS_BLOCKSIZE;

        final int e = ((x & 0xFFFF0000) != 0) ? (((x & 0xFF000000) != 0) ? 24 + LOG_TABLE[(x>>24) & 0xFF]
            : 16 + LOG_TABLE[(x>>16) & 0xFF])
            : (((x & 0x0000FF00) != 0) ? 8 + LOG_TABLE[(x>>8) & 0xFF]
                : LOG_TABLE[x & 0xFF]);

        if (e < 8)
           return SQQ_TABLE[x] >> 4;

        int y;

        if (e >= 16)
        {
            y = SQQ_TABLE[x>>((e-6)-(e&1))] << ((e>>1)-7);

            if (e >= 24)
            {
                y = (y + 1 + x / y) >> 1;
            }

            y = (y + 1 + x / y) >> 1;
        }
        else
        {
            y = (SQQ_TABLE[x>>((e-6)-(e&1))] >> (7-(e>>1))) + 1;
        }

        return (x < y*y) ? y-1 : y;
    }