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

; 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_blob = type { ptr, i32, i32, i8 }
%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_tls13_keys = type { i32, i32, i8, %struct.s2n_blob, %struct.s2n_blob, [48 x i8], [48 x i8], %struct.s2n_hmac_state }
%struct.s2n_hmac_state = type { i32, i16, i32, i16, i8, %struct.s2n_hash_state, %struct.s2n_hash_state, %struct.s2n_hash_state, %struct.s2n_hash_state, [128 x i8], [64 x i8] }
%struct.s2n_hash_state = type { ptr, i32, i8, i64, %union.anon }
%union.anon = type { %struct.s2n_hash_evp_digest }
%struct.s2n_hash_evp_digest = type { %struct.s2n_evp_digest, %struct.s2n_evp_digest }
%struct.s2n_evp_digest = type { ptr, ptr }

@s2n_tls13_label_traffic_secret_key = external dso_local constant %struct.s2n_blob, align 8
@s2n_tls13_label_traffic_secret_iv = external dso_local constant %struct.s2n_blob, align 8
@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.2 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [94 x i8], align 1
@zero_length_blob = external hidden constant %struct.s2n_blob, align 8

; 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: nounwind uwtable
define dso_local i32 @s2n_tls13_derive_traffic_keys(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  br label %10

10:                                               ; preds = %4
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = icmp ne ptr %11, null
  br i1 %12, label %44, label %13

13:                                               ; preds = %10
  br label %14

14:                                               ; preds = %13
  br label %15

15:                                               ; preds = %14
  %16 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %17 = getelementptr inbounds %struct.s2n_debug_info, ptr %16, i32 0, i32 0
  store ptr @.str.2, ptr %17, align 8, !tbaa !9
  %18 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %19 = getelementptr inbounds %struct.s2n_debug_info, ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds i8, ptr %20, i64 21
  %22 = call ptr @strrchr(ptr noundef %21, i32 noundef 47) #4
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %31

24:                                               ; preds = %15
  %25 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %26 = getelementptr inbounds %struct.s2n_debug_info, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %27, i64 21
  %29 = call ptr @strrchr(ptr noundef %28, i32 noundef 47) #4
  %30 = getelementptr inbounds i8, ptr %29, i64 1
  br label %36

31:                                               ; preds = %15
  %32 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %33 = getelementptr inbounds %struct.s2n_debug_info, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %34, i64 21
  br label %36

36:                                               ; preds = %31, %24
  %37 = phi ptr [ %30, %24 ], [ %35, %31 ]
  %38 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %39 = getelementptr inbounds %struct.s2n_debug_info, ptr %38, i32 0, i32 1
  store ptr %37, ptr %39, align 8, !tbaa !11
  %40 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %40, align 4, !tbaa !12
  %41 = call i32 @s2n_calculate_stacktrace()
  br label %42

42:                                               ; preds = %36
  store i32 -1, ptr %5, align 4
  br label %180

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %10
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %80, label %49

49:                                               ; preds = %46
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  %52 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %53 = getelementptr inbounds %struct.s2n_debug_info, ptr %52, i32 0, i32 0
  store ptr @.str.3, ptr %53, align 8, !tbaa !9
  %54 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %55 = getelementptr inbounds %struct.s2n_debug_info, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = getelementptr inbounds i8, ptr %56, i64 21
  %58 = call ptr @strrchr(ptr noundef %57, i32 noundef 47) #4
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %67

60:                                               ; preds = %51
  %61 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %62 = getelementptr inbounds %struct.s2n_debug_info, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds i8, ptr %63, i64 21
  %65 = call ptr @strrchr(ptr noundef %64, i32 noundef 47) #4
  %66 = getelementptr inbounds i8, ptr %65, i64 1
  br label %72

67:                                               ; preds = %51
  %68 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %69 = getelementptr inbounds %struct.s2n_debug_info, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds i8, ptr %70, i64 21
  br label %72

72:                                               ; preds = %67, %60
  %73 = phi ptr [ %66, %60 ], [ %71, %67 ]
  %74 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %75 = getelementptr inbounds %struct.s2n_debug_info, ptr %74, i32 0, i32 1
  store ptr %73, ptr %75, align 8, !tbaa !11
  %76 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %76, align 4, !tbaa !12
  %77 = call i32 @s2n_calculate_stacktrace()
  br label %78

78:                                               ; preds = %72
  store i32 -1, ptr %5, align 4
  br label %180

79:                                               ; No predecessors!
  br label %80

80:                                               ; preds = %79, %46
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = icmp ne ptr %83, null
  br i1 %84, label %116, label %85

85:                                               ; preds = %82
  br label %86

86:                                               ; preds = %85
  br label %87

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

96:                                               ; preds = %87
  %97 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %98 = getelementptr inbounds %struct.s2n_debug_info, ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  %100 = getelementptr inbounds i8, ptr %99, i64 21
  %101 = call ptr @strrchr(ptr noundef %100, i32 noundef 47) #4
  %102 = getelementptr inbounds i8, ptr %101, i64 1
  br label %108

103:                                              ; preds = %87
  %104 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %105 = getelementptr inbounds %struct.s2n_debug_info, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  %107 = getelementptr inbounds i8, ptr %106, i64 21
  br label %108

108:                                              ; preds = %103, %96
  %109 = phi ptr [ %102, %96 ], [ %107, %103 ]
  %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 1
  store ptr %109, ptr %111, align 8, !tbaa !11
  %112 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %112, align 4, !tbaa !12
  %113 = call i32 @s2n_calculate_stacktrace()
  br label %114

114:                                              ; preds = %108
  store i32 -1, ptr %5, align 4
  br label %180

115:                                              ; No predecessors!
  br label %116

116:                                              ; preds = %115, %82
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = icmp ne ptr %119, null
  br i1 %120, label %152, label %121

121:                                              ; preds = %118
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  %124 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %125 = getelementptr inbounds %struct.s2n_debug_info, ptr %124, i32 0, i32 0
  store ptr @.str.5, ptr %125, align 8, !tbaa !9
  %126 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %127 = getelementptr inbounds %struct.s2n_debug_info, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !9
  %129 = getelementptr inbounds i8, ptr %128, i64 21
  %130 = call ptr @strrchr(ptr noundef %129, i32 noundef 47) #4
  %131 = icmp ne ptr %130, null
  br i1 %131, label %132, label %139

132:                                              ; preds = %123
  %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
  %135 = load ptr, ptr %134, align 8, !tbaa !9
  %136 = getelementptr inbounds i8, ptr %135, i64 21
  %137 = call ptr @strrchr(ptr noundef %136, i32 noundef 47) #4
  %138 = getelementptr inbounds i8, ptr %137, i64 1
  br label %144

139:                                              ; preds = %123
  %140 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %141 = getelementptr inbounds %struct.s2n_debug_info, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !9
  %143 = getelementptr inbounds i8, ptr %142, i64 21
  br label %144

144:                                              ; preds = %139, %132
  %145 = phi ptr [ %138, %132 ], [ %143, %139 ]
  %146 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %147 = getelementptr inbounds %struct.s2n_debug_info, ptr %146, i32 0, i32 1
  store ptr %145, ptr %147, align 8, !tbaa !11
  %148 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %148, align 4, !tbaa !12
  %149 = call i32 @s2n_calculate_stacktrace()
  br label %150

150:                                              ; preds = %144
  store i32 -1, ptr %5, align 4
  br label %180

151:                                              ; No predecessors!
  br label %152

152:                                              ; preds = %151, %118
  br label %153

153:                                              ; preds = %152
  br label %154

154:                                              ; preds = %153
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.s2n_tls13_keys, ptr %155, i32 0, i32 7
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.s2n_tls13_keys, ptr %157, i32 0, i32 0
  %159 = load i32, ptr %158, align 8, !tbaa !14
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = load ptr, ptr %8, align 8, !tbaa !5
  %162 = call i32 @s2n_hkdf_expand_label(ptr noundef %156, i32 noundef %159, ptr noundef %160, ptr noundef @s2n_tls13_label_traffic_secret_key, ptr noundef @zero_length_blob, ptr noundef %161)
  %163 = icmp sgt i32 %162, -1
  br i1 %163, label %165, label %164

164:                                              ; preds = %154
  store i32 -1, ptr %5, align 4
  br label %180

165:                                              ; preds = %154
  br label %166

166:                                              ; preds = %165
  br label %167

167:                                              ; preds = %166
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.s2n_tls13_keys, ptr %168, i32 0, i32 7
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.s2n_tls13_keys, ptr %170, i32 0, i32 0
  %172 = load i32, ptr %171, align 8, !tbaa !14
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  %174 = load ptr, ptr %9, align 8, !tbaa !5
  %175 = call i32 @s2n_hkdf_expand_label(ptr noundef %169, i32 noundef %172, ptr noundef %173, ptr noundef @s2n_tls13_label_traffic_secret_iv, ptr noundef @zero_length_blob, ptr noundef %174)
  %176 = icmp sgt i32 %175, -1
  br i1 %176, label %178, label %177

177:                                              ; preds = %167
  store i32 -1, ptr %5, align 4
  br label %180

178:                                              ; preds = %167
  br label %179

179:                                              ; preds = %178
  store i32 0, ptr %5, align 4
  br label %180

180:                                              ; preds = %179, %177, %164, %150, %114, %78, %42
  %181 = load i32, ptr %5, align 4
  ret i32 %181
}

declare i32 @s2n_hkdf_expand_label(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr 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 = { 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 #4 = { 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, !13, i64 0}
!15 = !{!"s2n_tls13_keys", !13, i64 0, !13, i64 4, !7, i64 8, !16, i64 16, !16, i64 40, !7, i64 64, !7, i64 112, !17, i64 160}
!16 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!17 = !{!"s2n_hmac_state", !13, i64 0, !18, i64 4, !13, i64 8, !18, i64 12, !7, i64 14, !19, i64 16, !19, i64 72, !19, i64 128, !19, i64 184, !7, i64 240, !7, i64 368}
!18 = !{!"short", !7, i64 0}
!19 = !{!"s2n_hash_state", !6, i64 0, !13, i64 8, !7, i64 12, !20, i64 16, !7, i64 24}
!20 = !{!"long", !7, i64 0}


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

@s2n_tls13_label_traffic_secret_key = external dso_local constant %struct.s2n_blob, align 8
@s2n_tls13_label_traffic_secret_iv = external dso_local constant %struct.s2n_blob, align 8
@_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.2 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [94 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [94 x i8], align 1
@zero_length_blob = external hidden constant %struct.s2n_blob, align 8

; 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: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_tls13_derive_traffic_keys(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %5, label %13

5:                                                ; preds = %4
  %6 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.2, ptr %6, align 8, !tbaa !5
  %7 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.2, i64 21), i32 noundef 47) #4
  %.not20 = icmp eq ptr %7, null
  %8 = getelementptr inbounds i8, ptr %7, i64 1
  %9 = select i1 %.not20, ptr getelementptr inbounds (i8, ptr @.str.2, i64 21), ptr %8
  %10 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %9, ptr %10, align 8, !tbaa !10
  %11 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %11, align 4, !tbaa !11
  %12 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %48

13:                                               ; preds = %4
  %.not21 = icmp eq ptr %1, null
  br i1 %.not21, label %14, label %22

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

22:                                               ; preds = %13
  %.not23 = icmp eq ptr %2, null
  br i1 %.not23, label %23, label %31

23:                                               ; preds = %22
  %24 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.4, ptr %24, align 8, !tbaa !5
  %25 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.4, i64 21), i32 noundef 47) #4
  %.not24 = icmp eq ptr %25, null
  %26 = getelementptr inbounds i8, ptr %25, i64 1
  %27 = select i1 %.not24, ptr getelementptr inbounds (i8, ptr @.str.4, i64 21), ptr %26
  %28 = getelementptr inbounds i8, ptr %24, i64 8
  store ptr %27, ptr %28, align 8, !tbaa !10
  %29 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %29, align 4, !tbaa !11
  %30 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %48

31:                                               ; preds = %22
  %.not25 = icmp eq ptr %3, null
  br i1 %.not25, label %32, label %40

32:                                               ; preds = %31
  %33 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.5, ptr %33, align 8, !tbaa !5
  %34 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.5, i64 21), i32 noundef 47) #4
  %.not26 = icmp eq ptr %34, null
  %35 = getelementptr inbounds i8, ptr %34, i64 1
  %36 = select i1 %.not26, ptr getelementptr inbounds (i8, ptr @.str.5, i64 21), ptr %35
  %37 = getelementptr inbounds i8, ptr %33, i64 8
  store ptr %36, ptr %37, align 8, !tbaa !10
  %38 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %38, align 4, !tbaa !11
  %39 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %48

40:                                               ; preds = %31
  %41 = getelementptr inbounds i8, ptr %0, i64 160
  %42 = load i32, ptr %0, align 8, !tbaa !13
  %43 = tail call i32 @s2n_hkdf_expand_label(ptr noundef nonnull %41, i32 noundef %42, ptr noundef nonnull %1, ptr noundef nonnull @s2n_tls13_label_traffic_secret_key, ptr noundef nonnull @zero_length_blob, ptr noundef nonnull %2) #5
  %44 = icmp sgt i32 %43, -1
  br i1 %44, label %45, label %48

45:                                               ; preds = %40
  %46 = load i32, ptr %0, align 8, !tbaa !13
  %47 = tail call i32 @s2n_hkdf_expand_label(ptr noundef nonnull %41, i32 noundef %46, ptr noundef nonnull %1, ptr noundef nonnull @s2n_tls13_label_traffic_secret_iv, ptr noundef nonnull @zero_length_blob, ptr noundef nonnull %3) #5
  %.lobit = ashr i32 %47, 31
  br label %48

48:                                               ; preds = %45, %40, %32, %23, %14, %5
  %.0 = phi i32 [ -1, %32 ], [ -1, %23 ], [ -1, %14 ], [ -1, %5 ], [ -1, %40 ], [ %.lobit, %45 ]
  ret i32 %.0
}

declare i32 @s2n_hkdf_expand_label(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr 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 = { 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 #4 = { nounwind willreturn memory(read) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"s2n_tls13_keys", !12, i64 0, !12, i64 4, !8, i64 8, !15, i64 16, !15, i64 40, !8, i64 64, !8, i64 112, !16, i64 160}
!15 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!16 = !{!"s2n_hmac_state", !12, i64 0, !17, i64 4, !12, i64 8, !17, i64 12, !8, i64 14, !18, i64 16, !18, i64 72, !18, i64 128, !18, i64 184, !8, i64 240, !8, i64 368}
!17 = !{!"short", !8, i64 0}
!18 = !{!"s2n_hash_state", !7, i64 0, !12, i64 8, !8, i64 12, !19, i64 16, !8, i64 24}
!19 = !{!"long", !8, i64 0}


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