static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['int ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p,\n                                const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)\n{\n    int ret = 0;\n    BN_CTX *new_ctx = NULL;\n    if (ctx == NULL)\n        if ((ctx = new_ctx = BN_CTX_new()) == NULL)\n            return 0;\n    BN_CTX_start(ctx);\n    if (BN_ucmp(BN_get0_nist_prime_192(), p) == 0)\n        group->field_mod_func = BN_nist_mod_192;\n    else if (BN_ucmp(BN_get0_nist_prime_224(), p) == 0)\n        group->field_mod_func = BN_nist_mod_224;\n    else if (BN_ucmp(BN_get0_nist_prime_256(), p) == 0)\n        group->field_mod_func = BN_nist_mod_256;\n    else if (BN_ucmp(BN_get0_nist_prime_384(), p) == 0)\n        group->field_mod_func = BN_nist_mod_384;\n    else if (BN_ucmp(BN_get0_nist_prime_521(), p) == 0)\n        group->field_mod_func = BN_nist_mod_521;\n    else {\n        ECerr(EC_F_EC_GFP_NIST_GROUP_SET_CURVE, EC_R_NOT_A_NIST_PRIME);\n        goto err;\n    }\n    ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx);\n err:\n    BN_CTX_end(ctx);\n    BN_CTX_free(new_ctx);\n    return ret;\n}', 'void BN_CTX_start(BN_CTX *ctx)\n{\n    CTXDBG("ENTER BN_CTX_start()", ctx);\n    if (ctx->err_stack || ctx->too_many)\n        ctx->err_stack++;\n    else if (!BN_STACK_push(&ctx->stack, ctx->used)) {\n        BNerr(BN_F_BN_CTX_START, BN_R_TOO_MANY_TEMPORARY_VARIABLES);\n        ctx->err_stack++;\n    }\n    CTXDBG("LEAVE BN_CTX_start()", ctx);\n}', 'void BN_CTX_end(BN_CTX *ctx)\n{\n    CTXDBG("ENTER BN_CTX_end()", ctx);\n    if (ctx->err_stack)\n        ctx->err_stack--;\n    else {\n        unsigned int fp = BN_STACK_pop(&ctx->stack);\n        if (fp < ctx->used)\n            BN_POOL_release(&ctx->pool, ctx->used - fp);\n        ctx->used = fp;\n        ctx->too_many = 0;\n    }\n    CTXDBG("LEAVE BN_CTX_end()", ctx);\n}', 'static unsigned int BN_STACK_pop(BN_STACK *st)\n{\n    return st->indexes[--(st->depth)];\n}']