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

; 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_security_policy_selection = type { ptr, ptr, i8 }
%struct.s2n_debug_info = type { ptr, ptr }

@security_policy_selection = external dso_local global [119 x %struct.s2n_security_policy_selection], align 16
@deprecated_security_policies = external dso_local global [16 x ptr], align 16
@.str.134 = external hidden unnamed_addr constant [99 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.135 = external hidden unnamed_addr constant [99 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [99 x i8], align 1
@.str.137 = external hidden unnamed_addr constant [99 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_find_security_policy_from_version(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %9

9:                                                ; preds = %2
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = icmp ne ptr %10, null
  br i1 %11, label %43, label %12

12:                                               ; preds = %9
  br label %13

13:                                               ; preds = %12
  br label %14

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

23:                                               ; preds = %14
  %24 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %25 = getelementptr inbounds %struct.s2n_debug_info, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %26, i64 21
  %28 = call ptr @strrchr(ptr noundef %27, i32 noundef 47) #5
  %29 = getelementptr inbounds i8, ptr %28, i64 1
  br label %35

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

35:                                               ; preds = %30, %23
  %36 = phi ptr [ %29, %23 ], [ %34, %30 ]
  %37 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %38 = getelementptr inbounds %struct.s2n_debug_info, ptr %37, i32 0, i32 1
  store ptr %36, ptr %38, align 8, !tbaa !11
  %39 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %39, align 4, !tbaa !12
  %40 = call i32 @s2n_calculate_stacktrace()
  br label %41

41:                                               ; preds = %35
  store i32 -1, ptr %3, align 4
  br label %192

42:                                               ; No predecessors!
  br label %43

43:                                               ; preds = %42, %9
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %79, label %48

48:                                               ; preds = %45
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  %51 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %52 = getelementptr inbounds %struct.s2n_debug_info, ptr %51, i32 0, i32 0
  store ptr @.str.135, ptr %52, align 8, !tbaa !9
  %53 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %54 = getelementptr inbounds %struct.s2n_debug_info, ptr %53, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %55, i64 21
  %57 = call ptr @strrchr(ptr noundef %56, i32 noundef 47) #5
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %66

59:                                               ; preds = %50
  %60 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %61 = getelementptr inbounds %struct.s2n_debug_info, ptr %60, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  %63 = getelementptr inbounds i8, ptr %62, i64 21
  %64 = call ptr @strrchr(ptr noundef %63, i32 noundef 47) #5
  %65 = getelementptr inbounds i8, ptr %64, i64 1
  br label %71

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

71:                                               ; preds = %66, %59
  %72 = phi ptr [ %65, %59 ], [ %70, %66 ]
  %73 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %74 = getelementptr inbounds %struct.s2n_debug_info, ptr %73, i32 0, i32 1
  store ptr %72, ptr %74, align 8, !tbaa !11
  %75 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %75, align 4, !tbaa !12
  %76 = call i32 @s2n_calculate_stacktrace()
  br label %77

77:                                               ; preds = %71
  store i32 -1, ptr %3, align 4
  br label %192

78:                                               ; No predecessors!
  br label %79

79:                                               ; preds = %78, %45
  br label %80

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

81:                                               ; preds = %106, %80
  %82 = load i32, ptr %6, align 4, !tbaa !12
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [119 x %struct.s2n_security_policy_selection], ptr @security_policy_selection, i64 0, i64 %83
  %85 = getelementptr inbounds %struct.s2n_security_policy_selection, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !14
  %87 = icmp ne ptr %86, null
  br i1 %87, label %89, label %88

88:                                               ; preds = %81
  store i32 14, ptr %7, align 4
  br label %109

89:                                               ; preds = %81
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load i32, ptr %6, align 4, !tbaa !12
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [119 x %struct.s2n_security_policy_selection], ptr @security_policy_selection, i64 0, i64 %92
  %94 = getelementptr inbounds %struct.s2n_security_policy_selection, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !14
  %96 = call i32 @strcasecmp(ptr noundef %90, ptr noundef %95) #5
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %105, label %98

98:                                               ; preds = %89
  %99 = load i32, ptr %6, align 4, !tbaa !12
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [119 x %struct.s2n_security_policy_selection], ptr @security_policy_selection, i64 0, i64 %100
  %102 = getelementptr inbounds %struct.s2n_security_policy_selection, ptr %101, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !16
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %103, ptr %104, align 8, !tbaa !5
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %109

105:                                              ; preds = %89
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %6, align 4, !tbaa !12
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %6, align 4, !tbaa !12
  br label %81, !llvm.loop !17

109:                                              ; preds = %98, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %110 = load i32, ptr %7, align 4
  switch i32 %110, label %194 [
    i32 14, label %111
    i32 1, label %192
  ]

111:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !19
  br label %112

112:                                              ; preds = %157, %111
  %113 = load i64, ptr %8, align 8, !tbaa !19
  %114 = icmp ult i64 %113, 16
  br i1 %114, label %116, label %115

115:                                              ; preds = %112
  store i32 17, ptr %7, align 4
  br label %160

116:                                              ; preds = %112
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = load i64, ptr %8, align 8, !tbaa !19
  %119 = getelementptr inbounds [16 x ptr], ptr @deprecated_security_policies, i64 0, i64 %118
  %120 = load ptr, ptr %119, align 8, !tbaa !5
  %121 = call i32 @strcasecmp(ptr noundef %117, ptr noundef %120) #5
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %156, label %123

123:                                              ; preds = %116
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124
  %126 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %127 = getelementptr inbounds %struct.s2n_debug_info, ptr %126, i32 0, i32 0
  store ptr @.str.136, ptr %127, align 8, !tbaa !9
  %128 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %129 = getelementptr inbounds %struct.s2n_debug_info, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  %131 = getelementptr inbounds i8, ptr %130, i64 21
  %132 = call ptr @strrchr(ptr noundef %131, i32 noundef 47) #5
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %141

134:                                              ; preds = %125
  %135 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %136 = getelementptr inbounds %struct.s2n_debug_info, ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  %138 = getelementptr inbounds i8, ptr %137, i64 21
  %139 = call ptr @strrchr(ptr noundef %138, i32 noundef 47) #5
  %140 = getelementptr inbounds i8, ptr %139, i64 1
  br label %146

141:                                              ; preds = %125
  %142 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %143 = getelementptr inbounds %struct.s2n_debug_info, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  %145 = getelementptr inbounds i8, ptr %144, i64 21
  br label %146

146:                                              ; preds = %141, %134
  %147 = phi ptr [ %140, %134 ], [ %145, %141 ]
  %148 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %149 = getelementptr inbounds %struct.s2n_debug_info, ptr %148, i32 0, i32 1
  store ptr %147, ptr %149, align 8, !tbaa !11
  %150 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762100, ptr %150, align 4, !tbaa !12
  %151 = call i32 @s2n_calculate_stacktrace()
  br label %152

152:                                              ; preds = %146
  br label %153

153:                                              ; preds = %152
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %160

154:                                              ; No predecessors!
  br label %155

155:                                              ; preds = %154
  br label %156

156:                                              ; preds = %155, %116
  br label %157

157:                                              ; preds = %156
  %158 = load i64, ptr %8, align 8, !tbaa !19
  %159 = add i64 %158, 1
  store i64 %159, ptr %8, align 8, !tbaa !19
  br label %112, !llvm.loop !21

160:                                              ; preds = %153, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %161 = load i32, ptr %7, align 4
  switch i32 %161, label %194 [
    i32 17, label %162
    i32 1, label %192
  ]

162:                                              ; preds = %160
  br label %163

163:                                              ; preds = %162
  br label %164

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

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

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

185:                                              ; preds = %180, %173
  %186 = phi ptr [ %179, %173 ], [ %184, %180 ]
  %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 1
  store ptr %186, ptr %188, align 8, !tbaa !11
  %189 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762101, ptr %189, align 4, !tbaa !12
  %190 = call i32 @s2n_calculate_stacktrace()
  br label %191

191:                                              ; preds = %185
  store i32 -1, ptr %3, align 4
  br label %192

192:                                              ; preds = %191, %160, %109, %77, %41
  %193 = load i32, ptr %3, align 4
  ret i32 %193

194:                                              ; preds = %160, %109
  unreachable
}

; 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(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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(argmem: readwrite) }
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, !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, !6, i64 0}
!15 = !{!"s2n_security_policy_selection", !6, i64 0, !6, i64 8, !13, i64 16, !13, i64 16, !13, i64 16}
!16 = !{!15, !6, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = distinct !{!21, !18}


; 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_security_policy_selection = type { ptr, ptr, i8 }
%struct.s2n_debug_info = type { ptr, ptr }

@security_policy_selection = external dso_local local_unnamed_addr global [119 x %struct.s2n_security_policy_selection], align 16
@deprecated_security_policies = external dso_local local_unnamed_addr global [16 x ptr], align 16
@.str.134 = external hidden unnamed_addr constant [99 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.135 = external hidden unnamed_addr constant [99 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [99 x i8], align 1
@.str.137 = external hidden unnamed_addr constant [99 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_find_security_policy_from_version(ptr noundef readonly %0, ptr noundef writeonly %1) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %3, label %11

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

11:                                               ; preds = %2
  %.not26 = icmp eq ptr %1, null
  br i1 %.not26, label %14, label %.preheader43

.preheader43:                                     ; preds = %11
  %12 = load ptr, ptr @security_policy_selection, align 16, !tbaa !13
  %.not2845 = icmp eq ptr %12, null
  br i1 %.not2845, label %.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader43
  %13 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef nonnull %12) #5
  %.not2952 = icmp eq i32 %13, 0
  br i1 %.not2952, label %.thread, label %.lr.ph54

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

.lr.ph54:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv53 = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv53, 1
  %22 = getelementptr inbounds [119 x %struct.s2n_security_policy_selection], ptr @security_policy_selection, i64 0, i64 %indvars.iv.next
  %23 = load ptr, ptr %22, align 8, !tbaa !13
  %.not28 = icmp eq ptr %23, null
  br i1 %.not28, label %.preheader, label %.lr.ph, !llvm.loop !15

.preheader:                                       ; preds = %.lr.ph54, %.preheader43
  %24 = load ptr, ptr @deprecated_security_policies, align 16, !tbaa !17
  %25 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %24) #5
  %.not30 = icmp eq i32 %25, 0
  br i1 %.not30, label %82, label %29

.lr.ph:                                           ; preds = %.lr.ph54
  %26 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef nonnull %23) #5
  %.not29 = icmp eq i32 %26, 0
  br i1 %.not29, label %.thread, label %.lr.ph54, !llvm.loop !15

.thread:                                          ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa = phi ptr [ @security_policy_selection, %.lr.ph.preheader ], [ %22, %.lr.ph ]
  %27 = getelementptr inbounds i8, ptr %.lcssa, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !18
  store ptr %28, ptr %1, align 8, !tbaa !17
  br label %90

29:                                               ; preds = %.preheader
  %30 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 8), align 8, !tbaa !17
  %31 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %30) #5
  %.not30.1 = icmp eq i32 %31, 0
  br i1 %.not30.1, label %82, label %32

32:                                               ; preds = %29
  %33 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 16), align 16, !tbaa !17
  %34 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %33) #5
  %.not30.2 = icmp eq i32 %34, 0
  br i1 %.not30.2, label %82, label %35

35:                                               ; preds = %32
  %36 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 24), align 8, !tbaa !17
  %37 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %36) #5
  %.not30.3 = icmp eq i32 %37, 0
  br i1 %.not30.3, label %82, label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 32), align 16, !tbaa !17
  %40 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %39) #5
  %.not30.4 = icmp eq i32 %40, 0
  br i1 %.not30.4, label %82, label %41

41:                                               ; preds = %38
  %42 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 40), align 8, !tbaa !17
  %43 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %42) #5
  %.not30.5 = icmp eq i32 %43, 0
  br i1 %.not30.5, label %82, label %44

44:                                               ; preds = %41
  %45 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 48), align 16, !tbaa !17
  %46 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %45) #5
  %.not30.6 = icmp eq i32 %46, 0
  br i1 %.not30.6, label %82, label %47

47:                                               ; preds = %44
  %48 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 56), align 8, !tbaa !17
  %49 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %48) #5
  %.not30.7 = icmp eq i32 %49, 0
  br i1 %.not30.7, label %82, label %50

50:                                               ; preds = %47
  %51 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 64), align 16, !tbaa !17
  %52 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %51) #5
  %.not30.8 = icmp eq i32 %52, 0
  br i1 %.not30.8, label %82, label %53

53:                                               ; preds = %50
  %54 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 72), align 8, !tbaa !17
  %55 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %54) #5
  %.not30.9 = icmp eq i32 %55, 0
  br i1 %.not30.9, label %82, label %56

