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

; 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_stuffer_reservation = type { ptr, i32, i8 }
%struct.s2n_signature_preferences = type { i8, ptr }
%struct.s2n_signature_scheme = type { i16, ptr, i32, i32, i8, i8, i16, 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 [101 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [101 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

declare i32 @s2n_connection_get_signature_preferences(ptr noundef, 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 i32 @s2n_signature_algorithms_supported_list_send(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca %struct.s2n_result, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.s2n_stuffer_reservation, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  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 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  br label %11

11:                                               ; preds = %2
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call i32 @s2n_connection_get_signature_preferences(ptr noundef %12, ptr noundef %6)
  %14 = icmp sgt i32 %13, -1
  br i1 %14, label %17, label %15

15:                                               ; preds = %11
  %16 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %16, align 4, !tbaa !9
  store i32 1, ptr %7, align 4
  br label %160

17:                                               ; preds = %11
  br label %18

18:                                               ; preds = %17
  br label %19

19:                                               ; preds = %18
  br label %20

20:                                               ; preds = %19
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %57, label %23

23:                                               ; preds = %20
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  %26 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %27 = getelementptr inbounds %struct.s2n_debug_info, ptr %26, i32 0, i32 0
  store ptr @.str.9, ptr %27, align 8, !tbaa !12
  %28 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %29 = getelementptr inbounds %struct.s2n_debug_info, ptr %28, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !12
  %31 = getelementptr inbounds i8, ptr %30, i64 21
  %32 = call ptr @strrchr(ptr noundef %31, i32 noundef 47) #7
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %41

34:                                               ; preds = %25
  %35 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %36 = getelementptr inbounds %struct.s2n_debug_info, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !12
  %38 = getelementptr inbounds i8, ptr %37, i64 21
  %39 = call ptr @strrchr(ptr noundef %38, i32 noundef 47) #7
  %40 = getelementptr inbounds i8, ptr %39, i64 1
  br label %46

41:                                               ; preds = %25
  %42 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %43 = getelementptr inbounds %struct.s2n_debug_info, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !12
  %45 = getelementptr inbounds i8, ptr %44, i64 21
  br label %46

46:                                               ; preds = %41, %34
  %47 = phi ptr [ %40, %34 ], [ %45, %41 ]
  %48 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %49 = getelementptr inbounds %struct.s2n_debug_info, ptr %48, i32 0, i32 1
  store ptr %47, ptr %49, align 8, !tbaa !14
  %50 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %50, align 4, !tbaa !15
  %51 = call i32 @s2n_calculate_stacktrace()
  br label %52

52:                                               ; preds = %46
  br label %53

53:                                               ; preds = %52
  %54 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %54, align 4, !tbaa !9
  store i32 1, ptr %7, align 4
  br label %160

55:                                               ; No predecessors!
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56, %20
  br label %58

58:                                               ; preds = %57
  br label %59

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

60:                                               ; preds = %59
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call i32 @s2n_stuffer_reserve_uint16(ptr noundef %61, ptr noundef %8)
  %63 = icmp sgt i32 %62, -1
  br i1 %63, label %66, label %64

64:                                               ; preds = %60
  %65 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %65, align 4, !tbaa !9
  store i32 1, ptr %7, align 4
  br label %159

66:                                               ; preds = %60
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !16
  br label %69

69:                                               ; preds = %144, %68
  %70 = load i64, ptr %9, align 8, !tbaa !16
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.s2n_signature_preferences, ptr %71, i32 0, i32 0
  %73 = load i8, ptr %72, align 8, !tbaa !18
  %74 = zext i8 %73 to i64
  %75 = icmp ult i64 %70, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %69
  store i32 12, ptr %7, align 4
  br label %147

77:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.s2n_signature_preferences, ptr %78, i32 0, i32 1
  %80 = load ptr, ptr %79, align 8, !tbaa !20
  %81 = load i64, ptr %9, align 8, !tbaa !16
  %82 = getelementptr inbounds ptr, ptr %80, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  store ptr %83, ptr %10, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %77
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %121, label %87

87:                                               ; preds = %84
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  %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
  store ptr @.str.10, ptr %91, align 8, !tbaa !12
  %92 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %93 = getelementptr inbounds %struct.s2n_debug_info, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !12
  %95 = getelementptr inbounds i8, ptr %94, i64 21
  %96 = call ptr @strrchr(ptr noundef %95, i32 noundef 47) #7
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %105

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

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

110:                                              ; preds = %105, %98
  %111 = phi ptr [ %104, %98 ], [ %109, %105 ]
  %112 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %113 = getelementptr inbounds %struct.s2n_debug_info, ptr %112, i32 0, i32 1
  store ptr %111, ptr %113, align 8, !tbaa !14
  %114 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %114, align 4, !tbaa !15
  %115 = call i32 @s2n_calculate_stacktrace()
  br label %116

116:                                              ; preds = %110
  br label %117

117:                                              ; preds = %116
  %118 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %118, align 4, !tbaa !9
  store i32 1, ptr %7, align 4
  br label %141

119:                                              ; No predecessors!
  br label %120

120:                                              ; preds = %119
  br label %121

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

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = call zeroext i1 @s2n_signature_scheme_is_valid_for_send(ptr noundef %124, ptr noundef %125)
  br i1 %126, label %127, label %140

127:                                              ; preds = %123
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.s2n_signature_scheme, ptr %130, i32 0, i32 0
  %132 = load i16, ptr %131, align 8, !tbaa !21
  %133 = call i32 @s2n_stuffer_write_uint16(ptr noundef %129, i16 noundef zeroext %132)
  %134 = icmp sgt i32 %133, -1
  br i1 %134, label %137, label %135

135:                                              ; preds = %128
  %136 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %136, align 4, !tbaa !9
  store i32 1, ptr %7, align 4
  br label %141

137:                                              ; preds = %128
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139, %123
  store i32 0, ptr %7, align 4
  br label %141

141:                                              ; preds = %140, %135, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %142 = load i32, ptr %7, align 4
  switch i32 %142, label %147 [
    i32 0, label %143
  ]

143:                                              ; preds = %141
  br label %144

144:                                              ; preds = %143
  %145 = load i64, ptr %9, align 8, !tbaa !16
  %146 = add i64 %145, 1
  store i64 %146, ptr %9, align 8, !tbaa !16
  br label %69, !llvm.loop !24

147:                                              ; preds = %141, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %148 = load i32, ptr %7, align 4
  switch i32 %148, label %159 [
    i32 12, label %149
  ]

149:                                              ; preds = %147
  br label %150

150:                                              ; preds = %149
  %151 = call i32 @s2n_stuffer_write_vector_size(ptr noundef %8)
  %152 = icmp sgt i32 %151, -1
  br i1 %152, label %155, label %153

153:                                              ; preds = %150
  %154 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %154, align 4, !tbaa !9
  store i32 1, ptr %7, align 4
  br label %159

155:                                              ; preds = %150
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  %158 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 0, ptr %158, align 4, !tbaa !9
  store i32 1, ptr %7, align 4
  br label %159

159:                                              ; preds = %157, %153, %147, %64
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  br label %160

160:                                              ; preds = %159, %53, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %161 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  %162 = load i32, ptr %161, align 4
  ret i32 %162
}

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @s2n_signature_scheme_is_valid_for_send(ptr noundef, ptr noundef) #4

declare i32 @s2n_stuffer_write_uint16(ptr noundef, i16 noundef zeroext) #2

declare i32 @s2n_stuffer_write_vector_size(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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11, i64 0}
!10 = !{!"", !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!14 = !{!13, !6, i64 8}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !7, i64 0}
!19 = !{!"s2n_signature_preferences", !7, i64 0, !6, i64 8}
!20 = !{!19, !6, i64 8}
!21 = !{!22, !23, i64 0}
!22 = !{!"s2n_signature_scheme", !23, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !7, i64 24, !7, i64 25, !23, i64 26, !6, i64 32}
!23 = !{!"short", !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"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 }
%struct.s2n_stuffer_reservation = type { ptr, 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 [101 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [101 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

declare i32 @s2n_connection_get_signature_preferences(ptr noundef, 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 i32 @s2n_signature_algorithms_supported_list_send(ptr noundef %0, ptr noundef %1) local_unnamed_addr #4 {
  %3 = alloca ptr, align 8
  %4 = alloca %struct.s2n_stuffer_reservation, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store ptr null, ptr %3, align 8, !tbaa !5
  %5 = call i32 @s2n_connection_get_signature_preferences(ptr noundef %0, ptr noundef nonnull %3) #6
  %6 = icmp sgt i32 %5, -1
  br i1 %6, label %7, label %46

7:                                                ; preds = %2
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %9, label %17

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

17:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  %18 = call i32 @s2n_stuffer_reserve_uint16(ptr noundef %1, ptr noundef nonnull %4) #6
  %19 = icmp sgt i32 %18, -1
  br i1 %19, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %17
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = load i8, ptr %20, align 8, !tbaa !14
  %.not1922.not = icmp eq i8 %21, 0
  br i1 %.not1922.not, label %.critedge21, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %.critedge
  %22 = phi ptr [ %42, %.critedge ], [ %20, %.preheader ]
  %.023 = phi i64 [ %41, %.critedge ], [ 0, %.preheader ]
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = getelementptr inbounds ptr, ptr %24, i64 %.023
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %.not17 = icmp eq ptr %26, null
  br i1 %.not17, label %27, label %35

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

35:                                               ; preds = %.lr.ph
  %36 = call zeroext i1 @s2n_signature_scheme_is_valid_for_send(ptr noundef %0, ptr noundef nonnull %26)
  br i1 %36, label %37, label %.critedge

37:                                               ; preds = %35
  %38 = load i16, ptr %26, align 8, !tbaa !17
  %39 = call i32 @s2n_stuffer_write_uint16(ptr noundef %1, i16 noundef zeroext %38) #6
  %40 = icmp sgt i32 %39, -1
  br i1 %40, label %.critedge, label %.loopexit

.critedge:                                        ; preds = %37, %35
  %41 = add nuw nsw i64 %.023, 1
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = load i8, ptr %42, align 8, !tbaa !14
  %44 = zext i8 %43 to i64
  %.not19 = icmp ult i64 %41, %44
  br i1 %.not19, label %.lr.ph, label %.critedge21, !llvm.loop !20

.critedge21:                                      ; preds = %.critedge, %.preheader
  %45 = call i32 @s2n_stuffer_write_vector_size(ptr noundef nonnull %4) #6
  %.lobit = ashr i32 %45, 31
  br label %.loopexit

.loopexit:                                        ; preds = %37, %27, %.critedge21, %17
  %.sroa.0.3 = phi i32 [ -1, %17 ], [ %.lobit, %.critedge21 ], [ -1, %27 ], [ -1, %37 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  br label %46

46:                                               ; preds = %2, %.loopexit, %9
  %.sroa.0.4 = phi i32 [ %.sroa.0.3, %.loopexit ], [ -1, %9 ], [ -1, %2 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 %.sroa.0.4
}

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @s2n_signature_scheme_is_valid_for_send(ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @s2n_stuffer_write_uint16(ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

declare i32 @s2n_stuffer_write_vector_size(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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !7, i64 0}
!15 = !{!"s2n_signature_preferences", !7, i64 0, !6, i64 8}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !19, i64 0}
!18 = !{!"s2n_signature_scheme", !19, i64 0, !6, i64 8, !13, i64 16, !13, i64 20, !7, i64 24, !7, i64 25, !19, i64 26, !6, i64 32}
!19 = !{!"short", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass