int c2i_uint64_int(uint64_t *ret, int *neg, const unsigned char **pp, long len)
{
    unsigned char buf[sizeof(uint64_t)];
    size_t buflen;
    buflen = c2i_ibuf(NULL, NULL, *pp, len);
    if (buflen == 0)
        return 0;
    if (buflen > sizeof(uint64_t)) {
        ASN1err(ASN1_F_C2I_UINT64_INT, ASN1_R_TOO_LARGE);
        return 0;
    }
    (void)c2i_ibuf(buf, neg, *pp, len);
    return asn1_get_uint64(ret, buf, buflen);
}
['int c2i_uint64_int(uint64_t *ret, int *neg, const unsigned char **pp, long len)\n{\n    unsigned char buf[sizeof(uint64_t)];\n    size_t buflen;\n    buflen = c2i_ibuf(NULL, NULL, *pp, len);\n    if (buflen == 0)\n        return 0;\n    if (buflen > sizeof(uint64_t)) {\n        ASN1err(ASN1_F_C2I_UINT64_INT, ASN1_R_TOO_LARGE);\n        return 0;\n    }\n    (void)c2i_ibuf(buf, neg, *pp, len);\n    return asn1_get_uint64(ret, buf, buflen);\n}', 'static size_t c2i_ibuf(unsigned char *b, int *pneg,\n                       const unsigned char *p, size_t plen)\n{\n    int neg, pad;\n    if (plen == 0) {\n        ASN1err(ASN1_F_C2I_IBUF, ASN1_R_ILLEGAL_ZERO_CONTENT);\n        return 0;\n    }\n    neg = p[0] & 0x80;\n    if (pneg)\n        *pneg = neg;\n    if (plen == 1) {\n        if (b != NULL) {\n            if (neg)\n                b[0] = (p[0] ^ 0xFF) + 1;\n            else\n                b[0] = p[0];\n        }\n        return 1;\n    }\n    if (p[0] == 0 || p[0] == 0xFF)\n        pad = 1;\n    else\n        pad = 0;\n    if (pad && (neg == (p[1] & 0x80))) {\n        ASN1err(ASN1_F_C2I_IBUF, ASN1_R_ILLEGAL_PADDING);\n        return 0;\n    }\n    p += pad;\n    plen -= pad;\n    if (b != NULL)\n        twos_complement(b, p, plen, neg ? 0xffU : 0);\n    return plen;\n}', 'static void twos_complement(unsigned char *dst, const unsigned char *src,\n                            size_t len, unsigned char pad)\n{\n    unsigned int carry = pad & 1;\n    dst += len;\n    src += len;\n    while (len-- != 0) {\n        *(--dst) = (unsigned char)(carry += *(--src) ^ pad);\n        carry >>= 8;\n    }\n}']