#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_13__ TYPE_4__;
typedef struct TYPE_12__ TYPE_3__;
typedef struct TYPE_11__ TYPE_2__;
typedef struct TYPE_10__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;
struct TYPE_11__ {
  int /*<<< orphan*/ *fullname;
};
struct TYPE_13__ {
  int type;
  TYPE_2__ name;
  int /*<<< orphan*/ *dpname;
};
struct TYPE_10__ {
  int /*<<< orphan*/ *directoryName;
};
struct TYPE_12__ {
  scalar_t__ type;
  TYPE_1__ d;
};
typedef int /*<<< orphan*/ GENERAL_NAMES;
typedef TYPE_3__ GENERAL_NAME;
typedef TYPE_4__ DIST_POINT_NAME;

/* Variables and functions */
int /*<<< orphan*/ GENERAL_NAME_cmp(TYPE_3__ *, TYPE_3__ *);
scalar_t__ GEN_DIRNAME;
int /*<<< orphan*/ X509_NAME_cmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int sk_GENERAL_NAME_num(int /*<<< orphan*/ *);
TYPE_3__ *sk_GENERAL_NAME_value(int /*<<< orphan*/ *, int);
int idp_check_dp(DIST_POINT_NAME *a, DIST_POINT_NAME *b) {
  X509_NAME *nm = NULL;
  GENERAL_NAMES *gens = NULL;
  GENERAL_NAME *gena, *genb;
  int i, j;
  if (!a || !b)
    return 1;
  if (a->type == 1) {
    if (!a->dpname)
      return 0;
    if (b->type == 1) {
      if (!b->dpname)
        return 0;
      if (!X509_NAME_cmp(a->dpname, b->dpname))
        return 1;
      else
        return 0;
    }
    nm = a->dpname;
    gens = b->name.fullname;
  } else if (b->type == 1) {
    if (!b->dpname)
      return 0;
    gens = a->name.fullname;
    nm = b->dpname;
  }
  if (nm) {
    for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
      gena = sk_GENERAL_NAME_value(gens, i);
      if (gena->type != GEN_DIRNAME)
        continue;
      if (!X509_NAME_cmp(nm, gena->d.directoryName))
        return 1;
    }
    return 0;
  }
  for (i = 0; i < sk_GENERAL_NAME_num(a->name.fullname); i++) {
    gena = sk_GENERAL_NAME_value(a->name.fullname, i);
    for (j = 0; j < sk_GENERAL_NAME_num(b->name.fullname); j++) {
      genb = sk_GENERAL_NAME_value(b->name.fullname, j);
      if (!GENERAL_NAME_cmp(gena, genb))
        return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<idp_check_dp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1176 <idp_check_dp+0x36>
cmpq   $0x0,-0x18(%rbp)
jne    1182 <idp_check_dp+0x42>
movl   $0x1,-0x4(%rbp)
jmp    13ce <idp_check_dp+0x28e>
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1225 <idp_check_dp+0xe5>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    11aa <idp_check_dp+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    13ce <idp_check_dp+0x28e>
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1208 <idp_check_dp+0xc8>
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    11d2 <idp_check_dp+0x92>
movl   $0x0,-0x4(%rbp)
jmp    13ce <idp_check_dp+0x28e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rsi
call   1060 <X509_NAME_cmp@plt>
cmp    $0x0,%eax
jne    11fc <idp_check_dp+0xbc>
movl   $0x1,-0x4(%rbp)
jmp    13ce <idp_check_dp+0x28e>
movl   $0x0,-0x4(%rbp)
jmp    13ce <idp_check_dp+0x28e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    126a <idp_check_dp+0x12a>
mov    -0x18(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1265 <idp_check_dp+0x125>
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    124d <idp_check_dp+0x10d>
movl   $0x0,-0x4(%rbp)
jmp    13ce <idp_check_dp+0x28e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    126a <idp_check_dp+0x12a>
cmpq   $0x0,-0x20(%rbp)
je     1309 <idp_check_dp+0x1c9>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <sk_GENERAL_NAME_num@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
cmp    %ecx,%eax
jge    12fd <idp_check_dp+0x1bd>
mov    -0x28(%rbp),%rdi
mov    -0x3c(%rbp),%esi
call   1040 <sk_GENERAL_NAME_value@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    0x2d32(%rip),%rcx
cmp    (%rcx),%rax
je     12c4 <idp_check_dp+0x184>
jmp    12ef <idp_check_dp+0x1af>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rsi
call   1060 <X509_NAME_cmp@plt>
cmp    $0x0,%eax
jne    12ea <idp_check_dp+0x1aa>
movl   $0x1,-0x4(%rbp)
jmp    13ce <idp_check_dp+0x28e>
jmp    12ef <idp_check_dp+0x1af>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    127c <idp_check_dp+0x13c>
movl   $0x0,-0x4(%rbp)
jmp    13ce <idp_check_dp+0x28e>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <sk_GENERAL_NAME_num@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
cmp    %ecx,%eax
jge    13c7 <idp_check_dp+0x287>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x3c(%rbp),%esi
call   1040 <sk_GENERAL_NAME_value@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <sk_GENERAL_NAME_num@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
cmp    %ecx,%eax
jge    13b4 <idp_check_dp+0x274>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x40(%rbp),%esi
call   1040 <sk_GENERAL_NAME_value@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1050 <GENERAL_NAME_cmp@plt>
cmp    $0x0,%eax
jne    13a1 <idp_check_dp+0x261>
movl   $0x1,-0x4(%rbp)
jmp    13ce <idp_check_dp+0x28e>
jmp    13a6 <idp_check_dp+0x266>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    134b <idp_check_dp+0x20b>
jmp    13b9 <idp_check_dp+0x279>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1310 <idp_check_dp+0x1d0>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idp_check_dp>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %rdi,%rdi
je     1291 <idp_check_dp+0x151>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1291 <idp_check_dp+0x151>
mov    %rdi,%r14
cmpl   $0x1,(%rdi)
jne    11a0 <idp_check_dp+0x60>
mov    0x10(%r14),%r15
xor    %eax,%eax
test   %r15,%r15
je     129a <idp_check_dp+0x15a>
cmpl   $0x1,(%rbx)
jne    123c <idp_check_dp+0xfc>
mov    0x10(%rbx),%rsi
test   %rsi,%rsi
je     129a <idp_check_dp+0x15a>
mov    %r15,%rdi
call   1060 <X509_NAME_cmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
jmp    129a <idp_check_dp+0x15a>
cmpl   $0x1,(%rbx)
jne    11b7 <idp_check_dp+0x77>
mov    0x10(%rbx),%r15
test   %r15,%r15
jne    123f <idp_check_dp+0xff>
jmp    1298 <idp_check_dp+0x158>
mov    0x8(%r14),%rdi
call   1030 <sk_GENERAL_NAME_num@plt>
test   %eax,%eax
jle    1298 <idp_check_dp+0x158>
xor    %r15d,%r15d
jmp    11e7 <idp_check_dp+0xa7>
add    $0x1,%r15d
mov    0x8(%r14),%rdi
call   1030 <sk_GENERAL_NAME_num@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%r15d
jge    129a <idp_check_dp+0x15a>
mov    0x8(%r14),%rdi
mov    %r15d,%esi
call   1040 <sk_GENERAL_NAME_value@plt>
mov    %rax,%r12
mov    0x8(%rbx),%rdi
call   1030 <sk_GENERAL_NAME_num@plt>
test   %eax,%eax
jle    11cd <idp_check_dp+0x8d>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x8(%rbx),%rdi
mov    %ebp,%esi
call   1040 <sk_GENERAL_NAME_value@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1050 <GENERAL_NAME_cmp@plt>
test   %eax,%eax
je     1291 <idp_check_dp+0x151>
add    $0x1,%ebp
mov    0x8(%rbx),%rdi
call   1030 <sk_GENERAL_NAME_num@plt>
cmp    %eax,%ebp
jl     1210 <idp_check_dp+0xd0>
jmp    11cd <idp_check_dp+0x8d>
mov    %rbx,%r14
mov    0x8(%r14),%rbx
mov    %rbx,%rdi
call   1030 <sk_GENERAL_NAME_num@plt>
test   %eax,%eax
jle    1298 <idp_check_dp+0x158>
xor    %ebp,%ebp
mov    0x2d90(%rip),%r14
jmp    126f <idp_check_dp+0x12f>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %rbx,%rdi
call   1030 <sk_GENERAL_NAME_num@plt>
cmp    %eax,%ebp
jge    1298 <idp_check_dp+0x158>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <sk_GENERAL_NAME_value@plt>
mov    (%rax),%rcx
cmp    (%r14),%rcx
jne    1260 <idp_check_dp+0x120>
mov    0x8(%rax),%rsi
mov    %r15,%rdi
call   1060 <X509_NAME_cmp@plt>
test   %eax,%eax
jne    1260 <idp_check_dp+0x120>
mov    $0x1,%eax
jmp    129a <idp_check_dp+0x15a>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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