#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_12__ TYPE_6__;
typedef struct TYPE_11__ TYPE_3__;
typedef struct TYPE_10__ TYPE_2__;
typedef struct TYPE_9__ TYPE_1__;

/* Type definitions */
struct TYPE_12__ {
  scalar_t__ type;
};
struct TYPE_11__ {
  scalar_t__ type;
};
struct TYPE_10__ {
  TYPE_6__ *base;
  scalar_t__ maximum;
  scalar_t__ minimum;
};
struct TYPE_9__ {
  int /*<<< orphan*/ excludedSubtrees;
  int /*<<< orphan*/ permittedSubtrees;
};
typedef TYPE_1__ NAME_CONSTRAINTS;
typedef TYPE_2__ GENERAL_SUBTREE;
typedef TYPE_3__ GENERAL_NAME;

/* Variables and functions */
int X509_V_ERR_EXCLUDED_VIOLATION;
int X509_V_ERR_PERMITTED_VIOLATION;
int X509_V_ERR_SUBTREE_MINMAX;
int X509_V_OK;
int nc_match_single(TYPE_3__ *, TYPE_6__ *);
int sk_GENERAL_SUBTREE_num(int /*<<< orphan*/);
TYPE_2__ *sk_GENERAL_SUBTREE_value(int /*<<< orphan*/, int);
int nc_match(GENERAL_NAME *gen, NAME_CONSTRAINTS *nc) {
  GENERAL_SUBTREE *sub;
  int i, r, match = 0;
  for (i = 0; i < sk_GENERAL_SUBTREE_num(nc->permittedSubtrees); i++) {
    sub = sk_GENERAL_SUBTREE_value(nc->permittedSubtrees, i);
    if (gen->type != sub->base->type)
      continue;
    if (sub->minimum || sub->maximum)
      return X509_V_ERR_SUBTREE_MINMAX;
    if (match == 2)
      continue;
    if (match == 0)
      match = 1;
    r = nc_match_single(gen, sub->base);
    if (r == X509_V_OK)
      match = 2;
    else if (r != X509_V_ERR_PERMITTED_VIOLATION)
      return r;
  }
  if (match == 1)
    return X509_V_ERR_PERMITTED_VIOLATION;
  for (i = 0; i < sk_GENERAL_SUBTREE_num(nc->excludedSubtrees); i++) {
    sub = sk_GENERAL_SUBTREE_value(nc->excludedSubtrees, i);
    if (gen->type != sub->base->type)
      continue;
    if (sub->minimum || sub->maximum)
      return X509_V_ERR_SUBTREE_MINMAX;
    r = nc_match_single(gen, sub->base);
    if (r == X509_V_OK)
      return X509_V_ERR_EXCLUDED_VIOLATION;
    else if (r != X509_V_ERR_PERMITTED_VIOLATION)
      return r;
  }
  return X509_V_OK;
}


x86 assembly (clang, -O0):
<nc_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edi
call   1050 <sk_GENERAL_SUBTREE_num@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
cmp    %ecx,%eax
jge    1251 <nc_match+0x121>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edi
mov    -0x24(%rbp),%esi
call   1040 <sk_GENERAL_SUBTREE_value@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
cmp    (%rcx),%rax
je     119c <nc_match+0x6c>
jmp    1243 <nc_match+0x113>
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    11ba <nc_match+0x8a>
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     11cb <nc_match+0x9b>
mov    0x2e07(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1365 <nc_match+0x235>
cmpl   $0x2,-0x2c(%rbp)
jne    11da <nc_match+0xaa>
jmp    1243 <nc_match+0x113>
cmpl   $0x0,-0x2c(%rbp)
jne    11eb <nc_match+0xbb>
movl   $0x1,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <nc_match_single@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2df0(%rip),%rcx
cmp    (%rcx),%eax
jne    121c <nc_match+0xec>
movl   $0x2,-0x2c(%rbp)
jmp    123e <nc_match+0x10e>
mov    -0x28(%rbp),%eax
mov    0x2dba(%rip),%rcx
cmp    (%rcx),%eax
je     1239 <nc_match+0x109>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1365 <nc_match+0x235>
jmp    123e <nc_match+0x10e>
jmp    1243 <nc_match+0x113>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114e <nc_match+0x1e>
cmpl   $0x1,-0x2c(%rbp)
jne    126c <nc_match+0x13c>
mov    0x2d7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1365 <nc_match+0x235>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1050 <sk_GENERAL_SUBTREE_num@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
cmp    %ecx,%eax
jge    1359 <nc_match+0x229>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%esi
call   1040 <sk_GENERAL_SUBTREE_value@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
cmp    (%rcx),%rax
je     12bf <nc_match+0x18f>
jmp    134b <nc_match+0x21b>
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    12dd <nc_match+0x1ad>
mov    -0x20(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     12ee <nc_match+0x1be>
mov    0x2ce4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1365 <nc_match+0x235>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <nc_match_single@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2ced(%rip),%rcx
cmp    (%rcx),%eax
jne    1324 <nc_match+0x1f4>
mov    0x2cbe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1365 <nc_match+0x235>
mov    -0x28(%rbp),%eax
mov    0x2cb2(%rip),%rcx
cmp    (%rcx),%eax
je     1341 <nc_match+0x211>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1365 <nc_match+0x235>
jmp    1346 <nc_match+0x216>
jmp    134b <nc_match+0x21b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1273 <nc_match+0x143>
mov    0x2c98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nc_match>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x4(%rsi),%edi
call   1050 <sk_GENERAL_SUBTREE_num@plt>
test   %eax,%eax
jle    11e8 <nc_match+0xb8>
xor    %r15d,%r15d
mov    0x2e9d(%rip),%r12
xor    %ebp,%ebp
jmp    1172 <nc_match+0x42>
nop
mov    %r13d,%r15d
add    $0x1,%ebp
mov    0x4(%rbx),%edi
call   1050 <sk_GENERAL_SUBTREE_num@plt>
cmp    %eax,%ebp
jge    11d9 <nc_match+0xa9>
mov    %r15d,%r13d
mov    0x4(%rbx),%edi
mov    %ebp,%esi
call   1040 <sk_GENERAL_SUBTREE_value@plt>
mov    (%r14),%rcx
mov    (%rax),%rsi
cmp    (%rsi),%rcx
jne    1160 <nc_match+0x30>
cmpq   $0x0,0x10(%rax)
jne    1255 <nc_match+0x125>
cmpq   $0x0,0x8(%rax)
jne    1255 <nc_match+0x125>
mov    $0x2,%r15d
cmp    $0x2,%r13d
je     1163 <nc_match+0x33>
mov    %r14,%rdi
call   1030 <nc_match_single@plt>
cmp    (%r12),%eax
je     1163 <nc_match+0x33>
test   %r13d,%r13d
mov    $0x1,%ecx
cmove  %ecx,%r13d
mov    %r13d,%r15d
mov    0x2e10(%rip),%rcx
cmp    (%rcx),%eax
je     1163 <nc_match+0x33>
jmp    1267 <nc_match+0x137>
cmp    $0x1,%r15d
jne    11e8 <nc_match+0xb8>
mov    0x2dfa(%rip),%rax
jmp    1265 <nc_match+0x135>
mov    (%rbx),%edi
call   1050 <sk_GENERAL_SUBTREE_num@plt>
test   %eax,%eax
jle    125e <nc_match+0x12e>
xor    %ebp,%ebp
mov    0x2dfc(%rip),%r15
mov    0x2ddd(%rip),%r12
jmp    121e <nc_match+0xee>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
mov    (%rbx),%edi
call   1050 <sk_GENERAL_SUBTREE_num@plt>
cmp    %eax,%ebp
jge    125e <nc_match+0x12e>
mov    (%rbx),%edi
mov    %ebp,%esi
call   1040 <sk_GENERAL_SUBTREE_value@plt>
mov    (%r14),%rcx
mov    (%rax),%rsi
cmp    (%rsi),%rcx
jne    1210 <nc_match+0xe0>
cmpq   $0x0,0x10(%rax)
jne    1255 <nc_match+0x125>
cmpq   $0x0,0x8(%rax)
jne    1255 <nc_match+0x125>
mov    %r14,%rdi
call   1030 <nc_match_single@plt>
cmp    (%r15),%eax
je     1276 <nc_match+0x146>
cmp    (%r12),%eax
je     1210 <nc_match+0xe0>
jmp    1267 <nc_match+0x137>
mov    0x2d6c(%rip),%rax
jmp    1265 <nc_match+0x135>
mov    0x2d93(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d5b(%rip),%rax
jmp    1265 <nc_match+0x135>

LLVM IR (-O0):
%struct.TYPE_11__ = type { i64 }
%struct.TYPE_9__ = type { i32, i32 }
%struct.TYPE_10__ = type { %struct.TYPE_12__*, i64, i64 }
%struct.TYPE_12__ = type { i64 }
@X509_V_ERR_SUBTREE_MINMAX = global i32 0
@X509_V_OK = global i32 0
@X509_V_ERR_PERMITTED_VIOLATION = global i32 0
@X509_V_ERR_EXCLUDED_VIOLATION = global i32 0
define i32 @nc_match(%struct.TYPE_11__* %0, %struct.TYPE_9__* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_11__*
%5 = alloca %struct.TYPE_9__*
%6 = alloca %struct.TYPE_10__*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.TYPE_11__* %0, %struct.TYPE_11__** %4
store %struct.TYPE_9__* %1, %struct.TYPE_9__** %5
store i32 0, i32* %9
store i32 0, i32* %7
br label %10
10: ; preds = %71, %2
%11 = load i32, i32* %7
%12 = load %struct.TYPE_9__*, %struct.TYPE_9__** %5
%13 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = call i32 @sk_GENERAL_SUBTREE_num(i32 %14)
%16 = icmp slt i32 %11, %15
br i1 %16, label %17, label %74
17: ; preds = %10
%18 = load %struct.TYPE_9__*, %struct.TYPE_9__** %5
%19 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %18, i32 0, i32 1
%20 = load i32, i32* %19
%21 = load i32, i32* %7
%22 = call %struct.TYPE_10__* @sk_GENERAL_SUBTREE_value(i32 %20, i32 %21)
store %struct.TYPE_10__* %22, %struct.TYPE_10__** %6
%23 = load %struct.TYPE_11__*, %struct.TYPE_11__** %4
%24 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %23, i32 0, i32 0
%25 = load i64, i64* %24
%26 = load %struct.TYPE_10__*, %struct.TYPE_10__** %6
%27 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %26, i32 0, i32 0
%28 = load %struct.TYPE_12__*, %struct.TYPE_12__** %27
%29 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %28, i32 0, i32 0
%30 = load i64, i64* %29
%31 = icmp ne i64 %25, %30
br i1 %31, label %32, label %33
32: ; preds = %17
br label %71
33: ; preds = %17
%34 = load %struct.TYPE_10__*, %struct.TYPE_10__** %6
%35 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %34, i32 0, i32 2
%36 = load i64, i64* %35
%37 = icmp ne i64 %36, 0
br i1 %37, label %43, label %38
38: ; preds = %33
%39 = load %struct.TYPE_10__*, %struct.TYPE_10__** %6
%40 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %39, i32 0, i32 1
%41 = load i64, i64* %40
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %38, %33
%44 = load i32, i32* @X509_V_ERR_SUBTREE_MINMAX
store i32 %44, i32* %3
br label %139
45: ; preds = %38
%46 = load i32, i32* %9
%47 = icmp eq i32 %46, 2
br i1 %47, label %48, label %49
48: ; preds = %45
br label %71
49: ; preds = %45
%50 = load i32, i32* %9
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %49
store i32 1, i32* %9
br label %53
53: ; preds = %52, %49
%54 = load %struct.TYPE_11__*, %struct.TYPE_11__** %4
%55 = load %struct.TYPE_10__*, %struct.TYPE_10__** %6
%56 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %55, i32 0, i32 0
%57 = load %struct.TYPE_12__*, %struct.TYPE_12__** %56
%58 = call i32 @nc_match_single(%struct.TYPE_11__* %54, %struct.TYPE_12__* %57)
store i32 %58, i32* %8
%59 = load i32, i32* %8
%60 = load i32, i32* @X509_V_OK
%61 = icmp eq i32 %59, %60
br i1 %61, label %62, label %63
62: ; preds = %53
store i32 2, i32* %9
br label %70
63: ; preds = %53
%64 = load i32, i32* %8
%65 = load i32, i32* @X509_V_ERR_PERMITTED_VIOLATION
%66 = icmp ne i32 %64, %65
br i1 %66, label %67, label %69
67: ; preds = %63
%68 = load i32, i32* %8
store i32 %68, i32* %3
br label %139
69: ; preds = %63
br label %70
70: ; preds = %69, %62
br label %71
71: ; preds = %70, %48, %32
%72 = load i32, i32* %7
%73 = add nsw i32 %72, 1
store i32 %73, i32* %7
br label %10
74: ; preds = %10
%75 = load i32, i32* %9
%76 = icmp eq i32 %75, 1
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = load i32, i32* @X509_V_ERR_PERMITTED_VIOLATION
store i32 %78, i32* %3
br label %139
79: ; preds = %74
store i32 0, i32* %7
br label %80
80: ; preds = %134, %79
%81 = load i32, i32* %7
%82 = load %struct.TYPE_9__*, %struct.TYPE_9__** %5
%83 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %82, i32 0, i32 0
%84 = load i32, i32* %83
%85 = call i32 @sk_GENERAL_SUBTREE_num(i32 %84)
%86 = icmp slt i32 %81, %85
br i1 %86, label %87, label %137
87: ; preds = %80
%88 = load %struct.TYPE_9__*, %struct.TYPE_9__** %5
%89 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %88, i32 0, i32 0
%90 = load i32, i32* %89
%91 = load i32, i32* %7
%92 = call %struct.TYPE_10__* @sk_GENERAL_SUBTREE_value(i32 %90, i32 %91)
store %struct.TYPE_10__* %92, %struct.TYPE_10__** %6
%93 = load %struct.TYPE_11__*, %struct.TYPE_11__** %4
%94 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %93, i32 0, i32 0
%95 = load i64, i64* %94
%96 = load %struct.TYPE_10__*, %struct.TYPE_10__** %6
%97 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %96, i32 0, i32 0
%98 = load %struct.TYPE_12__*, %struct.TYPE_12__** %97
%99 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %98, i32 0, i32 0
%100 = load i64, i64* %99
%101 = icmp ne i64 %95, %100
br i1 %101, label %102, label %103
102: ; preds = %87
br label %134
103: ; preds = %87
%104 = load %struct.TYPE_10__*, %struct.TYPE_10__** %6
%105 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %104, i32 0, i32 2
%106 = load i64, i64* %105
%107 = icmp ne i64 %106, 0
br i1 %107, label %113, label %108
108: ; preds = %103
%109 = load %struct.TYPE_10__*, %struct.TYPE_10__** %6
%110 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %109, i32 0, i32 1
%111 = load i64, i64* %110
%112 = icmp ne i64 %111, 0
br i1 %112, label %113, label %115
113: ; preds = %108, %103
%114 = load i32, i32* @X509_V_ERR_SUBTREE_MINMAX
store i32 %114, i32* %3
br label %139
115: ; preds = %108
%116 = load %struct.TYPE_11__*, %struct.TYPE_11__** %4
%117 = load %struct.TYPE_10__*, %struct.TYPE_10__** %6
%118 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %117, i32 0, i32 0
%119 = load %struct.TYPE_12__*, %struct.TYPE_12__** %118
%120 = call i32 @nc_match_single(%struct.TYPE_11__* %116, %struct.TYPE_12__* %119)
store i32 %120, i32* %8
%121 = load i32, i32* %8
%122 = load i32, i32* @X509_V_OK
%123 = icmp eq i32 %121, %122
br i1 %123, label %124, label %126
124: ; preds = %115
%125 = load i32, i32* @X509_V_ERR_EXCLUDED_VIOLATION
store i32 %125, i32* %3
br label %139
126: ; preds = %115
%127 = load i32, i32* %8
%128 = load i32, i32* @X509_V_ERR_PERMITTED_VIOLATION
%129 = icmp ne i32 %127, %128
br i1 %129, label %130, label %132
130: ; preds = %126
%131 = load i32, i32* %8
store i32 %131, i32* %3
br label %139
132: ; preds = %126
br label %133
133: ; preds = %132
br label %134
134: ; preds = %133, %102
%135 = load i32, i32* %7
%136 = add nsw i32 %135, 1
store i32 %136, i32* %7
br label %80
137: ; preds = %80
%138 = load i32, i32* @X509_V_OK
store i32 %138, i32* %3
br label %139
139: ; preds = %137, %130, %124, %113, %77, %67, %43
%140 = load i32, i32* %3
ret i32 %140
}

LLVM IR (-O2):
%struct.TYPE_11__ = type { i64 }
%struct.TYPE_9__ = type { i32, i32 }
%struct.TYPE_10__ = type { %struct.TYPE_12__*, i64, i64 }
%struct.TYPE_12__ = type { i64 }
@X509_V_ERR_SUBTREE_MINMAX = global i32 0
@X509_V_OK = global i32 0
@X509_V_ERR_PERMITTED_VIOLATION = global i32 0
@X509_V_ERR_EXCLUDED_VIOLATION = global i32 0
define i32 @nc_match(%struct.TYPE_11__* %0, %struct.TYPE_9__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %1, i64 0, i32 1
%4 = load i32, i32* %3
%5 = tail call i32 @sk_GENERAL_SUBTREE_num(i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %49
7: ; preds = %2
%8 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %0, i64 0, i32 0
br label %9
9: ; preds = %7, %41
%10 = phi i32 [ 0, %7 ], [ %42, %41 ]
%11 = phi i32 [ 0, %7 ], [ %43, %41 ]
%12 = load i32, i32* %3
%13 = tail call %struct.TYPE_10__* @sk_GENERAL_SUBTREE_value(i32 %12, i32 %11)
%14 = load i64, i64* %8
%15 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %13, i64 0, i32 0
%16 = load %struct.TYPE_12__*, %struct.TYPE_12__** %15
%17 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %16, i64 0, i32 0
%18 = load i64, i64* %17
%19 = icmp eq i64 %14, %18
br i1 %19, label %20, label %41
20: ; preds = %9
%21 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %13, i64 0, i32 2
%22 = load i64, i64* %21
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %13, i64 0, i32 1
%26 = load i64, i64* %25
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %24, %20
%29 = load i32, i32* @X509_V_ERR_SUBTREE_MINMAX
br label %94
30: ; preds = %24
%31 = icmp eq i32 %10, 2
br i1 %31, label %41, label %32
32: ; preds = %30
%33 = tail call i32 @nc_match_single(%struct.TYPE_11__* %0, %struct.TYPE_12__* %16)
%34 = load i32, i32* @X509_V_OK
%35 = icmp eq i32 %33, %34
br i1 %35, label %41, label %36
36: ; preds = %32
%37 = icmp eq i32 %10, 0
%38 = select i1 %37, i32 1, i32 %10
%39 = load i32, i32* @X509_V_ERR_PERMITTED_VIOLATION
%40 = icmp eq i32 %33, %39
br i1 %40, label %41, label %94
41: ; preds = %32, %36, %30, %9
%42 = phi i32 [ %10, %9 ], [ 2, %30 ], [ %38, %36 ], [ 2, %32 ]
%43 = add nuw nsw i32 %11, 1
%44 = load i32, i32* %3
%45 = tail call i32 @sk_GENERAL_SUBTREE_num(i32 %44)
%46 = icmp slt i32 %43, %45
br i1 %46, label %9, label %47
47: ; preds = %41
%48 = icmp eq i32 %42, 1
br i1 %48, label %56, label %49
49: ; preds = %2, %47
%50 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %1, i64 0, i32 0
%51 = load i32, i32* %50
%52 = tail call i32 @sk_GENERAL_SUBTREE_num(i32 %51)
%53 = icmp sgt i32 %52, 0
br i1 %53, label %54, label %92
54: ; preds = %49
%55 = getelementptr inbounds %struct.TYPE_11__, %struct.TYPE_11__* %0, i64 0, i32 0
br label %58
56: ; preds = %47
%57 = load i32, i32* @X509_V_ERR_PERMITTED_VIOLATION
br label %94
58: ; preds = %54, %87
%59 = phi i32 [ 0, %54 ], [ %88, %87 ]
%60 = load i32, i32* %50
%61 = tail call %struct.TYPE_10__* @sk_GENERAL_SUBTREE_value(i32 %60, i32 %59)
%62 = load i64, i64* %55
%63 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %61, i64 0, i32 0
%64 = load %struct.TYPE_12__*, %struct.TYPE_12__** %63
%65 = getelementptr inbounds %struct.TYPE_12__, %struct.TYPE_12__* %64, i64 0, i32 0
%66 = load i64, i64* %65
%67 = icmp eq i64 %62, %66
br i1 %67, label %68, label %87
68: ; preds = %58
%69 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %61, i64 0, i32 2
%70 = load i64, i64* %69
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %76
72: ; preds = %68
%73 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %61, i64 0, i32 1
%74 = load i64, i64* %73
%75 = icmp eq i64 %74, 0
br i1 %75, label %78, label %76
76: ; preds = %72, %68
%77 = load i32, i32* @X509_V_ERR_SUBTREE_MINMAX
br label %94
78: ; preds = %72
%79 = tail call i32 @nc_match_single(%struct.TYPE_11__* %0, %struct.TYPE_12__* %64)
%80 = load i32, i32* @X509_V_OK
%81 = icmp eq i32 %79, %80
br i1 %81, label %82, label %84
82: ; preds = %78
%83 = load i32, i32* @X509_V_ERR_EXCLUDED_VIOLATION
br label %94
84: ; preds = %78
%85 = load i32, i32* @X509_V_ERR_PERMITTED_VIOLATION
%86 = icmp eq i32 %79, %85
br i1 %86, label %87, label %94
87: ; preds = %84, %58
%88 = add nuw nsw i32 %59, 1
%89 = load i32, i32* %50
%90 = tail call i32 @sk_GENERAL_SUBTREE_num(i32 %89)
%91 = icmp slt i32 %88, %90
br i1 %91, label %58, label %92
92: ; preds = %87, %49
%93 = load i32, i32* @X509_V_OK
br label %94
94: ; preds = %36, %84, %92, %82, %76, %56, %28
%95 = phi i32 [ %29, %28 ], [ %57, %56 ], [ %77, %76 ], [ %83, %82 ], [ %93, %92 ], [ %79, %84 ], [ %33, %36 ]
ret i32 %95
}