SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)
{
    STACK_OF(CONF_VALUE) *sk_conf = NULL;
    SSL_TEST_CTX *ctx = NULL;
    int i;
    size_t j;
    if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))
            || !TEST_ptr(ctx = SSL_TEST_CTX_new()))
        goto err;
    for (i = 0; i < sk_CONF_VALUE_num(sk_conf); i++) {
        int found = 0;
        const CONF_VALUE *option = sk_CONF_VALUE_value(sk_conf, i);
        if (strcmp(option->name, "client") == 0) {
            if (!parse_client_options(&ctx->extra.client, conf, option->value))
                goto err;
        } else if (strcmp(option->name, "server") == 0) {
            if (!parse_server_options(&ctx->extra.server, conf, option->value))
                goto err;
        } else if (strcmp(option->name, "server2") == 0) {
            if (!parse_server_options(&ctx->extra.server2, conf, option->value))
                goto err;
        } else if (strcmp(option->name, "resume-client") == 0) {
            if (!parse_client_options(&ctx->resume_extra.client, conf,
                                      option->value))
                goto err;
        } else if (strcmp(option->name, "resume-server") == 0) {
            if (!parse_server_options(&ctx->resume_extra.server, conf,
                                      option->value))
                goto err;
        } else if (strcmp(option->name, "resume-server2") == 0) {
            if (!parse_server_options(&ctx->resume_extra.server2, conf,
                                      option->value))
                goto err;
        } else {
            for (j = 0; j < OSSL_NELEM(ssl_test_ctx_options); j++) {
                if (strcmp(option->name, ssl_test_ctx_options[j].name) == 0) {
                    if (!ssl_test_ctx_options[j].parse(ctx, option->value)) {
                        TEST_info("Bad value %s for option %s",
                                   option->value, option->name);
                        goto err;
                    }
                    found = 1;
                    break;
                }
            }
            if (!found) {
                TEST_info("Unknown test option: %s", option->name);
                goto err;
            }
        }
    }
    goto done;
 err:
    SSL_TEST_CTX_free(ctx);
    ctx = NULL;
 done:
    return ctx;
}
['SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section)\n{\n    STACK_OF(CONF_VALUE) *sk_conf = NULL;\n    SSL_TEST_CTX *ctx = NULL;\n    int i;\n    size_t j;\n    if (!TEST_ptr(sk_conf = NCONF_get_section(conf, test_section))\n            || !TEST_ptr(ctx = SSL_TEST_CTX_new()))\n        goto err;\n    for (i = 0; i < sk_CONF_VALUE_num(sk_conf); i++) {\n        int found = 0;\n        const CONF_VALUE *option = sk_CONF_VALUE_value(sk_conf, i);\n        if (strcmp(option->name, "client") == 0) {\n            if (!parse_client_options(&ctx->extra.client, conf, option->value))\n                goto err;\n        } else if (strcmp(option->name, "server") == 0) {\n            if (!parse_server_options(&ctx->extra.server, conf, option->value))\n                goto err;\n        } else if (strcmp(option->name, "server2") == 0) {\n            if (!parse_server_options(&ctx->extra.server2, conf, option->value))\n                goto err;\n        } else if (strcmp(option->name, "resume-client") == 0) {\n            if (!parse_client_options(&ctx->resume_extra.client, conf,\n                                      option->value))\n                goto err;\n        } else if (strcmp(option->name, "resume-server") == 0) {\n            if (!parse_server_options(&ctx->resume_extra.server, conf,\n                                      option->value))\n                goto err;\n        } else if (strcmp(option->name, "resume-server2") == 0) {\n            if (!parse_server_options(&ctx->resume_extra.server2, conf,\n                                      option->value))\n                goto err;\n        } else {\n            for (j = 0; j < OSSL_NELEM(ssl_test_ctx_options); j++) {\n                if (strcmp(option->name, ssl_test_ctx_options[j].name) == 0) {\n                    if (!ssl_test_ctx_options[j].parse(ctx, option->value)) {\n                        TEST_info("Bad value %s for option %s",\n                                   option->value, option->name);\n                        goto err;\n                    }\n                    found = 1;\n                    break;\n                }\n            }\n            if (!found) {\n                TEST_info("Unknown test option: %s", option->name);\n                goto err;\n            }\n        }\n    }\n    goto done;\n err:\n    SSL_TEST_CTX_free(ctx);\n    ctx = NULL;\n done:\n    return ctx;\n}', 'STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section)\n{\n    if (conf == NULL) {\n        CONFerr(CONF_F_NCONF_GET_SECTION, CONF_R_NO_CONF);\n        return NULL;\n    }\n    if (section == NULL) {\n        CONFerr(CONF_F_NCONF_GET_SECTION, CONF_R_NO_SECTION);\n        return NULL;\n    }\n    return _CONF_get_section_values(conf, section);\n}', 'STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,\n                                               const char *section)\n{\n    CONF_VALUE *v;\n    v = _CONF_get_section(conf, section);\n    if (v != NULL)\n        return ((STACK_OF(CONF_VALUE) *)v->value);\n    else\n        return (NULL);\n}', 'CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section)\n{\n    CONF_VALUE *v, vv;\n    if ((conf == NULL) || (section == NULL))\n        return (NULL);\n    vv.name = NULL;\n    vv.section = (char *)section;\n    v = lh_CONF_VALUE_retrieve(conf->data, &vv);\n    return (v);\n}', 'void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data)\n{\n    unsigned long hash;\n    OPENSSL_LH_NODE **rn;\n    void *ret;\n    int scratch;\n    lh->error = 0;\n    rn = getrn(lh, data, &hash);\n    if (*rn == NULL) {\n        CRYPTO_atomic_add(&lh->num_retrieve_miss, 1, &scratch, lh->retrieve_stats_lock);\n        return NULL;\n    } else {\n        ret = (*rn)->data;\n        CRYPTO_atomic_add(&lh->num_retrieve, 1, &scratch, lh->retrieve_stats_lock);\n    }\n    return ret;\n}', 'int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)\n{\n# if defined(__GNUC__) && defined(__ATOMIC_ACQ_REL)\n    if (__atomic_is_lock_free(sizeof(*val), val)) {\n        *ret = __atomic_add_fetch(val, amount, __ATOMIC_ACQ_REL);\n        return 1;\n    }\n# endif\n    if (!CRYPTO_THREAD_write_lock(lock))\n        return 0;\n    *val += amount;\n    *ret  = *val;\n    if (!CRYPTO_THREAD_unlock(lock))\n        return 0;\n    return 1;\n}', 'int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)\n{\n# ifdef USE_RWLOCK\n    if (pthread_rwlock_wrlock(lock) != 0)\n        return 0;\n# else\n    if (pthread_mutex_lock(lock) != 0)\n        return 0;\n# endif\n    return 1;\n}', 'int test_ptr(const char *file, int line, const char *s, const void *p)\n{\n    if (p != NULL)\n        return 1;\n    test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);\n    return 0;\n}']