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

; 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_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }

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

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

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

8:                                                ; preds = %5
  br label %9

9:                                                ; preds = %8
  br label %10

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

19:                                               ; preds = %10
  %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 = getelementptr inbounds i8, ptr %24, i64 1
  br label %31

26:                                               ; preds = %10
  %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
  br label %31

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

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

39:                                               ; No predecessors!
  br label %40

40:                                               ; preds = %39, %5
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.s2n_stuffer, ptr %43, i32 0, i32 0
  %45 = call i32 @s2n_blob_validate(ptr noundef %44)
  %46 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 %45, ptr %46, align 4
  %47 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  %48 = load i32, ptr %47, align 4
  %49 = call zeroext i1 @s2n_result_is_ok(i32 %48)
  br i1 %49, label %52, label %50

50:                                               ; preds = %42
  %51 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %51, align 4, !tbaa !14
  br label %261

52:                                               ; preds = %42
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.s2n_stuffer, ptr %55, i32 0, i32 4
  %57 = load i8, ptr %56, align 4
  %58 = lshr i8 %57, 1
  %59 = and i8 %58, 1
  %60 = zext i8 %59 to i32
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %69

62:                                               ; preds = %54
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.s2n_stuffer, ptr %63, i32 0, i32 4
  %65 = load i8, ptr %64, align 4
  %66 = and i8 %65, 1
  %67 = zext i8 %66 to i32
  %68 = icmp ne i32 %67, 0
  br label %69

69:                                               ; preds = %62, %54
  %70 = phi i1 [ true, %54 ], [ %68, %62 ]
  %71 = xor i1 %70, true
  %72 = xor i1 %71, true
  %73 = xor i1 %72, true
  %74 = zext i1 %73 to i32
  %75 = sext i32 %74 to i64
  %76 = call i64 @llvm.expect.i64(i64 %75, i64 0)
  %77 = icmp ne i64 %76, 0
  br i1 %77, label %78, label %110

78:                                               ; preds = %69
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79
  %81 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %82 = getelementptr inbounds %struct.s2n_debug_info, ptr %81, i32 0, i32 0
  store ptr @.str.1, ptr %82, align 8, !tbaa !9
  %83 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %84 = getelementptr inbounds %struct.s2n_debug_info, ptr %83, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !9
  %86 = getelementptr inbounds i8, ptr %85, i64 21
  %87 = call ptr @strrchr(ptr noundef %86, i32 noundef 47) #6
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %96

89:                                               ; preds = %80
  %90 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %91 = getelementptr inbounds %struct.s2n_debug_info, ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = getelementptr inbounds i8, ptr %92, i64 21
  %94 = call ptr @strrchr(ptr noundef %93, i32 noundef 47) #6
  %95 = getelementptr inbounds i8, ptr %94, i64 1
  br label %101

96:                                               ; preds = %80
  %97 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %98 = getelementptr inbounds %struct.s2n_debug_info, ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  %100 = getelementptr inbounds i8, ptr %99, i64 21
  br label %101

101:                                              ; preds = %96, %89
  %102 = phi ptr [ %95, %89 ], [ %100, %96 ]
  %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 1
  store ptr %102, ptr %104, align 8, !tbaa !11
  %105 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %105, align 4, !tbaa !12
  %106 = call i32 @s2n_calculate_stacktrace()
  br label %107

107:                                              ; preds = %101
  %108 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %108, align 4, !tbaa !14
  br label %261

109:                                              ; No predecessors!
  br label %110

110:                                              ; preds = %109, %69
  br label %111

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.s2n_stuffer, ptr %113, i32 0, i32 3
  %115 = load i32, ptr %114, align 8, !tbaa !16
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.s2n_stuffer, ptr %116, i32 0, i32 0
  %118 = getelementptr inbounds %struct.s2n_blob, ptr %117, i32 0, i32 1
  %119 = load i32, ptr %118, align 8, !tbaa !19
  %120 = icmp ule i32 %115, %119
  %121 = xor i1 %120, true
  %122 = xor i1 %121, true
  %123 = xor i1 %122, true
  %124 = zext i1 %123 to i32
  %125 = sext i32 %124 to i64
  %126 = call i64 @llvm.expect.i64(i64 %125, i64 0)
  %127 = icmp ne i64 %126, 0
  br i1 %127, label %128, label %160

128:                                              ; preds = %112
  br label %129

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129
  %131 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %132 = getelementptr inbounds %struct.s2n_debug_info, ptr %131, i32 0, i32 0
  store ptr @.str.2, ptr %132, align 8, !tbaa !9
  %133 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %134 = getelementptr inbounds %struct.s2n_debug_info, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !9
  %136 = getelementptr inbounds i8, ptr %135, i64 21
  %137 = call ptr @strrchr(ptr noundef %136, i32 noundef 47) #6
  %138 = icmp ne ptr %137, null
  br i1 %138, label %139, label %146

