; 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_kex = type { i8, [2 x ptr], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_cipher_suite = type { i8, ptr, ptr, [2 x i8], ptr, i32, ptr, [2 x ptr], i8, ptr, ptr, i32, i8 }
%struct.s2n_record_algorithm = type { ptr, i32, i32, i64 }
%struct.s2n_cipher = type { i32, %union.anon, i8, ptr, ptr, ptr, ptr, ptr, ptr }
%union.anon = type { %struct.s2n_composite_cipher }
%struct.s2n_composite_cipher = type { i8, i8, i8, ptr, ptr, ptr, ptr }

@s2n_all_cipher_suites = external hidden global [36 x ptr], align 16
@crypto_initialized = external hidden global i8, align 1
@should_init_crypto = external hidden global i8, align 1
@s2n_kem = external constant %struct.s2n_kex, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_cipher_suites_init() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.s2n_blob, align 8
  %8 = alloca %struct.s2n_blob, align 8
  %9 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 36, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %133, %0
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 36
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  store i32 2, ptr %4, align 4
  br label %136

14:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [36 x ptr], ptr @s2n_all_cipher_suites, i64 0, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  store ptr %18, ptr %5, align 8, !tbaa !9
  %19 = load ptr, ptr %5, align 8, !tbaa !9
  %20 = load i8, ptr %19, align 8
  %21 = and i8 %20, -2
  %22 = or i8 %21, 0
  store i8 %22, ptr %19, align 8
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %23, i32 0, i32 6
  store ptr null, ptr %24, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %59, %14
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %27, i32 0, i32 8
  %29 = load i8, ptr %28, align 8, !tbaa !13
  %30 = zext i8 %29 to i32
  %31 = icmp slt i32 %26, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %25
  store i32 5, ptr %4, align 4
  br label %62

33:                                               ; preds = %25
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %34, i32 0, i32 7
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [2 x ptr], ptr %35, i64 0, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = getelementptr inbounds %struct.s2n_cipher, ptr %41, i32 0, i32 3
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  %44 = call zeroext i1 %43()
  br i1 %44, label %45, label %58

45:                                               ; preds = %33
  %46 = load ptr, ptr %5, align 8, !tbaa !9
  %47 = load i8, ptr %46, align 8
  %48 = and i8 %47, -2
  %49 = or i8 %48, 1
  store i8 %49, ptr %46, align 8
  %50 = load ptr, ptr %5, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %50, i32 0, i32 7
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [2 x ptr], ptr %51, i64 0, i64 %53
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = load ptr, ptr %5, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %56, i32 0, i32 6
  store ptr %55, ptr %57, align 8, !tbaa !11
  store i32 5, ptr %4, align 4
  br label %62

58:                                               ; preds = %33
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %6, align 4, !tbaa !5
  br label %25, !llvm.loop !19

62:                                               ; preds = %45, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %63

63:                                               ; preds = %62
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %64, i32 0, i32 4
  %66 = load ptr, ptr %65, align 8, !tbaa !21
  %67 = call zeroext i1 @s2n_kex_includes(ptr noundef %66, ptr noundef @s2n_kem)
  br i1 %67, label %68, label %77

68:                                               ; preds = %63
  %69 = call zeroext i1 @s2n_pq_is_enabled()
  br i1 %69, label %77, label %70

70:                                               ; preds = %68
  %71 = load ptr, ptr %5, align 8, !tbaa !9
  %72 = load i8, ptr %71, align 8
  %73 = and i8 %72, -2
  %74 = or i8 %73, 0
  store i8 %74, ptr %71, align 8
  %75 = load ptr, ptr %5, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %75, i32 0, i32 6
  store ptr null, ptr %76, align 8, !tbaa !11
  br label %77

77:                                               ; preds = %70, %68, %63
  %78 = load ptr, ptr %5, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %78, i32 0, i32 9
  %80 = load ptr, ptr %79, align 8, !tbaa !22
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %125

82:                                               ; preds = %77
  %83 = load ptr, ptr %5, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %83, i32 0, i32 9
  %85 = load ptr, ptr %84, align 8, !tbaa !22
  %86 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !14
  %88 = getelementptr inbounds %struct.s2n_cipher, ptr %87, i32 0, i32 3
  %89 = load ptr, ptr %88, align 8, !tbaa !17
  %90 = call zeroext i1 %89()
  br i1 %90, label %91, label %125

91:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #4
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 24, i1 false)
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr %5, align 8, !tbaa !9
  %94 = call i32 @s2n_blob_init(ptr noundef %7, ptr noundef %93, i32 noundef 104)
  %95 = icmp sgt i32 %94, -1
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %122

