static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['static int test_ctx_consttime_flag(void)\n{\n    BN_CTX *nctx = NULL;\n    BN_CTX *sctx = NULL;\n    size_t i = 0;\n    int st = 0;\n    if (!TEST_ptr(nctx = BN_CTX_new())\n            || !TEST_ptr(sctx = BN_CTX_secure_new()))\n        goto err;\n    for (i = 0; i < 2; i++) {\n        BN_CTX *c = i == 0 ? nctx : sctx;\n        if (!TEST_true(test_ctx_set_ct_flag(c))\n                || !TEST_true(test_ctx_check_ct_flag(c)))\n            goto err;\n    }\n    st = 1;\n err:\n    BN_CTX_free(nctx);\n    BN_CTX_free(sctx);\n    return st;\n}', 'static int test_ctx_set_ct_flag(BN_CTX *c)\n{\n    int st = 0;\n    size_t i;\n    BIGNUM *b[15];\n    BN_CTX_start(c);\n    for (i = 0; i < OSSL_NELEM(b); i++) {\n        if (!TEST_ptr(b[i] = BN_CTX_get(c)))\n            goto err;\n        if (i % 2 == 1)\n            BN_set_flags(b[i], BN_FLG_CONSTTIME);\n    }\n    st = 1;\n err:\n    BN_CTX_end(c);\n    return st;\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}']