; 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.43 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [88 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_array_num_elements(ptr noundef, ptr noundef) #3

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

declare zeroext i1 @s2n_constant_time_equals(ptr noundef, ptr noundef, i32 noundef) #3

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

13:                                               ; preds = %2
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.s2n_config, ptr %14, i32 0, i32 15
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = call i32 @s2n_array_num_elements(ptr noundef %16, ptr noundef %6)
  %18 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  store i32 %17, ptr %18, align 4
  %19 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  %20 = load i32, ptr %19, align 4
  %21 = call zeroext i1 @s2n_result_is_ok(i32 %20)
  br i1 %21, label %23, label %22

22:                                               ; preds = %13
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %158

23:                                               ; preds = %13
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %137, %25
  %27 = load i32, ptr %9, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = icmp ult i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 4, ptr %8, align 4
  br label %140

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr null, ptr %10, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %31
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.s2n_config, ptr %33, i32 0, i32 15
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = call i32 @s2n_array_get(ptr noundef %35, i32 noundef %36, ptr noundef %10)
  %38 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 %37, ptr %38, align 4
  %39 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %40 = load i32, ptr %39, align 4
  %41 = call zeroext i1 @s2n_result_is_ok(i32 %40)
  br i1 %41, label %43, label %42

42:                                               ; preds = %32
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %134

43:                                               ; preds = %32
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.s2n_ticket_key, ptr %47, i32 0, i32 0
  %49 = getelementptr inbounds [16 x i8], ptr %48, i64 0, i64 0
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.s2n_ticket_key, ptr %50, i32 0, i32 0
  %52 = getelementptr inbounds [16 x i8], ptr %51, i64 0, i64 0
  %53 = call zeroext i1 @s2n_constant_time_equals(ptr noundef %49, ptr noundef %52, i32 noundef 16)
  br i1 %53, label %54, label %87

54:                                               ; preds = %46
  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.43, ptr %58, align 8, !tbaa !18
  %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 !18
  %62 = getelementptr inbounds i8, ptr %61, i64 21
  %63 = call ptr @strrchr(ptr noundef %62, i32 noundef 47) #7
  %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 !18
  %69 = getelementptr inbounds i8, ptr %68, i64 21
  %70 = call ptr @strrchr(ptr noundef %69, i32 noundef 47) #7
  %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 !18
  %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 !20
  %81 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762081, ptr %81, align 4, !tbaa !9
  %82 = call i32 @s2n_calculate_stacktrace()
  br label %83

83:                                               ; preds = %77
  br label %84

84:                                               ; preds = %83
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %134

85:                                               ; No predecessors!
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86, %46
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.s2n_ticket_key, ptr %91, i32 0, i32 1
  %93 = getelementptr inbounds [32 x i8], ptr %92, i64 0, i64 0
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.s2n_ticket_key, ptr %94, i32 0, i32 1
  %96 = getelementptr inbounds [32 x i8], ptr %95, i64 0, i64 0
  %97 = call zeroext i1 @s2n_constant_time_equals(ptr noundef %93, ptr noundef %96, i32 noundef 32)
  br i1 %97, label %98, label %131

98:                                               ; preds = %90
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  %101 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %102 = getelementptr inbounds %struct.s2n_debug_info, ptr %101, i32 0, i32 0
  store ptr @.str.44, ptr %102, align 8, !tbaa !18
  %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 !18
  %106 = getelementptr inbounds i8, ptr %105, i64 21
  %107 = call ptr @strrchr(ptr noundef %106, i32 noundef 47) #7
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %116

109:                                              ; preds = %100
  %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 !18
  %113 = getelementptr inbounds i8, ptr %112, i64 21
  %114 = call ptr @strrchr(ptr noundef %113, i32 noundef 47) #7
  %115 = getelementptr inbounds i8, ptr %114, i64 1
  br label %121

116:                                              ; preds = %100
  %117 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %118 = getelementptr inbounds %struct.s2n_debug_info, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !18
  %120 = getelementptr inbounds i8, ptr %119, i64 21
  br label %121

121:                                              ; preds = %116, %109
  %122 = phi ptr [ %115, %109 ], [ %120, %116 ]
  %123 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %124 = getelementptr inbounds %struct.s2n_debug_info, ptr %123, i32 0, i32 1
  store ptr %122, ptr %124, align 8, !tbaa !20
  %125 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762082, ptr %125, align 4, !tbaa !9
  %126 = call i32 @s2n_calculate_stacktrace()
  br label %127

127:                                              ; preds = %121
  br label %128

128:                                              ; preds = %127
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %134

129:                                              ; No predecessors!
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130, %90
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  store i32 0, ptr %8, align 4
  br label %134

134:                                              ; preds = %133, %128, %84, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %135 = load i32, ptr %8, align 4
  switch i32 %135, label %140 [
    i32 0, label %136
  ]

136:                                              ; preds = %134
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %9, align 4, !tbaa !9
  %139 = add i32 %138, 1
  store i32 %139, ptr %9, align 4, !tbaa !9
  br label %26, !llvm.loop !21

140:                                              ; preds = %134, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  %141 = load i32, ptr %8, align 4
  switch i32 %141, label %158 [
    i32 4, label %142
  ]

142:                                              ; preds = %140
  br label %143

143:                                              ; preds = %142
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.s2n_config, ptr %144, i32 0, i32 15
  %146 = load ptr, ptr %145, align 8, !tbaa !11
  %147 = load i32, ptr %6, align 4, !tbaa !9
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = call i32 @s2n_array_insert_and_copy(ptr noundef %146, i32 noundef %147, ptr noundef %148)
  %150 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  store i32 %149, ptr %150, align 4
  %151 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  %152 = load i32, ptr %151, align 4
  %153 = call zeroext i1 @s2n_result_is_ok(i32 %152)
  br i1 %153, label %155, label %154

154:                                              ; preds = %143
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %158

155:                                              ; preds = %143
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %158

158:                                              ; preds = %157, %154, %140, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %159 = load i32, ptr %3, align 4
  ret i32 %159
}

declare i32 @s2n_array_insert_and_copy(ptr noundef, i32 noundef, ptr 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 152}
!12 = !{!"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, !13, i64 24, !14, 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, !15, i64 144, !6, i64 152, !15, i64 160, !15, 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, !16, i64 304, !17, 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, !14, i64 448}
!13 = !{!"certs_by_type", !7, i64 0}
!14 = !{!"s2n_blob", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!"s2n_x509_trust_store", !6, i64 0, !10, i64 8}
!17 = !{!"short", !7, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!20 = !{!19, !6, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"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_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.43 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [88 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_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

declare zeroext i1 @s2n_constant_time_equals(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_config_store_ticket_key(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #5 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 152
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %7 = call i32 @s2n_array_num_elements(ptr noundef %6, ptr noundef nonnull %3) #6
  %8 = call zeroext i1 @s2n_result_is_ok(i32 %7)
  br i1 %8, label %.preheader, label %36

.preheader:                                       ; preds = %2
  %9 = load i32, ptr %3, align 4, !tbaa !5
  %.not2023.not = icmp eq i32 %9, 0
  br i1 %.not2023.not, label %.critedge22, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %10 = getelementptr inbounds i8, ptr %1, i64 16
  br label %11

11:                                               ; preds = %.lr.ph, %22
  %.01624 = phi i32 [ 0, %.lr.ph ], [ %23, %22 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store ptr null, ptr %4, align 8, !tbaa !17
  %12 = load ptr, ptr %5, align 8, !tbaa !9
  %13 = call i32 @s2n_array_get(ptr noundef %12, i32 noundef %.01624, ptr noundef nonnull %4) #6
  %14 = call zeroext i1 @s2n_result_is_ok(i32 %13)
  br i1 %14, label %15, label %.critedge

15:                                               ; preds = %11
  %16 = load ptr, ptr %4, align 8, !tbaa !17
  %17 = call zeroext i1 @s2n_constant_time_equals(ptr noundef %1, ptr noundef %16, i32 noundef 16) #6
  br i1 %17, label %.critedge.sink.split, label %18

18:                                               ; preds = %15
  %19 = load ptr, ptr %4, align 8, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %21 = call zeroext i1 @s2n_constant_time_equals(ptr noundef nonnull %10, ptr noundef nonnull %20, i32 noundef 32) #6
  br i1 %21, label %.critedge.sink.split, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %23 = add nuw i32 %.01624, 1
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %.not20 = icmp ult i32 %23, %24
  br i1 %.not20, label %11, label %.critedge22, !llvm.loop !18

.critedge.sink.split:                             ; preds = %18, %15
  %.str.44.sink = phi ptr [ @.str.43, %15 ], [ @.str.44, %18 ]
  %.sink33 = phi ptr [ getelementptr inbounds (i8, ptr @.str.43, i64 21), %15 ], [ getelementptr inbounds (i8, ptr @.str.44, i64 21), %18 ]
  %.sink = phi i32 [ 469762081, %15 ], [ 469762082, %18 ]
  %25 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.44.sink, ptr %25, align 8, !tbaa !20
  %26 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink33, i32 noundef 47) #7
  %.not = icmp eq ptr %26, null
  %27 = getelementptr inbounds i8, ptr %26, i64 1
  %28 = select i1 %.not, ptr %.sink33, ptr %27
  %29 = getelementptr inbounds i8, ptr %25, i64 8
  store ptr %28, ptr %29, align 8, !tbaa !22
  %30 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 %.sink, ptr %30, align 4, !tbaa !5
  %31 = call i32 @s2n_calculate_stacktrace() #6
  br label %.critedge

.critedge:                                        ; preds = %11, %.critedge.sink.split
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %36

.critedge22:                                      ; preds = %22, %.preheader
  %32 = phi i32 [ 0, %.preheader ], [ %24, %22 ]
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = call i32 @s2n_array_insert_and_copy(ptr noundef %33, i32 noundef %32, ptr noundef %1) #6
  %35 = call zeroext i1 @s2n_result_is_ok(i32 %34)
  %not. = xor i1 %35, true
  %. = sext i1 %not. to i32
  br label %36

36:                                               ; preds = %.critedge, %.critedge22, %2
  %.3 = phi i32 [ -1, %.critedge ], [ -1, %2 ], [ %., %.critedge22 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  ret i32 %.3
}

declare i32 @s2n_array_insert_and_copy(ptr noundef, i32 noundef, ptr 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 152}
!10 = !{!"s2n_config", !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 0, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 1, !6, i64 2, !6, i64 2, !6, i64 2, !6, i64 2, !11, i64 8, !11, i64 16, !12, i64 24, !13, i64 56, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !6, i64 128, !6, i64 132, !11, i64 136, !14, i64 144, !11, i64 152, !14, i64 160, !14, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !6, i64 224, !7, i64 228, !6, i64 232, !6, i64 236, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !11, i64 288, !7, i64 296, !7, i64 297, !15, i64 304, !16, i64 320, !11, i64 328, !11, i64 336, !11, i64 344, !11, i64 352, !11, i64 360, !11, i64 368, !11, i64 376, !11, i64 384, !6, i64 392, !6, i64 396, !6, i64 400, !11, i64 408, !6, i64 416, !6, i64 420, !11, i64 424, !11, i64 432, !6, i64 440, !13, i64 448}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"certs_by_type", !7, i64 0}
!13 = !{!"s2n_blob", !11, i64 0, !6, i64 8, !6, i64 12, !6, i64 16}
!14 = !{!"long", !7, i64 0}
!15 = !{!"s2n_x509_trust_store", !11, i64 0, !6, i64 8}
!16 = !{!"short", !7, i64 0}
!17 = !{!11, !11, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21, !11, i64 0}
!21 = !{!"s2n_debug_info", !11, i64 0, !11, i64 8}
!22 = !{!21, !11, i64 8}


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