int fbytes(unsigned char *buf, int num)
{
    int ret;
    BIGNUM *tmp = NULL;
    if (use_fake == 0)
        return old_rand->bytes(buf, num);
    use_fake = 0;
    if (fbytes_counter >= 8)
        return 0;
    tmp = BN_new();
    if (!tmp)
        return 0;
    if (!BN_dec2bn(&tmp, numbers[fbytes_counter])) {
        BN_free(tmp);
        return 0;
    }
    fbytes_counter++;
    if (num != BN_num_bytes(tmp) || !BN_bn2bin(tmp, buf))
        ret = 0;
    else
        ret = 1;
    BN_free(tmp);
    return ret;
}
['int fbytes(unsigned char *buf, int num)\n{\n    int ret;\n    BIGNUM *tmp = NULL;\n    if (use_fake == 0)\n        return old_rand->bytes(buf, num);\n    use_fake = 0;\n    if (fbytes_counter >= 8)\n        return 0;\n    tmp = BN_new();\n    if (!tmp)\n        return 0;\n    if (!BN_dec2bn(&tmp, numbers[fbytes_counter])) {\n        BN_free(tmp);\n        return 0;\n    }\n    fbytes_counter++;\n    if (num != BN_num_bytes(tmp) || !BN_bn2bin(tmp, buf))\n        ret = 0;\n    else\n        ret = 1;\n    BN_free(tmp);\n    return ret;\n}', 'BIGNUM *BN_new(void)\n{\n    BIGNUM *ret;\n    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {\n        BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    ret->flags = BN_FLG_MALLOCED;\n    bn_check_top(ret);\n    return (ret);\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}']