DEFINE_RUN_ONCE_STATIC(do_load_builtin_compressions)
{
    SSL_COMP *comp = NULL;
    COMP_METHOD *method = COMP_zlib();
    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
    ssl_comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
    if (COMP_get_type(method) != NID_undef && ssl_comp_methods != NULL) {
        comp = OPENSSL_malloc(sizeof(*comp));
        if (comp != NULL) {
            comp->method = method;
            comp->id = SSL_COMP_ZLIB_IDX;
            comp->name = COMP_get_name(method);
            sk_SSL_COMP_push(ssl_comp_methods, comp);
            sk_SSL_COMP_sort(ssl_comp_methods);
        }
    }
    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
    return 1;
}
['DEFINE_RUN_ONCE_STATIC(do_load_builtin_compressions)', 'DEFINE_RUN_ONCE_STATIC(do_load_builtin_compressions)\n{\n    SSL_COMP *comp = NULL;\n    COMP_METHOD *method = COMP_zlib();\n    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);\n    ssl_comp_methods = sk_SSL_COMP_new(sk_comp_cmp);\n    if (COMP_get_type(method) != NID_undef && ssl_comp_methods != NULL) {\n        comp = OPENSSL_malloc(sizeof(*comp));\n        if (comp != NULL) {\n            comp->method = method;\n            comp->id = SSL_COMP_ZLIB_IDX;\n            comp->name = COMP_get_name(method);\n            sk_SSL_COMP_push(ssl_comp_methods, comp);\n            sk_SSL_COMP_sort(ssl_comp_methods);\n        }\n    }\n    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);\n    return 1;\n}', 'COMP_METHOD *COMP_zlib(void)\n{\n    COMP_METHOD *meth = &zlib_method_nozlib;\n#ifdef ZLIB_SHARED\n# ifndef LIBZ\n#  if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)\n#   define LIBZ "ZLIB1"\n#  elif defined(OPENSSL_SYS_VMS)\n#   define LIBZ "LIBZ"\n#  else\n#   define LIBZ "z"\n#  endif\n# endif\n    if (!zlib_loaded) {\n        zlib_dso = DSO_load(NULL, LIBZ, NULL, 0);\n        if (zlib_dso != NULL) {\n            p_compress = (compress_ft) DSO_bind_func(zlib_dso, "compress");\n            p_inflateEnd\n                = (inflateEnd_ft) DSO_bind_func(zlib_dso, "inflateEnd");\n            p_inflate = (inflate_ft) DSO_bind_func(zlib_dso, "inflate");\n            p_inflateInit_\n                = (inflateInit__ft) DSO_bind_func(zlib_dso, "inflateInit_");\n            p_deflateEnd\n                = (deflateEnd_ft) DSO_bind_func(zlib_dso, "deflateEnd");\n            p_deflate = (deflate_ft) DSO_bind_func(zlib_dso, "deflate");\n            p_deflateInit_\n                = (deflateInit__ft) DSO_bind_func(zlib_dso, "deflateInit_");\n            p_zError = (zError__ft) DSO_bind_func(zlib_dso, "zError");\n            if (p_compress && p_inflateEnd && p_inflate\n                && p_inflateInit_ && p_deflateEnd\n                && p_deflate && p_deflateInit_ && p_zError)\n                zlib_loaded++;\n            if (!OPENSSL_init_crypto(OPENSSL_INIT_ZLIB, NULL)) {\n                comp_zlib_cleanup_int();\n                return meth;\n            }\n            if (zlib_loaded)\n                meth = &zlib_stateful_method;\n        }\n    }\n#endif\n#if defined(ZLIB)\n    meth = &zlib_stateful_method;\n#endif\n    return (meth);\n}', 'int CRYPTO_mem_ctrl(int mode)\n{\n#ifdef OPENSSL_NO_CRYPTO_MDEBUG\n    return mode - mode;\n#else\n    int ret = mh_mode;\n    if (!RUN_ONCE(&memdbg_init, do_memdbg_init))\n        return -1;\n    CRYPTO_THREAD_write_lock(malloc_lock);\n    switch (mode) {\n    default:\n        break;\n    case CRYPTO_MEM_CHECK_ON:\n        mh_mode = CRYPTO_MEM_CHECK_ON | CRYPTO_MEM_CHECK_ENABLE;\n        num_disable = 0;\n        break;\n    case CRYPTO_MEM_CHECK_OFF:\n        mh_mode = 0;\n        num_disable = 0;\n        break;\n    case CRYPTO_MEM_CHECK_DISABLE:\n        if (mh_mode & CRYPTO_MEM_CHECK_ON) {\n            CRYPTO_THREAD_ID cur = CRYPTO_THREAD_get_current_id();\n            if (!num_disable\n                || !CRYPTO_THREAD_compare_id(disabling_threadid, cur)) {\n                CRYPTO_THREAD_unlock(malloc_lock);\n                CRYPTO_THREAD_write_lock(long_malloc_lock);\n                CRYPTO_THREAD_write_lock(malloc_lock);\n                mh_mode &= ~CRYPTO_MEM_CHECK_ENABLE;\n                disabling_threadid = cur;\n            }\n            num_disable++;\n        }\n        break;\n    case CRYPTO_MEM_CHECK_ENABLE:\n        if (mh_mode & CRYPTO_MEM_CHECK_ON) {\n            if (num_disable) {\n                num_disable--;\n                if (num_disable == 0) {\n                    mh_mode |= CRYPTO_MEM_CHECK_ENABLE;\n                    CRYPTO_THREAD_unlock(long_malloc_lock);\n                }\n            }\n        }\n        break;\n    }\n    CRYPTO_THREAD_unlock(malloc_lock);\n    return ret;\n#endif\n}', 'int COMP_get_type(const COMP_METHOD *meth)\n{\n    return meth->type;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num == 0)\n        return NULL;\n    FAILTEST();\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    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'const char *COMP_get_name(const COMP_METHOD *meth)\n{\n    return meth->name;\n}', 'int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)\n{\n    return (OPENSSL_sk_insert(st, data, st->num));\n}']