static int check_name_constraints(X509_STORE_CTX *ctx)
{
    X509 *x;
    int i, j, rv;
    for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {
        x = sk_X509_value(ctx->chain, i);
        if (i && (x->ex_flags & EXFLAG_SI))
            continue;
        for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {
            NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;
            if (nc) {
                rv = NAME_CONSTRAINTS_check(x, nc);
                if (rv != X509_V_OK) {
                    ctx->error = rv;
                    ctx->error_depth = i;
                    ctx->current_cert = x;
                    if (!ctx->verify_cb(0, ctx))
                        return 0;
                }
            }
        }
    }
    return 1;
}
['static int check_name_constraints(X509_STORE_CTX *ctx)\n{\n    X509 *x;\n    int i, j, rv;\n    for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) {\n        x = sk_X509_value(ctx->chain, i);\n        if (i && (x->ex_flags & EXFLAG_SI))\n            continue;\n        for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) {\n            NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc;\n            if (nc) {\n                rv = NAME_CONSTRAINTS_check(x, nc);\n                if (rv != X509_V_OK) {\n                    ctx->error = rv;\n                    ctx->error_depth = i;\n                    ctx->current_cert = x;\n                    if (!ctx->verify_cb(0, ctx))\n                        return 0;\n                }\n            }\n        }\n    }\n    return 1;\n}', 'int sk_num(const _STACK *st)\n{\n    if (st == NULL)\n        return -1;\n    return st->num;\n}', 'void *sk_value(const _STACK *st, int i)\n{\n    if (!st || (i < 0) || (i >= st->num))\n        return NULL;\n    return st->data[i];\n}']