; 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.6 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [97 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 uwtable
define dso_local i32 @s2n_stuffer_skip_expected_char(ptr noundef %0, i8 noundef signext %1, i32 noundef %2, i32 noundef %3, ptr noundef %4) #6 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %struct.s2n_result, align 4
  %13 = alloca %struct.s2n_result, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.s2n_result, align 4
  %17 = alloca %struct.s2n_result, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i8 %1, ptr %8, align 1, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !10
  store i32 %3, ptr %10, align 4, !tbaa !10
  store ptr %4, ptr %11, align 8, !tbaa !5
  br label %18

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

31:                                               ; preds = %18
  %32 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  store i32 0, ptr %32, align 4, !tbaa !12
  br label %35

33:                                               ; preds = %18
  %34 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  store i32 -1, ptr %34, align 4, !tbaa !12
  br label %35

35:                                               ; preds = %33, %31
  %36 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  %37 = load i32, ptr %36, align 4
  %38 = call zeroext i1 @s2n_result_is_ok(i32 %37)
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 -1, ptr %6, align 4
  br label %190

40:                                               ; preds = %35
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %9, align 4, !tbaa !10
  %44 = load i32, ptr %10, align 4, !tbaa !10
  %45 = icmp ule i32 %43, %44
  br i1 %45, label %77, label %46

46:                                               ; preds = %42
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  %49 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %50 = getelementptr inbounds %struct.s2n_debug_info, ptr %49, i32 0, i32 0
  store ptr @.str.6, ptr %50, align 8, !tbaa !14
  %51 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %52 = getelementptr inbounds %struct.s2n_debug_info, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !14
  %54 = getelementptr inbounds i8, ptr %53, i64 21
  %55 = call ptr @strrchr(ptr noundef %54, i32 noundef 47) #7
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %64

57:                                               ; preds = %48
  %58 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %59 = getelementptr inbounds %struct.s2n_debug_info, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !14
  %61 = getelementptr inbounds i8, ptr %60, i64 21
  %62 = call ptr @strrchr(ptr noundef %61, i32 noundef 47) #7
  %63 = getelementptr inbounds i8, ptr %62, i64 1
  br label %69

64:                                               ; preds = %48
  %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 0
  %67 = load ptr, ptr %66, align 8, !tbaa !14
  %68 = getelementptr inbounds i8, ptr %67, i64 21
  br label %69

69:                                               ; preds = %64, %57
  %70 = phi ptr [ %63, %57 ], [ %68, %64 ]
  %71 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %72 = getelementptr inbounds %struct.s2n_debug_info, ptr %71, i32 0, i32 1
  store ptr %70, ptr %72, align 8, !tbaa !16
  %73 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %73, align 4, !tbaa !10
  %74 = call i32 @s2n_calculate_stacktrace()
  br label %75

75:                                               ; preds = %69
  store i32 -1, ptr %6, align 4
  br label %190

76:                                               ; No predecessors!
  br label %77

77:                                               ; preds = %76, %42
  br label %78

78:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !10
  br label %79

79:                                               ; preds = %116, %78
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.s2n_stuffer, ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 8, !tbaa !17
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.s2n_stuffer, ptr %83, i32 0, i32 2
  %85 = load i32, ptr %84, align 4, !tbaa !20
  %86 = icmp ult i32 %82, %85
  br i1 %86, label %87, label %91

87:                                               ; preds = %79
  %88 = load i32, ptr %14, align 4, !tbaa !10
  %89 = load i32, ptr %10, align 4, !tbaa !10
  %90 = icmp ult i32 %88, %89
  br label %91

91:                                               ; preds = %87, %79
  %92 = phi i1 [ false, %79 ], [ %90, %87 ]
  br i1 %92, label %93, label %117

93:                                               ; preds = %91
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.s2n_stuffer, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %struct.s2n_blob, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !21
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.s2n_stuffer, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 8, !tbaa !17
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %97, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !9
  %104 = zext i8 %103 to i32
  %105 = load i8, ptr %8, align 1, !tbaa !9
  %106 = sext i8 %105 to i32
  %107 = icmp eq i32 %104, %106
  br i1 %107, label %108, label %115

108:                                              ; preds = %93
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.s2n_stuffer, ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 8, !tbaa !17
  %112 = add i32 %111, 1
  store i32 %112, ptr %110, align 8, !tbaa !17
  %113 = load i32, ptr %14, align 4, !tbaa !10
  %114 = add i32 %113, 1
  store i32 %114, ptr %14, align 4, !tbaa !10
  br label %116

115:                                              ; preds = %93
  br label %117

116:                                              ; preds = %108
  br label %79, !llvm.loop !22

117:                                              ; preds = %115, %91
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %14, align 4, !tbaa !10
  %120 = load i32, ptr %9, align 4, !tbaa !10
  %121 = icmp uge i32 %119, %120
  br i1 %121, label %155, label %122

122:                                              ; preds = %118
  br label %123

123:                                              ; preds = %122
  br label %124

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

133:                                              ; preds = %124
  %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 0
  %136 = load ptr, ptr %135, align 8, !tbaa !14
  %137 = getelementptr inbounds i8, ptr %136, i64 21
  %138 = call ptr @strrchr(ptr noundef %137, i32 noundef 47) #7
  %139 = getelementptr inbounds i8, ptr %138, i64 1
  br label %145

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

145:                                              ; preds = %140, %133
  %146 = phi ptr [ %139, %133 ], [ %144, %140 ]
  %147 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %148 = getelementptr inbounds %struct.s2n_debug_info, ptr %147, i32 0, i32 1
  store ptr %146, ptr %148, align 8, !tbaa !16
  %149 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653203, ptr %149, align 4, !tbaa !10
  %150 = call i32 @s2n_calculate_stacktrace()
  br label %151

151:                                              ; preds = %145
  br label %152

152:                                              ; preds = %151
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %189

153:                                              ; No predecessors!
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154, %118
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %163

160:                                              ; preds = %157
  %161 = load i32, ptr %14, align 4, !tbaa !10
  %162 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %161, ptr %162, align 4, !tbaa !10
  br label %163

163:                                              ; preds = %160, %157
  br label %164

164:                                              ; preds = %163
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = call i32 @s2n_stuffer_validate(ptr noundef %165)
  %167 = getelementptr inbounds %struct.s2n_result, ptr %17, i32 0, i32 0
  store i32 %166, ptr %167, align 4
  %168 = getelementptr inbounds %struct.s2n_result, ptr %17, i32 0, i32 0
  %169 = load i32, ptr %168, align 4
  %170 = call zeroext i1 @s2n_result_is_ok(i32 %169)
  %171 = xor i1 %170, true
  %172 = xor i1 %171, true
  %173 = zext i1 %172 to i32
  %174 = sext i32 %173 to i64
  %175 = call i64 @llvm.expect.i64(i64 %174, i64 1)
  %176 = icmp ne i64 %175, 0
  br i1 %176, label %177, label %179

177:                                              ; preds = %164
  %178 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  store i32 0, ptr %178, align 4, !tbaa !12
  br label %181

179:                                              ; preds = %164
  %180 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  store i32 -1, ptr %180, align 4, !tbaa !12
  br label %181

181:                                              ; preds = %179, %177
  %182 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  %183 = load i32, ptr %182, align 4
  %184 = call zeroext i1 @s2n_result_is_ok(i32 %183)
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %189

186:                                              ; preds = %181
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  store i32 0, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %189

189:                                              ; preds = %188, %185, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %190

190:                                              ; preds = %189, %75, %39
  %191 = load i32, ptr %6, align 4
  ret i32 %191
}

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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"", !11, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !11, i64 24}
!18 = !{!"s2n_stuffer", !19, i64 0, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 36, !11, i64 36}
!19 = !{!"s2n_blob", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!20 = !{!18, !11, i64 28}
!21 = !{!18, !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.6 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [97 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: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_stuffer_skip_expected_char(ptr noundef %0, i8 noundef signext %1, i32 noundef %2, i32 noundef %3, ptr noundef writeonly %4) local_unnamed_addr #4 {
  %6 = tail call i32 @s2n_stuffer_validate(ptr noundef %0) #5
  %7 = tail call zeroext i1 @s2n_result_is_ok(i32 %6)
  %not. = xor i1 %7, true
  %. = sext i1 %not. to i32
  %8 = tail call zeroext i1 @s2n_result_is_ok(i32 %.)
  br i1 %8, label %9, label %53

9:                                                ; preds = %5
  %.not = icmp ugt i32 %2, %3
  br i1 %.not, label %20, label %.preheader

.preheader:                                       ; preds = %9
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = getelementptr inbounds i8, ptr %0, i64 28
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %.promoted = load i32, ptr %10, align 8, !tbaa !12
  %13 = icmp ult i32 %.promoted, %12
  %14 = icmp ne i32 %3, 0
  %15 = and i1 %13, %14
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %16 = load ptr, ptr %0, align 8, !tbaa !13
  %17 = sext i8 %1 to i32
  %18 = zext i32 %.promoted to i64
  %19 = zext i32 %12 to i64
  br label %28

20:                                               ; preds = %9
  %21 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.6, ptr %21, align 8, !tbaa !14
  %22 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.6, i64 21), i32 noundef 47) #6
  %.not28 = icmp eq ptr %22, null
  %23 = getelementptr inbounds i8, ptr %22, i64 1
  %24 = select i1 %.not28, ptr getelementptr inbounds (i8, ptr @.str.6, i64 21), ptr %23
  %25 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %24, ptr %25, align 8, !tbaa !16
  %26 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %26, align 4, !tbaa !17
  %27 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %53

28:                                               ; preds = %.lr.ph, %33
  %indvars.iv = phi i64 [ %18, %.lr.ph ], [ %indvars.iv.next, %33 ]
  %.02135 = phi i32 [ 0, %.lr.ph ], [ %35, %33 ]
  %29 = getelementptr inbounds i8, ptr %16, i64 %indvars.iv
  %30 = load i8, ptr %29, align 1, !tbaa !18
  %31 = zext i8 %30 to i32
  %32 = icmp eq i32 %31, %17
  br i1 %32, label %33, label %._crit_edge

33:                                               ; preds = %28
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = trunc nuw i64 %indvars.iv.next to i32
  store i32 %34, ptr %10, align 8, !tbaa !12
  %35 = add nuw i32 %.02135, 1
  %36 = icmp ult i64 %indvars.iv.next, %19
  %37 = icmp ult i32 %35, %3
  %38 = select i1 %36, i1 %37, i1 false
  br i1 %38, label %28, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %28, %33, %.preheader
  %.021.lcssa = phi i32 [ 0, %.preheader ], [ %35, %33 ], [ %.02135, %28 ]
  %.not29 = icmp ult i32 %.021.lcssa, %2
  br i1 %.not29, label %39, label %47

39:                                               ; preds = %._crit_edge
  %40 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.7, ptr %40, align 8, !tbaa !14
  %41 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.7, i64 21), i32 noundef 47) #6
  %.not30 = icmp eq ptr %41, null
  %42 = getelementptr inbounds i8, ptr %41, i64 1
  %43 = select i1 %.not30, ptr getelementptr inbounds (i8, ptr @.str.7, i64 21), ptr %42
  %44 = getelementptr inbounds i8, ptr %40, i64 8
  store ptr %43, ptr %44, align 8, !tbaa !16
  %45 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653203, ptr %45, align 4, !tbaa !17
  %46 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %53

47:                                               ; preds = %._crit_edge
  %.not31 = icmp eq ptr %4, null
  br i1 %.not31, label %49, label %48

48:                                               ; preds = %47
  store i32 %.021.lcssa, ptr %4, align 4, !tbaa !17
  br label %49

49:                                               ; preds = %47, %48
  %50 = tail call i32 @s2n_stuffer_validate(ptr noundef nonnull %0) #5
  %51 = tail call zeroext i1 @s2n_result_is_ok(i32 %50)
  %not.33 = xor i1 %51, true
  %.32 = sext i1 %not.33 to i32
  %52 = tail call zeroext i1 @s2n_result_is_ok(i32 %.32)
  %not.34 = xor i1 %52, true
  %spec.select = sext i1 %not.34 to i32
  br label %53

53:                                               ; preds = %49, %39, %5, %20
  %.1 = phi i32 [ -1, %20 ], [ -1, %5 ], [ -1, %39 ], [ %spec.select, %49 ]
  ret i32 %.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, !11, i64 28}
!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 = !{!6, !11, i64 24}
!13 = !{!6, !8, i64 0}
!14 = !{!15, !8, i64 0}
!15 = !{!"s2n_debug_info", !8, i64 0, !8, i64 8}
!16 = !{!15, !8, i64 8}
!17 = !{!11, !11, i64 0}
!18 = !{!9, !9, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


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