static long combine(long adler1, long adler2, long len2){
    long BASEL = (long)BASE;
    long sum1;
    long sum2;
    long rem;  // unsigned int

    rem = len2 % BASEL;
    sum1 = adler1 & 0xffffL;
    sum2 = rem * sum1;
    sum2 %= BASEL; // MOD(sum2);
    sum1 += (adler2 & 0xffffL) + BASEL - 1;
    sum2 += ((adler1 >> 16) & 0xffffL) + ((adler2 >> 16) & 0xffffL) + BASEL - rem;
    if (sum1 >= BASEL) sum1 -= BASEL;
    if (sum1 >= BASEL) sum1 -= BASEL;
    if (sum2 >= (BASEL << 1)) sum2 -= (BASEL << 1);
    if (sum2 >= BASEL) sum2 -= BASEL;
    return sum1 | (sum2 << 16);
  }