static uint32_t adler32(uint32_t adler, const uint8_t *buf, unsigned int len)

{

    unsigned long s1 = adler & 0xffff;

    unsigned long s2 = (adler >> 16) & 0xffff;

    int k;



    if (buf == NULL) return 1L;



    while (len > 0) {

        k = len < NMAX ? len : NMAX;

        len -= k;

        while (k >= 16) {

            DO16(buf);

            k -= 16;

        }

        if (k != 0) do {

            DO1(buf);

        } while (--k);

        s1 %= BASE;

        s2 %= BASE;

    }

    return (s2 << 16) | s1;

}

static uint32_t adler32(uint32_t adler, const uint8_t *buf, unsigned int len)

{

    unsigned long s1 = adler & 0xffff;

    unsigned long s2 = (adler >> 16) & 0xffff;

    int k;



    if (buf == NULL) return 1L;



    while (len > 0) {

        k = len < NMAX ? len : NMAX;

        len -= k;

        while (k >= 16) {

            DO16(buf);

            k -= 16;

        }

        if (k != 0) do {

            DO1(buf);

        } while (--k);

        s1 %= BASE;

        s2 %= BASE;

    }

    return (s2 << 16) | s1;

}

static uint32_t FUNC_0(uint32_t adler, const uint8_t *buf, unsigned int len)

{

    unsigned long VAR_0 = adler & 0xffff;

    unsigned long VAR_1 = (adler >> 16) & 0xffff;

    int VAR_2;



    if (buf == NULL) return 1L;



    while (len > 0) {

        VAR_2 = len < NMAX ? len : NMAX;

        len -= VAR_2;

        while (VAR_2 >= 16) {

            DO16(buf);

            VAR_2 -= 16;

        }

        if (VAR_2 != 0) do {

            DO1(buf);

        } while (--VAR_2);

        VAR_0 %= BASE;

        VAR_1 %= BASE;

    }

    return (VAR_1 << 16) | VAR_0;

}

static uint32_t FUNC_0(uint32_t adler, const uint8_t *buf, unsigned int len)
{ unsigned long VAR_0 = adler & 0xffff; unsigned long VAR_1 = (adler >> 16) & 0xffff; int VAR_2; if (buf == NULL) return 1L; while (len > 0) { VAR_2 = len < NMAX ? len : NMAX; len -= VAR_2; while (VAR_2 >= 16) { DO16(buf); VAR_2 -= 16; } if (VAR_2 != 0) do { DO1(buf); } while (--VAR_2); VAR_0 %= BASE; VAR_1 %= BASE; } return (VAR_1 << 16) | VAR_0; }