static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group,\n                                              EC_POINT *point,\n                                              const BIGNUM *x_, int y_bit,\n                                              BN_CTX *ctx)\n{\n    BN_CTX *new_ctx = NULL;\n    BIGNUM *tmp, *x, *y, *z;\n    int ret = 0, z0;\n    ERR_clear_error();\n    if (ctx == NULL) {\n        ctx = new_ctx = BN_CTX_new();\n        if (ctx == NULL)\n            return 0;\n    }\n    y_bit = (y_bit != 0) ? 1 : 0;\n    BN_CTX_start(ctx);\n    tmp = BN_CTX_get(ctx);\n    x = BN_CTX_get(ctx);\n    y = BN_CTX_get(ctx);\n    z = BN_CTX_get(ctx);\n    if (z == NULL)\n        goto err;\n    if (!BN_GF2m_mod_arr(x, x_, group->poly))\n        goto err;\n    if (BN_is_zero(x)) {\n        if (!BN_GF2m_mod_sqrt_arr(y, group->b, group->poly, ctx))\n            goto err;\n    } else {\n        if (!group->meth->field_sqr(group, tmp, x, ctx))\n            goto err;\n        if (!group->meth->field_div(group, tmp, group->b, tmp, ctx))\n            goto err;\n        if (!BN_GF2m_add(tmp, group->a, tmp))\n            goto err;\n        if (!BN_GF2m_add(tmp, x, tmp))\n            goto err;\n        if (!BN_GF2m_mod_solve_quad_arr(z, tmp, group->poly, ctx)) {\n            unsigned long err = ERR_peek_last_error();\n            if (ERR_GET_LIB(err) == ERR_LIB_BN\n                && ERR_GET_REASON(err) == BN_R_NO_SOLUTION) {\n                ERR_clear_error();\n                ECerr(EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES,\n                      EC_R_INVALID_COMPRESSED_POINT);\n            } else\n                ECerr(EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES,\n                      ERR_R_BN_LIB);\n            goto err;\n        }\n        z0 = (BN_is_odd(z)) ? 1 : 0;\n        if (!group->meth->field_mul(group, y, x, z, ctx))\n            goto err;\n        if (z0 != y_bit) {\n            if (!BN_GF2m_add(y, y, x))\n                goto err;\n        }\n    }\n    if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))\n        goto err;\n    ret = 1;\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}']