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

; 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.2 = external hidden unnamed_addr constant [99 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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

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

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

; 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_write_base64(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 %struct.s2n_result, align 4
  %9 = alloca %struct.s2n_result, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, 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 %41, label %40

40:                                               ; preds = %36
  store i32 -1, ptr %3, align 4
  br label %186

41:                                               ; preds = %36
  br label %42

42:                                               ; preds = %41
  br label %43

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

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

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

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

64:                                               ; preds = %60
  store i32 -1, ptr %3, align 4
  br label %186

65:                                               ; preds = %60
  br label %66

66:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.s2n_stuffer, ptr %67, i32 0, i32 2
  %69 = load i32, ptr %68, align 4, !tbaa !12
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.s2n_stuffer, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !15
  %73 = sub i32 %69, %72
  store i32 %73, ptr %10, align 4, !tbaa !16
  %74 = load i32, ptr %10, align 4, !tbaa !16
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %66
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %185

77:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %78 = load i32, ptr %10, align 4, !tbaa !16
  %79 = sdiv i32 %78, 3
  store i32 %79, ptr %12, align 4, !tbaa !16
  %80 = load i32, ptr %10, align 4, !tbaa !16
  %81 = srem i32 %80, 3
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %77
  %84 = load i32, ptr %12, align 4, !tbaa !16
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %12, align 4, !tbaa !16
  br label %86

86:                                               ; preds = %83, %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %87 = load i32, ptr %12, align 4, !tbaa !16
  %88 = mul nsw i32 %87, 4
  store i32 %88, ptr %13, align 4, !tbaa !16
  %89 = load i32, ptr %13, align 4, !tbaa !16
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %13, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.s2n_stuffer, ptr %91, i32 0, i32 1
  %93 = load i32, ptr %92, align 8, !tbaa !15
  store i32 %93, ptr %14, align 4, !tbaa !16
  br label %94

94:                                               ; preds = %86
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = load i32, ptr %10, align 4, !tbaa !16
  %97 = call i32 @s2n_stuffer_skip_read(ptr noundef %95, i32 noundef %96)
  %98 = icmp sgt i32 %97, -1
  br i1 %98, label %100, label %99

99:                                               ; preds = %94
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %184

100:                                              ; preds = %94
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.s2n_stuffer, ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds %struct.s2n_blob, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !17
  %107 = load i32, ptr %14, align 4, !tbaa !16
  %108 = zext i32 %107 to i64
  %109 = getelementptr inbounds i8, ptr %106, i64 %108
  store ptr %109, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.s2n_stuffer, ptr %110, i32 0, i32 2
  %112 = load i32, ptr %111, align 4, !tbaa !12
  store i32 %112, ptr %16, align 4, !tbaa !16
  br label %113

113:                                              ; preds = %102
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = load i32, ptr %13, align 4, !tbaa !16
  %116 = call i32 @s2n_stuffer_skip_write(ptr noundef %114, i32 noundef %115)
  %117 = icmp sgt i32 %116, -1
  br i1 %117, label %119, label %118

118:                                              ; preds = %113
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %183

119:                                              ; preds = %113
  br label %120

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.s2n_stuffer, ptr %122, i32 0, i32 0
  %124 = getelementptr inbounds %struct.s2n_blob, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !17
  %126 = load i32, ptr %16, align 4, !tbaa !16
  %127 = zext i32 %126 to i64
  %128 = getelementptr inbounds i8, ptr %125, i64 %127
  store ptr %128, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %129 = load ptr, ptr %17, align 8, !tbaa !5
  %130 = load ptr, ptr %15, align 8, !tbaa !5
  %131 = load i32, ptr %10, align 4, !tbaa !16
  %132 = call i32 @EVP_EncodeBlock(ptr noundef %129, ptr noundef %130, i32 noundef %131)
  store i32 %132, ptr %18, align 4, !tbaa !16
  br label %133

133:                                              ; preds = %121
  %134 = load i32, ptr %18, align 4, !tbaa !16
  %135 = load i32, ptr %13, align 4, !tbaa !16
  %136 = sub nsw i32 %135, 1
  %137 = icmp eq i32 %134, %136
  br i1 %137, label %171, label %138

138:                                              ; preds = %133
  br label %139

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139
  %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
  store ptr @.str.2, ptr %142, align 8, !tbaa !18
  %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 !18
  %146 = getelementptr inbounds i8, ptr %145, i64 21
  %147 = call ptr @strrchr(ptr noundef %146, i32 noundef 47) #8
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %156

149:                                              ; preds = %140
  %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 !18
  %153 = getelementptr inbounds i8, ptr %152, i64 21
  %154 = call ptr @strrchr(ptr noundef %153, i32 noundef 47) #8
  %155 = getelementptr inbounds i8, ptr %154, i64 1
  br label %161

156:                                              ; preds = %140
  %157 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %158 = getelementptr inbounds %struct.s2n_debug_info, ptr %157, i32 0, i32 0
  %159 = load ptr, ptr %158, align 8, !tbaa !18
  %160 = getelementptr inbounds i8, ptr %159, i64 21
  br label %161

161:                                              ; preds = %156, %149
  %162 = phi ptr [ %155, %149 ], [ %160, %156 ]
  %163 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %164 = getelementptr inbounds %struct.s2n_debug_info, ptr %163, i32 0, i32 1
  store ptr %162, ptr %164, align 8, !tbaa !20
  %165 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762055, ptr %165, align 4, !tbaa !16
  %166 = call i32 @s2n_calculate_stacktrace()
  br label %167

167:                                              ; preds = %161
  br label %168

168:                                              ; preds = %167
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %182

169:                                              ; No predecessors!
  br label %170

170:                                              ; preds = %169
  br label %171

171:                                              ; preds = %170, %133
  br label %172

172:                                              ; preds = %171
  br label %173

173:                                              ; preds = %172
  br label %174

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

178:                                              ; preds = %174
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %182

179:                                              ; preds = %174
  br label %180

180:                                              ; preds = %179
  br label %181

181:                                              ; preds = %180
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %182

182:                                              ; preds = %181, %178, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %183

183:                                              ; preds = %182, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %184

184:                                              ; preds = %183, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %185

185:                                              ; preds = %184, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %186

186:                                              ; preds = %185, %64, %40
  %187 = load i32, ptr %3, align 4
  ret i32 %187
}

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

declare i32 @s2n_stuffer_wipe_n(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 }
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 28}
!13 = !{!"s2n_stuffer", !14, i64 0, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 36, !11, i64 36}
!14 = !{!"s2n_blob", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!15 = !{!13, !11, i64 24}
!16 = !{!11, !11, i64 0}
!17 = !{!13, !6, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!20 = !{!19, !6, i64 8}


; 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 [99 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

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

declare i32 @s2n_stuffer_skip_write(ptr noundef, i32 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_write_base64(ptr noundef %0, ptr noundef %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 %49

6:                                                ; preds = %2
  %7 = tail call i32 @s2n_stuffer_validate(ptr noundef %1) #5
  %8 = tail call zeroext i1 @s2n_result_is_ok(i32 %7)
  %not.35 = xor i1 %8, true
  %.33 = sext i1 %not.35 to i32
  %9 = tail call zeroext i1 @s2n_result_is_ok(i32 %.33)
  br i1 %9, label %10, label %49

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %1, i64 28
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %1, i64 24
  %14 = load i32, ptr %13, align 8, !tbaa !12
  %15 = sub i32 %12, %14
  %16 = icmp eq i32 %12, %14
  br i1 %16, label %49, label %17

17:                                               ; preds = %10
  %18 = sdiv i32 %15, 3
  %19 = srem i32 %15, 3
  %.not = icmp ne i32 %19, 0
  %20 = zext i1 %.not to i32
  %spec.select = add nsw i32 %18, %20
  %21 = shl nsw i32 %spec.select, 2
  %22 = tail call i32 @s2n_stuffer_skip_read(ptr noundef nonnull %1, i32 noundef %15) #5
  %23 = icmp sgt i32 %22, -1
  br i1 %23, label %24, label %49

24:                                               ; preds = %17
  %25 = or disjoint i32 %21, 1
  %26 = load ptr, ptr %1, align 8, !tbaa !13
  %27 = getelementptr inbounds i8, ptr %0, i64 28
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = tail call i32 @s2n_stuffer_skip_write(ptr noundef %0, i32 noundef %25) #5
  %30 = icmp sgt i32 %29, -1
  br i1 %30, label %31, label %49

31:                                               ; preds = %24
  %32 = zext i32 %14 to i64
  %33 = getelementptr inbounds i8, ptr %26, i64 %32
  %34 = load ptr, ptr %0, align 8, !tbaa !13
  %35 = zext i32 %28 to i64
  %36 = getelementptr inbounds i8, ptr %34, i64 %35
  %37 = tail call i32 @EVP_EncodeBlock(ptr noundef %36, ptr noundef %33, i32 noundef %15) #5
  %38 = icmp eq i32 %37, %21
  br i1 %38, label %47, label %39

39:                                               ; preds = %31
  %40 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.2, ptr %40, align 8, !tbaa !14
  %41 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.2, i64 21), i32 noundef 47) #6
  %.not32 = icmp eq ptr %41, null
  %42 = getelementptr inbounds i8, ptr %41, i64 1
  %43 = select i1 %.not32, ptr getelementptr inbounds (i8, ptr @.str.2, 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 469762055, ptr %45, align 4, !tbaa !17
  %46 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %49

47:                                               ; preds = %31
  %48 = tail call i32 @s2n_stuffer_wipe_n(ptr noundef nonnull %0, i32 noundef 1) #5
  %.lobit = ashr i32 %48, 31
  br label %49

49:                                               ; preds = %10, %24, %47, %39, %17, %6, %2
  %.4 = phi i32 [ -1, %2 ], [ -1, %6 ], [ 0, %10 ], [ -1, %17 ], [ -1, %24 ], [ -1, %39 ], [ %.lobit, %47 ]
  ret i32 %.4
}

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

declare i32 @s2n_stuffer_wipe_n(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, !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}


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