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

; 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_cipher_suite = type { i8, ptr, ptr, [2 x i8], ptr, i32, ptr, [2 x ptr], i8, ptr, ptr, i32, i8 }

@s2n_all_cipher_suites = external hidden global [36 x ptr], align 16
@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.71 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [95 x i8], align 1

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

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

declare i32 @s2n_calculate_stacktrace() #2

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

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

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

13:                                               ; preds = %3
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %48, label %16

16:                                               ; preds = %13
  br label %17

17:                                               ; preds = %16
  br label %18

18:                                               ; preds = %17
  %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
  store ptr @.str.71, ptr %20, align 8, !tbaa !11
  %21 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %22 = getelementptr inbounds %struct.s2n_debug_info, ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds i8, ptr %23, i64 21
  %25 = call ptr @strrchr(ptr noundef %24, i32 noundef 47) #5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %34

27:                                               ; preds = %18
  %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) #5
  %33 = getelementptr inbounds i8, ptr %32, i64 1
  br label %39

34:                                               ; preds = %18
  %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
  br label %39

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

45:                                               ; preds = %39
  %46 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %46, align 4, !tbaa !16
  br label %208

47:                                               ; No predecessors!
  br label %48

48:                                               ; preds = %47, %13
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr null, ptr %50, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %49
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %86, label %54

54:                                               ; preds = %51
  br label %55

55:                                               ; preds = %54
  br label %56

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

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

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

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

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

85:                                               ; No predecessors!
  br label %86

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

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  %89 = load i64, ptr %6, align 8, !tbaa !9
  %90 = icmp eq i64 %89, 2
  br i1 %90, label %123, label %91

91:                                               ; preds = %88
  br label %92

92:                                               ; preds = %91
  br label %93

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

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

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

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

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

122:                                              ; No predecessors!
  br label %123

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

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

125:                                              ; preds = %171, %124
  %126 = load i32, ptr %8, align 4, !tbaa !14
  %127 = load i32, ptr %9, align 4, !tbaa !14
  %128 = icmp sle i32 %126, %127
  br i1 %128, label %129, label %172

129:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %130 = load i32, ptr %8, align 4, !tbaa !14
  %131 = load i32, ptr %9, align 4, !tbaa !14
  %132 = load i32, ptr %8, align 4, !tbaa !14
  %133 = sub nsw i32 %131, %132
  %134 = sdiv i32 %133, 2
  %135 = add nsw i32 %130, %134
  %136 = sext i32 %135 to i64
  store i64 %136, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %137 = load i64, ptr %10, align 8, !tbaa !9
  %138 = getelementptr inbounds [36 x ptr], ptr @s2n_all_cipher_suites, i64 0, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %139, i32 0, i32 3
  %141 = getelementptr inbounds [2 x i8], ptr %140, i64 0, i64 0
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = call i32 @memcmp(ptr noundef %141, ptr noundef %142, i64 noundef 2) #5
  store i32 %143, ptr %11, align 4, !tbaa !14
  %144 = load i32, ptr %11, align 4, !tbaa !14
  %145 = icmp eq i32 %144, 0
  br i1 %145, label %146, label %152

146:                                              ; preds = %129
  %147 = load i64, ptr %10, align 8, !tbaa !9
  %148 = getelementptr inbounds [36 x ptr], ptr @s2n_all_cipher_suites, i64 0, i64 %147
  %149 = load ptr, ptr %148, align 8, !tbaa !5
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %149, ptr %150, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 0, ptr %151, align 4, !tbaa !16
  store i32 1, ptr %12, align 4
  br label %169

152:                                              ; preds = %129
  %153 = load i32, ptr %11, align 4, !tbaa !14
  %154 = icmp sgt i32 %153, 0
  br i1 %154, label %155, label %159

155:                                              ; preds = %152
  %156 = load i64, ptr %10, align 8, !tbaa !9
  %157 = sub i64 %156, 1
  %158 = trunc i64 %157 to i32
  store i32 %158, ptr %9, align 4, !tbaa !14
  br label %167

159:                                              ; preds = %152
  %160 = load i32, ptr %11, align 4, !tbaa !14
  %161 = icmp slt i32 %160, 0
  br i1 %161, label %162, label %166

