; 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_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.41 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [92 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_stuffer_validate(ptr noundef) #0

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

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

declare i32 @s2n_calculate_stacktrace() #3

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

declare i32 @s2n_blob_validate(ptr noundef) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #5

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

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

declare i32 @s2n_realloc(ptr noundef, i32 noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_stuffer_extract_blob(ptr noundef %0, ptr noundef %1) #0 {
  %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 ptr, align 8
  %10 = alloca i32, align 4
  %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 %200

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.41, 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 %200

70:                                               ; No predecessors!
  br label %71

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

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.s2n_stuffer, ptr %75, i32 0, i32 2
  %77 = load i32, ptr %76, align 4, !tbaa !16
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.s2n_stuffer, ptr %78, i32 0, i32 1
  %80 = load i32, ptr %79, align 8, !tbaa !19
  %81 = sub i32 %77, %80
  %82 = call i32 @s2n_realloc(ptr noundef %74, i32 noundef %81)
  %83 = icmp sgt i32 %82, -1
  br i1 %83, label %85, label %84

84:                                               ; preds = %73
  store i32 -1, ptr %3, align 4
  br label %200

85:                                               ; preds = %73
  br label %86

86:                                               ; preds = %85
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.s2n_stuffer, ptr %87, i32 0, i32 2
  %89 = load i32, ptr %88, align 4, !tbaa !16
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.s2n_stuffer, ptr %90, i32 0, i32 1
  %92 = load i32, ptr %91, align 8, !tbaa !19
  %93 = sub i32 %89, %92
  %94 = icmp ugt i32 %93, 0
  br i1 %94, label %95, label %175

95:                                               ; preds = %86
  br label %96

96:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.s2n_stuffer, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 4, !tbaa !16
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.s2n_stuffer, ptr %100, i32 0, i32 1
  %102 = load i32, ptr %101, align 8, !tbaa !19
  %103 = sub i32 %99, %102
  store i32 %103, ptr %8, align 4, !tbaa !15
  %104 = load i32, ptr %8, align 4, !tbaa !15
  %105 = icmp ne i32 %104, 0
  %106 = xor i1 %105, true
  %107 = xor i1 %106, true
  %108 = zext i1 %107 to i32
  %109 = sext i32 %108 to i64
  %110 = call i64 @llvm.expect.i64(i64 %109, i64 1)
  %111 = icmp ne i64 %110, 0
  br i1 %111, label %112, label %170

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

128:                                              ; preds = %112
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = icmp ne ptr %129, null
  br i1 %130, label %164, label %131

131:                                              ; preds = %128
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  %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
  store ptr @.str.42, ptr %135, align 8, !tbaa !12
  %136 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %137 = getelementptr inbounds %struct.s2n_debug_info, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !12
  %139 = getelementptr inbounds i8, ptr %138, i64 21
  %140 = call ptr @strrchr(ptr noundef %139, i32 noundef 47) #7
  %141 = icmp ne ptr %140, null
  br i1 %141, label %142, label %149

142:                                              ; preds = %133
  %143 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %144 = getelementptr inbounds %struct.s2n_debug_info, ptr %143, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !12
  %146 = getelementptr inbounds i8, ptr %145, i64 21
  %147 = call ptr @strrchr(ptr noundef %146, i32 noundef 47) #7
  %148 = getelementptr inbounds i8, ptr %147, i64 1
  br label %154

149:                                              ; preds = %133
  %150 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %151 = getelementptr inbounds %struct.s2n_debug_info, ptr %150, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !12
  %153 = getelementptr inbounds i8, ptr %152, i64 21
  br label %154

154:                                              ; preds = %149, %142
  %155 = phi ptr [ %148, %142 ], [ %153, %149 ]
  %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 1
  store ptr %155, ptr %157, align 8, !tbaa !14
  %158 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %158, align 4, !tbaa !15
  %159 = call i32 @s2n_calculate_stacktrace()
  br label %160

160:                                              ; preds = %154
  br label %161

161:                                              ; preds = %160
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %167

162:                                              ; No predecessors!
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163, %128
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  store i32 0, ptr %10, align 4
  br label %167

167:                                              ; preds = %166, %161
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  %168 = load i32, ptr %10, align 4
  switch i32 %168, label %171 [
    i32 0, label %169
  ]

169:                                              ; preds = %167
  br label %170

170:                                              ; preds = %169, %96
  store i32 0, ptr %10, align 4
  br label %171

171:                                              ; preds = %170, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  %172 = load i32, ptr %10, align 4
  switch i32 %172, label %202 [
    i32 0, label %173
    i32 1, label %200
  ]

173:                                              ; preds = %171
  br label %174

174:                                              ; preds = %173
  br label %175

175:                                              ; preds = %174, %86
  br label %176

176:                                              ; preds = %175
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = call i32 @s2n_blob_validate(ptr noundef %177)
  %179 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  store i32 %178, ptr %179, align 4
  %180 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  %181 = load i32, ptr %180, align 4
  %182 = call zeroext i1 @s2n_result_is_ok(i32 %181)
  %183 = xor i1 %182, true
  %184 = xor i1 %183, true
  %185 = zext i1 %184 to i32
  %186 = sext i32 %185 to i64
  %187 = call i64 @llvm.expect.i64(i64 %186, i64 1)
  %188 = icmp ne i64 %187, 0
  br i1 %188, label %189, label %191

189:                                              ; preds = %176
  %190 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 0, ptr %190, align 4, !tbaa !9
  br label %193

191:                                              ; preds = %176
  %192 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 -1, ptr %192, align 4, !tbaa !9
  br label %193

193:                                              ; preds = %191, %189
  %194 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %195 = load i32, ptr %194, align 4
  %196 = call zeroext i1 @s2n_result_is_ok(i32 %195)
  br i1 %196, label %198, label %197

197:                                              ; preds = %193
  store i32 -1, ptr %3, align 4
  br label %200

198:                                              ; preds = %193
  br label %199

199:                                              ; preds = %198
  store i32 0, ptr %3, align 4
  br label %200

200:                                              ; preds = %199, %197, %171, %84, %69, %34
  %201 = load i32, ptr %3, align 4
  ret i32 %201

202:                                              ; preds = %171
  unreachable
}

attributes #0 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { "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 = { 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 #5 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!18, !6, i64 0}
!21 = !{!17, !6, i64 0}


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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_stuffer_validate(ptr noundef) local_unnamed_addr #0

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #3

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

declare i32 @s2n_blob_validate(ptr noundef) local_unnamed_addr #3

declare i32 @s2n_realloc(ptr noundef, i32 noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_stuffer_extract_blob(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call i32 @s2n_stuffer_validate(ptr noundef %0)
  %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 %44

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.41, ptr %8, align 8, !tbaa !5
  %9 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.41, i64 21), i32 noundef 47) #5
  %.not26 = icmp eq ptr %9, null
  %10 = getelementptr inbounds i8, ptr %9, i64 1
  %11 = select i1 %.not26, ptr getelementptr inbounds (i8, ptr @.str.41, 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() #6
  br label %44

15:                                               ; preds = %6
  %16 = getelementptr inbounds i8, ptr %0, i64 28
  %17 = load i32, ptr %16, align 4, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  %19 = load i32, ptr %18, align 8, !tbaa !16
  %20 = sub i32 %17, %19
  %21 = tail call i32 @s2n_realloc(ptr noundef nonnull %1, i32 noundef %20) #6
  %22 = icmp sgt i32 %21, -1
  br i1 %22, label %23, label %44

23:                                               ; preds = %15
  %24 = load i32, ptr %16, align 4, !tbaa !13
  %25 = load i32, ptr %18, align 8, !tbaa !16
  %.not27 = icmp eq i32 %24, %25
  br i1 %.not27, label %.critedge.thread, label %26

26:                                               ; preds = %23
  %27 = sub i32 %24, %25
  %28 = load ptr, ptr %1, align 8, !tbaa !17
  %29 = load ptr, ptr %0, align 8, !tbaa !18
  %30 = zext i32 %25 to i64
  %31 = getelementptr inbounds i8, ptr %29, i64 %30
  %32 = zext i32 %27 to i64
  %33 = tail call ptr @s2n_ensure_memmove_trace(ptr noundef %28, ptr noundef %31, i64 noundef %32) #6
  %.not28.not = icmp eq ptr %33, null
  br i1 %.not28.not, label %.critedge, label %.critedge.thread

.critedge:                                        ; preds = %26
  %34 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.42, ptr %34, align 8, !tbaa !5
  %35 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.42, i64 21), i32 noundef 47) #5
  %.not29 = icmp eq ptr %35, null
  %36 = getelementptr inbounds i8, ptr %35, i64 1
  %37 = select i1 %.not29, ptr getelementptr inbounds (i8, ptr @.str.42, 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() #6
  br label %44

.critedge.thread:                                 ; preds = %26, %23
  %41 = tail call i32 @s2n_blob_validate(ptr noundef nonnull %1) #6
  %42 = tail call zeroext i1 @s2n_result_is_ok(i32 %41)
  %not.32 = xor i1 %42, true
  %.30 = sext i1 %not.32 to i32
  %43 = tail call zeroext i1 @s2n_result_is_ok(i32 %.30)
  %not.33 = xor i1 %43, true
  %spec.select = sext i1 %not.33 to i32
  br label %44

44:                                               ; preds = %.critedge, %.critedge.thread, %15, %2, %7
  %.3 = phi i32 [ -1, %.critedge ], [ -1, %7 ], [ -1, %2 ], [ -1, %15 ], [ %spec.select, %.critedge.thread ]
  ret i32 %.3
}

attributes #0 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { "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 = { 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 #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, !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 = !{!15, !7, i64 0}
!18 = !{!14, !7, i64 0}


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