56:                                               ; preds = %53
  %57 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 80), align 16, !tbaa !17
  %58 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %57) #5
  %.not30.10 = icmp eq i32 %58, 0
  br i1 %.not30.10, label %82, label %59

59:                                               ; preds = %56
  %60 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 88), align 8, !tbaa !17
  %61 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %60) #5
  %.not30.11 = icmp eq i32 %61, 0
  br i1 %.not30.11, label %82, label %62

62:                                               ; preds = %59
  %63 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 96), align 16, !tbaa !17
  %64 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %63) #5
  %.not30.12 = icmp eq i32 %64, 0
  br i1 %.not30.12, label %82, label %65

65:                                               ; preds = %62
  %66 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 104), align 8, !tbaa !17
  %67 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %66) #5
  %.not30.13 = icmp eq i32 %67, 0
  br i1 %.not30.13, label %82, label %68

68:                                               ; preds = %65
  %69 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 112), align 16, !tbaa !17
  %70 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %69) #5
  %.not30.14 = icmp eq i32 %70, 0
  br i1 %.not30.14, label %82, label %71

71:                                               ; preds = %68
  %72 = load ptr, ptr getelementptr inbounds (i8, ptr @deprecated_security_policies, i64 120), align 8, !tbaa !17
  %73 = tail call i32 @strcasecmp(ptr noundef nonnull %0, ptr noundef %72) #5
  %.not30.15 = icmp eq i32 %73, 0
  br i1 %.not30.15, label %82, label %74

74:                                               ; preds = %71
  %75 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.137, ptr %75, align 8, !tbaa !5
  %76 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.137, i64 21), i32 noundef 47) #5
  %.not32 = icmp eq ptr %76, null
  %77 = getelementptr inbounds i8, ptr %76, i64 1
  %78 = select i1 %.not32, ptr getelementptr inbounds (i8, ptr @.str.137, i64 21), ptr %77
  %79 = getelementptr inbounds i8, ptr %75, i64 8
  store ptr %78, ptr %79, align 8, !tbaa !10
  %80 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762101, ptr %80, align 4, !tbaa !11
  %81 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %90

82:                                               ; preds = %71, %68, %65, %62, %59, %56, %53, %50, %47, %44, %41, %38, %35, %32, %29, %.preheader
  %83 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.136, ptr %83, align 8, !tbaa !5
  %84 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.136, i64 21), i32 noundef 47) #5
  %.not31 = icmp eq ptr %84, null
  %85 = getelementptr inbounds i8, ptr %84, i64 1
  %86 = select i1 %.not31, ptr getelementptr inbounds (i8, ptr @.str.136, i64 21), ptr %85
  %87 = getelementptr inbounds i8, ptr %83, i64 8
  store ptr %86, ptr %87, align 8, !tbaa !10
  %88 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762100, ptr %88, align 4, !tbaa !11
  %89 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %90

90:                                               ; preds = %82, %.thread, %74, %14, %3
  %.2 = phi i32 [ -1, %82 ], [ -1, %74 ], [ -1, %14 ], [ -1, %3 ], [ 0, %.thread ]
  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: mustprogress nofree nounwind willreturn memory(read)
declare i32 @strcasecmp(ptr nocapture noundef, ptr nocapture noundef) 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 = { mustprogress nofree 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 #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 = !{!14, !7, i64 0}
!14 = !{!"s2n_security_policy_selection", !7, i64 0, !7, i64 8, !12, i64 16, !12, i64 16, !12, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!7, !7, i64 0}
!18 = !{!14, !7, i64 8}


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