162:                                              ; preds = %159
  %163 = load i64, ptr %10, align 8, !tbaa !9
  %164 = add i64 %163, 1
  %165 = trunc i64 %164 to i32
  store i32 %165, ptr %8, align 4, !tbaa !14
  br label %166

166:                                              ; preds = %162, %159
  br label %167

167:                                              ; preds = %166, %155
  br label %168

168:                                              ; preds = %167
  store i32 0, ptr %12, align 4
  br label %169

169:                                              ; preds = %168, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %170 = load i32, ptr %12, align 4
  switch i32 %170, label %206 [
    i32 0, label %171
  ]

171:                                              ; preds = %169
  br label %125, !llvm.loop !18

172:                                              ; preds = %125
  br label %173

173:                                              ; preds = %172
  br label %174

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

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

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

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

201:                                              ; preds = %195
  br label %202

202:                                              ; preds = %201
  %203 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %203, align 4, !tbaa !16
  store i32 1, ptr %12, align 4
  br label %206

204:                                              ; No predecessors!
  br label %205

205:                                              ; preds = %204
  store i32 0, ptr %12, align 4
  br label %206

206:                                              ; preds = %205, %202, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %207 = load i32, ptr %12, align 4
  switch i32 %207, label %211 [
    i32 0, label %208
    i32 1, label %208
  ]

208:                                              ; preds = %206, %206, %120, %83, %45
  %209 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  %210 = load i32, ptr %209, align 4
  ret i32 %210

211:                                              ; preds = %206
  unreachable
}

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

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !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 = !{!17, !15, i64 0}
!17 = !{!"", !15, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.s2n_debug_info = type { ptr, ptr }

@s2n_all_cipher_suites = external hidden local_unnamed_addr global [36 x ptr], align 16
@_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.71 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [95 x i8], align 1

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @s2n_cipher_suite_from_iana(ptr noundef readonly %0, i64 noundef %1, ptr noundef writeonly %2) local_unnamed_addr #3 {
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %4, label %12

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

12:                                               ; preds = %3
  store ptr null, ptr %2, align 8, !tbaa !13
  %.not30 = icmp eq ptr %0, null
  br i1 %.not30, label %13, label %21

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

21:                                               ; preds = %12
  %22 = icmp eq i64 %1, 2
  br i1 %22, label %.preheader, label %23

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

.preheader:                                       ; preds = %21, %39
  %.01839 = phi i32 [ %.1, %39 ], [ 0, %21 ]
  %.01938 = phi i32 [ %.120, %39 ], [ 35, %21 ]
  %31 = sub nsw i32 %.01938, %.01839
  %32 = sdiv i32 %31, 2
  %33 = add nsw i32 %32, %.01839
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [36 x ptr], ptr @s2n_all_cipher_suites, i64 0, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !13
  %37 = getelementptr inbounds i8, ptr %36, i64 24
  %38 = tail call i32 @memcmp(ptr noundef nonnull dereferenceable(2) %37, ptr noundef nonnull dereferenceable(2) %0, i64 noundef 2) #4
  %.not35 = icmp eq i32 %38, 0
  br i1 %.not35, label %.thread, label %39

.thread:                                          ; preds = %.preheader
  store ptr %36, ptr %2, align 8, !tbaa !13
  br label %51

39:                                               ; preds = %.preheader
  %40 = icmp sgt i32 %38, 0
  %41 = add i32 %33, -1
  %42 = add i32 %33, 1
  %.120 = select i1 %40, i32 %41, i32 %.01938
  %.1 = select i1 %40, i32 %.01839, i32 %42
  %.not33 = icmp sgt i32 %.1, %.120
  br i1 %.not33, label %43, label %.preheader, !llvm.loop !14

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

51:                                               ; preds = %.thread, %43, %23, %13, %4
  %.sroa.0.3 = phi i32 [ -1, %23 ], [ -1, %13 ], [ -1, %4 ], [ -1, %43 ], [ 0, %.thread ]
  ret i32 %.sroa.0.3
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @memcmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { "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 = { 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 #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_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 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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