; LLVM IR from aws/s2n-tls :: tests/unit (s2n_resume_test)

; 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_config = type { i32, ptr, ptr, %struct.certs_by_type, %struct.s2n_blob, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i64, ptr, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, i32, i8, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, %struct.s2n_x509_trust_store, i16, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, i32, i32, ptr, ptr, i32, %struct.s2n_blob }
%struct.certs_by_type = type { [4 x ptr] }
%struct.s2n_x509_trust_store = type { ptr, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_ticket_key = type { [16 x i8], [32 x i8], [12 x i8], i64 }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.42 = external hidden unnamed_addr constant [87 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 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.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #4

declare i32 @s2n_config_wall_clock(ptr noundef, ptr noundef) #3

declare i32 @s2n_array_num_elements(ptr noundef, ptr noundef) #3

declare i32 @s2n_array_get(ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_config_wipe_expired_ticket_crypto_keys(ptr noundef %0, i8 noundef signext %1) #5 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca [48 x i32], align 16
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca %struct.s2n_result, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.s2n_result, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.s2n_result, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.s2n_result, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i8 %1, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 192, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store ptr null, ptr %8, align 8, !tbaa !5
  %18 = load i8, ptr %5, align 1, !tbaa !9
  %19 = sext i8 %18 to i32
  %20 = icmp ne i32 %19, -1
  br i1 %20, label %21, label %29

21:                                               ; preds = %2
  %22 = load i8, ptr %5, align 1, !tbaa !9
  %23 = sext i8 %22 to i32
  %24 = load i32, ptr %6, align 4, !tbaa !10
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [48 x i32], ptr %7, i64 0, i64 %25
  store i32 %23, ptr %26, align 4, !tbaa !10
  %27 = load i32, ptr %6, align 4, !tbaa !10
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %6, align 4, !tbaa !10
  br label %142

29:                                               ; preds = %2
  store i64 0, ptr %9, align 8, !tbaa !12
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = call i32 @s2n_config_wall_clock(ptr noundef %31, ptr noundef %9)
  %33 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 %32, ptr %33, align 4
  %34 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  %35 = load i32, ptr %34, align 4
  %36 = call zeroext i1 @s2n_result_is_ok(i32 %35)
  br i1 %36, label %38, label %37

37:                                               ; preds = %30
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %174

38:                                               ; preds = %30
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.s2n_config, ptr %42, i32 0, i32 15
  %44 = load ptr, ptr %43, align 8, !tbaa !14
  %45 = icmp ne ptr %44, null
  br i1 %45, label %79, label %46

46:                                               ; preds = %41
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  %49 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %50 = getelementptr inbounds %struct.s2n_debug_info, ptr %49, i32 0, i32 0
  store ptr @.str.42, ptr %50, align 8, !tbaa !20
  %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
  %53 = load ptr, ptr %52, align 8, !tbaa !20
  %54 = getelementptr inbounds i8, ptr %53, i64 21
  %55 = call ptr @strrchr(ptr noundef %54, i32 noundef 47) #7
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %64

57:                                               ; preds = %48
  %58 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %59 = getelementptr inbounds %struct.s2n_debug_info, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !20
  %61 = getelementptr inbounds i8, ptr %60, i64 21
  %62 = call ptr @strrchr(ptr noundef %61, i32 noundef 47) #7
  %63 = getelementptr inbounds i8, ptr %62, i64 1
  br label %69

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

69:                                               ; preds = %64, %57
  %70 = phi ptr [ %63, %57 ], [ %68, %64 ]
  %71 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %72 = getelementptr inbounds %struct.s2n_debug_info, ptr %71, i32 0, i32 1
  store ptr %70, ptr %72, align 8, !tbaa !22
  %73 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %73, align 4, !tbaa !10
  %74 = call i32 @s2n_calculate_stacktrace()
  br label %75

75:                                               ; preds = %69
  br label %76

76:                                               ; preds = %75
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %174

77:                                               ; No predecessors!
  br label %78

78:                                               ; preds = %77
  br label %79

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

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  store i32 0, ptr %12, align 4, !tbaa !10
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.s2n_config, ptr %83, i32 0, i32 15
  %85 = load ptr, ptr %84, align 8, !tbaa !14
  %86 = call i32 @s2n_array_num_elements(ptr noundef %85, ptr noundef %12)
  %87 = getelementptr inbounds %struct.s2n_result, ptr %13, i32 0, i32 0
  store i32 %86, ptr %87, align 4
  %88 = getelementptr inbounds %struct.s2n_result, ptr %13, i32 0, i32 0
  %89 = load i32, ptr %88, align 4
  %90 = call zeroext i1 @s2n_result_is_ok(i32 %89)
  br i1 %90, label %92, label %91

91:                                               ; preds = %82
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %174

92:                                               ; preds = %82
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !10
  br label %95

95:                                               ; preds = %136, %94
  %96 = load i32, ptr %14, align 4, !tbaa !10
  %97 = load i32, ptr %12, align 4, !tbaa !10
  %98 = icmp ult i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  store i32 13, ptr %11, align 4
  br label %139

100:                                              ; preds = %95
  br label %101

101:                                              ; preds = %100
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.s2n_config, ptr %102, i32 0, i32 15
  %104 = load ptr, ptr %103, align 8, !tbaa !14
  %105 = load i32, ptr %14, align 4, !tbaa !10
  %106 = call i32 @s2n_array_get(ptr noundef %104, i32 noundef %105, ptr noundef %8)
  %107 = getelementptr inbounds %struct.s2n_result, ptr %15, i32 0, i32 0
  store i32 %106, ptr %107, align 4
  %108 = getelementptr inbounds %struct.s2n_result, ptr %15, i32 0, i32 0
  %109 = load i32, ptr %108, align 4
  %110 = call zeroext i1 @s2n_result_is_ok(i32 %109)
  br i1 %110, label %112, label %111

111:                                              ; preds = %101
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %139

112:                                              ; preds = %101
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  %115 = load i64, ptr %9, align 8, !tbaa !12
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.s2n_ticket_key, ptr %116, i32 0, i32 3
  %118 = load i64, ptr %117, align 8, !tbaa !23
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.s2n_config, ptr %119, i32 0, i32 16
  %121 = load i64, ptr %120, align 8, !tbaa !25
  %122 = add i64 %118, %121
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.s2n_config, ptr %123, i32 0, i32 17
  %125 = load i64, ptr %124, align 8, !tbaa !26
  %126 = add i64 %122, %125
  %127 = icmp uge i64 %115, %126
  br i1 %127, label %128, label %135

128:                                              ; preds = %114
  %129 = load i32, ptr %14, align 4, !tbaa !10
  %130 = load i32, ptr %6, align 4, !tbaa !10
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [48 x i32], ptr %7, i64 0, i64 %131
  store i32 %129, ptr %132, align 4, !tbaa !10
  %133 = load i32, ptr %6, align 4, !tbaa !10
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %6, align 4, !tbaa !10
  br label %135

135:                                              ; preds = %128, %114
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %14, align 4, !tbaa !10
  %138 = add i32 %137, 1
  store i32 %138, ptr %14, align 4, !tbaa !10
  br label %95, !llvm.loop !27

139:                                              ; preds = %111, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  %140 = load i32, ptr %11, align 4
  switch i32 %140, label %174 [
    i32 13, label %141
  ]

141:                                              ; preds = %139
  br label %142

142:                                              ; preds = %141, %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !10
  br label %143

143:                                              ; preds = %168, %142
  %144 = load i32, ptr %16, align 4, !tbaa !10
  %145 = load i32, ptr %6, align 4, !tbaa !10
  %146 = icmp slt i32 %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  store i32 18, ptr %11, align 4
  br label %171

148:                                              ; preds = %143
  br label %149

149:                                              ; preds = %148
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.s2n_config, ptr %150, i32 0, i32 15
  %152 = load ptr, ptr %151, align 8, !tbaa !14
  %153 = load i32, ptr %16, align 4, !tbaa !10
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [48 x i32], ptr %7, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !10
  %157 = load i32, ptr %16, align 4, !tbaa !10
  %158 = sub nsw i32 %156, %157
  %159 = call i32 @s2n_array_remove(ptr noundef %152, i32 noundef %158)
  %160 = getelementptr inbounds %struct.s2n_result, ptr %17, i32 0, i32 0
  store i32 %159, ptr %160, align 4
  %161 = getelementptr inbounds %struct.s2n_result, ptr %17, i32 0, i32 0
  %162 = load i32, ptr %161, align 4
  %163 = call zeroext i1 @s2n_result_is_ok(i32 %162)
  br i1 %163, label %165, label %164

164:                                              ; preds = %149
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %171

165:                                              ; preds = %149
  br label %166

166:                                              ; preds = %165
  br label %167

167:                                              ; preds = %166
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %16, align 4, !tbaa !10
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %16, align 4, !tbaa !10
  br label %143, !llvm.loop !29

171:                                              ; preds = %164, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  %172 = load i32, ptr %11, align 4
  switch i32 %172, label %174 [
    i32 18, label %173
  ]

173:                                              ; preds = %171
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %174

174:                                              ; preds = %173, %171, %139, %91, %76, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 192, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %175 = load i32, ptr %3, align 4
  ret i32 %175
}

declare i32 @s2n_array_remove(ptr noundef, i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !6, i64 152}
!15 = !{!"s2n_config", !11, i64 0, !11, i64 0, !11, i64 0, !11, i64 0, !11, i64 0, !11, i64 0, !11, i64 0, !11, i64 0, !11, i64 1, !11, i64 1, !11, i64 1, !11, i64 1, !11, i64 1, !11, i64 1, !11, i64 1, !11, i64 1, !11, i64 2, !11, i64 2, !11, i64 2, !11, i64 2, !6, i64 8, !6, i64 16, !16, i64 24, !17, i64 56, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !11, i64 128, !11, i64 132, !6, i64 136, !13, i64 144, !6, i64 152, !13, i64 160, !13, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !11, i64 224, !7, i64 228, !11, i64 232, !11, i64 236, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !18, i64 304, !19, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !11, i64 392, !11, i64 396, !11, i64 400, !6, i64 408, !11, i64 416, !11, i64 420, !6, i64 424, !6, i64 432, !11, i64 440, !17, i64 448}
!16 = !{!"certs_by_type", !7, i64 0}
!17 = !{!"s2n_blob", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!18 = !{!"s2n_x509_trust_store", !6, i64 0, !11, i64 8}
!19 = !{!"short", !7, i64 0}
!20 = !{!21, !6, i64 0}
!21 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!22 = !{!21, !6, i64 8}
!23 = !{!24, !13, i64 64}
!24 = !{!"s2n_ticket_key", !7, i64 0, !7, i64 16, !7, i64 48, !13, i64 64}
!25 = !{!15, !13, i64 160}
!26 = !{!15, !13, i64 168}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}


; 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_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.42 = external hidden unnamed_addr constant [87 x i8], align 1

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

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #4

declare i32 @s2n_config_wall_clock(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @s2n_array_num_elements(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @s2n_array_get(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_config_wipe_expired_ticket_crypto_keys(ptr noundef %0, i8 noundef signext %1) local_unnamed_addr #5 {
  %3 = alloca [48 x i32], align 16
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store ptr null, ptr %4, align 8, !tbaa !5
  %.not = icmp eq i8 %1, -1
  br i1 %.not, label %8, label %.critedge.thread

.critedge.thread:                                 ; preds = %2
  %7 = sext i8 %1 to i32
  store i32 %7, ptr %3, align 16, !tbaa !9
  br label %.lr.ph48

8:                                                ; preds = %2
  store i64 0, ptr %5, align 8, !tbaa !11
  %9 = call i32 @s2n_config_wall_clock(ptr noundef %0, ptr noundef nonnull %5) #6
  %10 = call zeroext i1 @s2n_result_is_ok(i32 %9)
  br i1 %10, label %11, label %.loopexit

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %0, i64 152
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %.not36 = icmp eq ptr %13, null
  br i1 %.not36, label %14, label %22

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

22:                                               ; preds = %11
  store i32 0, ptr %6, align 4, !tbaa !9
  %23 = call i32 @s2n_array_num_elements(ptr noundef nonnull %13, ptr noundef nonnull %6) #6
  %24 = call zeroext i1 @s2n_result_is_ok(i32 %23)
  br i1 %24, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %22
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %.not3842.not = icmp eq i32 %25, 0
  br i1 %.not3842.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %26 = getelementptr inbounds i8, ptr %0, i64 160
  %27 = getelementptr inbounds i8, ptr %0, i64 168
  br label %28

28:                                               ; preds = %.lr.ph, %45
  %.02944 = phi i32 [ 0, %.lr.ph ], [ %.130, %45 ]
  %.03243 = phi i32 [ 0, %.lr.ph ], [ %46, %45 ]
  %29 = load ptr, ptr %12, align 8, !tbaa !13
  %30 = call i32 @s2n_array_get(ptr noundef %29, i32 noundef %.03243, ptr noundef nonnull %4) #6
  %31 = call zeroext i1 @s2n_result_is_ok(i32 %30)
  br i1 %31, label %32, label %.loopexit

32:                                               ; preds = %28
  %33 = load i64, ptr %5, align 8, !tbaa !11
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 64
  %36 = load i64, ptr %35, align 8, !tbaa !22
  %37 = load i64, ptr %26, align 8, !tbaa !24
  %38 = add i64 %37, %36
  %39 = load i64, ptr %27, align 8, !tbaa !25
  %40 = add i64 %38, %39
  %.not39 = icmp ult i64 %33, %40
  br i1 %.not39, label %45, label %41

41:                                               ; preds = %32
  %42 = sext i32 %.02944 to i64
  %43 = getelementptr inbounds [48 x i32], ptr %3, i64 0, i64 %42
  store i32 %.03243, ptr %43, align 4, !tbaa !9
  %44 = add nsw i32 %.02944, 1
  br label %45

45:                                               ; preds = %32, %41
  %.130 = phi i32 [ %44, %41 ], [ %.02944, %32 ]
  %46 = add nuw i32 %.03243, 1
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %.not38 = icmp ult i32 %46, %47
  br i1 %.not38, label %28, label %.critedge, !llvm.loop !26

.critedge:                                        ; preds = %45
  %.not4045 = icmp sgt i32 %.130, 0
  br i1 %.not4045, label %.lr.ph48, label %.loopexit

.lr.ph48:                                         ; preds = %.critedge.thread, %.critedge
  %.23154 = phi i32 [ 1, %.critedge.thread ], [ %.130, %.critedge ]
  %48 = getelementptr inbounds i8, ptr %0, i64 152
  %49 = zext nneg i32 %.23154 to i64
  %wide.trip.count = zext nneg i32 %.23154 to i64
  %50 = load ptr, ptr %48, align 8, !tbaa !13
  %51 = load i32, ptr %3, align 16, !tbaa !9
  %52 = call i32 @s2n_array_remove(ptr noundef %50, i32 noundef %51) #6
  %53 = call zeroext i1 @s2n_result_is_ok(i32 %52)
  br i1 %53, label %.lr.ph59, label %.loopexit

.lr.ph59:                                         ; preds = %.lr.ph48, %54
  %indvars.iv58 = phi i64 [ %indvars.iv.next, %54 ], [ 0, %.lr.ph48 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv58, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.loopexit.loopexit, label %54, !llvm.loop !28

54:                                               ; preds = %.lr.ph59
  %55 = load ptr, ptr %48, align 8, !tbaa !13
  %56 = getelementptr inbounds [48 x i32], ptr %3, i64 0, i64 %indvars.iv.next
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = trunc nuw nsw i64 %indvars.iv.next to i32
  %59 = sub nsw i32 %57, %58
  %60 = call i32 @s2n_array_remove(ptr noundef %55, i32 noundef %59) #6
  %61 = call zeroext i1 @s2n_result_is_ok(i32 %60)
  br i1 %61, label %.lr.ph59, label %._crit_edge.loopexit.loopexit, !llvm.loop !28

._crit_edge.loopexit.loopexit:                    ; preds = %54, %.lr.ph59
  %.not40.le = icmp ult i64 %indvars.iv.next, %49
  %62 = sext i1 %.not40.le to i32
  br label %.loopexit

.loopexit:                                        ; preds = %28, %.lr.ph48, %._crit_edge.loopexit.loopexit, %.preheader, %.critedge, %22, %8, %14
  %.3 = phi i32 [ -1, %14 ], [ -1, %8 ], [ -1, %22 ], [ 0, %.critedge ], [ 0, %.preheader ], [ -1, %.lr.ph48 ], [ %62, %._crit_edge.loopexit.loopexit ], [ -1, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %3) #6
  ret i32 %.3
}

declare i32 @s2n_array_remove(ptr noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind 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 #6 = { nounwind }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 152}
!14 = !{!"s2n_config", !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !6, i64 8, !6, i64 16, !15, i64 24, !16, i64 56, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !10, i64 128, !10, i64 132, !6, i64 136, !12, i64 144, !6, i64 152, !12, i64 160, !12, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !10, i64 224, !7, i64 228, !10, i64 232, !10, i64 236, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !17, i64 304, !18, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !10, i64 392, !10, i64 396, !10, i64 400, !6, i64 408, !10, i64 416, !10, i64 420, !6, i64 424, !6, i64 432, !10, i64 440, !16, i64 448}
!15 = !{!"certs_by_type", !7, i64 0}
!16 = !{!"s2n_blob", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!17 = !{!"s2n_x509_trust_store", !6, i64 0, !10, i64 8}
!18 = !{!"short", !7, i64 0}
!19 = !{!20, !6, i64 0}
!20 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!21 = !{!20, !6, i64 8}
!22 = !{!23, !12, i64 64}
!23 = !{!"s2n_ticket_key", !7, i64 0, !7, i64 16, !7, i64 48, !12, i64 64}
!24 = !{!14, !12, i64 160}
!25 = !{!14, !12, i64 168}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}


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