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

; 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.session_cache_entry = type { [32 x i8], i8, [255 x i8], i8 }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.47 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [83 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: nounwind uwtable
define dso_local i32 @cache_delete_callback(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i64 %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %16, ptr %10, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %18 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %18, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 1, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 32, ptr %13, align 8, !tbaa !9
  br label %19

19:                                               ; preds = %17
  %20 = load i64, ptr %11, align 8, !tbaa !9
  %21 = load i64, ptr %12, align 8, !tbaa !9
  %22 = icmp uge i64 %20, %21
  br i1 %22, label %56, label %23

23:                                               ; preds = %19
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  %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
  store ptr @.str.47, ptr %27, align 8, !tbaa !11
  %28 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %29 = getelementptr inbounds %struct.s2n_debug_info, ptr %28, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !11
  %31 = getelementptr inbounds i8, ptr %30, i64 21
  %32 = call ptr @strrchr(ptr noundef %31, i32 noundef 47) #6
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %41

34:                                               ; preds = %25
  %35 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %36 = getelementptr inbounds %struct.s2n_debug_info, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds i8, ptr %37, i64 21
  %39 = call ptr @strrchr(ptr noundef %38, i32 noundef 47) #6
  %40 = getelementptr inbounds i8, ptr %39, i64 1
  br label %46

41:                                               ; preds = %25
  %42 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %43 = getelementptr inbounds %struct.s2n_debug_info, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds i8, ptr %44, i64 21
  br label %46

46:                                               ; preds = %41, %34
  %47 = phi ptr [ %40, %34 ], [ %45, %41 ]
  %48 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %49 = getelementptr inbounds %struct.s2n_debug_info, ptr %48, i32 0, i32 1
  store ptr %47, ptr %49, align 8, !tbaa !13
  %50 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %50, align 4, !tbaa !14
  %51 = call i32 @s2n_calculate_stacktrace()
  br label %52

52:                                               ; preds = %46
  br label %53

53:                                               ; preds = %52
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %99

54:                                               ; No predecessors!
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55, %19
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  %60 = load i64, ptr %11, align 8, !tbaa !9
  %61 = load i64, ptr %13, align 8, !tbaa !9
  %62 = icmp ule i64 %60, %61
  br i1 %62, label %96, label %63

63:                                               ; preds = %59
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %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
  store ptr @.str.47, ptr %67, align 8, !tbaa !11
  %68 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %69 = getelementptr inbounds %struct.s2n_debug_info, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = getelementptr inbounds i8, ptr %70, i64 21
  %72 = call ptr @strrchr(ptr noundef %71, i32 noundef 47) #6
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %81

74:                                               ; preds = %65
  %75 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %76 = getelementptr inbounds %struct.s2n_debug_info, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = getelementptr inbounds i8, ptr %77, i64 21
  %79 = call ptr @strrchr(ptr noundef %78, i32 noundef 47) #6
  %80 = getelementptr inbounds i8, ptr %79, i64 1
  br label %86

81:                                               ; preds = %65
  %82 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %83 = getelementptr inbounds %struct.s2n_debug_info, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = getelementptr inbounds i8, ptr %84, i64 21
  br label %86

86:                                               ; preds = %81, %74
  %87 = phi ptr [ %80, %74 ], [ %85, %81 ]
  %88 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %89 = getelementptr inbounds %struct.s2n_debug_info, ptr %88, i32 0, i32 1
  store ptr %87, ptr %89, align 8, !tbaa !13
  %90 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %90, align 4, !tbaa !14
  %91 = call i32 @s2n_calculate_stacktrace()
  br label %92

92:                                               ; preds = %86
  br label %93

93:                                               ; preds = %92
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %99

94:                                               ; No predecessors!
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95, %59
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  store i32 0, ptr %14, align 4
  br label %99

99:                                               ; preds = %98, %93, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %100 = load i32, ptr %14, align 4
  switch i32 %100, label %221 [
    i32 0, label %101
  ]

101:                                              ; preds = %99
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %104, i64 0
  %106 = load i8, ptr %105, align 1, !tbaa !16
  store i8 %106, ptr %15, align 1, !tbaa !16
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = load i8, ptr %15, align 1, !tbaa !16
  %109 = zext i8 %108 to i64
  %110 = getelementptr inbounds %struct.session_cache_entry, ptr %107, i64 %109
  %111 = getelementptr inbounds %struct.session_cache_entry, ptr %110, i32 0, i32 1
  %112 = load i8, ptr %111, align 1, !tbaa !17
  %113 = zext i8 %112 to i32
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %209

115:                                              ; preds = %103
  br label %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = load i8, ptr %15, align 1, !tbaa !16
  %119 = zext i8 %118 to i64
  %120 = getelementptr inbounds %struct.session_cache_entry, ptr %117, i64 %119
  %121 = getelementptr inbounds %struct.session_cache_entry, ptr %120, i32 0, i32 1
  %122 = load i8, ptr %121, align 1, !tbaa !17
  %123 = zext i8 %122 to i64
  %124 = load i64, ptr %9, align 8, !tbaa !9
  %125 = icmp eq i64 %123, %124
  br i1 %125, label %159, label %126

126:                                              ; preds = %116
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  %129 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %130 = getelementptr inbounds %struct.s2n_debug_info, ptr %129, i32 0, i32 0
  store ptr @.str.48, ptr %130, align 8, !tbaa !11
  %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
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = getelementptr inbounds i8, ptr %133, i64 21
  %135 = call ptr @strrchr(ptr noundef %134, i32 noundef 47) #6
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %144

137:                                              ; preds = %128
  %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 0
  %140 = load ptr, ptr %139, align 8, !tbaa !11
  %141 = getelementptr inbounds i8, ptr %140, i64 21
  %142 = call ptr @strrchr(ptr noundef %141, i32 noundef 47) #6
  %143 = getelementptr inbounds i8, ptr %142, i64 1
  br label %149

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

149:                                              ; preds = %144, %137
  %150 = phi ptr [ %143, %137 ], [ %148, %144 ]
  %151 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %152 = getelementptr inbounds %struct.s2n_debug_info, ptr %151, i32 0, i32 1
  store ptr %150, ptr %152, align 8, !tbaa !13
  %153 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %153, align 4, !tbaa !14
  %154 = call i32 @s2n_calculate_stacktrace()
  br label %155

155:                                              ; preds = %149
  br label %156

156:                                              ; preds = %155
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %220

157:                                              ; No predecessors!
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158, %116
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  %164 = load i8, ptr %15, align 1, !tbaa !16
  %165 = zext i8 %164 to i64
  %166 = getelementptr inbounds %struct.session_cache_entry, ptr %163, i64 %165
  %167 = getelementptr inbounds %struct.session_cache_entry, ptr %166, i32 0, i32 0
  %168 = getelementptr inbounds [32 x i8], ptr %167, i64 0, i64 0
  %169 = load ptr, ptr %8, align 8, !tbaa !5
  %170 = load i64, ptr %9, align 8, !tbaa !9
  %171 = call i32 @memcmp(ptr noundef %168, ptr noundef %169, i64 noundef %170) #6
  %172 = icmp eq i32 %171, 0
  br i1 %172, label %206, label %173

173:                                              ; preds = %162
  br label %174

174:                                              ; preds = %173
  br label %175

175:                                              ; preds = %174
  %176 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %177 = getelementptr inbounds %struct.s2n_debug_info, ptr %176, i32 0, i32 0
  store ptr @.str.49, ptr %177, align 8, !tbaa !11
  %178 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %179 = getelementptr inbounds %struct.s2n_debug_info, ptr %178, i32 0, i32 0
  %180 = load ptr, ptr %179, align 8, !tbaa !11
  %181 = getelementptr inbounds i8, ptr %180, i64 21
  %182 = call ptr @strrchr(ptr noundef %181, i32 noundef 47) #6
  %183 = icmp ne ptr %182, null
  br i1 %183, label %184, label %191

184:                                              ; preds = %175
  %185 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %186 = getelementptr inbounds %struct.s2n_debug_info, ptr %185, i32 0, i32 0
  %187 = load ptr, ptr %186, align 8, !tbaa !11
  %188 = getelementptr inbounds i8, ptr %187, i64 21
  %189 = call ptr @strrchr(ptr noundef %188, i32 noundef 47) #6
  %190 = getelementptr inbounds i8, ptr %189, i64 1
  br label %196

191:                                              ; preds = %175
  %192 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %193 = getelementptr inbounds %struct.s2n_debug_info, ptr %192, i32 0, i32 0
  %194 = load ptr, ptr %193, align 8, !tbaa !11
  %195 = getelementptr inbounds i8, ptr %194, i64 21
  br label %196

196:                                              ; preds = %191, %184
  %197 = phi ptr [ %190, %184 ], [ %195, %191 ]
  %198 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %199 = getelementptr inbounds %struct.s2n_debug_info, ptr %198, i32 0, i32 1
  store ptr %197, ptr %199, align 8, !tbaa !13
  %200 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %200, align 4, !tbaa !14
  %201 = call i32 @s2n_calculate_stacktrace()
  br label %202

202:                                              ; preds = %196
  br label %203

203:                                              ; preds = %202
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %220

204:                                              ; No predecessors!
  br label %205

205:                                              ; preds = %204
  br label %206

206:                                              ; preds = %205, %162
  br label %207

207:                                              ; preds = %206
  br label %208

208:                                              ; preds = %207
  br label %209

209:                                              ; preds = %208, %103
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = load i8, ptr %15, align 1, !tbaa !16
  %212 = zext i8 %211 to i64
  %213 = getelementptr inbounds %struct.session_cache_entry, ptr %210, i64 %212
  %214 = getelementptr inbounds %struct.session_cache_entry, ptr %213, i32 0, i32 1
  store i8 0, ptr %214, align 1, !tbaa !17
  %215 = load ptr, ptr %10, align 8, !tbaa !5
  %216 = load i8, ptr %15, align 1, !tbaa !16
  %217 = zext i8 %216 to i64
  %218 = getelementptr inbounds %struct.session_cache_entry, ptr %215, i64 %217
  %219 = getelementptr inbounds %struct.session_cache_entry, ptr %218, i32 0, i32 3
  store i8 0, ptr %219, align 1, !tbaa !19
  store i32 0, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %220

220:                                              ; preds = %209, %203, %156
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  br label %221

221:                                              ; preds = %220, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %222 = load i32, ptr %5, align 4
  ret i32 %222
}

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

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

declare i32 @s2n_calculate_stacktrace() #4

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { "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 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !7, i64 32}
!18 = !{!"session_cache_entry", !7, i64 0, !7, i64 32, !7, i64 33, !7, i64 288}
!19 = !{!18, !7, i64 288}


; 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 }
%struct.session_cache_entry = type { [32 x i8], i8, [255 x i8], i8 }

@_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.47 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [83 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @cache_delete_callback(ptr nocapture noundef readnone %0, ptr nocapture noundef %1, ptr nocapture noundef readonly %2, i64 noundef %3) local_unnamed_addr #0 {
  %.not = icmp eq i64 %3, 0
  br i1 %.not, label %5, label %13

5:                                                ; preds = %4
  %6 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.47, ptr %6, align 8, !tbaa !5
  %7 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.47, i64 21), i32 noundef 47) #5
  %.not27 = icmp eq ptr %7, null
  %8 = getelementptr inbounds i8, ptr %7, i64 1
  %9 = select i1 %.not27, ptr getelementptr inbounds (i8, ptr @.str.47, 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 402653194, ptr %11, align 4, !tbaa !11
  %12 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %.critedge

13:                                               ; preds = %4
  %14 = icmp ult i64 %3, 33
  br i1 %14, label %23, label %15

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

23:                                               ; preds = %13
  %24 = load i8, ptr %2, align 1, !tbaa !13
  %25 = zext i8 %24 to i64
  %26 = getelementptr inbounds %struct.session_cache_entry, ptr %1, i64 %25
  %27 = getelementptr inbounds i8, ptr %26, i64 32
  %28 = load i8, ptr %27, align 1, !tbaa !14
  %.not29 = icmp eq i8 %28, 0
  br i1 %.not29, label %50, label %29

29:                                               ; preds = %23
  %30 = zext i8 %28 to i64
  %31 = icmp eq i64 %30, %3
  br i1 %31, label %40, label %32

32:                                               ; preds = %29
  %33 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.48, ptr %33, align 8, !tbaa !5
  %34 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.48, i64 21), i32 noundef 47) #5
  %.not30 = icmp eq ptr %34, null
  %35 = getelementptr inbounds i8, ptr %34, i64 1
  %36 = select i1 %.not30, ptr getelementptr inbounds (i8, ptr @.str.48, i64 21), ptr %35
  %37 = getelementptr inbounds i8, ptr %33, i64 8
  store ptr %36, ptr %37, align 8, !tbaa !10
  %38 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %38, align 4, !tbaa !11
  %39 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %.critedge

40:                                               ; preds = %29
  %bcmp = tail call i32 @bcmp(ptr nonnull %26, ptr nonnull %2, i64 %3)
  %41 = icmp eq i32 %bcmp, 0
  br i1 %41, label %50, label %42

42:                                               ; preds = %40
  %43 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.49, ptr %43, align 8, !tbaa !5
  %44 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.49, i64 21), i32 noundef 47) #5
  %.not31 = icmp eq ptr %44, null
  %45 = getelementptr inbounds i8, ptr %44, i64 1
  %46 = select i1 %.not31, ptr getelementptr inbounds (i8, ptr @.str.49, i64 21), ptr %45
  %47 = getelementptr inbounds i8, ptr %43, i64 8
  store ptr %46, ptr %47, align 8, !tbaa !10
  %48 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %48, align 4, !tbaa !11
  %49 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %.critedge

50:                                               ; preds = %40, %23
  store i8 0, ptr %27, align 1, !tbaa !14
  %51 = getelementptr inbounds i8, ptr %26, i64 288
  store i8 0, ptr %51, align 1, !tbaa !16
  br label %.critedge

.critedge:                                        ; preds = %15, %5, %32, %42, %50
  %.2 = phi i32 [ 0, %50 ], [ -1, %42 ], [ -1, %32 ], [ -1, %5 ], [ -1, %15 ]
  ret i32 %.2
}

; 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: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #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 = { 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 = { nofree nounwind willreturn memory(argmem: read) }
attributes #5 = { nounwind willreturn memory(read) }
attributes #6 = { 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 = !{!8, !8, i64 0}
!14 = !{!15, !8, i64 32}
!15 = !{!"session_cache_entry", !8, i64 0, !8, i64 32, !8, i64 33, !8, i64 288}
!16 = !{!15, !8, i64 288}


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