int ossl_init_thread_start(uint64_t opts)
{
    struct thread_local_inits_st *locals = ossl_init_get_thread_local(1);
    if (locals == NULL)
        return 0;
    if (opts & OPENSSL_INIT_THREAD_ASYNC) {
#ifdef OPENSSL_INIT_DEBUG
        fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
                        "marking thread for async\n");
#endif
        locals->async = 1;
    }
    if (opts & OPENSSL_INIT_THREAD_ERR_STATE) {
#ifdef OPENSSL_INIT_DEBUG
        fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "
                        "marking thread for err_state\n");
#endif
        locals->err_state = 1;
    }
    return 1;
}
['int ossl_init_thread_start(uint64_t opts)\n{\n    struct thread_local_inits_st *locals = ossl_init_get_thread_local(1);\n    if (locals == NULL)\n        return 0;\n    if (opts & OPENSSL_INIT_THREAD_ASYNC) {\n#ifdef OPENSSL_INIT_DEBUG\n        fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "\n                        "marking thread for async\\n");\n#endif\n        locals->async = 1;\n    }\n    if (opts & OPENSSL_INIT_THREAD_ERR_STATE) {\n#ifdef OPENSSL_INIT_DEBUG\n        fprintf(stderr, "OPENSSL_INIT: ossl_init_thread_start: "\n                        "marking thread for err_state\\n");\n#endif\n        locals->err_state = 1;\n    }\n    return 1;\n}', 'static struct thread_local_inits_st *ossl_init_get_thread_local(int alloc)\n{\n    struct thread_local_inits_st *local =\n        CRYPTO_THREAD_get_local(&threadstopkey);\n    if (local == NULL && alloc) {\n        local = OPENSSL_zalloc(sizeof *local);\n        CRYPTO_THREAD_set_local(&threadstopkey, local);\n    }\n    if (!alloc) {\n        CRYPTO_THREAD_set_local(&threadstopkey, NULL);\n    }\n    return local;\n}', 'void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)\n{\n    return pthread_getspecific(*key);\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 (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\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    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)\n{\n    if (pthread_setspecific(*key, val) != 0)\n        return 0;\n    return 1;\n}']