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

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

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.9 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [95 x i8], align 1

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

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

declare i32 @s2n_calculate_stacktrace() #2

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

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

declare i32 @s2n_free(ptr noundef) #2

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

declare i32 @s2n_blob_zero(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local ptr @s2n_cert_chain_and_key_new() #5 {
  %1 = alloca ptr, align 8
  %2 = alloca %struct.s2n_blob, align 8
  %3 = alloca i32, align 4
  %4 = alloca %struct.s2n_blob, align 8
  %5 = alloca %struct.s2n_blob, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.s2n_result, align 4
  %10 = alloca %struct.s2n_result, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #6
  call void @llvm.memset.p0.i64(ptr align 8 %2, i8 0, i64 24, i1 false)
  br label %11

11:                                               ; preds = %0
  %12 = call i32 @s2n_alloc(ptr noundef %2, i32 noundef 88)
  %13 = icmp sgt i32 %12, -1
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  store ptr null, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %160

15:                                               ; preds = %11
  br label %16

16:                                               ; preds = %15
  br label %17

17:                                               ; preds = %16
  br label %18

18:                                               ; preds = %17
  %19 = call i32 @s2n_blob_zero(ptr noundef %2)
  %20 = icmp sgt i32 %19, -1
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  store ptr null, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %160

22:                                               ; preds = %18
  br label %23

23:                                               ; preds = %22
  br label %24

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

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

28:                                               ; preds = %25
  store ptr null, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %158

29:                                               ; preds = %25
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31
  %33 = call i32 @s2n_blob_zero(ptr noundef %4)
  %34 = icmp sgt i32 %33, -1
  br i1 %34, label %36, label %35

35:                                               ; preds = %32
  store ptr null, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %158

36:                                               ; preds = %32
  br label %37

37:                                               ; preds = %36
  br label %38

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

39:                                               ; preds = %38
  %40 = call i32 @s2n_alloc(ptr noundef %5, i32 noundef 48)
  %41 = icmp sgt i32 %40, -1
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  store ptr null, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %156

43:                                               ; preds = %39
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  %47 = call i32 @s2n_blob_zero(ptr noundef %5)
  %48 = icmp sgt i32 %47, -1
  br i1 %48, label %50, label %49

49:                                               ; preds = %46
  store ptr null, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %156

50:                                               ; preds = %46
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  %53 = call ptr @s2n_array_new(i32 noundef 24)
  store ptr %53, ptr %6, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %52
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = icmp ne ptr %55, null
  br i1 %56, label %90, label %57

57:                                               ; preds = %54
  br label %58

58:                                               ; preds = %57
  br label %59

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

68:                                               ; preds = %59
  %69 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %70 = getelementptr inbounds %struct.s2n_debug_info, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  %72 = getelementptr inbounds i8, ptr %71, i64 21
  %73 = call ptr @strrchr(ptr noundef %72, i32 noundef 47) #7
  %74 = getelementptr inbounds i8, ptr %73, i64 1
  br label %80

75:                                               ; preds = %59
  %76 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %77 = getelementptr inbounds %struct.s2n_debug_info, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !9
  %79 = getelementptr inbounds i8, ptr %78, i64 21
  br label %80

80:                                               ; preds = %75, %68
  %81 = phi ptr [ %74, %68 ], [ %79, %75 ]
  %82 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %83 = getelementptr inbounds %struct.s2n_debug_info, ptr %82, i32 0, i32 1
  store ptr %81, ptr %83, align 8, !tbaa !11
  %84 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %84, align 4, !tbaa !12
  %85 = call i32 @s2n_calculate_stacktrace()
  br label %86

86:                                               ; preds = %80
  br label %87

87:                                               ; preds = %86
  store ptr null, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %153

88:                                               ; No predecessors!
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89, %54
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store ptr null, ptr %7, align 8, !tbaa !5
  %93 = call ptr @s2n_array_new(i32 noundef 24)
  store ptr %93, ptr %7, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %92
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = icmp ne ptr %95, null
  br i1 %96, label %130, label %97

97:                                               ; preds = %94
  br label %98

98:                                               ; preds = %97
  br label %99

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

108:                                              ; preds = %99
  %109 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %110 = getelementptr inbounds %struct.s2n_debug_info, ptr %109, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !9
  %112 = getelementptr inbounds i8, ptr %111, i64 21
  %113 = call ptr @strrchr(ptr noundef %112, i32 noundef 47) #7
  %114 = getelementptr inbounds i8, ptr %113, i64 1
  br label %120

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

120:                                              ; preds = %115, %108
  %121 = phi ptr [ %114, %108 ], [ %119, %115 ]
  %122 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %123 = getelementptr inbounds %struct.s2n_debug_info, ptr %122, i32 0, i32 1
  store ptr %121, ptr %123, align 8, !tbaa !11
  %124 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %124, align 4, !tbaa !12
  %125 = call i32 @s2n_calculate_stacktrace()
  br label %126

126:                                              ; preds = %120
  br label %127

127:                                              ; preds = %126
  store ptr null, ptr %1, align 8
  store i32 1, ptr %3, align 4
  br label %150

128:                                              ; No predecessors!
  br label %129

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129, %94
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %133 = getelementptr inbounds %struct.s2n_blob, ptr %2, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !14
  store ptr %134, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.s2n_blob, ptr %4, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !14
  %137 = load ptr, ptr %8, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.s2n_cert_chain_and_key, ptr %137, i32 0, i32 0
  store ptr %136, ptr %138, align 8, !tbaa !16
  %139 = getelementptr inbounds %struct.s2n_blob, ptr %5, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !14
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.s2n_cert_chain_and_key, ptr %141, i32 0, i32 1
  store ptr %140, ptr %142, align 8, !tbaa !18
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.s2n_cert_chain_and_key, ptr %144, i32 0, i32 5
  store ptr %143, ptr %145, align 8, !tbaa !19
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.s2n_cert_chain_and_key, ptr %147, i32 0, i32 4
  store ptr %146, ptr %148, align 8, !tbaa !20
  call void @llvm.memset.p0.i64(ptr align 8 %2, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %5, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 8, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 8, i1 false)
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %149, ptr %1, align 8
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %150

150:                                              ; preds = %132, %127
  %151 = call i32 @s2n_array_free_p(ptr noundef %7)
  %152 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %151, ptr %152, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %153

153:                                              ; preds = %150, %87
  %154 = call i32 @s2n_array_free_p(ptr noundef %6)
  %155 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 %154, ptr %155, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %156

156:                                              ; preds = %153, %49, %42
  %157 = call i32 @s2n_free(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  br label %158

158:                                              ; preds = %156, %35, %28
  %159 = call i32 @s2n_free(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  br label %160

160:                                              ; preds = %158, %21, %14
  %161 = call i32 @s2n_free(ptr noundef %2)
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  %162 = load ptr, ptr %1, align 8
  ret ptr %162
}

declare i32 @s2n_array_free_p(ptr noundef) #2

declare ptr @s2n_array_new(i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !6, i64 0}
!10 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!16 = !{!17, !6, i64 0}
!17 = !{!"s2n_cert_chain_and_key", !6, i64 0, !6, i64 8, !15, i64 16, !15, i64 40, !6, i64 64, !6, i64 72, !6, i64 80}
!18 = !{!17, !6, i64 8}
!19 = !{!17, !6, i64 72}
!20 = !{!17, !6, i64 64}


; 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_blob = type { ptr, i32, i32, i8 }

@_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.9 = external hidden unnamed_addr constant [95 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [95 x i8], align 1

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #2

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

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

declare i32 @s2n_free(ptr noundef) local_unnamed_addr #2

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

declare i32 @s2n_blob_zero(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @s2n_cert_chain_and_key_new() local_unnamed_addr #5 {
  %1 = alloca %struct.s2n_blob, align 8
  %2 = alloca %struct.s2n_blob, align 8
  %3 = alloca %struct.s2n_blob, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, i8 0, i64 24, i1 false)
  %6 = call i32 @s2n_alloc(ptr noundef nonnull %1, i32 noundef 88) #6
  %7 = icmp sgt i32 %6, -1
  br i1 %7, label %8, label %58

8:                                                ; preds = %0
  %9 = call i32 @s2n_blob_zero(ptr noundef nonnull %1) #6
  %10 = icmp sgt i32 %9, -1
  br i1 %10, label %11, label %58

11:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, i8 0, i64 24, i1 false)
  %12 = call i32 @s2n_alloc(ptr noundef nonnull %2, i32 noundef 16) #6
  %13 = icmp sgt i32 %12, -1
  br i1 %13, label %14, label %56

14:                                               ; preds = %11
  %15 = call i32 @s2n_blob_zero(ptr noundef nonnull %2) #6
  %16 = icmp sgt i32 %15, -1
  br i1 %16, label %17, label %56

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

20:                                               ; preds = %17
  %21 = call i32 @s2n_blob_zero(ptr noundef nonnull %3) #6
  %22 = icmp sgt i32 %21, -1
  br i1 %22, label %23, label %54

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %24 = call ptr @s2n_array_new(i32 noundef 24) #6
  store ptr %24, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %24, null
  br i1 %.not, label %25, label %33

25:                                               ; preds = %23
  %26 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.9, ptr %26, align 8, !tbaa !9
  %27 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.9, i64 21), i32 noundef 47) #7
  %.not9 = icmp eq ptr %27, null
  %28 = getelementptr inbounds i8, ptr %27, i64 1
  %29 = select i1 %.not9, ptr getelementptr inbounds (i8, ptr @.str.9, i64 21), ptr %28
  %30 = getelementptr inbounds i8, ptr %26, i64 8
  store ptr %29, ptr %30, align 8, !tbaa !11
  %31 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %31, align 4, !tbaa !12
  %32 = call i32 @s2n_calculate_stacktrace() #6
  br label %52

33:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %34 = call ptr @s2n_array_new(i32 noundef 24) #6
  store ptr %34, ptr %5, align 8, !tbaa !5
  %.not10 = icmp eq ptr %34, null
  br i1 %.not10, label %35, label %43

35:                                               ; preds = %33
  %36 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.10, ptr %36, align 8, !tbaa !9
  %37 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.10, i64 21), i32 noundef 47) #7
  %.not11 = icmp eq ptr %37, null
  %38 = getelementptr inbounds i8, ptr %37, i64 1
  %39 = select i1 %.not11, ptr getelementptr inbounds (i8, ptr @.str.10, i64 21), ptr %38
  %40 = getelementptr inbounds i8, ptr %36, i64 8
  store ptr %39, ptr %40, align 8, !tbaa !11
  %41 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %41, align 4, !tbaa !12
  %42 = call i32 @s2n_calculate_stacktrace() #6
  br label %50

43:                                               ; preds = %33
  %44 = load ptr, ptr %1, align 8, !tbaa !14
  %45 = load ptr, ptr %2, align 8, !tbaa !14
  store ptr %45, ptr %44, align 8, !tbaa !16
  %46 = load ptr, ptr %3, align 8, !tbaa !14
  %47 = getelementptr inbounds i8, ptr %44, i64 8
  store ptr %46, ptr %47, align 8, !tbaa !18
  %48 = getelementptr inbounds i8, ptr %44, i64 72
  store ptr %24, ptr %48, align 8, !tbaa !19
  %49 = getelementptr inbounds i8, ptr %44, i64 64
  store ptr %34, ptr %49, align 8, !tbaa !20
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, i8 0, i64 24, i1 false)
  store i64 0, ptr %4, align 8
  store i64 0, ptr %5, align 8
  br label %50

50:                                               ; preds = %43, %35
  %.0 = phi ptr [ %44, %43 ], [ null, %35 ]
  %51 = call i32 @s2n_array_free_p(ptr noundef nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %52

52:                                               ; preds = %50, %25
  %.1 = phi ptr [ %.0, %50 ], [ null, %25 ]
  %53 = call i32 @s2n_array_free_p(ptr noundef nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %54

54:                                               ; preds = %20, %17, %52
  %.2 = phi ptr [ %.1, %52 ], [ null, %17 ], [ null, %20 ]
  %55 = call i32 @s2n_free(ptr noundef nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  br label %56

56:                                               ; preds = %14, %11, %54
  %.3 = phi ptr [ %.2, %54 ], [ null, %11 ], [ null, %14 ]
  %57 = call i32 @s2n_free(ptr noundef nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  br label %58

58:                                               ; preds = %8, %0, %56
  %.4 = phi ptr [ %.3, %56 ], [ null, %0 ], [ null, %8 ]
  %59 = call i32 @s2n_free(ptr noundef nonnull %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  ret ptr %.4
}

declare i32 @s2n_array_free_p(ptr noundef) local_unnamed_addr #2

declare ptr @s2n_array_new(i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !6, i64 0}
!10 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!16 = !{!17, !6, i64 0}
!17 = !{!"s2n_cert_chain_and_key", !6, i64 0, !6, i64 8, !15, i64 16, !15, i64 40, !6, i64 64, !6, i64 72, !6, i64 80}
!18 = !{!17, !6, i64 8}
!19 = !{!17, !6, i64 72}
!20 = !{!17, !6, i64 64}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass