; LLVM IR from aws/s2n-tls :: tests/unit (s2n_kem_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_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_kem_params = type { ptr, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_blob, i8 }

@TEST_PUBLIC_KEY = external dso_local constant [2 x i8], align 1
@TEST_PRIVATE_KEY = external dso_local constant [3 x i8], align 1
@TEST_SHARED_SECRET = external dso_local constant [4 x i8], align 1
@.str = external hidden unnamed_addr constant [95 x i8], align 1
@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [95 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @alloc_test_kem_params(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %struct.s2n_stuffer, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.s2n_stuffer, align 8
  %7 = alloca %struct.s2n_stuffer, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %1
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.s2n_kem_params, ptr %9, i32 0, i32 2
  %11 = call i32 @s2n_alloc(ptr noundef %10, i32 noundef 3)
  %12 = icmp sgt i32 %11, -1
  br i1 %12, label %14, label %13

13:                                               ; preds = %8
  store i32 -1, ptr %2, align 4
  br label %211

14:                                               ; preds = %8
  br label %15

15:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 40, ptr %4) #6
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 40, i1 false)
  br label %16

16:                                               ; preds = %15
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.s2n_kem_params, ptr %17, i32 0, i32 2
  %19 = call i32 @s2n_stuffer_init(ptr noundef %4, ptr noundef %18)
  %20 = icmp sgt i32 %19, -1
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %210

22:                                               ; preds = %16
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  %26 = call i32 @s2n_stuffer_write_bytes(ptr noundef %4, ptr noundef @TEST_PRIVATE_KEY, i32 noundef 3)
  %27 = icmp sgt i32 %26, -1
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %210

29:                                               ; preds = %25
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.s2n_kem_params, ptr %33, i32 0, i32 1
  %35 = call i32 @s2n_alloc(ptr noundef %34, i32 noundef 2)
  %36 = icmp sgt i32 %35, -1
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %210

38:                                               ; preds = %32
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 40, ptr %6) #6
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 40, i1 false)
  br label %41

41:                                               ; preds = %40
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.s2n_kem_params, ptr %42, i32 0, i32 1
  %44 = call i32 @s2n_stuffer_init(ptr noundef %6, ptr noundef %43)
  %45 = icmp sgt i32 %44, -1
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %209

47:                                               ; preds = %41
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  %51 = call i32 @s2n_stuffer_write_bytes(ptr noundef %6, ptr noundef @TEST_PUBLIC_KEY, i32 noundef 2)
  %52 = icmp sgt i32 %51, -1
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %209

54:                                               ; preds = %50
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.s2n_kem_params, ptr %58, i32 0, i32 3
  %60 = call i32 @s2n_alloc(ptr noundef %59, i32 noundef 4)
  %61 = icmp sgt i32 %60, -1
  br i1 %61, label %63, label %62

62:                                               ; preds = %57
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %209

63:                                               ; preds = %57
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #6
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 40, i1 false)
  br label %66

66:                                               ; preds = %65
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.s2n_kem_params, ptr %67, i32 0, i32 3
  %69 = call i32 @s2n_stuffer_init(ptr noundef %7, ptr noundef %68)
  %70 = icmp sgt i32 %69, -1
  br i1 %70, label %72, label %71

71:                                               ; preds = %66
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %208

72:                                               ; preds = %66
  br label %73

73:                                               ; preds = %72
  br label %74

74:                                               ; preds = %73
  br label %75

75:                                               ; preds = %74
  %76 = call i32 @s2n_stuffer_write_bytes(ptr noundef %7, ptr noundef @TEST_SHARED_SECRET, i32 noundef 4)
  %77 = icmp sgt i32 %76, -1
  br i1 %77, label %79, label %78

78:                                               ; preds = %75
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %208

79:                                               ; preds = %75
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.s2n_kem_params, ptr %83, i32 0, i32 2
  %85 = getelementptr inbounds %struct.s2n_blob, ptr %84, i32 0, i32 2
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = icmp ne i32 0, %86
  br i1 %87, label %121, label %88

88:                                               ; preds = %82
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  %91 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %92 = getelementptr inbounds %struct.s2n_debug_info, ptr %91, i32 0, i32 0
  store ptr @.str, ptr %92, align 8, !tbaa !14
  %93 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %94 = getelementptr inbounds %struct.s2n_debug_info, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !14
  %96 = getelementptr inbounds i8, ptr %95, i64 21
  %97 = call ptr @strrchr(ptr noundef %96, i32 noundef 47) #7
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %106

99:                                               ; preds = %90
  %100 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %101 = getelementptr inbounds %struct.s2n_debug_info, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !14
  %103 = getelementptr inbounds i8, ptr %102, i64 21
  %104 = call ptr @strrchr(ptr noundef %103, i32 noundef 47) #7
  %105 = getelementptr inbounds i8, ptr %104, i64 1
  br label %111

106:                                              ; preds = %90
  %107 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %108 = getelementptr inbounds %struct.s2n_debug_info, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !14
  %110 = getelementptr inbounds i8, ptr %109, i64 21
  br label %111

111:                                              ; preds = %106, %99
  %112 = phi ptr [ %105, %99 ], [ %110, %106 ]
  %113 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %114 = getelementptr inbounds %struct.s2n_debug_info, ptr %113, i32 0, i32 1
  store ptr %112, ptr %114, align 8, !tbaa !16
  %115 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %115, align 4, !tbaa !17
  %116 = call i32 @s2n_calculate_stacktrace()
  br label %117

117:                                              ; preds = %111
  br label %118

118:                                              ; preds = %117
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %208

119:                                              ; No predecessors!
  br label %120

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120, %82
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.s2n_kem_params, ptr %125, i32 0, i32 1
  %127 = getelementptr inbounds %struct.s2n_blob, ptr %126, i32 0, i32 2
  %128 = load i32, ptr %127, align 4, !tbaa !18
  %129 = icmp ne i32 0, %128
  br i1 %129, label %163, label %130

130:                                              ; preds = %124
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  %133 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %134 = getelementptr inbounds %struct.s2n_debug_info, ptr %133, i32 0, i32 0
  store ptr @.str.1, ptr %134, align 8, !tbaa !14
  %135 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %136 = getelementptr inbounds %struct.s2n_debug_info, ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8, !tbaa !14
  %138 = getelementptr inbounds i8, ptr %137, i64 21
  %139 = call ptr @strrchr(ptr noundef %138, i32 noundef 47) #7
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %148

141:                                              ; preds = %132
  %142 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %143 = getelementptr inbounds %struct.s2n_debug_info, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !14
  %145 = getelementptr inbounds i8, ptr %144, i64 21
  %146 = call ptr @strrchr(ptr noundef %145, i32 noundef 47) #7
  %147 = getelementptr inbounds i8, ptr %146, i64 1
  br label %153

148:                                              ; preds = %132
  %149 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %150 = getelementptr inbounds %struct.s2n_debug_info, ptr %149, i32 0, i32 0
  %151 = load ptr, ptr %150, align 8, !tbaa !14
  %152 = getelementptr inbounds i8, ptr %151, i64 21
  br label %153

153:                                              ; preds = %148, %141
  %154 = phi ptr [ %147, %141 ], [ %152, %148 ]
  %155 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %156 = getelementptr inbounds %struct.s2n_debug_info, ptr %155, i32 0, i32 1
  store ptr %154, ptr %156, align 8, !tbaa !16
  %157 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %157, align 4, !tbaa !17
  %158 = call i32 @s2n_calculate_stacktrace()
  br label %159

159:                                              ; preds = %153
  br label %160

160:                                              ; preds = %159
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %208

161:                                              ; No predecessors!
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162, %124
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.s2n_kem_params, ptr %167, i32 0, i32 3
  %169 = getelementptr inbounds %struct.s2n_blob, ptr %168, i32 0, i32 2
  %170 = load i32, ptr %169, align 4, !tbaa !19
  %171 = icmp ne i32 0, %170
  br i1 %171, label %205, label %172

172:                                              ; preds = %166
  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.2, ptr %176, align 8, !tbaa !14
  %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 !14
  %180 = getelementptr inbounds i8, ptr %179, i64 21
  %181 = call ptr @strrchr(ptr noundef %180, i32 noundef 47) #7
  %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 !14
  %187 = getelementptr inbounds i8, ptr %186, i64 21
  %188 = call ptr @strrchr(ptr noundef %187, i32 noundef 47) #7
  %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 !14
  %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 !16
  %199 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %199, align 4, !tbaa !17
  %200 = call i32 @s2n_calculate_stacktrace()
  br label %201

201:                                              ; preds = %195
  br label %202

202:                                              ; preds = %201
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %208

203:                                              ; No predecessors!
  br label %204

204:                                              ; preds = %203
  br label %205

205:                                              ; preds = %204, %166
  br label %206

206:                                              ; preds = %205
  br label %207

207:                                              ; preds = %206
  store i32 0, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %208

208:                                              ; preds = %207, %202, %160, %118, %78, %71
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #6
  br label %209

209:                                              ; preds = %208, %62, %53, %46
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #6
  br label %210

210:                                              ; preds = %209, %37, %28, %21
  call void @llvm.lifetime.end.p0(i64 40, ptr %4) #6
  br label %211

211:                                              ; preds = %210, %13
  %212 = load i32, ptr %2, align 4
  ret i32 %212
}

declare i32 @s2n_alloc(ptr noundef, i32 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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_stuffer_init(ptr noundef, ptr noundef) #1

declare i32 @s2n_stuffer_write_bytes(ptr noundef, ptr noundef, i32 noundef) #1

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

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

declare i32 @s2n_calculate_stacktrace() #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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, !12, i64 44}
!10 = !{!"s2n_kem_params", !6, i64 0, !11, i64 8, !11, i64 32, !11, i64 56, !13, i64 80}
!11 = !{!"s2n_blob", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!16 = !{!15, !6, i64 8}
!17 = !{!12, !12, i64 0}
!18 = !{!10, !12, i64 20}
!19 = !{!10, !12, i64 68}


; 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 }
%struct.s2n_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }

@TEST_PUBLIC_KEY = external dso_local constant [2 x i8], align 1
@TEST_PRIVATE_KEY = external dso_local constant [3 x i8], align 1
@TEST_SHARED_SECRET = external dso_local constant [4 x i8], align 1
@.str = external hidden unnamed_addr constant [95 x i8], align 1
@_s2n_debug_info = external thread_local local_unnamed_addr global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [95 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @alloc_test_kem_params(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca %struct.s2n_stuffer, align 8
  %3 = alloca %struct.s2n_stuffer, align 8
  %4 = alloca %struct.s2n_stuffer, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = tail call i32 @s2n_alloc(ptr noundef nonnull %5, i32 noundef 3) #6
  %7 = icmp sgt i32 %6, -1
  br i1 %7, label %8, label %53

8:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %2, i8 0, i64 40, i1 false)
  %9 = call i32 @s2n_stuffer_init(ptr noundef nonnull %2, ptr noundef nonnull %5) #6
  %10 = icmp sgt i32 %9, -1
  br i1 %10, label %11, label %52

11:                                               ; preds = %8
  %12 = call i32 @s2n_stuffer_write_bytes(ptr noundef nonnull %2, ptr noundef nonnull @TEST_PRIVATE_KEY, i32 noundef 3) #6
  %13 = icmp sgt i32 %12, -1
  br i1 %13, label %14, label %52

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = call i32 @s2n_alloc(ptr noundef nonnull %15, i32 noundef 2) #6
  %17 = icmp sgt i32 %16, -1
  br i1 %17, label %18, label %52

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %3, i8 0, i64 40, i1 false)
  %19 = call i32 @s2n_stuffer_init(ptr noundef nonnull %3, ptr noundef nonnull %15) #6
  %20 = icmp sgt i32 %19, -1
  br i1 %20, label %21, label %51

21:                                               ; preds = %18
  %22 = call i32 @s2n_stuffer_write_bytes(ptr noundef nonnull %3, ptr noundef nonnull @TEST_PUBLIC_KEY, i32 noundef 2) #6
  %23 = icmp sgt i32 %22, -1
  br i1 %23, label %24, label %51

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %0, i64 56
  %26 = call i32 @s2n_alloc(ptr noundef nonnull %25, i32 noundef 4) #6
  %27 = icmp sgt i32 %26, -1
  br i1 %27, label %28, label %51

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %4, i8 0, i64 40, i1 false)
  %29 = call i32 @s2n_stuffer_init(ptr noundef nonnull %4, ptr noundef nonnull %25) #6
  %30 = icmp sgt i32 %29, -1
  br i1 %30, label %31, label %50

31:                                               ; preds = %28
  %32 = call i32 @s2n_stuffer_write_bytes(ptr noundef nonnull %4, ptr noundef nonnull @TEST_SHARED_SECRET, i32 noundef 4) #6
  %33 = icmp sgt i32 %32, -1
  br i1 %33, label %34, label %50

34:                                               ; preds = %31
  %35 = getelementptr inbounds i8, ptr %0, i64 44
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %.not = icmp eq i32 %36, 0
  br i1 %.not, label %.sink.split, label %37

37:                                               ; preds = %34
  %38 = getelementptr inbounds i8, ptr %0, i64 20
  %39 = load i32, ptr %38, align 4, !tbaa !13
  %.not13 = icmp eq i32 %39, 0
  br i1 %.not13, label %.sink.split, label %40

40:                                               ; preds = %37
  %41 = getelementptr inbounds i8, ptr %0, i64 68
  %42 = load i32, ptr %41, align 4, !tbaa !14
  %.not15 = icmp eq i32 %42, 0
  br i1 %.not15, label %.sink.split, label %50

.sink.split:                                      ; preds = %40, %37, %34
  %.str.2.sink = phi ptr [ @.str, %34 ], [ @.str.1, %37 ], [ @.str.2, %40 ]
  %.sink22 = phi ptr [ getelementptr inbounds (i8, ptr @.str, i64 21), %34 ], [ getelementptr inbounds (i8, ptr @.str.1, i64 21), %37 ], [ getelementptr inbounds (i8, ptr @.str.2, i64 21), %40 ]
  %43 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.2.sink, ptr %43, align 8, !tbaa !15
  %44 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink22, i32 noundef 47) #7
  %.not16 = icmp eq ptr %44, null
  %45 = getelementptr inbounds i8, ptr %44, i64 1
  %46 = select i1 %.not16, ptr %.sink22, ptr %45
  %47 = getelementptr inbounds i8, ptr %43, i64 8
  store ptr %46, ptr %47, align 8, !tbaa !17
  %48 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %48, align 4, !tbaa !18
  %49 = call i32 @s2n_calculate_stacktrace() #6
  br label %50

50:                                               ; preds = %.sink.split, %40, %31, %28
  %.0 = phi i32 [ -1, %28 ], [ -1, %31 ], [ 0, %40 ], [ -1, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  br label %51

51:                                               ; preds = %24, %21, %18, %50
  %.1 = phi i32 [ %.0, %50 ], [ -1, %18 ], [ -1, %21 ], [ -1, %24 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #6
  br label %52

52:                                               ; preds = %14, %11, %8, %51
  %.2 = phi i32 [ %.1, %51 ], [ -1, %8 ], [ -1, %11 ], [ -1, %14 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #6
  br label %53

53:                                               ; preds = %1, %52
  %.3 = phi i32 [ %.2, %52 ], [ -1, %1 ]
  ret i32 %.3
}

declare i32 @s2n_alloc(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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_stuffer_init(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @s2n_stuffer_write_bytes(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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, !11, i64 44}
!6 = !{!"s2n_kem_params", !7, i64 0, !10, i64 8, !10, i64 32, !10, i64 56, !12, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"s2n_blob", !7, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!6, !11, i64 20}
!14 = !{!6, !11, i64 68}
!15 = !{!16, !7, i64 0}
!16 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!17 = !{!16, !7, i64 8}
!18 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass