; LLVM IR from Trusted-eSign/trusted-crypto :: deps/wrapper/src/pki (chain)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.LoggerFunction = type { %class.Handle.1, ptr }
%class.Handle.1 = type { ptr }
%class.Handle.4 = type { ptr }
%class.Handle.0 = type { ptr }

@logger = external global ptr, align 8
@_ZTI6HandleI9ExceptionE = external dso_local constant { ptr, ptr }, align 8
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef) unnamed_addr #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6HandleI11CertificateED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI11CertificateEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @_ZN6Logger5errorEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #4 align 2

declare void @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176), i1 noundef zeroext, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ...) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr)

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #7

; Function Attrs: nounwind
declare void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #8

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE(ptr noundef nonnull align 1 dereferenceable(1) %0, ptr noundef %1, ptr noundef %2) #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %class.LoggerFunction, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %class.Handle.4, align 8
  %13 = alloca %class.Handle.4, align 8
  %14 = alloca i1, align 1
  %15 = alloca ptr, align 8
  %16 = alloca %class.Handle.4, align 8
  %17 = alloca %class.Handle.4, align 8
  %18 = alloca i1, align 1
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %class.Handle.0, align 8
  %22 = alloca %class.Handle.0, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %class.Handle.4, align 8
  %25 = alloca %class.Handle.4, align 8
  %26 = alloca i1, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #9
  %28 = load ptr, ptr @logger, align 8, !tbaa !5
  call void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef %28, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE)
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #9
  store i8 1, ptr %8, align 1, !tbaa !9
  %29 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %29, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.4)
          to label %30 unwind label %48

30:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %31 = invoke ptr @X509_STORE_CTX_new()
          to label %32 unwind label %52

32:                                               ; preds = %30
  store ptr %31, ptr %11, align 8, !tbaa !5
  %33 = load ptr, ptr %11, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %82, label %35

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %36 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 176) #10
          to label %37 unwind label %56

37:                                               ; preds = %35
  store i1 true, ptr %14, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef null)
          to label %38 unwind label %60

38:                                               ; preds = %37
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %36, i1 noundef zeroext true, ptr noundef @.str.1, i32 noundef 51, i32 noundef 0, ptr noundef @.str.5, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef %13, ptr noundef @.str.6)
          to label %39 unwind label %64

39:                                               ; preds = %38
  store i1 false, ptr %14, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %36)
          to label %40 unwind label %64

40:                                               ; preds = %39
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #9
  %41 = load ptr, ptr @logger, align 8, !tbaa !5
  %42 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %43 unwind label %72

43:                                               ; preds = %40
  %44 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %42) #9
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %41, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.7, ptr noundef %44)
          to label %45 unwind label %72

45:                                               ; preds = %43
  %46 = call ptr @__cxa_allocate_exception(i64 8) #9
  invoke void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %47 unwind label %76

47:                                               ; preds = %45
  invoke void @__cxa_throw(ptr %46, ptr @_ZTI6HandleI9ExceptionE, ptr @_ZN6HandleI9ExceptionED2Ev) #11
          to label %307 unwind label %72

48:                                               ; preds = %3
  %49 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %9, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %10, align 4
  br label %247

52:                                               ; preds = %82, %30
  %53 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %9, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %10, align 4
  br label %246

56:                                               ; preds = %35
  %57 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %9, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %10, align 4
  br label %81

60:                                               ; preds = %37
  %61 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %9, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %10, align 4
  br label %68

64:                                               ; preds = %39, %38
  %65 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %9, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %10, align 4
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #9
  br label %68

68:                                               ; preds = %64, %60
  %69 = load i1, ptr %14, align 1
  br i1 %69, label %70, label %71

70:                                               ; preds = %68
  call void @_ZdlPvm(ptr noundef %36, i64 noundef 176) #12
  br label %71

71:                                               ; preds = %70, %68
  br label %81

72:                                               ; preds = %47, %43, %40
  %73 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %9, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %10, align 4
  br label %80

76:                                               ; preds = %45
  %77 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %9, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %10, align 4
  call void @__cxa_free_exception(ptr %46) #9
  br label %80

80:                                               ; preds = %76, %72
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #9
  br label %81

81:                                               ; preds = %80, %71, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %246

82:                                               ; preds = %32
  %83 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %83, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.8)
          to label %84 unwind label %52

84:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %85 = invoke ptr @X509_STORE_new()
          to label %86 unwind label %102

86:                                               ; preds = %84
  store ptr %85, ptr %15, align 8, !tbaa !5
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %132, label %89

89:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %90 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 176) #10
          to label %91 unwind label %106

91:                                               ; preds = %89
  store i1 true, ptr %18, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef null)
          to label %92 unwind label %110

92:                                               ; preds = %91
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %90, i1 noundef zeroext true, ptr noundef @.str.1, i32 noundef 57, i32 noundef 0, ptr noundef @.str.5, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef %17, ptr noundef @.str.9)
          to label %93 unwind label %114

93:                                               ; preds = %92
  store i1 false, ptr %18, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef %90)
          to label %94 unwind label %114

94:                                               ; preds = %93
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #9
  %95 = load ptr, ptr @logger, align 8, !tbaa !5
  %96 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %97 unwind label %122

97:                                               ; preds = %94
  %98 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %96) #9
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %95, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.7, ptr noundef %98)
          to label %99 unwind label %122

99:                                               ; preds = %97
  %100 = call ptr @__cxa_allocate_exception(i64 8) #9
  invoke void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %101 unwind label %126

101:                                              ; preds = %99
  invoke void @__cxa_throw(ptr %100, ptr @_ZTI6HandleI9ExceptionE, ptr @_ZN6HandleI9ExceptionED2Ev) #11
          to label %307 unwind label %122

102:                                              ; preds = %240, %238, %236, %234, %228, %226, %224, %222, %210, %208, %206, %204, %203, %201, %198, %196, %192, %190, %173, %84
  %103 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %9, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %10, align 4
  br label %245

106:                                              ; preds = %89
  %107 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %9, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %10, align 4
  br label %131

110:                                              ; preds = %91
  %111 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %9, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %10, align 4
  br label %118

114:                                              ; preds = %93, %92
  %115 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %9, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %10, align 4
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #9
  br label %118

118:                                              ; preds = %114, %110
  %119 = load i1, ptr %18, align 1
  br i1 %119, label %120, label %121

120:                                              ; preds = %118
  call void @_ZdlPvm(ptr noundef %90, i64 noundef 176) #12
  br label %121

121:                                              ; preds = %120, %118
  br label %131

122:                                              ; preds = %101, %97, %94
  %123 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %9, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %10, align 4
  br label %130

126:                                              ; preds = %99
  %127 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %9, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %10, align 4
  call void @__cxa_free_exception(ptr %100) #9
  br label %130

130:                                              ; preds = %126, %122
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #9
  br label %131

131:                                              ; preds = %130, %121, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br label %245

132:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  store i32 0, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  %133 = invoke noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %134 unwind label %142

134:                                              ; preds = %132
  %135 = invoke noundef i32 @_ZN21CertificateCollection6lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %133)
          to label %136 unwind label %142

136:                                              ; preds = %134
  store i32 %135, ptr %20, align 4, !tbaa !11
  br label %137

137:                                              ; preds = %160, %136
  %138 = load i32, ptr %19, align 4, !tbaa !11
  %139 = load i32, ptr %20, align 4, !tbaa !11
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %146, label %141

141:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %173

142:                                              ; preds = %146, %134, %132
  %143 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %9, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %10, align 4
  br label %172

146:                                              ; preds = %137
  %147 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %147, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.10)
          to label %148 unwind label %142

148:                                              ; preds = %146
  %149 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %150 = invoke noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %151 unwind label %163

151:                                              ; preds = %148
  %152 = load i32, ptr %19, align 4, !tbaa !11
  invoke void @_ZN21CertificateCollection5itemsEi(ptr dead_on_unwind writable sret(%class.Handle.0) align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %150, i32 noundef %152)
          to label %153 unwind label %163

153:                                              ; preds = %151
  %154 = invoke noundef ptr @_ZNK6HandleI11CertificateEptEv(ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %155 unwind label %167

155:                                              ; preds = %153
  %156 = invoke noundef ptr @_ZN9SSLObjectI7x509_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %154)
          to label %157 unwind label %167

157:                                              ; preds = %155
  %158 = invoke i32 @X509_STORE_add_cert(ptr noundef %149, ptr noundef %156)
          to label %159 unwind label %167

159:                                              ; preds = %157
  call void @_ZN6HandleI11CertificateED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %19, align 4, !tbaa !11
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %19, align 4, !tbaa !11
  br label %137, !llvm.loop !13

163:                                              ; preds = %151, %148
  %164 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %9, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %10, align 4
  br label %171

167:                                              ; preds = %157, %155, %153
  %168 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %9, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %10, align 4
  call void @_ZN6HandleI11CertificateED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #9
  br label %171

171:                                              ; preds = %167, %163
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %172

172:                                              ; preds = %171, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %245

173:                                              ; preds = %141
  %174 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %174, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.11)
          to label %175 unwind label %102

175:                                              ; preds = %173
  %176 = load ptr, ptr %11, align 8, !tbaa !5
  %177 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %178 = invoke noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %179 unwind label %213

179:                                              ; preds = %175
  invoke void @_ZN21CertificateCollection5itemsEi(ptr dead_on_unwind writable sret(%class.Handle.0) align 8 %22, ptr noundef nonnull align 8 dereferenceable(16) %178, i32 noundef 0)
          to label %180 unwind label %213

180:                                              ; preds = %179
  %181 = invoke noundef ptr @_ZNK6HandleI11CertificateEptEv(ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %182 unwind label %217

182:                                              ; preds = %180
  %183 = invoke noundef ptr @_ZN9SSLObjectI7x509_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %181)
          to label %184 unwind label %217

184:                                              ; preds = %182
  %185 = invoke noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %186 unwind label %217

186:                                              ; preds = %184
  %187 = invoke noundef ptr @_ZN9SSLObjectI13stack_st_X509E8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %185)
          to label %188 unwind label %217

188:                                              ; preds = %186
  %189 = invoke i32 @X509_STORE_CTX_init(ptr noundef %176, ptr noundef %177, ptr noundef %183, ptr noundef %187)
          to label %190 unwind label %217

190:                                              ; preds = %188
  call void @_ZN6HandleI11CertificateED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  %191 = invoke noundef ptr @_ZNK6HandleI13CrlCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %192 unwind label %102

192:                                              ; preds = %190
  %193 = invoke noundef i32 @_ZN13CrlCollection6lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %191)
          to label %194 unwind label %102

194:                                              ; preds = %192
  %195 = icmp ne i32 %193, 0
  br i1 %195, label %196, label %222

196:                                              ; preds = %194
  %197 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %197, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.12)
          to label %198 unwind label %102

198:                                              ; preds = %196
  %199 = load ptr, ptr %11, align 8, !tbaa !5
  %200 = invoke noundef ptr @_ZNK6HandleI13CrlCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %201 unwind label %102

201:                                              ; preds = %198
  %202 = invoke noundef ptr @_ZN9SSLObjectI17stack_st_X509_CRLE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %200)
          to label %203 unwind label %102

203:                                              ; preds = %201
  invoke void @X509_STORE_CTX_set0_crls(ptr noundef %199, ptr noundef %202)
          to label %204 unwind label %102

204:                                              ; preds = %203
  %205 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %205, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.13)
          to label %206 unwind label %102

206:                                              ; preds = %204
  %207 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @X509_STORE_CTX_set_flags(ptr noundef %207, i64 noundef 4)
          to label %208 unwind label %102

208:                                              ; preds = %206
  %209 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %209, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.13)
          to label %210 unwind label %102

210:                                              ; preds = %208
  %211 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @X509_STORE_CTX_set_flags(ptr noundef %211, i64 noundef 8)
          to label %212 unwind label %102

212:                                              ; preds = %210
  br label %222

213:                                              ; preds = %179, %175
  %214 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %9, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %10, align 4
  br label %221

217:                                              ; preds = %188, %186, %184, %182, %180
  %218 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  %219 = extractvalue { ptr, i32 } %218, 0
  store ptr %219, ptr %9, align 8
  %220 = extractvalue { ptr, i32 } %218, 1
  store i32 %220, ptr %10, align 4
  call void @_ZN6HandleI11CertificateED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %22) #9
  br label %221

221:                                              ; preds = %217, %213
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  br label %245

222:                                              ; preds = %212, %194
  %223 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %223, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.13)
          to label %224 unwind label %102

224:                                              ; preds = %222
  %225 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @X509_STORE_CTX_set_flags(ptr noundef %225, i64 noundef 16384)
          to label %226 unwind label %102

226:                                              ; preds = %224
  %227 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %227, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.14)
          to label %228 unwind label %102

228:                                              ; preds = %226
  %229 = load ptr, ptr %11, align 8, !tbaa !5
  %230 = invoke i32 @X509_verify_cert(ptr noundef %229)
          to label %231 unwind label %102

231:                                              ; preds = %228
  %232 = icmp sle i32 %230, 0
  br i1 %232, label %233, label %234

233:                                              ; preds = %231
  store i8 0, ptr %8, align 1, !tbaa !9
  br label %234

234:                                              ; preds = %233, %231
  %235 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %235, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.15)
          to label %236 unwind label %102

236:                                              ; preds = %234
  %237 = load ptr, ptr %11, align 8, !tbaa !5
  invoke void @X509_STORE_CTX_free(ptr noundef %237)
          to label %238 unwind label %102

238:                                              ; preds = %236
  store ptr null, ptr %11, align 8, !tbaa !5
  %239 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %239, i32 noundef 32, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.16)
          to label %240 unwind label %102

240:                                              ; preds = %238
  %241 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @X509_STORE_free(ptr noundef %241)
          to label %242 unwind label %102

242:                                              ; preds = %240
  store ptr null, ptr %15, align 8, !tbaa !5
  %243 = load i8, ptr %8, align 1, !tbaa !9, !range !15, !noundef !16
  %244 = trunc i8 %243 to i1
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #9
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #9
  ret i1 %244

245:                                              ; preds = %221, %172, %131, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br label %246

246:                                              ; preds = %245, %81, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  br label %247

247:                                              ; preds = %246, %48
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #9
  br label %248

248:                                              ; preds = %247
  %249 = load i32, ptr %10, align 4
  %250 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTI6HandleI9ExceptionE) #9
  %251 = icmp eq i32 %249, %250
  br i1 %251, label %252, label %298

252:                                              ; preds = %248
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  %253 = load ptr, ptr %9, align 8
  %254 = call ptr @__cxa_begin_catch(ptr %253) #9
  store ptr %254, ptr %23, align 8
  %255 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger5errorEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %255, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef @.str.17)
          to label %256 unwind label %265

256:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #9
  %257 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 176) #10
          to label %258 unwind label %269

258:                                              ; preds = %256
  store i1 true, ptr %26, align 1
  %259 = load ptr, ptr %23, align 8, !tbaa !5
  invoke void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %259)
          to label %260 unwind label %273

260:                                              ; preds = %258
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %257, i1 noundef zeroext false, ptr noundef @.str.1, i32 noundef 97, i32 noundef 0, ptr noundef @.str.2, ptr noundef @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef %25, ptr noundef @.str.17)
          to label %261 unwind label %277

261:                                              ; preds = %260
  store i1 false, ptr %26, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef %257)
          to label %262 unwind label %277

262:                                              ; preds = %261
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %25) #9
  %263 = call ptr @__cxa_allocate_exception(i64 8) #9
  invoke void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %263, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %264 unwind label %285

264:                                              ; preds = %262
  invoke void @__cxa_throw(ptr %263, ptr @_ZTI6HandleI9ExceptionE, ptr @_ZN6HandleI9ExceptionED2Ev) #11
          to label %307 unwind label %289

265:                                              ; preds = %252
  %266 = landingpad { ptr, i32 }
          cleanup
  %267 = extractvalue { ptr, i32 } %266, 0
  store ptr %267, ptr %9, align 8
  %268 = extractvalue { ptr, i32 } %266, 1
  store i32 %268, ptr %10, align 4
  br label %295

269:                                              ; preds = %256
  %270 = landingpad { ptr, i32 }
          cleanup
  %271 = extractvalue { ptr, i32 } %270, 0
  store ptr %271, ptr %9, align 8
  %272 = extractvalue { ptr, i32 } %270, 1
  store i32 %272, ptr %10, align 4
  br label %294

273:                                              ; preds = %258
  %274 = landingpad { ptr, i32 }
          cleanup
  %275 = extractvalue { ptr, i32 } %274, 0
  store ptr %275, ptr %9, align 8
  %276 = extractvalue { ptr, i32 } %274, 1
  store i32 %276, ptr %10, align 4
  br label %281

277:                                              ; preds = %261, %260
  %278 = landingpad { ptr, i32 }
          cleanup
  %279 = extractvalue { ptr, i32 } %278, 0
  store ptr %279, ptr %9, align 8
  %280 = extractvalue { ptr, i32 } %278, 1
  store i32 %280, ptr %10, align 4
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %25) #9
  br label %281

281:                                              ; preds = %277, %273
  %282 = load i1, ptr %26, align 1
  br i1 %282, label %283, label %284

283:                                              ; preds = %281
  call void @_ZdlPvm(ptr noundef %257, i64 noundef 176) #12
  br label %284

284:                                              ; preds = %283, %281
  br label %294

285:                                              ; preds = %262
  %286 = landingpad { ptr, i32 }
          cleanup
  %287 = extractvalue { ptr, i32 } %286, 0
  store ptr %287, ptr %9, align 8
  %288 = extractvalue { ptr, i32 } %286, 1
  store i32 %288, ptr %10, align 4
  call void @__cxa_free_exception(ptr %263) #9
  br label %293

289:                                              ; preds = %264
  %290 = landingpad { ptr, i32 }
          cleanup
  %291 = extractvalue { ptr, i32 } %290, 0
  store ptr %291, ptr %9, align 8
  %292 = extractvalue { ptr, i32 } %290, 1
  store i32 %292, ptr %10, align 4
  br label %293

293:                                              ; preds = %289, %285
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %24) #9
  br label %294

294:                                              ; preds = %293, %284, %269
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  br label %295

295:                                              ; preds = %294, %265
  invoke void @__cxa_end_catch()
          to label %296 unwind label %304

296:                                              ; preds = %295
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  br label %298

297:                                              ; No predecessors!
  unreachable

298:                                              ; preds = %296, %248
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #9
  br label %299

299:                                              ; preds = %298
  %300 = load ptr, ptr %9, align 8
  %301 = load i32, ptr %10, align 4
  %302 = insertvalue { ptr, i32 } poison, ptr %300, 0
  %303 = insertvalue { ptr, i32 } %302, i32 %301, 1
  resume { ptr, i32 } %303

304:                                              ; preds = %295
  %305 = landingpad { ptr, i32 }
          catch ptr null
  %306 = extractvalue { ptr, i32 } %305, 0
  call void @__clang_call_terminate(ptr %306) #13
  unreachable

307:                                              ; preds = %264, %101, %47
  unreachable
}

declare void @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef, ptr noundef, ...) #1

declare ptr @X509_STORE_CTX_new() #1

declare void @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: nounwind
declare noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176)) #8

declare ptr @X509_STORE_new() #1

declare noundef i32 @_ZN21CertificateCollection6lengthEv(ptr noundef nonnull align 8 dereferenceable(16)) #1

declare i32 @X509_STORE_add_cert(ptr noundef, ptr noundef) #1

declare void @_ZN21CertificateCollection5itemsEi(ptr dead_on_unwind writable sret(%class.Handle.0) align 8, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9SSLObjectI7x509_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

declare i32 @X509_STORE_CTX_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9SSLObjectI13stack_st_X509E8internalEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI13CrlCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

declare noundef i32 @_ZN13CrlCollection6lengthEv(ptr noundef nonnull align 8 dereferenceable(16)) #1

declare void @X509_STORE_CTX_set0_crls(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9SSLObjectI17stack_st_X509_CRLE8internalEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

declare void @X509_STORE_CTX_set_flags(ptr noundef, i64 noundef) #1

declare i32 @X509_verify_cert(ptr noundef) #1

declare void @X509_STORE_CTX_free(ptr noundef) #1

declare void @X509_STORE_free(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind memory(none) }
attributes #7 = { noinline noreturn nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { noreturn }
attributes #12 = { builtin nounwind }
attributes #13 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.LoggerFunction = type { %class.Handle.1, ptr }
%class.Handle.1 = type { ptr }
%class.Handle.4 = type { ptr }
%class.Handle.0 = type { ptr }

@logger = external local_unnamed_addr global ptr, align 8
@_ZTI6HandleI9ExceptionE = external dso_local constant { ptr, ptr }, align 8
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef) unnamed_addr #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6HandleI11CertificateED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI11CertificateEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @_ZN6Logger5errorEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #4 align 2

declare void @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176), i1 noundef zeroext, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ...) unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 2

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #7

; Function Attrs: nounwind
declare void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #8

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE(ptr nocapture noundef nonnull readnone align 1 dereferenceable(1) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.LoggerFunction, align 8
  %5 = alloca %class.Handle.4, align 8
  %6 = alloca %class.Handle.4, align 8
  %7 = alloca %class.Handle.4, align 8
  %8 = alloca %class.Handle.4, align 8
  %9 = alloca %class.Handle.0, align 8
  %10 = alloca %class.Handle.0, align 8
  %11 = alloca %class.Handle.4, align 8
  %12 = alloca %class.Handle.4, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  %13 = load ptr, ptr @logger, align 8, !tbaa !5
  call void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef %13, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE)
  %14 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.4)
          to label %15 unwind label %31

15:                                               ; preds = %3
  %16 = invoke ptr @X509_STORE_CTX_new()
          to label %17 unwind label %33

17:                                               ; preds = %15
  %.not = icmp eq ptr %16, null
  br i1 %.not, label %18, label %44

18:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %19 = invoke noalias noundef nonnull dereferenceable(176) ptr @_Znwm(i64 noundef 176) #10
          to label %20 unwind label %35

20:                                               ; preds = %18
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef null)
          to label %21 unwind label %.thread

21:                                               ; preds = %20
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %19, i1 noundef zeroext true, ptr noundef nonnull @.str.1, i32 noundef 51, i32 noundef 0, ptr noundef nonnull @.str.5, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull %6, ptr noundef nonnull @.str.6)
          to label %23 unwind label %.thread70

.thread70:                                        ; preds = %21
  %22 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  br label %40

23:                                               ; preds = %21
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %19)
          to label %24 unwind label %38

24:                                               ; preds = %23
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  %25 = load ptr, ptr @logger, align 8, !tbaa !5
  %26 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %27 unwind label %41

27:                                               ; preds = %24
  %28 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %26) #9
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.7, ptr noundef %28)
          to label %29 unwind label %41

29:                                               ; preds = %27
  %30 = call ptr @__cxa_allocate_exception(i64 8) #9
  call void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @__cxa_throw(ptr nonnull %30, ptr nonnull @_ZTI6HandleI9ExceptionE, ptr nonnull @_ZN6HandleI9ExceptionED2Ev) #11
          to label %175 unwind label %41

31:                                               ; preds = %3
  %32 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %147

33:                                               ; preds = %44, %15
  %34 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %147

35:                                               ; preds = %18
  %36 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %43

.thread:                                          ; preds = %20
  %37 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %40

38:                                               ; preds = %23
  %39 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  br label %43

40:                                               ; preds = %.thread70, %.thread
  %.pn69 = phi { ptr, i32 } [ %37, %.thread ], [ %22, %.thread70 ]
  call void @_ZdlPvm(ptr noundef nonnull %19, i64 noundef 176) #12
  br label %43

41:                                               ; preds = %29, %27, %24
  %42 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #9
  br label %43

43:                                               ; preds = %38, %40, %41, %35
  %.pn48 = phi { ptr, i32 } [ %42, %41 ], [ %.pn69, %40 ], [ %39, %38 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  br label %147

44:                                               ; preds = %17
  %45 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %45, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.8)
          to label %46 unwind label %33

46:                                               ; preds = %44
  %47 = invoke ptr @X509_STORE_new()
          to label %48 unwind label %62

48:                                               ; preds = %46
  %.not50 = icmp eq ptr %47, null
  br i1 %.not50, label %49, label %73

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  %50 = invoke noalias noundef nonnull dereferenceable(176) ptr @_Znwm(i64 noundef 176) #10
          to label %51 unwind label %64

51:                                               ; preds = %49
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef null)
          to label %52 unwind label %.thread72

52:                                               ; preds = %51
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %50, i1 noundef zeroext true, ptr noundef nonnull @.str.1, i32 noundef 57, i32 noundef 0, ptr noundef nonnull @.str.5, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull %8, ptr noundef nonnull @.str.9)
          to label %54 unwind label %.thread76

.thread76:                                        ; preds = %52
  %53 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  br label %69

54:                                               ; preds = %52
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %50)
          to label %55 unwind label %67

55:                                               ; preds = %54
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  %56 = load ptr, ptr @logger, align 8, !tbaa !5
  %57 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %58 unwind label %70

58:                                               ; preds = %55
  %59 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %57) #9
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.7, ptr noundef %59)
          to label %60 unwind label %70

60:                                               ; preds = %58
  %61 = call ptr @__cxa_allocate_exception(i64 8) #9
  call void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull align 8 dereferenceable(8) %7)
  invoke void @__cxa_throw(ptr nonnull %61, ptr nonnull @_ZTI6HandleI9ExceptionE, ptr nonnull @_ZN6HandleI9ExceptionED2Ev) #11
          to label %175 unwind label %70

62:                                               ; preds = %144, %142, %141, %139, %137, %135, %134, %132, %126, %124, %123, %121, %120, %118, %116, %114, %111, %109, %._crit_edge, %46
  %63 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %147

64:                                               ; preds = %49
  %65 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %72

.thread72:                                        ; preds = %51
  %66 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %69

67:                                               ; preds = %54
  %68 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #9
  br label %72

69:                                               ; preds = %.thread76, %.thread72
  %.pn5175 = phi { ptr, i32 } [ %66, %.thread72 ], [ %53, %.thread76 ]
  call void @_ZdlPvm(ptr noundef nonnull %50, i64 noundef 176) #12
  br label %72

70:                                               ; preds = %60, %58, %55
  %71 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #9
  br label %72

72:                                               ; preds = %67, %69, %70, %64
  %.pn53 = phi { ptr, i32 } [ %71, %70 ], [ %.pn5175, %69 ], [ %68, %67 ], [ %65, %64 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  br label %147

73:                                               ; preds = %48
  %74 = invoke noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %75 unwind label %.loopexit.split-lp

75:                                               ; preds = %73
  %76 = invoke noundef i32 @_ZN21CertificateCollection6lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %74)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %75
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %89, %.preheader
  %78 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %78, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.11)
          to label %96 unwind label %62

.loopexit:                                        ; preds = %.lr.ph
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %147

.loopexit.split-lp:                               ; preds = %73, %75
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %147

.lr.ph:                                           ; preds = %.preheader, %89
  %.02780 = phi i32 [ %90, %89 ], [ 0, %.preheader ]
  %79 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %79, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.10)
          to label %80 unwind label %.loopexit

80:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %81 = invoke noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %82 unwind label %91

82:                                               ; preds = %80
  invoke void @_ZN21CertificateCollection5itemsEi(ptr dead_on_unwind nonnull writable sret(%class.Handle.0) align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %81, i32 noundef %.02780)
          to label %83 unwind label %91

83:                                               ; preds = %82
  %84 = invoke noundef ptr @_ZNK6HandleI11CertificateEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %85 unwind label %93

85:                                               ; preds = %83
  %86 = invoke noundef ptr @_ZN9SSLObjectI7x509_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %84)
          to label %87 unwind label %93

87:                                               ; preds = %85
  %88 = invoke i32 @X509_STORE_add_cert(ptr noundef nonnull %47, ptr noundef %86)
          to label %89 unwind label %93

89:                                               ; preds = %87
  call void @_ZN6HandleI11CertificateED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  %90 = add nuw nsw i32 %.02780, 1
  %exitcond.not = icmp eq i32 %90, %76
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

91:                                               ; preds = %82, %80
  %92 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %95

93:                                               ; preds = %87, %85, %83
  %94 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  call void @_ZN6HandleI11CertificateED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #9
  br label %95

95:                                               ; preds = %93, %91
  %.pn58 = phi { ptr, i32 } [ %94, %93 ], [ %92, %91 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %147

96:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %97 = invoke noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %98 unwind label %127

98:                                               ; preds = %96
  invoke void @_ZN21CertificateCollection5itemsEi(ptr dead_on_unwind nonnull writable sret(%class.Handle.0) align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) %97, i32 noundef 0)
          to label %99 unwind label %127

99:                                               ; preds = %98
  %100 = invoke noundef ptr @_ZNK6HandleI11CertificateEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %101 unwind label %129

101:                                              ; preds = %99
  %102 = invoke noundef ptr @_ZN9SSLObjectI7x509_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %100)
          to label %103 unwind label %129

103:                                              ; preds = %101
  %104 = invoke noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %105 unwind label %129

105:                                              ; preds = %103
  %106 = invoke noundef ptr @_ZN9SSLObjectI13stack_st_X509E8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %104)
          to label %107 unwind label %129

107:                                              ; preds = %105
  %108 = invoke i32 @X509_STORE_CTX_init(ptr noundef nonnull %16, ptr noundef nonnull %47, ptr noundef %102, ptr noundef %106)
          to label %109 unwind label %129

109:                                              ; preds = %107
  call void @_ZN6HandleI11CertificateED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  %110 = invoke noundef ptr @_ZNK6HandleI13CrlCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %111 unwind label %62

111:                                              ; preds = %109
  %112 = invoke noundef i32 @_ZN13CrlCollection6lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %110)
          to label %113 unwind label %62

113:                                              ; preds = %111
  %.not57 = icmp eq i32 %112, 0
  br i1 %.not57, label %132, label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %115, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.12)
          to label %116 unwind label %62

116:                                              ; preds = %114
  %117 = invoke noundef ptr @_ZNK6HandleI13CrlCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %118 unwind label %62

118:                                              ; preds = %116
  %119 = invoke noundef ptr @_ZN9SSLObjectI17stack_st_X509_CRLE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %117)
          to label %120 unwind label %62

120:                                              ; preds = %118
  invoke void @X509_STORE_CTX_set0_crls(ptr noundef nonnull %16, ptr noundef %119)
          to label %121 unwind label %62

121:                                              ; preds = %120
  %122 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %122, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.13)
          to label %123 unwind label %62

123:                                              ; preds = %121
  invoke void @X509_STORE_CTX_set_flags(ptr noundef nonnull %16, i64 noundef 4)
          to label %124 unwind label %62

124:                                              ; preds = %123
  %125 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %125, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.13)
          to label %126 unwind label %62

126:                                              ; preds = %124
  invoke void @X509_STORE_CTX_set_flags(ptr noundef nonnull %16, i64 noundef 8)
          to label %132 unwind label %62

127:                                              ; preds = %98, %96
  %128 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  br label %131

129:                                              ; preds = %107, %105, %103, %101, %99
  %130 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTI6HandleI9ExceptionE
  call void @_ZN6HandleI11CertificateED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #9
  br label %131

131:                                              ; preds = %129, %127
  %.pn55 = phi { ptr, i32 } [ %130, %129 ], [ %128, %127 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  br label %147

132:                                              ; preds = %126, %113
  %133 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %133, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.13)
          to label %134 unwind label %62

134:                                              ; preds = %132
  invoke void @X509_STORE_CTX_set_flags(ptr noundef nonnull %16, i64 noundef 16384)
          to label %135 unwind label %62

135:                                              ; preds = %134
  %136 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %136, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.14)
          to label %137 unwind label %62

137:                                              ; preds = %135
  %138 = invoke i32 @X509_verify_cert(ptr noundef nonnull %16)
          to label %139 unwind label %62

139:                                              ; preds = %137
  %140 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %140, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.15)
          to label %141 unwind label %62

141:                                              ; preds = %139
  invoke void @X509_STORE_CTX_free(ptr noundef nonnull %16)
          to label %142 unwind label %62

142:                                              ; preds = %141
  %143 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %143, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.16)
          to label %144 unwind label %62

144:                                              ; preds = %142
  invoke void @X509_STORE_free(ptr noundef nonnull %47)
          to label %145 unwind label %62

145:                                              ; preds = %144
  %146 = icmp sgt i32 %138, 0
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  ret i1 %146