139:                                              ; preds = %130
  %140 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %141 = getelementptr inbounds %struct.s2n_debug_info, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !9
  %143 = getelementptr inbounds i8, ptr %142, i64 21
  %144 = call ptr @strrchr(ptr noundef %143, i32 noundef 47) #6
  %145 = getelementptr inbounds i8, ptr %144, i64 1
  br label %151

146:                                              ; preds = %130
  %147 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %148 = getelementptr inbounds %struct.s2n_debug_info, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !9
  %150 = getelementptr inbounds i8, ptr %149, i64 21
  br label %151

151:                                              ; preds = %146, %139
  %152 = phi ptr [ %145, %139 ], [ %150, %146 ]
  %153 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %154 = getelementptr inbounds %struct.s2n_debug_info, ptr %153, i32 0, i32 1
  store ptr %152, ptr %154, align 8, !tbaa !11
  %155 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %155, align 4, !tbaa !12
  %156 = call i32 @s2n_calculate_stacktrace()
  br label %157

157:                                              ; preds = %151
  %158 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %158, align 4, !tbaa !14
  br label %261

159:                                              ; No predecessors!
  br label %160

160:                                              ; preds = %159, %112
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.s2n_stuffer, ptr %163, i32 0, i32 2
  %165 = load i32, ptr %164, align 4, !tbaa !20
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.s2n_stuffer, ptr %166, i32 0, i32 3
  %168 = load i32, ptr %167, align 8, !tbaa !16
  %169 = icmp ule i32 %165, %168
  %170 = xor i1 %169, true
  %171 = xor i1 %170, true
  %172 = xor i1 %171, true
  %173 = zext i1 %172 to i32
  %174 = sext i32 %173 to i64
  %175 = call i64 @llvm.expect.i64(i64 %174, i64 0)
  %176 = icmp ne i64 %175, 0
  br i1 %176, label %177, label %209

177:                                              ; preds = %162
  br label %178

178:                                              ; preds = %177
  br label %179

179:                                              ; preds = %178
  %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
  store ptr @.str.3, ptr %181, align 8, !tbaa !9
  %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
  %186 = call ptr @strrchr(ptr noundef %185, i32 noundef 47) #6
  %187 = icmp ne ptr %186, null
  br i1 %187, label %188, label %195

188:                                              ; preds = %179
  %189 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %190 = getelementptr inbounds %struct.s2n_debug_info, ptr %189, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8, !tbaa !9
  %192 = getelementptr inbounds i8, ptr %191, i64 21
  %193 = call ptr @strrchr(ptr noundef %192, i32 noundef 47) #6
  %194 = getelementptr inbounds i8, ptr %193, i64 1
  br label %200

195:                                              ; preds = %179
  %196 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %197 = getelementptr inbounds %struct.s2n_debug_info, ptr %196, i32 0, i32 0
  %198 = load ptr, ptr %197, align 8, !tbaa !9
  %199 = getelementptr inbounds i8, ptr %198, i64 21
  br label %200

200:                                              ; preds = %195, %188
  %201 = phi ptr [ %194, %188 ], [ %199, %195 ]
  %202 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %203 = getelementptr inbounds %struct.s2n_debug_info, ptr %202, i32 0, i32 1
  store ptr %201, ptr %203, align 8, !tbaa !11
  %204 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %204, align 4, !tbaa !12
  %205 = call i32 @s2n_calculate_stacktrace()
  br label %206

206:                                              ; preds = %200
  %207 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %207, align 4, !tbaa !14
  br label %261

208:                                              ; No predecessors!
  br label %209

209:                                              ; preds = %208, %162
  br label %210

210:                                              ; preds = %209
  br label %211

211:                                              ; preds = %210
  %212 = load ptr, ptr %3, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.s2n_stuffer, ptr %212, i32 0, i32 1
  %214 = load i32, ptr %213, align 8, !tbaa !21
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.s2n_stuffer, ptr %215, i32 0, i32 2
  %217 = load i32, ptr %216, align 4, !tbaa !20
  %218 = icmp ule i32 %214, %217
  %219 = xor i1 %218, true
  %220 = xor i1 %219, true
  %221 = xor i1 %220, true
  %222 = zext i1 %221 to i32
  %223 = sext i32 %222 to i64
  %224 = call i64 @llvm.expect.i64(i64 %223, i64 0)
  %225 = icmp ne i64 %224, 0
  br i1 %225, label %226, label %258

226:                                              ; preds = %211
  br label %227

227:                                              ; preds = %226
  br label %228

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

237:                                              ; preds = %228
  %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 0
  %240 = load ptr, ptr %239, align 8, !tbaa !9
  %241 = getelementptr inbounds i8, ptr %240, i64 21
  %242 = call ptr @strrchr(ptr noundef %241, i32 noundef 47) #6
  %243 = getelementptr inbounds i8, ptr %242, i64 1
  br label %249

244:                                              ; preds = %228
  %245 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %246 = getelementptr inbounds %struct.s2n_debug_info, ptr %245, i32 0, i32 0
  %247 = load ptr, ptr %246, align 8, !tbaa !9
  %248 = getelementptr inbounds i8, ptr %247, i64 21
  br label %249

249:                                              ; preds = %244, %237
  %250 = phi ptr [ %243, %237 ], [ %248, %244 ]
  %251 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %252 = getelementptr inbounds %struct.s2n_debug_info, ptr %251, i32 0, i32 1
  store ptr %250, ptr %252, align 8, !tbaa !11
  %253 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %253, align 4, !tbaa !12
  %254 = call i32 @s2n_calculate_stacktrace()
  br label %255

255:                                              ; preds = %249
  %256 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  store i32 -1, ptr %256, align 4, !tbaa !14
  br label %261

257:                                              ; No predecessors!
  br label %258

258:                                              ; preds = %257, %211
  br label %259

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

261:                                              ; preds = %259, %255, %206, %157, %107, %50, %37
  %262 = getelementptr inbounds %struct.s2n_result, ptr %2, i32 0, i32 0
  %263 = load i32, ptr %262, align 4
  ret i32 %263
}

; 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: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #4

declare i32 @s2n_blob_validate(ptr noundef) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #5

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 = { 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 #5 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #6 = { 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, !13, i64 32}
!17 = !{!"s2n_stuffer", !18, i64 0, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 36, !13, i64 36}
!18 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!19 = !{!17, !13, i64 8}
!20 = !{!17, !13, i64 28}
!21 = !{!17, !13, i64 24}


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

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

2:                                                ; preds = %1
  %3 = tail call i32 @s2n_blob_validate(ptr noundef nonnull %0) #5
  %4 = tail call zeroext i1 @s2n_result_is_ok(i32 %3)
  br i1 %4, label %5, label %28

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 36
  %7 = load i8, ptr %6, align 4
  %8 = and i8 %7, 3
  %9 = icmp eq i8 %8, 2
  br i1 %9, label %.sink.split, label %10, !prof !5

10:                                               ; preds = %5
  %11 = getelementptr inbounds i8, ptr %0, i64 32
  %12 = load i32, ptr %11, align 8, !tbaa !6
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load i32, ptr %13, align 8, !tbaa !13
  %.not18 = icmp ugt i32 %12, %14
  br i1 %.not18, label %.sink.split, label %15, !prof !5

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %0, i64 28
  %17 = load i32, ptr %16, align 4, !tbaa !14
  %.not19 = icmp ugt i32 %17, %12
  br i1 %.not19, label %.sink.split, label %18, !prof !5

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = load i32, ptr %19, align 8, !tbaa !15
  %.not20 = icmp ugt i32 %20, %17
  br i1 %.not20, label %.sink.split, label %28, !prof !5

.sink.split:                                      ; preds = %18, %15, %10, %5, %1
  %.str.4.sink = phi ptr [ @.str, %1 ], [ @.str.1, %5 ], [ @.str.2, %10 ], [ @.str.3, %15 ], [ @.str.4, %18 ]
  %.sink33 = 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), %10 ], [ getelementptr inbounds (i8, ptr @.str.3, i64 21), %15 ], [ getelementptr inbounds (i8, ptr @.str.4, i64 21), %18 ]
  %.sink = phi i32 [ 402653193, %1 ], [ 402653194, %5 ], [ 402653194, %10 ], [ 402653194, %15 ], [ 402653194, %18 ]
  %21 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.4.sink, ptr %21, align 8, !tbaa !16
  %22 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink33, i32 noundef 47) #6
  %.not21 = icmp eq ptr %22, null
  %23 = getelementptr inbounds i8, ptr %22, i64 1
  %24 = select i1 %.not21, ptr %.sink33, ptr %23
  %25 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %24, ptr %25, align 8, !tbaa !18
  %26 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 %.sink, ptr %26, align 4, !tbaa !19
  %27 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %28

28:                                               ; preds = %.sink.split, %18, %2
  %.sroa.010.0 = phi i32 [ -1, %2 ], [ 0, %18 ], [ -1, %.sink.split ]
  ret i32 %.sroa.010.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: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #4

declare i32 @s2n_blob_validate(ptr noundef) 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 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!6 = !{!7, !12, i64 32}
!7 = !{!"s2n_stuffer", !8, i64 0, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 36, !12, i64 36}
!8 = !{!"s2n_blob", !9, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!"int", !10, i64 0}
!13 = !{!7, !12, i64 8}
!14 = !{!7, !12, i64 28}
!15 = !{!7, !12, i64 24}
!16 = !{!17, !9, i64 0}
!17 = !{!"s2n_debug_info", !9, i64 0, !9, i64 8}
!18 = !{!17, !9, i64 8}
!19 = !{!12, !12, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass,TailCallElimPass