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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }

@_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

; 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(none)
declare i64 @llvm.expect.i64(i64, i64) #3

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_stuffer_skip_read(ptr noundef, i32 noundef) #6

declare ptr @s2n_ensure_memmove_trace(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_stuffer_erase_and_read_bytes(ptr noundef %0, ptr noundef %1, i32 noundef %2) #6 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  br label %14

14:                                               ; preds = %3
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = call i32 @s2n_stuffer_skip_read(ptr noundef %15, i32 noundef %16)
  %18 = icmp sgt i32 %17, -1
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  store i32 -1, ptr %4, align 4
  br label %202

20:                                               ; preds = %14
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.s2n_stuffer, ptr %23, i32 0, i32 0
  %25 = getelementptr inbounds %struct.s2n_blob, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = icmp ne ptr %26, null
  br i1 %27, label %59, label %28

28:                                               ; preds = %22
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  %31 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %32 = getelementptr inbounds %struct.s2n_debug_info, ptr %31, i32 0, i32 0
  store ptr @.str.28, ptr %32, align 8, !tbaa !14
  %33 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %34 = getelementptr inbounds %struct.s2n_debug_info, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %35, i64 21
  %37 = call ptr @strrchr(ptr noundef %36, i32 noundef 47) #7
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %46

39:                                               ; preds = %30
  %40 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %41 = getelementptr inbounds %struct.s2n_debug_info, ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !14
  %43 = getelementptr inbounds i8, ptr %42, i64 21
  %44 = call ptr @strrchr(ptr noundef %43, i32 noundef 47) #7
  %45 = getelementptr inbounds i8, ptr %44, i64 1
  br label %51

46:                                               ; preds = %30
  %47 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %48 = getelementptr inbounds %struct.s2n_debug_info, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !14
  %50 = getelementptr inbounds i8, ptr %49, i64 21
  br label %51

51:                                               ; preds = %46, %39
  %52 = phi ptr [ %45, %39 ], [ %50, %46 ]
  %53 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %54 = getelementptr inbounds %struct.s2n_debug_info, ptr %53, i32 0, i32 1
  store ptr %52, ptr %54, align 8, !tbaa !16
  %55 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %55, align 4, !tbaa !9
  %56 = call i32 @s2n_calculate_stacktrace()
  br label %57

57:                                               ; preds = %51
  store i32 -1, ptr %4, align 4
  br label %202

58:                                               ; No predecessors!
  br label %59

59:                                               ; preds = %58, %22
  br label %60

60:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.s2n_stuffer, ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds %struct.s2n_blob, ptr %62, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.s2n_stuffer, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 8, !tbaa !17
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds i8, ptr %64, i64 %68
  %70 = load i32, ptr %7, align 4, !tbaa !9
  %71 = zext i32 %70 to i64
  %72 = sub i64 0, %71
  %73 = getelementptr inbounds i8, ptr %69, i64 %72
  store ptr %73, ptr %8, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %75 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %75, ptr %9, align 4, !tbaa !9
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = icmp ne i32 %76, 0
  %78 = xor i1 %77, true
  %79 = xor i1 %78, true
  %80 = zext i1 %79 to i32
  %81 = sext i32 %80 to i64
  %82 = call i64 @llvm.expect.i64(i64 %81, i64 1)
  %83 = icmp ne i64 %82, 0
  br i1 %83, label %84, label %132

84:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = zext i32 %87 to i64
  %89 = call ptr @s2n_ensure_memmove_trace(ptr noundef %85, ptr noundef %86, i64 noundef %88)
  store ptr %89, ptr %10, align 8, !tbaa !5
  br label %90

90:                                               ; preds = %84
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = icmp ne ptr %91, null
  br i1 %92, label %126, label %93

93:                                               ; preds = %90
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  %96 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %97 = getelementptr inbounds %struct.s2n_debug_info, ptr %96, i32 0, i32 0
  store ptr @.str.29, ptr %97, align 8, !tbaa !14
  %98 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %99 = getelementptr inbounds %struct.s2n_debug_info, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !14
  %101 = getelementptr inbounds i8, ptr %100, i64 21
  %102 = call ptr @strrchr(ptr noundef %101, i32 noundef 47) #7
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %111

104:                                              ; preds = %95
  %105 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %106 = getelementptr inbounds %struct.s2n_debug_info, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !14
  %108 = getelementptr inbounds i8, ptr %107, i64 21
  %109 = call ptr @strrchr(ptr noundef %108, i32 noundef 47) #7
  %110 = getelementptr inbounds i8, ptr %109, i64 1
  br label %116

111:                                              ; preds = %95
  %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
  %114 = load ptr, ptr %113, align 8, !tbaa !14
  %115 = getelementptr inbounds i8, ptr %114, i64 21
  br label %116

116:                                              ; preds = %111, %104
  %117 = phi ptr [ %110, %104 ], [ %115, %111 ]
  %118 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %119 = getelementptr inbounds %struct.s2n_debug_info, ptr %118, i32 0, i32 1
  store ptr %117, ptr %119, align 8, !tbaa !16
  %120 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %120, align 4, !tbaa !9
  %121 = call i32 @s2n_calculate_stacktrace()
  br label %122

122:                                              ; preds = %116
  br label %123

123:                                              ; preds = %122
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %129

124:                                              ; No predecessors!
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125, %90
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  store i32 0, ptr %11, align 4
  br label %129

129:                                              ; preds = %128, %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %130 = load i32, ptr %11, align 4
  switch i32 %130, label %133 [
    i32 0, label %131
  ]

131:                                              ; preds = %129
  br label %132

132:                                              ; preds = %131, %74
  store i32 0, ptr %11, align 4
  br label %133

133:                                              ; preds = %132, %129
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  %134 = load i32, ptr %11, align 4
  switch i32 %134, label %201 [
    i32 0, label %135
  ]

135:                                              ; preds = %133
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %139 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %139, ptr %12, align 4, !tbaa !9
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = icmp ne i32 %140, 0
  %142 = xor i1 %141, true
  %143 = xor i1 %142, true
  %144 = zext i1 %143 to i32
  %145 = sext i32 %144 to i64
  %146 = call i64 @llvm.expect.i64(i64 %145, i64 1)
  %147 = icmp ne i64 %146, 0
  br i1 %147, label %148, label %195

148:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %149, ptr %13, align 8, !tbaa !5
  br label %150

150:                                              ; preds = %148
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  %152 = icmp ne ptr %151, null
  br i1 %152, label %186, label %153

153:                                              ; preds = %150
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  %156 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %157 = getelementptr inbounds %struct.s2n_debug_info, ptr %156, i32 0, i32 0
  store ptr @.str.30, ptr %157, align 8, !tbaa !14
  %158 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %159 = getelementptr inbounds %struct.s2n_debug_info, ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !14
  %161 = getelementptr inbounds i8, ptr %160, i64 21
  %162 = call ptr @strrchr(ptr noundef %161, i32 noundef 47) #7
  %163 = icmp ne ptr %162, null
  br i1 %163, label %164, label %171

164:                                              ; preds = %155
  %165 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %166 = getelementptr inbounds %struct.s2n_debug_info, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !14
  %168 = getelementptr inbounds i8, ptr %167, i64 21
  %169 = call ptr @strrchr(ptr noundef %168, i32 noundef 47) #7
  %170 = getelementptr inbounds i8, ptr %169, i64 1
  br label %176

171:                                              ; preds = %155
  %172 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %173 = getelementptr inbounds %struct.s2n_debug_info, ptr %172, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8, !tbaa !14
  %175 = getelementptr inbounds i8, ptr %174, i64 21
  br label %176

176:                                              ; preds = %171, %164
  %177 = phi ptr [ %170, %164 ], [ %175, %171 ]
  %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 1
  store ptr %177, ptr %179, align 8, !tbaa !16
  %180 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %180, align 4, !tbaa !9
  %181 = call i32 @s2n_calculate_stacktrace()
  br label %182

182:                                              ; preds = %176
  br label %183

183:                                              ; preds = %182
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %192

184:                                              ; No predecessors!
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185, %150
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  %189 = load ptr, ptr %13, align 8, !tbaa !5
  %190 = load i32, ptr %12, align 4, !tbaa !9
  %191 = zext i32 %190 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %189, i8 0, i64 %191, i1 false)
  store i32 0, ptr %11, align 4
  br label %192

192:                                              ; preds = %188, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  %193 = load i32, ptr %11, align 4
  switch i32 %193, label %196 [
    i32 0, label %194
  ]

194:                                              ; preds = %192
  br label %195

195:                                              ; preds = %194, %138
  store i32 0, ptr %11, align 4
  br label %196

196:                                              ; preds = %195, %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %197 = load i32, ptr %11, align 4
  switch i32 %197, label %201 [
    i32 0, label %198
  ]

198:                                              ; preds = %196
  br label %199

199:                                              ; preds = %198
  br label %200

200:                                              ; preds = %199
  store i32 0, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %201

201:                                              ; preds = %200, %196, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %202

202:                                              ; preds = %201, %57, %19
  %203 = load i32, ptr %4, align 4
  ret i32 %203
}

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(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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, !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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"s2n_stuffer", !13, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 36, !10, i64 36}
!13 = !{!"s2n_blob", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!14 = !{!15, !6, i64 0}
!15 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!16 = !{!15, !6, i64 8}
!17 = !{!12, !10, i64 24}


; 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

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_stuffer_skip_read(ptr noundef, i32 noundef) local_unnamed_addr #4

declare ptr @s2n_ensure_memmove_trace(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_stuffer_erase_and_read_bytes(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #4 {
  %4 = tail call i32 @s2n_stuffer_skip_read(ptr noundef %0, i32 noundef %2)
  %5 = icmp sgt i32 %4, -1
  br i1 %5, label %6, label %.critedge

6:                                                ; preds = %3
  %7 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %16

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

16:                                               ; preds = %6
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = load i32, ptr %17, align 8, !tbaa !16
  %19 = zext i32 %18 to i64
  %20 = getelementptr inbounds i8, ptr %7, i64 %19
  %21 = zext i32 %2 to i64
  %22 = sub nsw i64 0, %21
  %23 = getelementptr inbounds i8, ptr %20, i64 %22
  %.not33 = icmp eq i32 %2, 0
  br i1 %.not33, label %.critedge, label %24, !prof !17

24:                                               ; preds = %16
  %25 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef %1, ptr noundef nonnull %23, i64 noundef %21) #6
  %.not34.not = icmp eq ptr %25, null
  br i1 %.not34.not, label %26, label %.critedge37

26:                                               ; preds = %24
  %27 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.29, ptr %27, align 8, !tbaa !12
  %28 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.29, i64 21), i32 noundef 47) #5
  %.not35 = icmp eq ptr %28, null
  %29 = getelementptr inbounds i8, ptr %28, i64 1
  %30 = select i1 %.not35, ptr getelementptr inbounds (i8, ptr @.str.29, i64 21), ptr %29
  %31 = getelementptr inbounds i8, ptr %27, i64 8
  store ptr %30, ptr %31, align 8, !tbaa !14
  %32 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %32, align 4, !tbaa !15
  %33 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %.critedge

.critedge37:                                      ; preds = %24
  tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %23, i8 0, i64 %21, i1 false)
  br label %.critedge

.critedge:                                        ; preds = %26, %16, %.critedge37, %3, %8
  %.7 = phi i32 [ -1, %8 ], [ -1, %3 ], [ -1, %26 ], [ 0, %.critedge37 ], [ 0, %16 ]
  ret i32 %.7
}

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 nounwind willreturn memory(argmem: write) }
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 = { nounwind willreturn memory(read) }
attributes #6 = { 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, !8, i64 0}
!6 = !{!"s2n_stuffer", !7, i64 0, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 36, !11, i64 36}
!7 = !{!"s2n_blob", !8, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!13, !8, i64 0}
!13 = !{!"s2n_debug_info", !8, i64 0, !8, i64 8}
!14 = !{!13, !8, i64 8}
!15 = !{!11, !11, i64 0}
!16 = !{!6, !11, i64 24}
!17 = !{!"branch_weights", !"expected", i32 1, i32 2000}


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