97:                                               ; preds = %92
  br label %98

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 24, i1 false)
  br label %100

100:                                              ; preds = %99
  %101 = call i32 @s2n_dup(ptr noundef %7, ptr noundef %8)
  %102 = icmp sgt i32 %101, -1
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %121

104:                                              ; preds = %100
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %107 = getelementptr inbounds %struct.s2n_blob, ptr %8, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8, !tbaa !23
  store ptr %108, ptr %9, align 8, !tbaa !9
  %109 = load ptr, ptr %9, align 8, !tbaa !9
  %110 = load i8, ptr %109, align 8
  %111 = and i8 %110, -2
  %112 = or i8 %111, 1
  store i8 %112, ptr %109, align 8
  %113 = load ptr, ptr %5, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %113, i32 0, i32 9
  %115 = load ptr, ptr %114, align 8, !tbaa !22
  %116 = load ptr, ptr %9, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %116, i32 0, i32 6
  store ptr %115, ptr %117, align 8, !tbaa !11
  %118 = load ptr, ptr %9, align 8, !tbaa !9
  %119 = load ptr, ptr %5, align 8, !tbaa !9
  %120 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %119, i32 0, i32 10
  store ptr %118, ptr %120, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  store i32 0, ptr %4, align 4
  br label %121

121:                                              ; preds = %106, %103
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  br label %122

122:                                              ; preds = %121, %96
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  %123 = load i32, ptr %4, align 4
  switch i32 %123, label %130 [
    i32 0, label %124
  ]

124:                                              ; preds = %122
  br label %129

125:                                              ; preds = %82, %77
  %126 = load ptr, ptr %5, align 8, !tbaa !9
  %127 = load ptr, ptr %5, align 8, !tbaa !9
  %128 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %127, i32 0, i32 10
  store ptr %126, ptr %128, align 8, !tbaa !25
  br label %129

129:                                              ; preds = %125, %124
  store i32 0, ptr %4, align 4
  br label %130

130:                                              ; preds = %129, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  %131 = load i32, ptr %4, align 4
  switch i32 %131, label %136 [
    i32 0, label %132
  ]

132:                                              ; preds = %130
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %3, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %3, align 4, !tbaa !5
  br label %10, !llvm.loop !26

136:                                              ; preds = %130, %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  %137 = load i32, ptr %4, align 4
  switch i32 %137, label %144 [
    i32 2, label %138
  ]

138:                                              ; preds = %136
  %139 = load i8, ptr @should_init_crypto, align 1, !tbaa !27, !range !29, !noundef !30
  %140 = trunc i8 %139 to i1
  br i1 %140, label %141, label %143

141:                                              ; preds = %138
  %142 = call i32 @OPENSSL_init_crypto(i64 noundef 14, ptr noundef null)
  br label %143

143:                                              ; preds = %141, %138
  store i8 1, ptr @crypto_initialized, align 1, !tbaa !27
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %144

144:                                              ; preds = %143, %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %145 = load i32, ptr %1, align 4
  ret i32 %145
}

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

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

declare zeroext i1 @s2n_kex_includes(ptr noundef, ptr noundef) #2

declare zeroext i1 @s2n_pq_is_enabled() #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare i32 @s2n_blob_init(ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @s2n_dup(ptr noundef, ptr noundef) #2

declare i32 @OPENSSL_init_crypto(i64 noundef, ptr noundef) #2

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 willreturn memory(argmem: readwrite) }
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 nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 48}
!12 = !{!"s2n_cipher_suite", !6, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !6, i64 40, !10, i64 48, !7, i64 56, !7, i64 72, !10, i64 80, !10, i64 88, !6, i64 96, !7, i64 100}
!13 = !{!12, !7, i64 72}
!14 = !{!15, !10, i64 0}
!15 = !{!"s2n_record_algorithm", !10, i64 0, !6, i64 8, !6, i64 12, !16, i64 16}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !10, i64 56}
!18 = !{!"s2n_cipher", !6, i64 0, !7, i64 8, !7, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!12, !10, i64 32}
!22 = !{!12, !10, i64 80}
!23 = !{!24, !10, i64 0}
!24 = !{!"s2n_blob", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16}
!25 = !{!12, !10, i64 88}
!26 = distinct !{!26, !20}
!27 = !{!28, !28, i64 0}
!28 = !{!"_Bool", !7, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}


; 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_kex = type { i8, [2 x ptr], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.s2n_blob = type { ptr, i32, i32, i8 }

@s2n_all_cipher_suites = external hidden local_unnamed_addr global [36 x ptr], align 16
@crypto_initialized = external hidden local_unnamed_addr global i8, align 1
@should_init_crypto = external hidden local_unnamed_addr global i8, align 1
@s2n_kem = external constant %struct.s2n_kex, align 8

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @s2n_cipher_suites_init() local_unnamed_addr #0 {
  %1 = alloca %struct.s2n_blob, align 8
  %2 = alloca %struct.s2n_blob, align 8
  br label %3

3:                                                ; preds = %0, %.critedge
  %indvars.iv53 = phi i64 [ 0, %0 ], [ %indvars.iv.next54, %.critedge ]
  %4 = getelementptr inbounds [36 x ptr], ptr @s2n_all_cipher_suites, i64 0, i64 %indvars.iv53
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = load i8, ptr %5, align 8
  %7 = and i8 %6, -2
  store i8 %7, ptr %5, align 8
  %8 = getelementptr inbounds i8, ptr %5, i64 48
  store ptr null, ptr %8, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %5, i64 72
  %10 = load i8, ptr %9, align 8, !tbaa !12
  %.not50 = icmp eq i8 %10, 0
  br i1 %.not50, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %11 = getelementptr inbounds i8, ptr %5, i64 56
  br label %16

12:                                               ; preds = %16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i8, ptr %9, align 8, !tbaa !12
  %14 = zext i8 %13 to i64
  %15 = icmp ult i64 %indvars.iv.next, %14
  br i1 %15, label %16, label %.loopexit, !llvm.loop !13

16:                                               ; preds = %.lr.ph, %12
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %12 ]
  %17 = getelementptr inbounds [2 x ptr], ptr %11, i64 0, i64 %indvars.iv
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %19, i64 56
  %21 = load ptr, ptr %20, align 8, !tbaa !18
  %22 = call zeroext i1 %21() #4
  br i1 %22, label %23, label %12

23:                                               ; preds = %16
  %24 = getelementptr inbounds [2 x ptr], ptr %11, i64 0, i64 %indvars.iv
  %25 = load i8, ptr %5, align 8
  %26 = or i8 %25, 1
  store i8 %26, ptr %5, align 8
  %27 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %27, ptr %8, align 8, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %12, %3, %23
  %28 = getelementptr inbounds i8, ptr %5, i64 32
  %29 = load ptr, ptr %28, align 8, !tbaa !20
  %30 = call zeroext i1 @s2n_kex_includes(ptr noundef %29, ptr noundef nonnull @s2n_kem) #4
  br i1 %30, label %31, label %36

31:                                               ; preds = %.loopexit
  %32 = call zeroext i1 @s2n_pq_is_enabled() #4
  br i1 %32, label %36, label %33

33:                                               ; preds = %31
  %34 = load i8, ptr %5, align 8
  %35 = and i8 %34, -2
  store i8 %35, ptr %5, align 8
  store ptr null, ptr %8, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %33, %31, %.loopexit
  %37 = getelementptr inbounds i8, ptr %5, i64 80
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %.not = icmp eq ptr %38, null
  br i1 %.not, label %57, label %39

39:                                               ; preds = %36
  %40 = load ptr, ptr %38, align 8, !tbaa !15
  %41 = getelementptr inbounds i8, ptr %40, i64 56
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  %43 = call zeroext i1 %42() #4
  br i1 %43, label %44, label %57

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, i8 0, i64 24, i1 false)
  %45 = call i32 @s2n_blob_init(ptr noundef nonnull %1, ptr noundef nonnull %5, i32 noundef 104) #4
  %46 = icmp sgt i32 %45, -1
  br i1 %46, label %47, label %.thread

.thread:                                          ; preds = %44
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #4
  br label %64

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, i8 0, i64 24, i1 false)
  %48 = call i32 @s2n_dup(ptr noundef nonnull %1, ptr noundef nonnull %2) #4
  %49 = icmp sgt i32 %48, -1
  br i1 %49, label %.thread43, label %56

.thread43:                                        ; preds = %47
  %50 = load ptr, ptr %2, align 8, !tbaa !22
  %51 = load i8, ptr %50, align 8
  %52 = or i8 %51, 1
  store i8 %52, ptr %50, align 8
  %53 = load ptr, ptr %37, align 8, !tbaa !21
  %54 = getelementptr inbounds i8, ptr %50, i64 48
  store ptr %53, ptr %54, align 8, !tbaa !9
  %55 = getelementptr inbounds i8, ptr %5, i64 88
  store ptr %50, ptr %55, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #4
  br label %.critedge

56:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #4
  br label %64

57:                                               ; preds = %39, %36
  %58 = getelementptr inbounds i8, ptr %5, i64 88
  store ptr %5, ptr %58, align 8, !tbaa !24
  br label %.critedge

.critedge:                                        ; preds = %.thread43, %57
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %exitcond = icmp eq i64 %indvars.iv.next54, 36
  br i1 %exitcond, label %.critedge40, label %3, !llvm.loop !25

.critedge40:                                      ; preds = %.critedge
  %59 = load i8, ptr @should_init_crypto, align 1, !tbaa !26, !range !28, !noundef !29
  %60 = trunc nuw i8 %59 to i1
  br i1 %60, label %61, label %63

61:                                               ; preds = %.critedge40
  %62 = call i32 @OPENSSL_init_crypto(i64 noundef 14, ptr noundef null) #4
  br label %63

63:                                               ; preds = %61, %.critedge40
  store i8 1, ptr @crypto_initialized, align 1, !tbaa !26
  br label %64

64:                                               ; preds = %.thread, %56, %63
  %.6 = phi i32 [ 0, %63 ], [ -1, %56 ], [ -1, %.thread ]
  ret i32 %.6
}

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

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

declare zeroext i1 @s2n_kex_includes(ptr noundef, ptr noundef) local_unnamed_addr #2

declare zeroext i1 @s2n_pq_is_enabled() local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare i32 @s2n_blob_init(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @s2n_dup(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @OPENSSL_init_crypto(i64 noundef, ptr noundef) local_unnamed_addr #2

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 willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 48}
!10 = !{!"s2n_cipher_suite", !11, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !6, i64 32, !11, i64 40, !6, i64 48, !7, i64 56, !7, i64 72, !6, i64 80, !6, i64 88, !11, i64 96, !7, i64 100}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !7, i64 72}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 0}
!16 = !{!"s2n_record_algorithm", !6, i64 0, !11, i64 8, !11, i64 12, !17, i64 16}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !6, i64 56}
!19 = !{!"s2n_cipher", !11, i64 0, !7, i64 8, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!20 = !{!10, !6, i64 32}
!21 = !{!10, !6, i64 80}
!22 = !{!23, !6, i64 0}
!23 = !{!"s2n_blob", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!24 = !{!10, !6, i64 88}
!25 = distinct !{!25, !14}
!26 = !{!27, !27, i64 0}
!27 = !{!"_Bool", !7, i64 0}
!28 = !{i8 0, i8 2}
!29 = !{}


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