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

; 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 = 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.4 = external hidden unnamed_addr constant [96 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [96 x i8], align 1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #1

declare i32 @s2n_stuffer_validate(ptr noundef) #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.end.p0(i64 immarg, ptr nocapture) #0

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

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

declare i32 @s2n_calculate_stacktrace() #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

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

13:                                               ; preds = %2
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = call i32 @s2n_stuffer_validate(ptr noundef %14)
  %16 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  store i32 %15, ptr %16, align 4
  %17 = getelementptr inbounds %struct.s2n_result, ptr %7, i32 0, i32 0
  %18 = load i32, ptr %17, align 4
  %19 = call zeroext i1 @s2n_result_is_ok(i32 %18)
  %20 = xor i1 %19, true
  %21 = xor i1 %20, true
  %22 = zext i1 %21 to i32
  %23 = sext i32 %22 to i64
  %24 = call i64 @llvm.expect.i64(i64 %23, i64 1)
  %25 = icmp ne i64 %24, 0
  br i1 %25, label %26, label %28

26:                                               ; preds = %13
  %27 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %30

28:                                               ; preds = %13
  %29 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  store i32 -1, ptr %29, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %28, %26
  %31 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  %32 = load i32, ptr %31, align 4
  %33 = call zeroext i1 @s2n_result_is_ok(i32 %32)
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 -1, ptr %3, align 4
  br label %210

35:                                               ; preds = %30
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %71, label %40

40:                                               ; preds = %37
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  %43 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %44 = getelementptr inbounds %struct.s2n_debug_info, ptr %43, i32 0, i32 0
  store ptr @.str.4, ptr %44, align 8, !tbaa !12
  %45 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %46 = getelementptr inbounds %struct.s2n_debug_info, ptr %45, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !12
  %48 = getelementptr inbounds i8, ptr %47, i64 21
  %49 = call ptr @strrchr(ptr noundef %48, i32 noundef 47) #7
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %58

51:                                               ; preds = %42
  %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
  %54 = load ptr, ptr %53, align 8, !tbaa !12
  %55 = getelementptr inbounds i8, ptr %54, i64 21
  %56 = call ptr @strrchr(ptr noundef %55, i32 noundef 47) #7
  %57 = getelementptr inbounds i8, ptr %56, i64 1
  br label %63

58:                                               ; preds = %42
  %59 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %60 = getelementptr inbounds %struct.s2n_debug_info, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !12
  %62 = getelementptr inbounds i8, ptr %61, i64 21
  br label %63

63:                                               ; preds = %58, %51
  %64 = phi ptr [ %57, %51 ], [ %62, %58 ]
  %65 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %66 = getelementptr inbounds %struct.s2n_debug_info, ptr %65, i32 0, i32 1
  store ptr %64, ptr %66, align 8, !tbaa !14
  %67 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %67, align 4, !tbaa !15
  %68 = call i32 @s2n_calculate_stacktrace()
  br label %69

69:                                               ; preds = %63
  store i32 -1, ptr %3, align 4
  br label %210

70:                                               ; No predecessors!
  br label %71

71:                                               ; preds = %70, %37
  br label %72

72:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = call i64 @strlen(ptr noundef %73) #7
  %75 = trunc i64 %74 to i32
  store i32 %75, ptr %8, align 4, !tbaa !15
  %76 = load i32, ptr %8, align 4, !tbaa !15
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %72
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %209

79:                                               ; preds = %72
  br label %80

80:                                               ; preds = %181, %79
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.s2n_stuffer, ptr %81, i32 0, i32 2
  %83 = load i32, ptr %82, align 4, !tbaa !16
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.s2n_stuffer, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 8, !tbaa !19
  %87 = sub i32 %83, %86
  %88 = load i32, ptr %8, align 4, !tbaa !15
  %89 = icmp uge i32 %87, %88
  br i1 %89, label %90, label %183

90:                                               ; preds = %80
  br label %91

91:                                               ; preds = %90
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i64 0
  %95 = load i8, ptr %94, align 1, !tbaa !20
  %96 = call i32 @s2n_stuffer_skip_to_char(ptr noundef %92, i8 noundef signext %95)
  %97 = icmp sgt i32 %96, -1
  br i1 %97, label %99, label %98

98:                                               ; preds = %91
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %209

99:                                               ; preds = %91
  br label %100

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = load i32, ptr %8, align 4, !tbaa !15
  %105 = call i32 @s2n_stuffer_skip_read(ptr noundef %103, i32 noundef %104)
  %106 = icmp sgt i32 %105, -1
  br i1 %106, label %108, label %107

107:                                              ; preds = %102
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %209

108:                                              ; preds = %102
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.s2n_stuffer, ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %struct.s2n_blob, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !21
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.s2n_stuffer, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 8, !tbaa !19
  %118 = zext i32 %117 to i64
  %119 = getelementptr inbounds i8, ptr %114, i64 %118
  %120 = load i32, ptr %8, align 4, !tbaa !15
  %121 = zext i32 %120 to i64
  %122 = sub i64 0, %121
  %123 = getelementptr inbounds i8, ptr %119, i64 %122
  store ptr %123, ptr %10, align 8, !tbaa !5
  br label %124

124:                                              ; preds = %110
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = icmp ne ptr %125, null
  br i1 %126, label %160, label %127

127:                                              ; preds = %124
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  %130 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %131 = getelementptr inbounds %struct.s2n_debug_info, ptr %130, i32 0, i32 0
  store ptr @.str.5, ptr %131, align 8, !tbaa !12
  %132 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %133 = getelementptr inbounds %struct.s2n_debug_info, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !12
  %135 = getelementptr inbounds i8, ptr %134, i64 21
  %136 = call ptr @strrchr(ptr noundef %135, i32 noundef 47) #7
  %137 = icmp ne ptr %136, null
  br i1 %137, label %138, label %145

138:                                              ; preds = %129
  %139 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %140 = getelementptr inbounds %struct.s2n_debug_info, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !12
  %142 = getelementptr inbounds i8, ptr %141, i64 21
  %143 = call ptr @strrchr(ptr noundef %142, i32 noundef 47) #7
  %144 = getelementptr inbounds i8, ptr %143, i64 1
  br label %150

145:                                              ; preds = %129
  %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 0
  %148 = load ptr, ptr %147, align 8, !tbaa !12
  %149 = getelementptr inbounds i8, ptr %148, i64 21
  br label %150

150:                                              ; preds = %145, %138
  %151 = phi ptr [ %144, %138 ], [ %149, %145 ]
  %152 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %153 = getelementptr inbounds %struct.s2n_debug_info, ptr %152, i32 0, i32 1
  store ptr %151, ptr %153, align 8, !tbaa !14
  %154 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %154, align 4, !tbaa !15
  %155 = call i32 @s2n_calculate_stacktrace()
  br label %156

156:                                              ; preds = %150
  br label %157

157:                                              ; preds = %156
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %181

158:                                              ; No predecessors!
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159, %124
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = load i32, ptr %8, align 4, !tbaa !15
  %166 = zext i32 %165 to i64
  %167 = call i32 @strncmp(ptr noundef %163, ptr noundef %164, i64 noundef %166) #7
  %168 = icmp eq i32 %167, 0
  br i1 %168, label %169, label %170

169:                                              ; preds = %162
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %181

170:                                              ; preds = %162
  br label %171

171:                                              ; preds = %170
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = load i32, ptr %8, align 4, !tbaa !15
  %174 = sub i32 %173, 1
  %175 = call i32 @s2n_stuffer_rewind_read(ptr noundef %172, i32 noundef %174)
  %176 = icmp sgt i32 %175, -1
  br i1 %176, label %178, label %177

177:                                              ; preds = %171
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %181

178:                                              ; preds = %171
  br label %179

179:                                              ; preds = %178
  br label %180

180:                                              ; preds = %179
  store i32 10, ptr %9, align 4
  br label %181, !llvm.loop !22

181:                                              ; preds = %180, %177, %169, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %182 = load i32, ptr %9, align 4
  switch i32 %182, label %209 [
    i32 10, label %80
  ]

183:                                              ; preds = %80
  br label %184

184:                                              ; preds = %183
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = call i32 @s2n_stuffer_validate(ptr noundef %185)
  %187 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  store i32 %186, ptr %187, align 4
  %188 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  %189 = load i32, ptr %188, align 4
  %190 = call zeroext i1 @s2n_result_is_ok(i32 %189)
  %191 = xor i1 %190, true
  %192 = xor i1 %191, true
  %193 = zext i1 %192 to i32
  %194 = sext i32 %193 to i64
  %195 = call i64 @llvm.expect.i64(i64 %194, i64 1)
  %196 = icmp ne i64 %195, 0
  br i1 %196, label %197, label %199

197:                                              ; preds = %184
  %198 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 0, ptr %198, align 4, !tbaa !9
  br label %201

199:                                              ; preds = %184
  %200 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 -1, ptr %200, align 4, !tbaa !9
  br label %201

201:                                              ; preds = %199, %197
  %202 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %203 = load i32, ptr %202, align 4
  %204 = call zeroext i1 @s2n_result_is_ok(i32 %203)
  br i1 %204, label %206, label %205

205:                                              ; preds = %201
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %209

206:                                              ; preds = %201
  br label %207

207:                                              ; preds = %206
  br label %208

208:                                              ; preds = %207
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %209

209:                                              ; preds = %208, %205, %181, %107, %98, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %210

210:                                              ; preds = %209, %69, %34
  %211 = load i32, ptr %3, align 4
  ret i32 %211
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #5

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 speculatable willreturn memory(none) }
attributes #5 = { 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 #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, !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, !11, i64 28}
!17 = !{!"s2n_stuffer", !18, i64 0, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 36, !11, i64 36}
!18 = !{!"s2n_blob", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!19 = !{!17, !11, i64 24}
!20 = !{!7, !7, i64 0}
!21 = !{!17, !6, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"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 }

@_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.4 = external hidden unnamed_addr constant [96 x i8], align 1

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #0

declare i32 @s2n_stuffer_validate(ptr noundef) local_unnamed_addr #1

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_stuffer_skip_read_until(ptr noundef %0, ptr noundef readonly %1) local_unnamed_addr #4 {
  %3 = tail call i32 @s2n_stuffer_validate(ptr noundef %0) #5
  %4 = tail call zeroext i1 @s2n_result_is_ok(i32 %3)
  %not. = xor i1 %4, true
  %. = sext i1 %not. to i32
  %5 = tail call zeroext i1 @s2n_result_is_ok(i32 %.)
  br i1 %5, label %6, label %.thread

6:                                                ; preds = %2
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %7, label %15

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

15:                                               ; preds = %6
  %16 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #6
  %17 = trunc i64 %16 to i32
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %.thread, label %.preheader

.preheader:                                       ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 28
  %20 = getelementptr inbounds i8, ptr %0, i64 24
  %21 = and i64 %16, 4294967295
  %22 = sub nsw i64 0, %21
  %23 = add i32 %17, -1
  br label %24

24:                                               ; preds = %.preheader, %43
  %25 = load i32, ptr %19, align 4, !tbaa !13
  %26 = load i32, ptr %20, align 8, !tbaa !16
  %27 = sub i32 %25, %26
  %.not31 = icmp ult i32 %27, %17
  br i1 %.not31, label %46, label %28

28:                                               ; preds = %24
  %29 = load i8, ptr %1, align 1, !tbaa !17
  %30 = tail call i32 @s2n_stuffer_skip_to_char(ptr noundef nonnull %0, i8 noundef signext %29)
  %31 = icmp sgt i32 %30, -1
  br i1 %31, label %32, label %.thread

32:                                               ; preds = %28
  %33 = tail call i32 @s2n_stuffer_skip_read(ptr noundef nonnull %0, i32 noundef %17) #5
  %34 = icmp sgt i32 %33, -1
  br i1 %34, label %35, label %.thread

35:                                               ; preds = %32
  %36 = load ptr, ptr %0, align 8, !tbaa !18
  %37 = load i32, ptr %20, align 8, !tbaa !16
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds i8, ptr %36, i64 %38
  %40 = getelementptr inbounds i8, ptr %39, i64 %22
  %41 = tail call i32 @strncmp(ptr noundef %40, ptr noundef nonnull %1, i64 noundef %21) #6
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %.thread, label %43

43:                                               ; preds = %35
  %44 = tail call i32 @s2n_stuffer_rewind_read(ptr noundef nonnull %0, i32 noundef %23) #5
  %45 = icmp sgt i32 %44, -1
  br i1 %45, label %24, label %.thread

46:                                               ; preds = %24
  %47 = tail call i32 @s2n_stuffer_validate(ptr noundef nonnull %0) #5
  %48 = tail call zeroext i1 @s2n_result_is_ok(i32 %47)
  %not.36 = xor i1 %48, true
  %.33 = sext i1 %not.36 to i32
  %49 = tail call zeroext i1 @s2n_result_is_ok(i32 %.33)
  %not.37 = xor i1 %49, true
  %spec.select = sext i1 %not.37 to i32
  br label %.thread

.thread:                                          ; preds = %35, %43, %28, %32, %46, %15, %2, %7
  %.3 = phi i32 [ -1, %7 ], [ -1, %2 ], [ 0, %15 ], [ %spec.select, %46 ], [ 0, %35 ], [ -1, %32 ], [ -1, %28 ], [ -1, %43 ]
  ret i32 %.3
}

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

declare i32 @s2n_stuffer_skip_read(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3

declare i32 @s2n_stuffer_rewind_read(ptr noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { inlinehint 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 #1 = { "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #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 }
attributes #6 = { 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, !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 28}
!14 = !{!"s2n_stuffer", !15, i64 0, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 36, !12, i64 36}
!15 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!16 = !{!14, !12, i64 24}
!17 = !{!8, !8, i64 0}
!18 = !{!14, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass