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

; 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_blob = type { ptr, i32, i32, i8 }

@.str = external hidden unnamed_addr constant [86 x i8], align 1
@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [86 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_blob_validate(ptr noundef %0) #0 {
  %2 = alloca %struct.s2n_result, align 4
  %3 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  br label %4

4:                                                ; preds = %1
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = icmp ne ptr %5, null
  br i1 %6, label %39, label %7

7:                                                ; preds = %4
  br label %8

8:                                                ; preds = %7
  br label %9

9:                                                ; preds = %8
  %10 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %11 = getelementptr inbounds %struct.s2n_debug_info, ptr %10, i32 0, i32 0
  store ptr @.str, ptr %11, align 8, !tbaa !9
  %12 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %13 = getelementptr inbounds %struct.s2n_debug_info, ptr %12, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %14, i64 21
  %16 = call ptr @strrchr(ptr noundef %15, i32 noundef 47) #5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %18, label %25

18:                                               ; preds = %9
  %19 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %20 = getelementptr inbounds %struct.s2n_debug_info, ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = getelementptr inbounds i8, ptr %21, i64 21
  %23 = call ptr @strrchr(ptr noundef %22, i32 noundef 47) #5
  %24 = getelementptr inbounds i8, ptr %23, i64 1
  br label %30

25:                                               ; preds = %9
  %26 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %27 = getelementptr inbounds %struct.s2n_debug_info, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %28, i64 21
  br label %30

30:                                               ; preds = %25, %18
  %31 = phi ptr [ %24, %18 ], [ %29, %25 ]
  %32 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %33 = getelementptr inbounds %struct.s2n_debug_info, ptr %32, i32 0, i32 1
  store ptr %31, ptr %33, align 8, !tbaa !11
  %34 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %34, align 4, !tbaa !12
  %35 = call i32 @s2n_calculate_stacktrace()
  br label %36

36:                                               ; preds = %30
  %37 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %37, align 4, !tbaa !14
  br label %429

38:                                               ; No predecessors!
  br label %39

39:                                               ; preds = %38, %4
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.s2n_blob, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !16
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %51

46:                                               ; preds = %41
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.s2n_blob, ptr %47, i32 0, i32 1
  %49 = load i32, ptr %48, align 8, !tbaa !18
  %50 = icmp eq i32 %49, 0
  br label %51

51:                                               ; preds = %46, %41
  %52 = phi i1 [ true, %41 ], [ %50, %46 ]
  %53 = xor i1 %52, true
  %54 = xor i1 %53, true
  %55 = xor i1 %54, true
  %56 = zext i1 %55 to i32
  %57 = sext i32 %56 to i64
  %58 = call i64 @llvm.expect.i64(i64 %57, i64 0)
  %59 = icmp ne i64 %58, 0
  br i1 %59, label %60, label %92

60:                                               ; preds = %51
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %64 = getelementptr inbounds %struct.s2n_debug_info, ptr %63, i32 0, i32 0
  store ptr @.str.1, ptr %64, align 8, !tbaa !9
  %65 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %66 = getelementptr inbounds %struct.s2n_debug_info, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds i8, ptr %67, i64 21
  %69 = call ptr @strrchr(ptr noundef %68, i32 noundef 47) #5
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %78

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

78:                                               ; preds = %62
  %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 0
  %81 = load ptr, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds i8, ptr %81, i64 21
  br label %83

83:                                               ; preds = %78, %71
  %84 = phi ptr [ %77, %71 ], [ %82, %78 ]
  %85 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %86 = getelementptr inbounds %struct.s2n_debug_info, ptr %85, i32 0, i32 1
  store ptr %84, ptr %86, align 8, !tbaa !11
  %87 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %87, align 4, !tbaa !12
  %88 = call i32 @s2n_calculate_stacktrace()
  br label %89

89:                                               ; preds = %83
  %90 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %90, align 4, !tbaa !14
  br label %429

91:                                               ; No predecessors!
  br label %92

92:                                               ; preds = %91, %51
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.s2n_blob, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !16
  %98 = icmp eq ptr %97, null
  br i1 %98, label %99, label %104

99:                                               ; preds = %94
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.s2n_blob, ptr %100, i32 0, i32 2
  %102 = load i32, ptr %101, align 4, !tbaa !19
  %103 = icmp eq i32 %102, 0
  br label %104

104:                                              ; preds = %99, %94
  %105 = phi i1 [ true, %94 ], [ %103, %99 ]
  %106 = xor i1 %105, true
  %107 = xor i1 %106, true
  %108 = xor i1 %107, true
  %109 = zext i1 %108 to i32
  %110 = sext i32 %109 to i64
  %111 = call i64 @llvm.expect.i64(i64 %110, i64 0)
  %112 = icmp ne i64 %111, 0
  br i1 %112, label %113, label %145

113:                                              ; preds = %104
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114
  %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 0
  store ptr @.str.2, ptr %117, align 8, !tbaa !9
  %118 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %119 = getelementptr inbounds %struct.s2n_debug_info, ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !9
  %121 = getelementptr inbounds i8, ptr %120, i64 21
  %122 = call ptr @strrchr(ptr noundef %121, i32 noundef 47) #5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %131

124:                                              ; preds = %115
  %125 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %126 = getelementptr inbounds %struct.s2n_debug_info, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = getelementptr inbounds i8, ptr %127, i64 21
  %129 = call ptr @strrchr(ptr noundef %128, i32 noundef 47) #5
  %130 = getelementptr inbounds i8, ptr %129, i64 1
  br label %136

131:                                              ; preds = %115
  %132 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %133 = getelementptr inbounds %struct.s2n_debug_info, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !9
  %135 = getelementptr inbounds i8, ptr %134, i64 21
  br label %136

136:                                              ; preds = %131, %124
  %137 = phi ptr [ %130, %124 ], [ %135, %131 ]
  %138 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %139 = getelementptr inbounds %struct.s2n_debug_info, ptr %138, i32 0, i32 1
  store ptr %137, ptr %139, align 8, !tbaa !11
  %140 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %140, align 4, !tbaa !12
  %141 = call i32 @s2n_calculate_stacktrace()
  br label %142

142:                                              ; preds = %136
  %143 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %143, align 4, !tbaa !14
  br label %429

144:                                              ; No predecessors!
  br label %145

145:                                              ; preds = %144, %104
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.s2n_blob, ptr %148, i32 0, i32 3
  %150 = load i8, ptr %149, align 8
  %151 = and i8 %150, 1
  %152 = zext i8 %151 to i32
  %153 = icmp eq i32 %152, 0
  br i1 %153, label %154, label %159

154:                                              ; preds = %147
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.s2n_blob, ptr %155, i32 0, i32 2
  %157 = load i32, ptr %156, align 4, !tbaa !19
  %158 = icmp eq i32 %157, 0
  br label %159

159:                                              ; preds = %154, %147
  %160 = phi i1 [ true, %147 ], [ %158, %154 ]
  %161 = xor i1 %160, true
  %162 = xor i1 %161, true
  %163 = xor i1 %162, true
  %164 = zext i1 %163 to i32
  %165 = sext i32 %164 to i64
  %166 = call i64 @llvm.expect.i64(i64 %165, i64 0)
  %167 = icmp ne i64 %166, 0
  br i1 %167, label %168, label %200

168:                                              ; preds = %159
  br label %169

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169
  %171 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %172 = getelementptr inbounds %struct.s2n_debug_info, ptr %171, i32 0, i32 0
  store ptr @.str.3, ptr %172, align 8, !tbaa !9
  %173 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %174 = getelementptr inbounds %struct.s2n_debug_info, ptr %173, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !9
  %176 = getelementptr inbounds i8, ptr %175, i64 21
  %177 = call ptr @strrchr(ptr noundef %176, i32 noundef 47) #5
  %178 = icmp ne ptr %177, null
  br i1 %178, label %179, label %186

179:                                              ; preds = %170
  %180 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %181 = getelementptr inbounds %struct.s2n_debug_info, ptr %180, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !9
  %183 = getelementptr inbounds i8, ptr %182, i64 21
  %184 = call ptr @strrchr(ptr noundef %183, i32 noundef 47) #5
  %185 = getelementptr inbounds i8, ptr %184, i64 1
  br label %191

186:                                              ; preds = %170
  %187 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %188 = getelementptr inbounds %struct.s2n_debug_info, ptr %187, i32 0, i32 0
  %189 = load ptr, ptr %188, align 8, !tbaa !9
  %190 = getelementptr inbounds i8, ptr %189, i64 21
  br label %191

191:                                              ; preds = %186, %179
  %192 = phi ptr [ %185, %179 ], [ %190, %186 ]
  %193 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %194 = getelementptr inbounds %struct.s2n_debug_info, ptr %193, i32 0, i32 1
  store ptr %192, ptr %194, align 8, !tbaa !11
  %195 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %195, align 4, !tbaa !12
  %196 = call i32 @s2n_calculate_stacktrace()
  br label %197

197:                                              ; preds = %191
  %198 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %198, align 4, !tbaa !14
  br label %429

199:                                              ; No predecessors!
  br label %200

200:                                              ; preds = %199, %159
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr %3, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.s2n_blob, ptr %203, i32 0, i32 3
  %205 = load i8, ptr %204, align 8
  %206 = and i8 %205, 1
  %207 = zext i8 %206 to i32
  %208 = icmp eq i32 %207, 1
  br i1 %208, label %209, label %221

209:                                              ; preds = %202
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.s2n_blob, ptr %210, i32 0, i32 2
  %212 = load i32, ptr %211, align 4, !tbaa !19
  %213 = icmp ugt i32 %212, 0
  br i1 %213, label %219, label %214

214:                                              ; preds = %209
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.s2n_blob, ptr %215, i32 0, i32 1
  %217 = load i32, ptr %216, align 8, !tbaa !18
  %218 = icmp eq i32 %217, 0
  br label %219

219:                                              ; preds = %214, %209
  %220 = phi i1 [ true, %209 ], [ %218, %214 ]
  br label %221

221:                                              ; preds = %219, %202
  %222 = phi i1 [ true, %202 ], [ %220, %219 ]
  %223 = xor i1 %222, true
  %224 = xor i1 %223, true
  %225 = xor i1 %224, true
  %226 = zext i1 %225 to i32
  %227 = sext i32 %226 to i64
  %228 = call i64 @llvm.expect.i64(i64 %227, i64 0)
  %229 = icmp ne i64 %228, 0
  br i1 %229, label %230, label %262

230:                                              ; preds = %221
  br label %231

231:                                              ; preds = %230
  br label %232

232:                                              ; preds = %231
  %233 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %234 = getelementptr inbounds %struct.s2n_debug_info, ptr %233, i32 0, i32 0
  store ptr @.str.4, ptr %234, align 8, !tbaa !9
  %235 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %236 = getelementptr inbounds %struct.s2n_debug_info, ptr %235, i32 0, i32 0
  %237 = load ptr, ptr %236, align 8, !tbaa !9
  %238 = getelementptr inbounds i8, ptr %237, i64 21
  %239 = call ptr @strrchr(ptr noundef %238, i32 noundef 47) #5
  %240 = icmp ne ptr %239, null
  br i1 %240, label %241, label %248

241:                                              ; preds = %232
  %242 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %243 = getelementptr inbounds %struct.s2n_debug_info, ptr %242, i32 0, i32 0
  %244 = load ptr, ptr %243, align 8, !tbaa !9
  %245 = getelementptr inbounds i8, ptr %244, i64 21
  %246 = call ptr @strrchr(ptr noundef %245, i32 noundef 47) #5
  %247 = getelementptr inbounds i8, ptr %246, i64 1
  br label %253

248:                                              ; preds = %232
  %249 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %250 = getelementptr inbounds %struct.s2n_debug_info, ptr %249, i32 0, i32 0
  %251 = load ptr, ptr %250, align 8, !tbaa !9
  %252 = getelementptr inbounds i8, ptr %251, i64 21
  br label %253

253:                                              ; preds = %248, %241
  %254 = phi ptr [ %247, %241 ], [ %252, %248 ]
  %255 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %256 = getelementptr inbounds %struct.s2n_debug_info, ptr %255, i32 0, i32 1
  store ptr %254, ptr %256, align 8, !tbaa !11
  %257 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %257, align 4, !tbaa !12
  %258 = call i32 @s2n_calculate_stacktrace()
  br label %259

259:                                              ; preds = %253
  %260 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %260, align 4, !tbaa !14
  br label %429

261:                                              ; No predecessors!
  br label %262

262:                                              ; preds = %261, %221
  br label %263

263:                                              ; preds = %262
  br label %264

264:                                              ; preds = %263
  %265 = load ptr, ptr %3, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.s2n_blob, ptr %265, i32 0, i32 3
  %267 = load i8, ptr %266, align 8
  %268 = and i8 %267, 1
  %269 = zext i8 %268 to i32
  %270 = icmp ne i32 %269, 0
  br i1 %270, label %271, label %279

271:                                              ; preds = %264
  %272 = load ptr, ptr %3, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.s2n_blob, ptr %272, i32 0, i32 1
  %274 = load i32, ptr %273, align 8, !tbaa !18
  %275 = load ptr, ptr %3, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.s2n_blob, ptr %275, i32 0, i32 2
  %277 = load i32, ptr %276, align 4, !tbaa !19
  %278 = icmp ule i32 %274, %277
  br label %279

279:                                              ; preds = %271, %264
  %280 = phi i1 [ true, %264 ], [ %278, %271 ]
  %281 = xor i1 %280, true
  %282 = xor i1 %281, true
  %283 = xor i1 %282, true
  %284 = zext i1 %283 to i32
  %285 = sext i32 %284 to i64
  %286 = call i64 @llvm.expect.i64(i64 %285, i64 0)
  %287 = icmp ne i64 %286, 0
  br i1 %287, label %288, label %320

288:                                              ; preds = %279
  br label %289

289:                                              ; preds = %288
  br label %290

290:                                              ; preds = %289
  %291 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %292 = getelementptr inbounds %struct.s2n_debug_info, ptr %291, i32 0, i32 0
  store ptr @.str.5, ptr %292, align 8, !tbaa !9
  %293 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %294 = getelementptr inbounds %struct.s2n_debug_info, ptr %293, i32 0, i32 0
  %295 = load ptr, ptr %294, align 8, !tbaa !9
  %296 = getelementptr inbounds i8, ptr %295, i64 21
  %297 = call ptr @strrchr(ptr noundef %296, i32 noundef 47) #5
  %298 = icmp ne ptr %297, null
  br i1 %298, label %299, label %306

299:                                              ; preds = %290
  %300 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %301 = getelementptr inbounds %struct.s2n_debug_info, ptr %300, i32 0, i32 0
  %302 = load ptr, ptr %301, align 8, !tbaa !9
  %303 = getelementptr inbounds i8, ptr %302, i64 21
  %304 = call ptr @strrchr(ptr noundef %303, i32 noundef 47) #5
  %305 = getelementptr inbounds i8, ptr %304, i64 1
  br label %311

306:                                              ; preds = %290
  %307 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %308 = getelementptr inbounds %struct.s2n_debug_info, ptr %307, i32 0, i32 0
  %309 = load ptr, ptr %308, align 8, !tbaa !9
  %310 = getelementptr inbounds i8, ptr %309, i64 21
  br label %311

311:                                              ; preds = %306, %299
  %312 = phi ptr [ %305, %299 ], [ %310, %306 ]
  %313 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %314 = getelementptr inbounds %struct.s2n_debug_info, ptr %313, i32 0, i32 1
  store ptr %312, ptr %314, align 8, !tbaa !11
  %315 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %315, align 4, !tbaa !12
  %316 = call i32 @s2n_calculate_stacktrace()
  br label %317

317:                                              ; preds = %311
  %318 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %318, align 4, !tbaa !14
  br label %429

319:                                              ; No predecessors!
  br label %320

320:                                              ; preds = %319, %279
  br label %321

321:                                              ; preds = %320
  br label %322

322:                                              ; preds = %321
  %323 = load ptr, ptr %3, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.s2n_blob, ptr %323, i32 0, i32 2
  %325 = load i32, ptr %324, align 4, !tbaa !19
  %326 = icmp eq i32 %325, 0
  br i1 %326, label %332, label %327

327:                                              ; preds = %322
  %328 = load ptr, ptr %3, align 8, !tbaa !5
  %329 = getelementptr inbounds %struct.s2n_blob, ptr %328, i32 0, i32 0
  %330 = load ptr, ptr %329, align 8, !tbaa !16
  %331 = icmp ne ptr %330, null
  br label %332

332:                                              ; preds = %327, %322
  %333 = phi i1 [ true, %322 ], [ %331, %327 ]
  %334 = xor i1 %333, true
  %335 = xor i1 %334, true
  %336 = xor i1 %335, true
  %337 = zext i1 %336 to i32
  %338 = sext i32 %337 to i64
  %339 = call i64 @llvm.expect.i64(i64 %338, i64 0)
  %340 = icmp ne i64 %339, 0
  br i1 %340, label %341, label %373

341:                                              ; preds = %332
  br label %342

342:                                              ; preds = %341
  br label %343

343:                                              ; preds = %342
  %344 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %345 = getelementptr inbounds %struct.s2n_debug_info, ptr %344, i32 0, i32 0
  store ptr @.str.6, ptr %345, align 8, !tbaa !9
  %346 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %347 = getelementptr inbounds %struct.s2n_debug_info, ptr %346, i32 0, i32 0
  %348 = load ptr, ptr %347, align 8, !tbaa !9
  %349 = getelementptr inbounds i8, ptr %348, i64 21
  %350 = call ptr @strrchr(ptr noundef %349, i32 noundef 47) #5
  %351 = icmp ne ptr %350, null
  br i1 %351, label %352, label %359

352:                                              ; preds = %343
  %353 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %354 = getelementptr inbounds %struct.s2n_debug_info, ptr %353, i32 0, i32 0
  %355 = load ptr, ptr %354, align 8, !tbaa !9
  %356 = getelementptr inbounds i8, ptr %355, i64 21
  %357 = call ptr @strrchr(ptr noundef %356, i32 noundef 47) #5
  %358 = getelementptr inbounds i8, ptr %357, i64 1
  br label %364

359:                                              ; preds = %343
  %360 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %361 = getelementptr inbounds %struct.s2n_debug_info, ptr %360, i32 0, i32 0
  %362 = load ptr, ptr %361, align 8, !tbaa !9
  %363 = getelementptr inbounds i8, ptr %362, i64 21
  br label %364

364:                                              ; preds = %359, %352
  %365 = phi ptr [ %358, %352 ], [ %363, %359 ]
  %366 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %367 = getelementptr inbounds %struct.s2n_debug_info, ptr %366, i32 0, i32 1
  store ptr %365, ptr %367, align 8, !tbaa !11
  %368 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %368, align 4, !tbaa !12
  %369 = call i32 @s2n_calculate_stacktrace()
  br label %370

370:                                              ; preds = %364
  %371 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %371, align 4, !tbaa !14
  br label %429

372:                                              ; No predecessors!
  br label %373

373:                                              ; preds = %372, %332
  br label %374

374:                                              ; preds = %373
  br label %375

375:                                              ; preds = %374
  %376 = load ptr, ptr %3, align 8, !tbaa !5
  %377 = getelementptr inbounds %struct.s2n_blob, ptr %376, i32 0, i32 1
  %378 = load i32, ptr %377, align 8, !tbaa !18
  %379 = icmp eq i32 %378, 0
  br i1 %379, label %385, label %380

380:                                              ; preds = %375
  %381 = load ptr, ptr %3, align 8, !tbaa !5
  %382 = getelementptr inbounds %struct.s2n_blob, ptr %381, i32 0, i32 0
  %383 = load ptr, ptr %382, align 8, !tbaa !16
  %384 = icmp ne ptr %383, null
  br label %385

385:                                              ; preds = %380, %375
  %386 = phi i1 [ true, %375 ], [ %384, %380 ]
  %387 = xor i1 %386, true
  %388 = xor i1 %387, true
  %389 = xor i1 %388, true
  %390 = zext i1 %389 to i32
  %391 = sext i32 %390 to i64
  %392 = call i64 @llvm.expect.i64(i64 %391, i64 0)
  %393 = icmp ne i64 %392, 0
  br i1 %393, label %394, label %426

394:                                              ; preds = %385
  br label %395

395:                                              ; preds = %394
  br label %396

396:                                              ; preds = %395
  %397 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %398 = getelementptr inbounds %struct.s2n_debug_info, ptr %397, i32 0, i32 0
  store ptr @.str.7, ptr %398, align 8, !tbaa !9
  %399 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %400 = getelementptr inbounds %struct.s2n_debug_info, ptr %399, i32 0, i32 0
  %401 = load ptr, ptr %400, align 8, !tbaa !9
  %402 = getelementptr inbounds i8, ptr %401, i64 21
  %403 = call ptr @strrchr(ptr noundef %402, i32 noundef 47) #5
  %404 = icmp ne ptr %403, null
  br i1 %404, label %405, label %412

405:                                              ; preds = %396
  %406 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %407 = getelementptr inbounds %struct.s2n_debug_info, ptr %406, i32 0, i32 0
  %408 = load ptr, ptr %407, align 8, !tbaa !9
  %409 = getelementptr inbounds i8, ptr %408, i64 21
  %410 = call ptr @strrchr(ptr noundef %409, i32 noundef 47) #5
  %411 = getelementptr inbounds i8, ptr %410, i64 1
  br label %417

412:                                              ; preds = %396
  %413 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %414 = getelementptr inbounds %struct.s2n_debug_info, ptr %413, i32 0, i32 0
  %415 = load ptr, ptr %414, align 8, !tbaa !9
  %416 = getelementptr inbounds i8, ptr %415, i64 21
  br label %417

417:                                              ; preds = %412, %405
  %418 = phi ptr [ %411, %405 ], [ %416, %412 ]
  %419 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %420 = getelementptr inbounds %struct.s2n_debug_info, ptr %419, i32 0, i32 1
  store ptr %418, ptr %420, align 8, !tbaa !11
  %421 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %421, align 4, !tbaa !12
  %422 = call i32 @s2n_calculate_stacktrace()
  br label %423

423:                                              ; preds = %417
  %424 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %424, align 4, !tbaa !14
  br label %429

425:                                              ; No predecessors!
  br label %426

426:                                              ; preds = %425, %385
  br label %427

427:                                              ; preds = %426
  %428 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 0, ptr %428, align 4, !tbaa !14
  br label %429

429:                                              ; preds = %427, %423, %370, %317, %259, %197, %142, %89, %36
  %430 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  %431 = load i32, ptr %430, align 4
  ret i32 %431
}

; 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: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #4

attributes #0 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #5 = { nounwind willreturn memory(read) }

!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 0}
!17 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!18 = !{!17, !13, i64 8}
!19 = !{!17, !13, i64 12}


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

@.str = external hidden unnamed_addr constant [86 x i8], align 1
@_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.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [86 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_blob_validate(ptr noundef readonly %0) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %.critedge47.sink.split, label %2

2:                                                ; preds = %1
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = icmp ne ptr %3, null
  br i1 %4, label %.critedge37, label %5

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load i32, ptr %6, align 8, !tbaa !11
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %9, label %.critedge47.sink.split, !prof !12

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 12
  %11 = load i32, ptr %10, align 4, !tbaa !13
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %.critedge37, label %.critedge47.sink.split, !prof !12

.critedge37:                                      ; preds = %2, %9
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = load i8, ptr %13, align 8
  %15 = and i8 %14, 1
  %16 = icmp eq i8 %15, 0
  %17 = getelementptr inbounds i8, ptr %0, i64 12
  %18 = load i32, ptr %17, align 4, !tbaa !13
  %19 = icmp eq i32 %18, 0
  br i1 %16, label %20, label %.critedge39

20:                                               ; preds = %.critedge37
  br i1 %19, label %.critedge45, label %.critedge47.sink.split, !prof !12

.critedge39:                                      ; preds = %.critedge37
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = load i32, ptr %21, align 8, !tbaa !11
  br i1 %19, label %23, label %24

23:                                               ; preds = %.critedge39
  %.not49 = icmp eq i32 %22, 0
  br i1 %.not49, label %.critedge45, label %.critedge47.sink.split, !prof !12

24:                                               ; preds = %.critedge39
  %25 = icmp ule i32 %22, %18
  %brmerge61.not = and i1 %25, %4
  %.str.5.mux = select i1 %25, ptr @.str.6, ptr @.str.5, !prof !14
  %.mux = select i1 %25, ptr getelementptr inbounds (i8, ptr @.str.6, i64 21), ptr getelementptr inbounds (i8, ptr @.str.5, i64 21), !prof !14
  br i1 %brmerge61.not, label %.critedge47, label %.critedge47.sink.split, !prof !15

.critedge45:                                      ; preds = %23, %20
  %26 = getelementptr inbounds i8, ptr %0, i64 8
  %27 = load i32, ptr %26, align 8, !tbaa !11
  %28 = icmp eq i32 %27, 0
  %brmerge = or i1 %4, %28
  br i1 %brmerge, label %.critedge47, label %.critedge47.sink.split, !prof !16

.critedge47.sink.split:                           ; preds = %24, %.critedge45, %23, %20, %9, %5, %1
  %.str.7.sink = phi ptr [ @.str, %1 ], [ @.str.1, %5 ], [ @.str.2, %9 ], [ @.str.3, %20 ], [ @.str.4, %23 ], [ %.str.5.mux, %24 ], [ @.str.7, %.critedge45 ]
  %.sink58 = phi ptr [ getelementptr inbounds (i8, ptr @.str, i64 21), %1 ], [ getelementptr inbounds (i8, ptr @.str.1, i64 21), %5 ], [ getelementptr inbounds (i8, ptr @.str.2, i64 21), %9 ], [ getelementptr inbounds (i8, ptr @.str.3, i64 21), %20 ], [ getelementptr inbounds (i8, ptr @.str.4, i64 21), %23 ], [ %.mux, %24 ], [ getelementptr inbounds (i8, ptr @.str.7, i64 21), %.critedge45 ]
  %.sink = phi i32 [ 402653193, %1 ], [ 402653194, %5 ], [ 402653194, %9 ], [ 402653194, %20 ], [ 402653194, %23 ], [ 402653194, %24 ], [ 402653194, %.critedge45 ]
  %29 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.7.sink, ptr %29, align 8, !tbaa !17
  %30 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink58, i32 noundef 47) #4
  %.not29 = icmp eq ptr %30, null
  %31 = getelementptr inbounds i8, ptr %30, i64 1
  %32 = select i1 %.not29, ptr %.sink58, ptr %31
  %33 = getelementptr inbounds i8, ptr %29, i64 8
  store ptr %32, ptr %33, align 8, !tbaa !19
  %34 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 %.sink, ptr %34, align 4, !tbaa !20
  %35 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %.critedge47

.critedge47:                                      ; preds = %24, %.critedge47.sink.split, %.critedge45
  %.sroa.0.0 = phi i32 [ 0, %.critedge45 ], [ -1, %.critedge47.sink.split ], [ 0, %24 ]
  ret i32 %.sroa.0.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

attributes #0 = { 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 #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 willreturn memory(read) }
attributes #5 = { 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_blob", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!13 = !{!6, !10, i64 12}
!14 = !{!"branch_weights", i32 2145766843, i32 -859640491}
!15 = !{!"branch_weights", i32 -104016431, i32 5450286}
!16 = !{!"branch_weights", i32 -2860985, i32 2860985}
!17 = !{!18, !7, i64 0}
!18 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!19 = !{!18, !7, i64 8}
!20 = !{!10, !10, i64 0}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LowerExpectIntrinsicPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass