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

; 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_blob = type { ptr, i32, i32, i8 }
%struct.s2n_stuffer = type { %struct.s2n_blob, i32, 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.2 = external hidden unnamed_addr constant [95 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: nounwind uwtable
define dso_local i32 @s2n_stuffer_read_hex(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca %struct.s2n_result, 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 %struct.s2n_result, align 4
  %9 = alloca %struct.s2n_result, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca %struct.s2n_result, align 4
  %18 = 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 %19

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

32:                                               ; preds = %19
  %33 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  store i32 0, ptr %33, align 4, !tbaa !9
  br label %36

34:                                               ; preds = %19
  %35 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  store i32 -1, ptr %35, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %34, %32
  %37 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  %38 = load i32, ptr %37, align 4
  %39 = call zeroext i1 @s2n_result_is_ok(i32 %38)
  br i1 %39, label %42, label %40

40:                                               ; preds = %36
  %41 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %41, align 4, !tbaa !9
  br label %216

42:                                               ; preds = %36
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = call i32 @s2n_blob_validate(ptr noundef %45)
  %47 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %46, ptr %47, align 4
  %48 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  %49 = load i32, ptr %48, align 4
  %50 = call zeroext i1 @s2n_result_is_ok(i32 %49)
  %51 = xor i1 %50, true
  %52 = xor i1 %51, true
  %53 = zext i1 %52 to i32
  %54 = sext i32 %53 to i64
  %55 = call i64 @llvm.expect.i64(i64 %54, i64 1)
  %56 = icmp ne i64 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %44
  %58 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 0, ptr %58, align 4, !tbaa !9
  br label %61

59:                                               ; preds = %44
  %60 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 -1, ptr %60, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %59, %57
  %62 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  %63 = load i32, ptr %62, align 4
  %64 = call zeroext i1 @s2n_result_is_ok(i32 %63)
  br i1 %64, label %67, label %65

65:                                               ; preds = %61
  %66 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %66, align 4, !tbaa !9
  br label %216

67:                                               ; preds = %61
  br label %68

68:                                               ; preds = %67
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.s2n_blob, ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 8, !tbaa !12
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %73, label %75

73:                                               ; preds = %68
  %74 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 0, ptr %74, align 4, !tbaa !9
  br label %216

75:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.s2n_blob, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !12
  %79 = mul i32 %78, 2
  %80 = zext i32 %79 to i64
  store i64 %80, ptr %10, align 8, !tbaa !14
  br label %81

81:                                               ; preds = %75
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.s2n_stuffer, ptr %82, i32 0, i32 2
  %84 = load i32, ptr %83, align 4, !tbaa !16
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.s2n_stuffer, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 8, !tbaa !18
  %88 = sub i32 %84, %87
  %89 = zext i32 %88 to i64
  %90 = load i64, ptr %10, align 8, !tbaa !14
  %91 = icmp uge i64 %89, %90
  br i1 %91, label %126, label %92

92:                                               ; preds = %81
  br label %93

93:                                               ; preds = %92
  br label %94

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

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

110:                                              ; preds = %94
  %111 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %112 = getelementptr inbounds %struct.s2n_debug_info, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !19
  %114 = getelementptr inbounds i8, ptr %113, i64 21
  br label %115

115:                                              ; preds = %110, %103
  %116 = phi ptr [ %109, %103 ], [ %114, %110 ]
  %117 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %118 = getelementptr inbounds %struct.s2n_debug_info, ptr %117, i32 0, i32 1
  store ptr %116, ptr %118, align 8, !tbaa !21
  %119 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653270, ptr %119, align 4, !tbaa !22
  %120 = call i32 @s2n_calculate_stacktrace()
  br label %121

121:                                              ; preds = %115
  br label %122

122:                                              ; preds = %121
  %123 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %123, align 4, !tbaa !9
  store i32 1, ptr %11, align 4
  br label %215

124:                                              ; No predecessors!
  br label %125

125:                                              ; preds = %124
  br label %126

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

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.s2n_blob, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !23
  store ptr %131, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.s2n_stuffer, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds %struct.s2n_blob, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !24
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.s2n_stuffer, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 8, !tbaa !18
  %139 = zext i32 %138 to i64
  %140 = getelementptr inbounds i8, ptr %135, i64 %139
  store ptr %140, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !14
  br label %141

141:                                              ; preds = %196, %128
  %142 = load i64, ptr %14, align 8, !tbaa !14
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.s2n_blob, ptr %143, i32 0, i32 1
  %145 = load i32, ptr %144, align 8, !tbaa !12
  %146 = zext i32 %145 to i64
  %147 = icmp ult i64 %142, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %141
  store i32 12, ptr %11, align 4
  br label %199

149:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #7
  store i8 0, ptr %15, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #7
  store i8 0, ptr %16, align 1, !tbaa !25
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  %152 = load i64, ptr %14, align 8, !tbaa !14
  %153 = mul i64 %152, 2
  %154 = getelementptr inbounds i8, ptr %151, i64 %153
  %155 = load i8, ptr %154, align 1, !tbaa !25
  %156 = call i32 @s2n_stuffer_hex_digit_from_char(i8 noundef zeroext %155, ptr noundef %15)
  %157 = getelementptr inbounds %struct.s2n_result, ptr %17, i32 0, i32 0
  store i32 %156, ptr %157, align 4
  %158 = getelementptr inbounds %struct.s2n_result, ptr %17, i32 0, i32 0
  %159 = load i32, ptr %158, align 4
  %160 = call zeroext i1 @s2n_result_is_ok(i32 %159)
  br i1 %160, label %163, label %161

161:                                              ; preds = %150
  %162 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %162, align 4, !tbaa !9
  store i32 1, ptr %11, align 4
  br label %193

163:                                              ; preds = %150
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %13, align 8, !tbaa !5
  %168 = load i64, ptr %14, align 8, !tbaa !14
  %169 = mul i64 %168, 2
  %170 = add i64 %169, 1
  %171 = getelementptr inbounds i8, ptr %167, i64 %170
  %172 = load i8, ptr %171, align 1, !tbaa !25
  %173 = call i32 @s2n_stuffer_hex_digit_from_char(i8 noundef zeroext %172, ptr noundef %16)
  %174 = getelementptr inbounds %struct.s2n_result, ptr %18, i32 0, i32 0
  store i32 %173, ptr %174, align 4
  %175 = getelementptr inbounds %struct.s2n_result, ptr %18, i32 0, i32 0
  %176 = load i32, ptr %175, align 4
  %177 = call zeroext i1 @s2n_result_is_ok(i32 %176)
  br i1 %177, label %180, label %178

178:                                              ; preds = %166
  %179 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %179, align 4, !tbaa !9
  store i32 1, ptr %11, align 4
  br label %193

180:                                              ; preds = %166
  br label %181

181:                                              ; preds = %180
  br label %182

182:                                              ; preds = %181
  %183 = load i8, ptr %15, align 1, !tbaa !25
  %184 = zext i8 %183 to i32
  %185 = mul nsw i32 %184, 16
  %186 = load i8, ptr %16, align 1, !tbaa !25
  %187 = zext i8 %186 to i32
  %188 = add nsw i32 %185, %187
  %189 = trunc i32 %188 to i8
  %190 = load ptr, ptr %12, align 8, !tbaa !5
  %191 = load i64, ptr %14, align 8, !tbaa !14
  %192 = getelementptr inbounds i8, ptr %190, i64 %191
  store i8 %189, ptr %192, align 1, !tbaa !25
  store i32 0, ptr %11, align 4
  br label %193

193:                                              ; preds = %182, %178, %161
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  %194 = load i32, ptr %11, align 4
  switch i32 %194, label %199 [
    i32 0, label %195
  ]

195:                                              ; preds = %193
  br label %196

196:                                              ; preds = %195
  %197 = load i64, ptr %14, align 8, !tbaa !14
  %198 = add i64 %197, 1
  store i64 %198, ptr %14, align 8, !tbaa !14
  br label %141, !llvm.loop !26

199:                                              ; preds = %193, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %200 = load i32, ptr %11, align 4
  switch i32 %200, label %214 [
    i32 12, label %201
  ]

201:                                              ; preds = %199
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr %4, align 8, !tbaa !5
  %204 = load i64, ptr %10, align 8, !tbaa !14
  %205 = trunc i64 %204 to i32
  %206 = call i32 @s2n_stuffer_skip_read(ptr noundef %203, i32 noundef %205)
  %207 = icmp sgt i32 %206, -1
  br i1 %207, label %210, label %208

208:                                              ; preds = %202
  %209 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %209, align 4, !tbaa !9
  store i32 1, ptr %11, align 4
  br label %214

210:                                              ; preds = %202
  br label %211

211:                                              ; preds = %210
  br label %212

212:                                              ; preds = %211
  %213 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 0, ptr %213, align 4, !tbaa !9
  store i32 1, ptr %11, align 4
  br label %214

214:                                              ; preds = %212, %208, %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %215

215:                                              ; preds = %214, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %216

216:                                              ; preds = %215, %73, %65, %40
  %217 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  %218 = load i32, ptr %217, align 4
  ret i32 %218
}

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

declare i32 @s2n_stuffer_validate(ptr noundef) #2

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

declare i32 @s2n_blob_validate(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_stuffer_hex_digit_from_char(i8 noundef zeroext, ptr noundef) #3

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

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

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 }
attributes #8 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 8}
!13 = !{!"s2n_blob", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !11, i64 28}
!17 = !{!"s2n_stuffer", !13, i64 0, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 36, !11, i64 36}
!18 = !{!17, !11, i64 24}
!19 = !{!20, !6, i64 0}
!20 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!21 = !{!20, !6, i64 8}
!22 = !{!11, !11, i64 0}
!23 = !{!13, !6, i64 0}
!24 = !{!17, !6, i64 0}
!25 = !{!7, !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"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.2 = external hidden unnamed_addr constant [95 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: nounwind uwtable
define dso_local i32 @s2n_stuffer_read_hex(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = tail call i32 @s2n_stuffer_validate(ptr noundef %0) #6
  %6 = tail call zeroext i1 @s2n_result_is_ok(i32 %5)
  %not. = xor i1 %6, true
  %. = sext i1 %not. to i32
  %7 = tail call zeroext i1 @s2n_result_is_ok(i32 %.)
  br i1 %7, label %8, label %56

8:                                                ; preds = %2
  %9 = tail call i32 @s2n_blob_validate(ptr noundef %1) #6
  %10 = tail call zeroext i1 @s2n_result_is_ok(i32 %9)
  %not.38 = xor i1 %10, true
  %.34 = sext i1 %not.38 to i32
  %11 = tail call zeroext i1 @s2n_result_is_ok(i32 %.34)
  br i1 %11, label %12, label %56

12:                                               ; preds = %8
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %56, label %16

16:                                               ; preds = %12
  %17 = shl i32 %14, 1
  %18 = getelementptr inbounds i8, ptr %0, i64 28
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %0, i64 24
  %21 = load i32, ptr %20, align 8, !tbaa !13
  %22 = sub i32 %19, %21
  %.not = icmp ult i32 %22, %17
  br i1 %.not, label %23, label %.lr.ph.preheader

23:                                               ; preds = %16
  %24 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.2, ptr %24, align 8, !tbaa !14
  %25 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.2, i64 21), i32 noundef 47) #7
  %.not32 = icmp eq ptr %25, null
  %26 = getelementptr inbounds i8, ptr %25, i64 1
  %27 = select i1 %.not32, ptr getelementptr inbounds (i8, ptr @.str.2, i64 21), ptr %26
  %28 = getelementptr inbounds i8, ptr %24, i64 8
  store ptr %27, ptr %28, align 8, !tbaa !16
  %29 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653270, ptr %29, align 4, !tbaa !17
  %30 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %56

.lr.ph.preheader:                                 ; preds = %16
  %31 = load ptr, ptr %1, align 8, !tbaa !18
  %32 = load ptr, ptr %0, align 8, !tbaa !19
  %33 = zext i32 %21 to i64
  %34 = getelementptr inbounds i8, ptr %32, i64 %33
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.critedge
  %.041 = phi i64 [ %51, %.critedge ], [ 0, %.lr.ph.preheader ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  store i8 0, ptr %3, align 1, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  store i8 0, ptr %4, align 1, !tbaa !20
  %35 = shl nuw nsw i64 %.041, 1
  %36 = getelementptr inbounds i8, ptr %34, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !20
  %38 = call i32 @s2n_stuffer_hex_digit_from_char(i8 noundef zeroext %37, ptr noundef nonnull %3)
  %39 = call zeroext i1 @s2n_result_is_ok(i32 %38)
  br i1 %39, label %40, label %54

40:                                               ; preds = %.lr.ph
  %41 = or disjoint i64 %35, 1
  %42 = getelementptr inbounds i8, ptr %34, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !20
  %44 = call i32 @s2n_stuffer_hex_digit_from_char(i8 noundef zeroext %43, ptr noundef nonnull %4)
  %45 = call zeroext i1 @s2n_result_is_ok(i32 %44)
  br i1 %45, label %.critedge, label %54

.critedge:                                        ; preds = %40
  %46 = load i8, ptr %3, align 1, !tbaa !20
  %47 = shl i8 %46, 4
  %48 = load i8, ptr %4, align 1, !tbaa !20
  %49 = add i8 %47, %48
  %50 = getelementptr inbounds i8, ptr %31, i64 %.041
  store i8 %49, ptr %50, align 1, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  %51 = add nuw nsw i64 %.041, 1
  %52 = load i32, ptr %13, align 8, !tbaa !5
  %53 = zext i32 %52 to i64
  %.not33 = icmp ult i64 %51, %53
  br i1 %.not33, label %.lr.ph, label %.critedge36, !llvm.loop !21

54:                                               ; preds = %40, %.lr.ph
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  br label %56

.critedge36:                                      ; preds = %.critedge
  %55 = call i32 @s2n_stuffer_skip_read(ptr noundef nonnull %0, i32 noundef %17) #6
  %.lobit = ashr i32 %55, 31
  br label %56

56:                                               ; preds = %54, %23, %.critedge36, %12, %8, %2
  %.sroa.028.5 = phi i32 [ -1, %2 ], [ -1, %8 ], [ 0, %12 ], [ -1, %23 ], [ -1, %54 ], [ %.lobit, %.critedge36 ]
  ret i32 %.sroa.028.5
}

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

declare i32 @s2n_stuffer_validate(ptr noundef) local_unnamed_addr #2

declare i32 @s2n_blob_validate(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_stuffer_hex_digit_from_char(i8 noundef zeroext, ptr noundef) local_unnamed_addr #3

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { 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, !10, i64 8}
!6 = !{!"s2n_blob", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !10, i64 28}
!12 = !{!"s2n_stuffer", !6, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 36, !10, i64 36}
!13 = !{!12, !10, i64 24}
!14 = !{!15, !7, i64 0}
!15 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!16 = !{!15, !7, i64 8}
!17 = !{!10, !10, i64 0}
!18 = !{!6, !7, i64 0}
!19 = !{!12, !7, i64 0}
!20 = !{!8, !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LowerExpectIntrinsicPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass