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

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

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.28 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [92 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

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

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

8:                                                ; preds = %3
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  %10 = icmp ne ptr %9, null
  br i1 %10, label %43, label %11

11:                                               ; preds = %8
  br label %12

12:                                               ; preds = %11
  br label %13

13:                                               ; preds = %12
  %14 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %15 = getelementptr inbounds %struct.s2n_debug_info, ptr %14, i32 0, i32 0
  store ptr @.str.28, ptr %15, align 8, !tbaa !11
  %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
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %18, i64 21
  %20 = call ptr @strrchr(ptr noundef %19, i32 noundef 47) #4
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %29

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

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

34:                                               ; preds = %29, %22
  %35 = phi ptr [ %28, %22 ], [ %33, %29 ]
  %36 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %37 = getelementptr inbounds %struct.s2n_debug_info, ptr %36, i32 0, i32 1
  store ptr %35, ptr %37, align 8, !tbaa !13
  %38 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %38, align 4, !tbaa !14
  %39 = call i32 @s2n_calculate_stacktrace()
  br label %40

40:                                               ; preds = %34
  %41 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %41, align 4, !tbaa !16
  br label %208

42:                                               ; No predecessors!
  br label %43

43:                                               ; preds = %42, %8
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  %46 = load i64, ptr %7, align 8, !tbaa !9
  %47 = icmp eq i64 %46, 0
  br i1 %47, label %83, label %48

48:                                               ; preds = %45
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %83, label %51

51:                                               ; preds = %48
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %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
  store ptr @.str.29, ptr %55, align 8, !tbaa !11
  %56 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %57 = getelementptr inbounds %struct.s2n_debug_info, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = getelementptr inbounds i8, ptr %58, i64 21
  %60 = call ptr @strrchr(ptr noundef %59, i32 noundef 47) #4
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %69

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

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

74:                                               ; preds = %69, %62
  %75 = phi ptr [ %68, %62 ], [ %73, %69 ]
  %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 1
  store ptr %75, ptr %77, align 8, !tbaa !13
  %78 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %78, align 4, !tbaa !14
  %79 = call i32 @s2n_calculate_stacktrace()
  br label %80

80:                                               ; preds = %74
  %81 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %81, align 4, !tbaa !16
  br label %208

82:                                               ; No predecessors!
  br label %83

83:                                               ; preds = %82, %48, %45
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.s2n_fingerprint_hash, ptr %85, i32 0, i32 2
  %87 = load ptr, ptr %86, align 8, !tbaa !18
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %103

89:                                               ; preds = %84
  br label %90

90:                                               ; preds = %89
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.s2n_fingerprint_hash, ptr %91, i32 0, i32 2
  %93 = load ptr, ptr %92, align 8, !tbaa !18
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load i64, ptr %7, align 8, !tbaa !9
  %96 = trunc i64 %95 to i32
  %97 = call i32 @s2n_hash_update(ptr noundef %93, ptr noundef %94, i32 noundef %96)
  %98 = icmp sgt i32 %97, -1
  br i1 %98, label %101, label %99

99:                                               ; preds = %90
  %100 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %100, align 4, !tbaa !16
  br label %208

101:                                              ; preds = %90
  br label %102

102:                                              ; preds = %101
  br label %206

103:                                              ; preds = %84
  br label %104

104:                                              ; preds = %103
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.s2n_fingerprint_hash, ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !20
  %108 = icmp ne ptr %107, null
  br i1 %108, label %141, label %109

109:                                              ; preds = %104
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110
  %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 0
  store ptr @.str.30, ptr %113, align 8, !tbaa !11
  %114 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %115 = getelementptr inbounds %struct.s2n_debug_info, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !11
  %117 = getelementptr inbounds i8, ptr %116, i64 21
  %118 = call ptr @strrchr(ptr noundef %117, i32 noundef 47) #4
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %127

120:                                              ; preds = %111
  %121 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %122 = getelementptr inbounds %struct.s2n_debug_info, ptr %121, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !11
  %124 = getelementptr inbounds i8, ptr %123, i64 21
  %125 = call ptr @strrchr(ptr noundef %124, i32 noundef 47) #4
  %126 = getelementptr inbounds i8, ptr %125, i64 1
  br label %132

127:                                              ; preds = %111
  %128 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %129 = getelementptr inbounds %struct.s2n_debug_info, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !11
  %131 = getelementptr inbounds i8, ptr %130, i64 21
  br label %132

132:                                              ; preds = %127, %120
  %133 = phi ptr [ %126, %120 ], [ %131, %127 ]
  %134 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %135 = getelementptr inbounds %struct.s2n_debug_info, ptr %134, i32 0, i32 1
  store ptr %133, ptr %135, align 8, !tbaa !13
  %136 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %136, align 4, !tbaa !14
  %137 = call i32 @s2n_calculate_stacktrace()
  br label %138

138:                                              ; preds = %132
  %139 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %139, align 4, !tbaa !16
  br label %208

140:                                              ; No predecessors!
  br label %141

141:                                              ; preds = %140, %104
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.s2n_fingerprint_hash, ptr %144, i32 0, i32 1
  %146 = load ptr, ptr %145, align 8, !tbaa !20
  %147 = getelementptr inbounds %struct.s2n_stuffer, ptr %146, i32 0, i32 0
  %148 = getelementptr inbounds %struct.s2n_blob, ptr %147, i32 0, i32 1
  %149 = load i32, ptr %148, align 8, !tbaa !21
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.s2n_fingerprint_hash, ptr %150, i32 0, i32 1
  %152 = load ptr, ptr %151, align 8, !tbaa !20
  %153 = getelementptr inbounds %struct.s2n_stuffer, ptr %152, i32 0, i32 2
  %154 = load i32, ptr %153, align 4, !tbaa !24
  %155 = sub i32 %149, %154
  %156 = zext i32 %155 to i64
  %157 = load i64, ptr %7, align 8, !tbaa !9
  %158 = icmp uge i64 %156, %157
  br i1 %158, label %191, label %159

159:                                              ; preds = %143
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  %162 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %163 = getelementptr inbounds %struct.s2n_debug_info, ptr %162, i32 0, i32 0
  store ptr @.str.31, ptr %163, align 8, !tbaa !11
  %164 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %165 = getelementptr inbounds %struct.s2n_debug_info, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !11
  %167 = getelementptr inbounds i8, ptr %166, i64 21
  %168 = call ptr @strrchr(ptr noundef %167, i32 noundef 47) #4
  %169 = icmp ne ptr %168, null
  br i1 %169, label %170, label %177

170:                                              ; preds = %161
  %171 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %172 = getelementptr inbounds %struct.s2n_debug_info, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !11
  %174 = getelementptr inbounds i8, ptr %173, i64 21
  %175 = call ptr @strrchr(ptr noundef %174, i32 noundef 47) #4
  %176 = getelementptr inbounds i8, ptr %175, i64 1
  br label %182

177:                                              ; preds = %161
  %178 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %179 = getelementptr inbounds %struct.s2n_debug_info, ptr %178, i32 0, i32 0
  %180 = load ptr, ptr %179, align 8, !tbaa !11
  %181 = getelementptr inbounds i8, ptr %180, i64 21
  br label %182

182:                                              ; preds = %177, %170
  %183 = phi ptr [ %176, %170 ], [ %181, %177 ]
  %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 1
  store ptr %183, ptr %185, align 8, !tbaa !13
  %186 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762120, ptr %186, align 4, !tbaa !14
  %187 = call i32 @s2n_calculate_stacktrace()
  br label %188

188:                                              ; preds = %182
  %189 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %189, align 4, !tbaa !16
  br label %208

190:                                              ; No predecessors!
  br label %191

191:                                              ; preds = %190, %143
  br label %192

192:                                              ; preds = %191
  br label %193

193:                                              ; preds = %192
  %194 = load ptr, ptr %5, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.s2n_fingerprint_hash, ptr %194, i32 0, i32 1
  %196 = load ptr, ptr %195, align 8, !tbaa !20
  %197 = load ptr, ptr %6, align 8, !tbaa !5
  %198 = load i64, ptr %7, align 8, !tbaa !9
  %199 = trunc i64 %198 to i32
  %200 = call i32 @s2n_stuffer_write_bytes(ptr noundef %196, ptr noundef %197, i32 noundef %199)
  %201 = icmp sgt i32 %200, -1
  br i1 %201, label %204, label %202

202:                                              ; preds = %193
  %203 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 -1, ptr %203, align 4, !tbaa !16
  br label %208

204:                                              ; preds = %193
  br label %205

205:                                              ; preds = %204
  br label %206

206:                                              ; preds = %205, %102
  %207 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  store i32 0, ptr %207, align 4, !tbaa !16
  br label %208

208:                                              ; preds = %206, %202, %188, %138, %99, %80, %40
  %209 = getelementptr inbounds %struct.s2n_result, ptr %4, i32 0, i32 0
  %210 = load i32, ptr %209, align 4
  ret i32 %210
}

declare i32 @s2n_stuffer_write_bytes(ptr noundef, ptr noundef, 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 = { 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !15, i64 0}
!17 = !{!"", !15, i64 0}
!18 = !{!19, !6, i64 16}
!19 = !{!"s2n_fingerprint_hash", !15, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!19, !6, i64 8}
!21 = !{!22, !15, i64 8}
!22 = !{!"s2n_stuffer", !23, i64 0, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !15, i64 36, !15, i64 36}
!23 = !{!"s2n_blob", !6, i64 0, !15, i64 8, !15, i64 12, !15, i64 16}
!24 = !{!22, !15, i64 28}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.s2n_debug_info = type { ptr, ptr }

@_s2n_debug_info = external thread_local local_unnamed_addr global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@.str.28 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [92 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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_fingerprint_hash_add_bytes(ptr noundef readonly %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #3 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %12

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

12:                                               ; preds = %3
  %13 = icmp eq i64 %2, 0
  %14 = icmp ne ptr %1, null
  %or.cond = or i1 %14, %13
  br i1 %or.cond, label %23, label %15

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

23:                                               ; preds = %12
  %24 = getelementptr inbounds i8, ptr %0, i64 16
  %25 = load ptr, ptr %24, align 8, !tbaa !13
  %.not23 = icmp eq ptr %25, null
  br i1 %.not23, label %30, label %26

26:                                               ; preds = %23
  %27 = trunc i64 %2 to i32
  %28 = tail call i32 @s2n_hash_update(ptr noundef nonnull %25, ptr noundef %1, i32 noundef %27) #5
  %29 = icmp sgt i32 %28, -1
  br i1 %29, label %60, label %61

30:                                               ; preds = %23
  %31 = getelementptr inbounds i8, ptr %0, i64 8
  %32 = load ptr, ptr %31, align 8, !tbaa !15
  %.not24 = icmp eq ptr %32, null
  br i1 %.not24, label %33, label %41

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

41:                                               ; preds = %30
  %42 = getelementptr inbounds i8, ptr %32, i64 8
  %43 = load i32, ptr %42, align 8, !tbaa !16
  %44 = getelementptr inbounds i8, ptr %32, i64 28
  %45 = load i32, ptr %44, align 4, !tbaa !19
  %46 = sub i32 %43, %45
  %47 = zext i32 %46 to i64
  %.not26 = icmp ult i64 %47, %2
  br i1 %.not26, label %48, label %56

48:                                               ; preds = %41
  %49 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.31, ptr %49, align 8, !tbaa !5
  %50 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.31, i64 21), i32 noundef 47) #4
  %.not27 = icmp eq ptr %50, null
  %51 = getelementptr inbounds i8, ptr %50, i64 1
  %52 = select i1 %.not27, ptr getelementptr inbounds (i8, ptr @.str.31, i64 21), ptr %51
  %53 = getelementptr inbounds i8, ptr %49, i64 8
  store ptr %52, ptr %53, align 8, !tbaa !10
  %54 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762120, ptr %54, align 4, !tbaa !11
  %55 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %61

56:                                               ; preds = %41
  %57 = trunc nuw i64 %2 to i32
  %58 = tail call i32 @s2n_stuffer_write_bytes(ptr noundef nonnull %32, ptr noundef %1, i32 noundef %57) #5
  %59 = icmp sgt i32 %58, -1
  br i1 %59, label %60, label %61

60:                                               ; preds = %56, %26
  br label %61

61:                                               ; preds = %56, %26, %60, %48, %33, %15, %4
  %.sroa.0.0 = phi i32 [ 0, %60 ], [ -1, %48 ], [ -1, %33 ], [ -1, %15 ], [ -1, %4 ], [ -1, %26 ], [ -1, %56 ]
  ret i32 %.sroa.0.0
}

declare i32 @s2n_stuffer_write_bytes(ptr noundef, ptr noundef, 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 = { 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, !7, i64 16}
!14 = !{!"s2n_fingerprint_hash", !12, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!14, !7, i64 8}
!16 = !{!17, !12, i64 8}
!17 = !{!"s2n_stuffer", !18, i64 0, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 36, !12, i64 36}
!18 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!19 = !{!17, !12, i64 28}


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