147:                                              ; preds = %.loopexit, %.loopexit.split-lp, %33, %43, %95, %131, %72, %62, %31
  %.pn58.pn.pn.pn.pn = phi { ptr, i32 } [ %32, %31 ], [ %34, %33 ], [ %.pn48, %43 ], [ %63, %62 ], [ %.pn55, %131 ], [ %.pn53, %72 ], [ %.pn58, %95 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  %.941 = extractvalue { ptr, i32 } %.pn58.pn.pn.pn.pn, 1
  %148 = call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTI6HandleI9ExceptionE) #9
  %149 = icmp eq i32 %.941, %148
  br i1 %149, label %150, label %171

150:                                              ; preds = %147
  %.9 = extractvalue { ptr, i32 } %.pn58.pn.pn.pn.pn, 0
  %151 = call ptr @__cxa_begin_catch(ptr %.9) #9
  %152 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger5errorEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %152, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull @.str.17)
          to label %153 unwind label %159

153:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  %154 = invoke noalias noundef nonnull dereferenceable(176) ptr @_Znwm(i64 noundef 176) #10
          to label %155 unwind label %161

155:                                              ; preds = %153
  call void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %151)
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %154, i1 noundef zeroext false, ptr noundef nonnull @.str.1, i32 noundef 97, i32 noundef 0, ptr noundef nonnull @.str.2, ptr noundef nonnull @__FUNCTION__._ZN5Chain11verifyChainE6HandleI21CertificateCollectionES0_I13CrlCollectionE, ptr noundef nonnull %12, ptr noundef nonnull @.str.17)
          to label %156 unwind label %165

156:                                              ; preds = %155
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull %154)
          to label %157 unwind label %163

157:                                              ; preds = %156
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #9
  %158 = call ptr @__cxa_allocate_exception(i64 8) #9
  call void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %158, ptr noundef nonnull align 8 dereferenceable(8) %11)
  invoke void @__cxa_throw(ptr nonnull %158, ptr nonnull @_ZTI6HandleI9ExceptionE, ptr nonnull @_ZN6HandleI9ExceptionED2Ev) #11
          to label %175 unwind label %167

159:                                              ; preds = %150
  %160 = landingpad { ptr, i32 }
          cleanup
  br label %170

161:                                              ; preds = %153
  %162 = landingpad { ptr, i32 }
          cleanup
  br label %169

163:                                              ; preds = %156
  %164 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #9
  br label %169

165:                                              ; preds = %155
  %166 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #9
  call void @_ZdlPvm(ptr noundef nonnull %154, i64 noundef 176) #12
  br label %169

167:                                              ; preds = %157
  %168 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #9
  br label %169

169:                                              ; preds = %163, %165, %167, %161
  %.pn64 = phi { ptr, i32 } [ %168, %167 ], [ %166, %165 ], [ %164, %163 ], [ %162, %161 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  br label %170

170:                                              ; preds = %169, %159
  %.pn64.pn = phi { ptr, i32 } [ %.pn64, %169 ], [ %160, %159 ]
  invoke void @__cxa_end_catch()
          to label %171 unwind label %172

171:                                              ; preds = %170, %147
  %.merged = phi { ptr, i32 } [ %.pn58.pn.pn.pn.pn, %147 ], [ %.pn64.pn, %170 ]
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  resume { ptr, i32 } %.merged

172:                                              ; preds = %170
  %173 = landingpad { ptr, i32 }
          catch ptr null
  %174 = extractvalue { ptr, i32 } %173, 0
  call void @__clang_call_terminate(ptr %174) #13
  unreachable

175:                                              ; preds = %157, %60, %29
  unreachable
}

declare void @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare ptr @X509_STORE_CTX_new() local_unnamed_addr #1

declare void @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: nounwind
declare noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #8

declare ptr @X509_STORE_new() local_unnamed_addr #1

declare noundef i32 @_ZN21CertificateCollection6lengthEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare i32 @X509_STORE_add_cert(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @_ZN21CertificateCollection5itemsEi(ptr dead_on_unwind writable sret(%class.Handle.0) align 8, ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9SSLObjectI7x509_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

declare i32 @X509_STORE_CTX_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9SSLObjectI13stack_st_X509E8internalEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI13CrlCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

declare noundef i32 @_ZN13CrlCollection6lengthEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare void @X509_STORE_CTX_set0_crls(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9SSLObjectI17stack_st_X509_CRLE8internalEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

declare void @X509_STORE_CTX_set_flags(ptr noundef, i64 noundef) local_unnamed_addr #1

declare i32 @X509_verify_cert(ptr noundef) local_unnamed_addr #1

declare void @X509_STORE_CTX_free(ptr noundef) local_unnamed_addr #1

declare void @X509_STORE_free(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nosync nounwind memory(none) }
attributes #7 = { noinline noreturn nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { noreturn }
attributes #12 = { builtin nounwind }
attributes #13 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass