; LLVM IR from aws/s2n-tls :: tls (s2n_crl)

; 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"

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_result = type { i32 }
%struct.s2n_x509_validator = type { ptr, ptr, i8, i8, i16, ptr, i32, ptr, %struct.s2n_cert_validation_info, i8 }
%struct.s2n_cert_validation_info = type { i8, [3 x i8] }
%struct.s2n_crl_lookup = type { i32, ptr, i16, ptr }
%struct.s2n_crl = type { ptr }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.18 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [84 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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strrchr(ptr noundef, i32 noundef) #2

declare i32 @s2n_calculate_stacktrace() #3

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_crl_get_crls_from_lookup_list(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca %struct.s2n_result, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.s2n_result, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %struct.s2n_result, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %12

12:                                               ; preds = %2
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %47, label %15

15:                                               ; preds = %12
  br label %16

16:                                               ; preds = %15
  br label %17

17:                                               ; preds = %16
  %18 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %19 = getelementptr inbounds %struct.s2n_debug_info, ptr %18, i32 0, i32 0
  store ptr @.str.18, ptr %19, align 8, !tbaa !9
  %20 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %21 = getelementptr inbounds %struct.s2n_debug_info, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %22, i64 21
  %24 = call ptr @strrchr(ptr noundef %23, i32 noundef 47) #6
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %33

26:                                               ; preds = %17
  %27 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %28 = getelementptr inbounds %struct.s2n_debug_info, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = getelementptr inbounds i8, ptr %29, i64 21
  %31 = call ptr @strrchr(ptr noundef %30, i32 noundef 47) #6
  %32 = getelementptr inbounds i8, ptr %31, i64 1
  br label %38

33:                                               ; preds = %17
  %34 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %35 = getelementptr inbounds %struct.s2n_debug_info, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %36, i64 21
  br label %38

38:                                               ; preds = %33, %26
  %39 = phi ptr [ %32, %26 ], [ %37, %33 ]
  %40 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %41 = getelementptr inbounds %struct.s2n_debug_info, ptr %40, i32 0, i32 1
  store ptr %39, ptr %41, align 8, !tbaa !11
  %42 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %42, align 4, !tbaa !12
  %43 = call i32 @s2n_calculate_stacktrace()
  br label %44

44:                                               ; preds = %38
  %45 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %45, align 4, !tbaa !14
  br label %306

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46, %12
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.s2n_x509_validator, ptr %50, i32 0, i32 7
  %52 = load ptr, ptr %51, align 8, !tbaa !16
  %53 = icmp ne ptr %52, null
  br i1 %53, label %86, label %54

54:                                               ; preds = %49
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  %57 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %58 = getelementptr inbounds %struct.s2n_debug_info, ptr %57, i32 0, i32 0
  store ptr @.str.19, ptr %58, align 8, !tbaa !9
  %59 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %60 = getelementptr inbounds %struct.s2n_debug_info, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = getelementptr inbounds i8, ptr %61, i64 21
  %63 = call ptr @strrchr(ptr noundef %62, i32 noundef 47) #6
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %72

65:                                               ; preds = %56
  %66 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %67 = getelementptr inbounds %struct.s2n_debug_info, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  %69 = getelementptr inbounds i8, ptr %68, i64 21
  %70 = call ptr @strrchr(ptr noundef %69, i32 noundef 47) #6
  %71 = getelementptr inbounds i8, ptr %70, i64 1
  br label %77

72:                                               ; preds = %56
  %73 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %74 = getelementptr inbounds %struct.s2n_debug_info, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds i8, ptr %75, i64 21
  br label %77

77:                                               ; preds = %72, %65
  %78 = phi ptr [ %71, %65 ], [ %76, %72 ]
  %79 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %80 = getelementptr inbounds %struct.s2n_debug_info, ptr %79, i32 0, i32 1
  store ptr %78, ptr %80, align 8, !tbaa !11
  %81 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %81, align 4, !tbaa !12
  %82 = call i32 @s2n_calculate_stacktrace()
  br label %83

83:                                               ; preds = %77
  %84 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %84, align 4, !tbaa !14
  br label %306

85:                                               ; No predecessors!
  br label %86

86:                                               ; preds = %85, %49
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = icmp ne ptr %89, null
  br i1 %90, label %123, label %91

91:                                               ; preds = %88
  br label %92

92:                                               ; preds = %91
  br label %93

93:                                               ; preds = %92
  %94 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %95 = getelementptr inbounds %struct.s2n_debug_info, ptr %94, i32 0, i32 0
  store ptr @.str.20, ptr %95, align 8, !tbaa !9
  %96 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %97 = getelementptr inbounds %struct.s2n_debug_info, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = getelementptr inbounds i8, ptr %98, i64 21
  %100 = call ptr @strrchr(ptr noundef %99, i32 noundef 47) #6
  %101 = icmp ne ptr %100, null
  br i1 %101, label %102, label %109

102:                                              ; preds = %93
  %103 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %104 = getelementptr inbounds %struct.s2n_debug_info, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = getelementptr inbounds i8, ptr %105, i64 21
  %107 = call ptr @strrchr(ptr noundef %106, i32 noundef 47) #6
  %108 = getelementptr inbounds i8, ptr %107, i64 1
  br label %114

109:                                              ; preds = %93
  %110 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %111 = getelementptr inbounds %struct.s2n_debug_info, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !9
  %113 = getelementptr inbounds i8, ptr %112, i64 21
  br label %114

114:                                              ; preds = %109, %102
  %115 = phi ptr [ %108, %102 ], [ %113, %109 ]
  %116 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %117 = getelementptr inbounds %struct.s2n_debug_info, ptr %116, i32 0, i32 1
  store ptr %115, ptr %117, align 8, !tbaa !11
  %118 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %118, align 4, !tbaa !12
  %119 = call i32 @s2n_calculate_stacktrace()
  br label %120

120:                                              ; preds = %114
  %121 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %121, align 4, !tbaa !14
  br label %306

122:                                              ; No predecessors!
  br label %123

123:                                              ; preds = %122, %88
  br label %124

124:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !12
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.s2n_x509_validator, ptr %126, i32 0, i32 7
  %128 = load ptr, ptr %127, align 8, !tbaa !16
  %129 = call i32 @s2n_array_num_elements(ptr noundef %128, ptr noundef %6)
  %130 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  store i32 %129, ptr %130, align 4
  %131 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  %132 = load i32, ptr %131, align 4
  %133 = call zeroext i1 @s2n_result_is_ok(i32 %132)
  br i1 %133, label %136, label %134

134:                                              ; preds = %125
  %135 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %135, align 4, !tbaa !14
  store i32 1, ptr %8, align 4
  br label %305

136:                                              ; preds = %125
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !12
  br label %139

139:                                              ; preds = %298, %138
  %140 = load i32, ptr %9, align 4, !tbaa !12
  %141 = load i32, ptr %6, align 4, !tbaa !12
  %142 = icmp ult i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  store i32 22, ptr %8, align 4
  br label %301

144:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr null, ptr %10, align 8, !tbaa !5
  br label %145

145:                                              ; preds = %144
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.s2n_x509_validator, ptr %146, i32 0, i32 7
  %148 = load ptr, ptr %147, align 8, !tbaa !16
  %149 = load i32, ptr %9, align 4, !tbaa !12
  %150 = call i32 @s2n_array_get(ptr noundef %148, i32 noundef %149, ptr noundef %10)
  %151 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 %150, ptr %151, align 4
  %152 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %153 = load i32, ptr %152, align 4
  %154 = call zeroext i1 @s2n_result_is_ok(i32 %153)
  br i1 %154, label %157, label %155

155:                                              ; preds = %145
  %156 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %156, align 4, !tbaa !14
  store i32 1, ptr %8, align 4
  br label %295

157:                                              ; preds = %145
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  %162 = icmp ne ptr %161, null
  br i1 %162, label %197, label %163

163:                                              ; preds = %160
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  %166 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %167 = getelementptr inbounds %struct.s2n_debug_info, ptr %166, i32 0, i32 0
  store ptr @.str.21, ptr %167, align 8, !tbaa !9
  %168 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %169 = getelementptr inbounds %struct.s2n_debug_info, ptr %168, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8, !tbaa !9
  %171 = getelementptr inbounds i8, ptr %170, i64 21
  %172 = call ptr @strrchr(ptr noundef %171, i32 noundef 47) #6
  %173 = icmp ne ptr %172, null
  br i1 %173, label %174, label %181

174:                                              ; preds = %165
  %175 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %176 = getelementptr inbounds %struct.s2n_debug_info, ptr %175, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8, !tbaa !9
  %178 = getelementptr inbounds i8, ptr %177, i64 21
  %179 = call ptr @strrchr(ptr noundef %178, i32 noundef 47) #6
  %180 = getelementptr inbounds i8, ptr %179, i64 1
  br label %186

181:                                              ; preds = %165
  %182 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %183 = getelementptr inbounds %struct.s2n_debug_info, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !9
  %185 = getelementptr inbounds i8, ptr %184, i64 21
  br label %186

186:                                              ; preds = %181, %174
  %187 = phi ptr [ %180, %174 ], [ %185, %181 ]
  %188 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %189 = getelementptr inbounds %struct.s2n_debug_info, ptr %188, i32 0, i32 1
  store ptr %187, ptr %189, align 8, !tbaa !11
  %190 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %190, align 4, !tbaa !12
  %191 = call i32 @s2n_calculate_stacktrace()
  br label %192

192:                                              ; preds = %186
  br label %193

193:                                              ; preds = %192
  %194 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %194, align 4, !tbaa !14
  store i32 1, ptr %8, align 4
  br label %295

195:                                              ; No predecessors!
  br label %196

196:                                              ; preds = %195
  br label %197

197:                                              ; preds = %196, %160
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr %10, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.s2n_crl_lookup, ptr %200, i32 0, i32 3
  %202 = load ptr, ptr %201, align 8, !tbaa !21
  %203 = icmp eq ptr %202, null
  br i1 %203, label %204, label %205

204:                                              ; preds = %199
  store i32 24, ptr %8, align 4
  br label %295

205:                                              ; preds = %199
  br label %206

206:                                              ; preds = %205
  %207 = load ptr, ptr %10, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.s2n_crl_lookup, ptr %207, i32 0, i32 3
  %209 = load ptr, ptr %208, align 8, !tbaa !21
  %210 = getelementptr inbounds %struct.s2n_crl, ptr %209, i32 0, i32 0
  %211 = load ptr, ptr %210, align 8, !tbaa !23
  %212 = icmp ne ptr %211, null
  br i1 %212, label %247, label %213

213:                                              ; preds = %206
  br label %214

214:                                              ; preds = %213
  br label %215

215:                                              ; preds = %214
  %216 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %217 = getelementptr inbounds %struct.s2n_debug_info, ptr %216, i32 0, i32 0
  store ptr @.str.22, ptr %217, align 8, !tbaa !9
  %218 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %219 = getelementptr inbounds %struct.s2n_debug_info, ptr %218, i32 0, i32 0
  %220 = load ptr, ptr %219, align 8, !tbaa !9
  %221 = getelementptr inbounds i8, ptr %220, i64 21
  %222 = call ptr @strrchr(ptr noundef %221, i32 noundef 47) #6
  %223 = icmp ne ptr %222, null
  br i1 %223, label %224, label %231

224:                                              ; preds = %215
  %225 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %226 = getelementptr inbounds %struct.s2n_debug_info, ptr %225, i32 0, i32 0
  %227 = load ptr, ptr %226, align 8, !tbaa !9
  %228 = getelementptr inbounds i8, ptr %227, i64 21
  %229 = call ptr @strrchr(ptr noundef %228, i32 noundef 47) #6
  %230 = getelementptr inbounds i8, ptr %229, i64 1
  br label %236

231:                                              ; preds = %215
  %232 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %233 = getelementptr inbounds %struct.s2n_debug_info, ptr %232, i32 0, i32 0
  %234 = load ptr, ptr %233, align 8, !tbaa !9
  %235 = getelementptr inbounds i8, ptr %234, i64 21
  br label %236

236:                                              ; preds = %231, %224
  %237 = phi ptr [ %230, %224 ], [ %235, %231 ]
  %238 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %239 = getelementptr inbounds %struct.s2n_debug_info, ptr %238, i32 0, i32 1
  store ptr %237, ptr %239, align 8, !tbaa !11
  %240 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %240, align 4, !tbaa !12
  %241 = call i32 @s2n_calculate_stacktrace()
  br label %242

242:                                              ; preds = %236
  br label %243

243:                                              ; preds = %242
  %244 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %244, align 4, !tbaa !14
  store i32 1, ptr %8, align 4
  br label %295

245:                                              ; No predecessors!
  br label %246

246:                                              ; preds = %245
  br label %247

247:                                              ; preds = %246, %206
  br label %248

248:                                              ; preds = %247
  br label %249

249:                                              ; preds = %248
  %250 = load ptr, ptr %5, align 8, !tbaa !5
  %251 = call ptr @ossl_check_X509_CRL_sk_type(ptr noundef %250)
  %252 = load ptr, ptr %10, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.s2n_crl_lookup, ptr %252, i32 0, i32 3
  %254 = load ptr, ptr %253, align 8, !tbaa !21
  %255 = getelementptr inbounds %struct.s2n_crl, ptr %254, i32 0, i32 0
  %256 = load ptr, ptr %255, align 8, !tbaa !23
  %257 = call ptr @ossl_check_X509_CRL_type(ptr noundef %256)
  %258 = call i32 @OPENSSL_sk_push(ptr noundef %251, ptr noundef %257)
  %259 = icmp ne i32 %258, 0
  br i1 %259, label %294, label %260

260:                                              ; preds = %249
  br label %261

261:                                              ; preds = %260
  br label %262

262:                                              ; preds = %261
  %263 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %264 = getelementptr inbounds %struct.s2n_debug_info, ptr %263, i32 0, i32 0
  store ptr @.str.23, ptr %264, align 8, !tbaa !9
  %265 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %266 = getelementptr inbounds %struct.s2n_debug_info, ptr %265, i32 0, i32 0
  %267 = load ptr, ptr %266, align 8, !tbaa !9
  %268 = getelementptr inbounds i8, ptr %267, i64 21
  %269 = call ptr @strrchr(ptr noundef %268, i32 noundef 47) #6
  %270 = icmp ne ptr %269, null
  br i1 %270, label %271, label %278

271:                                              ; preds = %262
  %272 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %273 = getelementptr inbounds %struct.s2n_debug_info, ptr %272, i32 0, i32 0
  %274 = load ptr, ptr %273, align 8, !tbaa !9
  %275 = getelementptr inbounds i8, ptr %274, i64 21
  %276 = call ptr @strrchr(ptr noundef %275, i32 noundef 47) #6
  %277 = getelementptr inbounds i8, ptr %276, i64 1
  br label %283

278:                                              ; preds = %262
  %279 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %280 = getelementptr inbounds %struct.s2n_debug_info, ptr %279, i32 0, i32 0
  %281 = load ptr, ptr %280, align 8, !tbaa !9
  %282 = getelementptr inbounds i8, ptr %281, i64 21
  br label %283

283:                                              ; preds = %278, %271
  %284 = phi ptr [ %277, %271 ], [ %282, %278 ]
  %285 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %286 = getelementptr inbounds %struct.s2n_debug_info, ptr %285, i32 0, i32 1
  store ptr %284, ptr %286, align 8, !tbaa !11
  %287 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653268, ptr %287, align 4, !tbaa !12
  %288 = call i32 @s2n_calculate_stacktrace()
  br label %289

289:                                              ; preds = %283
  br label %290

290:                                              ; preds = %289
  %291 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %291, align 4, !tbaa !14
  store i32 1, ptr %8, align 4
  br label %295

292:                                              ; No predecessors!
  br label %293

293:                                              ; preds = %292
  br label %294

294:                                              ; preds = %293, %249
  store i32 0, ptr %8, align 4
  br label %295

295:                                              ; preds = %294, %290, %243, %204, %193, %155
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %296 = load i32, ptr %8, align 4
  switch i32 %296, label %301 [
    i32 0, label %297
    i32 24, label %298
  ]

297:                                              ; preds = %295
  br label %298

298:                                              ; preds = %297, %295
  %299 = load i32, ptr %9, align 4, !tbaa !12
  %300 = add i32 %299, 1
  store i32 %300, ptr %9, align 4, !tbaa !12
  br label %139, !llvm.loop !25

301:                                              ; preds = %295, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %302 = load i32, ptr %8, align 4
  switch i32 %302, label %305 [
    i32 22, label %303
  ]

303:                                              ; preds = %301
  %304 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 0, ptr %304, align 4, !tbaa !14
  store i32 1, ptr %8, align 4
  br label %305

305:                                              ; preds = %303, %301, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %306

306:                                              ; preds = %305, %120, %83, %44
  %307 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  %308 = load i32, ptr %307, align 4
  ret i32 %308
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #5

declare i32 @s2n_array_num_elements(ptr noundef, ptr noundef) #3

declare i32 @s2n_array_get(ptr noundef, i32 noundef, ptr noundef) #3

declare i32 @OPENSSL_sk_push(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_CRL_sk_type(ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_CRL_type(ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nounwind willreturn memory(read) "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 = { "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 = { 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 #5 = { inlinehint 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 willreturn memory(read) }
attributes #7 = { 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/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"", !13, i64 0}
!16 = !{!17, !6, i64 40}
!17 = !{!"s2n_x509_validator", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !18, i64 18, !6, i64 24, !13, i64 32, !6, i64 40, !19, i64 48, !20, i64 52}
!18 = !{!"short", !7, i64 0}
!19 = !{!"s2n_cert_validation_info", !13, i64 0, !13, i64 0}
!20 = !{!"_Bool", !7, i64 0}
!21 = !{!22, !6, i64 24}
!22 = !{!"s2n_crl_lookup", !13, i64 0, !6, i64 8, !18, i64 16, !6, i64 24}
!23 = !{!24, !6, i64 0}
!24 = !{!"s2n_crl", !6, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; 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"

%struct.s2n_debug_info = type { ptr, ptr }

@_s2n_debug_info = external thread_local local_unnamed_addr global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@.str.18 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [84 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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @s2n_crl_get_crls_from_lookup_list(ptr noundef readonly %0, ptr noundef %1) local_unnamed_addr #4 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %5, label %13

5:                                                ; preds = %2
  %6 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.18, ptr %6, align 8, !tbaa !5
  %7 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.18, i64 21), i32 noundef 47) #6
  %.not23 = icmp eq ptr %7, null
  %8 = getelementptr inbounds i8, ptr %7, i64 1
  %9 = select i1 %.not23, ptr getelementptr inbounds (i8, ptr @.str.18, i64 21), ptr %8
  %10 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %9, ptr %10, align 8, !tbaa !10
  %11 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %11, align 4, !tbaa !11
  %12 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %66

13:                                               ; preds = %2
  %14 = getelementptr inbounds i8, ptr %0, i64 40
  %15 = load ptr, ptr %14, align 8, !tbaa !13
  %.not24 = icmp eq ptr %15, null
  br i1 %.not24, label %16, label %24

16:                                               ; preds = %13
  %17 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.19, ptr %17, align 8, !tbaa !5
  %18 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.19, i64 21), i32 noundef 47) #6
  %.not25 = icmp eq ptr %18, null
  %19 = getelementptr inbounds i8, ptr %18, i64 1
  %20 = select i1 %.not25, ptr getelementptr inbounds (i8, ptr @.str.19, i64 21), ptr %19
  %21 = getelementptr inbounds i8, ptr %17, i64 8
  store ptr %20, ptr %21, align 8, !tbaa !10
  %22 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %22, align 4, !tbaa !11
  %23 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %66

24:                                               ; preds = %13
  %.not26 = icmp eq ptr %1, null
  br i1 %.not26, label %25, label %33

25:                                               ; preds = %24
  %26 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.20, ptr %26, align 8, !tbaa !5
  %27 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.20, i64 21), i32 noundef 47) #6
  %.not27 = icmp eq ptr %27, null
  %28 = getelementptr inbounds i8, ptr %27, i64 1
  %29 = select i1 %.not27, ptr getelementptr inbounds (i8, ptr @.str.20, i64 21), ptr %28
  %30 = getelementptr inbounds i8, ptr %26, i64 8
  store ptr %29, ptr %30, align 8, !tbaa !10
  %31 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %31, align 4, !tbaa !11
  %32 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %66

33:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !11
  %34 = call i32 @s2n_array_num_elements(ptr noundef nonnull %15, ptr noundef nonnull %3) #7
  %35 = call zeroext i1 @s2n_result_is_ok(i32 %34)
  br i1 %35, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %33
  %36 = load i32, ptr %3, align 4, !tbaa !11
  %.not3442.not = icmp eq i32 %36, 0
  br i1 %.not3442.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %63
  %.043 = phi i32 [ %64, %63 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store ptr null, ptr %4, align 8, !tbaa !18
  %37 = load ptr, ptr %14, align 8, !tbaa !13
  %38 = call i32 @s2n_array_get(ptr noundef %37, i32 noundef %.043, ptr noundef nonnull %4) #7
  %39 = call zeroext i1 @s2n_result_is_ok(i32 %38)
  br i1 %39, label %40, label %.thread

40:                                               ; preds = %.lr.ph
  %41 = load ptr, ptr %4, align 8, !tbaa !18
  %.not28 = icmp eq ptr %41, null
  br i1 %.not28, label %.thread.sink.split, label %42

42:                                               ; preds = %40
  %43 = getelementptr inbounds i8, ptr %41, i64 24
  %44 = load ptr, ptr %43, align 8, !tbaa !19
  %45 = icmp eq ptr %44, null
  br i1 %45, label %63, label %46

46:                                               ; preds = %42
  %47 = load ptr, ptr %44, align 8, !tbaa !21
  %.not30 = icmp eq ptr %47, null
  br i1 %.not30, label %.thread.sink.split, label %48

48:                                               ; preds = %46
  %49 = call ptr @ossl_check_X509_CRL_sk_type(ptr noundef nonnull %1)
  %50 = load ptr, ptr %4, align 8, !tbaa !18
  %51 = getelementptr inbounds i8, ptr %50, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !19
  %53 = load ptr, ptr %52, align 8, !tbaa !21
  %54 = call ptr @ossl_check_X509_CRL_type(ptr noundef %53)
  %55 = call i32 @OPENSSL_sk_push(ptr noundef %49, ptr noundef %54) #7
  %.not32 = icmp eq i32 %55, 0
  br i1 %.not32, label %.thread.sink.split, label %63

.thread.sink.split:                               ; preds = %48, %46, %40
  %.str.23.sink = phi ptr [ @.str.21, %40 ], [ @.str.22, %46 ], [ @.str.23, %48 ]
  %.sink58 = phi ptr [ getelementptr inbounds (i8, ptr @.str.21, i64 21), %40 ], [ getelementptr inbounds (i8, ptr @.str.22, i64 21), %46 ], [ getelementptr inbounds (i8, ptr @.str.23, i64 21), %48 ]
  %.sink = phi i32 [ 402653193, %40 ], [ 402653193, %46 ], [ 402653268, %48 ]
  %56 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.23.sink, ptr %56, align 8, !tbaa !5
  %57 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink58, i32 noundef 47) #6
  %.not33 = icmp eq ptr %57, null
  %58 = getelementptr inbounds i8, ptr %57, i64 1
  %59 = select i1 %.not33, ptr %.sink58, ptr %58
  %60 = getelementptr inbounds i8, ptr %56, i64 8
  store ptr %59, ptr %60, align 8, !tbaa !10
  %61 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 %.sink, ptr %61, align 4, !tbaa !11
  %62 = call i32 @s2n_calculate_stacktrace() #7
  br label %.thread

.thread:                                          ; preds = %.lr.ph, %.thread.sink.split
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %.loopexit

63:                                               ; preds = %42, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %64 = add nuw i32 %.043, 1
  %65 = load i32, ptr %3, align 4, !tbaa !11
  %.not34 = icmp ult i32 %64, %65
  br i1 %.not34, label %.lr.ph, label %.loopexit, !llvm.loop !23

.loopexit:                                        ; preds = %63, %.thread, %.preheader, %33
  %.sroa.011.3 = phi i32 [ -1, %33 ], [ -1, %.thread ], [ 0, %.preheader ], [ 0, %63 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %66

66:                                               ; preds = %.loopexit, %25, %16, %5
  %.sroa.011.4 = phi i32 [ %.sroa.011.3, %.loopexit ], [ -1, %25 ], [ -1, %16 ], [ -1, %5 ]
  ret i32 %.sroa.011.4
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #5

declare i32 @s2n_array_num_elements(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @s2n_array_get(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare i32 @OPENSSL_sk_push(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_CRL_sk_type(ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_CRL_type(ptr noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { "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 = { 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 #5 = { inlinehint 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 willreturn memory(read) }
attributes #7 = { 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, !7, i64 0}
!6 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!14, !7, i64 40}
!14 = !{!"s2n_x509_validator", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !15, i64 18, !7, i64 24, !12, i64 32, !7, i64 40, !16, i64 48, !17, i64 52}
!15 = !{!"short", !8, i64 0}
!16 = !{!"s2n_cert_validation_info", !12, i64 0, !12, i64 0}
!17 = !{!"_Bool", !8, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !7, i64 24}
!20 = !{!"s2n_crl_lookup", !12, i64 0, !7, i64 8, !15, i64 16, !7, i64 24}
!21 = !{!22, !7, i64 0}
!22 = !{!"s2n_crl", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass