; LLVM IR from aws/s2n-tls :: crypto (s2n_ecc_evp)

; 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_blob = type { ptr, i32, i32, i8 }
%struct.s2n_ecdhe_raw_server_params = type { %struct.s2n_blob, %struct.s2n_blob }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.32 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [91 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_ecc_evp_read_params_point(ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_ecc_evp_read_params(ptr noundef %0, ptr noundef %1, ptr noundef %2) #4 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  br label %11

11:                                               ; preds = %3
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %45, label %14

14:                                               ; preds = %11
  br label %15

15:                                               ; preds = %14
  br label %16

16:                                               ; preds = %15
  %17 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %18 = getelementptr inbounds %struct.s2n_debug_info, ptr %17, i32 0, i32 0
  store ptr @.str.32, ptr %18, align 8, !tbaa !9
  %19 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %20 = getelementptr inbounds %struct.s2n_debug_info, ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = getelementptr inbounds i8, ptr %21, i64 21
  %23 = call ptr @strrchr(ptr noundef %22, i32 noundef 47) #5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %32

25:                                               ; preds = %16
  %26 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %27 = getelementptr inbounds %struct.s2n_debug_info, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %28, i64 21
  %30 = call ptr @strrchr(ptr noundef %29, i32 noundef 47) #5
  %31 = getelementptr inbounds i8, ptr %30, i64 1
  br label %37

32:                                               ; preds = %16
  %33 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %34 = getelementptr inbounds %struct.s2n_debug_info, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %35, i64 21
  br label %37

37:                                               ; preds = %32, %25
  %38 = phi ptr [ %31, %25 ], [ %36, %32 ]
  %39 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %40 = getelementptr inbounds %struct.s2n_debug_info, ptr %39, i32 0, i32 1
  store ptr %38, ptr %40, align 8, !tbaa !11
  %41 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %41, align 4, !tbaa !12
  %42 = call i32 @s2n_calculate_stacktrace()
  br label %43

43:                                               ; preds = %37
  store i32 -1, ptr %4, align 4
  br label %216

44:                                               ; No predecessors!
  br label %45

45:                                               ; preds = %44, %11
  br label %46

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  store i8 0, ptr %8, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  store i8 0, ptr %9, align 1, !tbaa !14
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call ptr @s2n_stuffer_raw_read(ptr noundef %47, i32 noundef 0)
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.s2n_blob, ptr %49, i32 0, i32 0
  store ptr %48, ptr %50, align 8, !tbaa !15
  br label %51

51:                                               ; preds = %46
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.s2n_blob, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  %55 = icmp ne ptr %54, null
  br i1 %55, label %89, label %56

56:                                               ; preds = %51
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  %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
  store ptr @.str.33, ptr %60, align 8, !tbaa !9
  %61 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %62 = getelementptr inbounds %struct.s2n_debug_info, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds i8, ptr %63, i64 21
  %65 = call ptr @strrchr(ptr noundef %64, i32 noundef 47) #5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %74

67:                                               ; preds = %58
  %68 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %69 = getelementptr inbounds %struct.s2n_debug_info, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds i8, ptr %70, i64 21
  %72 = call ptr @strrchr(ptr noundef %71, i32 noundef 47) #5
  %73 = getelementptr inbounds i8, ptr %72, i64 1
  br label %79

74:                                               ; preds = %58
  %75 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %76 = getelementptr inbounds %struct.s2n_debug_info, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds i8, ptr %77, i64 21
  br label %79

79:                                               ; preds = %74, %67
  %80 = phi ptr [ %73, %67 ], [ %78, %74 ]
  %81 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %82 = getelementptr inbounds %struct.s2n_debug_info, ptr %81, i32 0, i32 1
  store ptr %80, ptr %82, align 8, !tbaa !11
  %83 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %83, align 4, !tbaa !12
  %84 = call i32 @s2n_calculate_stacktrace()
  br label %85

85:                                               ; preds = %79
  br label %86

86:                                               ; preds = %85
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %215

87:                                               ; No predecessors!
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88, %51
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = call i32 @s2n_stuffer_read_uint8(ptr noundef %93, ptr noundef %8)
  %95 = icmp sgt i32 %94, -1
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %215

97:                                               ; preds = %92
  br label %98

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  %101 = load i8, ptr %8, align 1, !tbaa !14
  %102 = zext i8 %101 to i32
  %103 = icmp ne i32 %102, 3
  br i1 %103, label %104, label %137

104:                                              ; preds = %100
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  %107 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %108 = getelementptr inbounds %struct.s2n_debug_info, ptr %107, i32 0, i32 0
  store ptr @.str.34, ptr %108, align 8, !tbaa !9
  %109 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %110 = getelementptr inbounds %struct.s2n_debug_info, ptr %109, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !9
  %112 = getelementptr inbounds i8, ptr %111, i64 21
  %113 = call ptr @strrchr(ptr noundef %112, i32 noundef 47) #5
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %122

115:                                              ; preds = %106
  %116 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %117 = getelementptr inbounds %struct.s2n_debug_info, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !9
  %119 = getelementptr inbounds i8, ptr %118, i64 21
  %120 = call ptr @strrchr(ptr noundef %119, i32 noundef 47) #5
  %121 = getelementptr inbounds i8, ptr %120, i64 1
  br label %127

122:                                              ; preds = %106
  %123 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %124 = getelementptr inbounds %struct.s2n_debug_info, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = getelementptr inbounds i8, ptr %125, i64 21
  br label %127

127:                                              ; preds = %122, %115
  %128 = phi ptr [ %121, %115 ], [ %126, %122 ]
  %129 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %130 = getelementptr inbounds %struct.s2n_debug_info, ptr %129, i32 0, i32 1
  store ptr %128, ptr %130, align 8, !tbaa !11
  %131 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544322, ptr %131, align 4, !tbaa !12
  %132 = call i32 @s2n_calculate_stacktrace()
  br label %133

133:                                              ; preds = %127
  br label %134

134:                                              ; preds = %133
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %215

135:                                              ; No predecessors!
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136, %100
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = call ptr @s2n_stuffer_raw_read(ptr noundef %140, i32 noundef 2)
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.s2n_ecdhe_raw_server_params, ptr %142, i32 0, i32 1
  %144 = getelementptr inbounds %struct.s2n_blob, ptr %143, i32 0, i32 0
  store ptr %141, ptr %144, align 8, !tbaa !17
  br label %145

145:                                              ; preds = %139
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.s2n_ecdhe_raw_server_params, ptr %146, i32 0, i32 1
  %148 = getelementptr inbounds %struct.s2n_blob, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !17
  %150 = icmp ne ptr %149, null
  br i1 %150, label %184, label %151

151:                                              ; preds = %145
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152
  %154 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %155 = getelementptr inbounds %struct.s2n_debug_info, ptr %154, i32 0, i32 0
  store ptr @.str.35, ptr %155, align 8, !tbaa !9
  %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 0
  %158 = load ptr, ptr %157, align 8, !tbaa !9
  %159 = getelementptr inbounds i8, ptr %158, i64 21
  %160 = call ptr @strrchr(ptr noundef %159, i32 noundef 47) #5
  %161 = icmp ne ptr %160, null
  br i1 %161, label %162, label %169

162:                                              ; preds = %153
  %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 0
  %165 = load ptr, ptr %164, align 8, !tbaa !9
  %166 = getelementptr inbounds i8, ptr %165, i64 21
  %167 = call ptr @strrchr(ptr noundef %166, i32 noundef 47) #5
  %168 = getelementptr inbounds i8, ptr %167, i64 1
  br label %174

169:                                              ; preds = %153
  %170 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %171 = getelementptr inbounds %struct.s2n_debug_info, ptr %170, i32 0, i32 0
  %172 = load ptr, ptr %171, align 8, !tbaa !9
  %173 = getelementptr inbounds i8, ptr %172, i64 21
  br label %174

174:                                              ; preds = %169, %162
  %175 = phi ptr [ %168, %162 ], [ %173, %169 ]
  %176 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %177 = getelementptr inbounds %struct.s2n_debug_info, ptr %176, i32 0, i32 1
  store ptr %175, ptr %177, align 8, !tbaa !11
  %178 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %178, align 4, !tbaa !12
  %179 = call i32 @s2n_calculate_stacktrace()
  br label %180

180:                                              ; preds = %174
  br label %181

181:                                              ; preds = %180
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %215

182:                                              ; No predecessors!
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183, %145
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.s2n_ecdhe_raw_server_params, ptr %187, i32 0, i32 1
  %189 = getelementptr inbounds %struct.s2n_blob, ptr %188, i32 0, i32 1
  store i32 2, ptr %189, align 8, !tbaa !19
  br label %190

190:                                              ; preds = %186
  %191 = load ptr, ptr %5, align 8, !tbaa !5
  %192 = call i32 @s2n_stuffer_read_uint8(ptr noundef %191, ptr noundef %9)
  %193 = icmp sgt i32 %192, -1
  br i1 %193, label %195, label %194

194:                                              ; preds = %190
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %215

195:                                              ; preds = %190
  br label %196

196:                                              ; preds = %195
  br label %197

197:                                              ; preds = %196
  br label %198

198:                                              ; preds = %197
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = load i8, ptr %9, align 1, !tbaa !14
  %201 = zext i8 %200 to i32
  %202 = load ptr, ptr %7, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.s2n_ecdhe_raw_server_params, ptr %202, i32 0, i32 0
  %204 = call i32 @s2n_ecc_evp_read_params_point(ptr noundef %199, i32 noundef %201, ptr noundef %203)
  %205 = icmp sgt i32 %204, -1
  br i1 %205, label %207, label %206

206:                                              ; preds = %198
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %215

207:                                              ; preds = %198
  br label %208

208:                                              ; preds = %207
  br label %209

209:                                              ; preds = %208
  %210 = load i8, ptr %9, align 1, !tbaa !14
  %211 = zext i8 %210 to i32
  %212 = add nsw i32 %211, 4
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.s2n_blob, ptr %213, i32 0, i32 1
  store i32 %212, ptr %214, align 8, !tbaa !20
  store i32 0, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %215

215:                                              ; preds = %209, %206, %194, %181, %134, %96, %86
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  br label %216

216:                                              ; preds = %215, %43
  %217 = load i32, ptr %4, align 4
  ret i32 %217
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!17 = !{!18, !6, i64 24}
!18 = !{!"s2n_ecdhe_raw_server_params", !16, i64 0, !16, i64 24}
!19 = !{!18, !13, i64 32}
!20 = !{!16, !13, 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.32 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [91 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_ecc_evp_read_params(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr noundef %2) local_unnamed_addr #4 {
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %14

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

14:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  store i8 0, ptr %4, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  store i8 0, ptr %5, align 1, !tbaa !13
  %15 = tail call ptr @s2n_stuffer_raw_read(ptr noundef nonnull %0, i32 noundef 0) #6
  store ptr %15, ptr %1, align 8, !tbaa !14
  %.not19 = icmp eq ptr %15, null
  br i1 %.not19, label %16, label %24

16:                                               ; preds = %14
  %17 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.33, ptr %17, align 8, !tbaa !5
  %18 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.33, i64 21), i32 noundef 47) #5
  %.not20 = icmp eq ptr %18, null
  %19 = getelementptr inbounds i8, ptr %18, i64 1
  %20 = select i1 %.not20, ptr getelementptr inbounds (i8, ptr @.str.33, i64 21), ptr %19
  %21 = getelementptr inbounds i8, ptr %17, i64 8
  store ptr %20, ptr %21, align 8, !tbaa !10
  %22 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %22, align 4, !tbaa !11
  %23 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %62

24:                                               ; preds = %14
  %25 = call i32 @s2n_stuffer_read_uint8(ptr noundef nonnull %0, ptr noundef nonnull %4) #6
  %26 = icmp sgt i32 %25, -1
  br i1 %26, label %27, label %62

27:                                               ; preds = %24
  %28 = load i8, ptr %4, align 1, !tbaa !13
  %.not21 = icmp eq i8 %28, 3
  br i1 %.not21, label %37, label %29

29:                                               ; preds = %27
  %30 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.34, ptr %30, align 8, !tbaa !5
  %31 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.34, i64 21), i32 noundef 47) #5
  %.not24 = icmp eq ptr %31, null
  %32 = getelementptr inbounds i8, ptr %31, i64 1
  %33 = select i1 %.not24, ptr getelementptr inbounds (i8, ptr @.str.34, i64 21), ptr %32
  %34 = getelementptr inbounds i8, ptr %30, i64 8
  store ptr %33, ptr %34, align 8, !tbaa !10
  %35 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544322, ptr %35, align 4, !tbaa !11
  %36 = call i32 @s2n_calculate_stacktrace() #6
  br label %62

37:                                               ; preds = %27
  %38 = call ptr @s2n_stuffer_raw_read(ptr noundef nonnull %0, i32 noundef 2) #6
  %39 = getelementptr inbounds i8, ptr %2, i64 24
  store ptr %38, ptr %39, align 8, !tbaa !16
  %.not22 = icmp eq ptr %38, null
  br i1 %.not22, label %40, label %48

40:                                               ; preds = %37
  %41 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.35, ptr %41, align 8, !tbaa !5
  %42 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.35, i64 21), i32 noundef 47) #5
  %.not23 = icmp eq ptr %42, null
  %43 = getelementptr inbounds i8, ptr %42, i64 1
  %44 = select i1 %.not23, ptr getelementptr inbounds (i8, ptr @.str.35, i64 21), ptr %43
  %45 = getelementptr inbounds i8, ptr %41, i64 8
  store ptr %44, ptr %45, align 8, !tbaa !10
  %46 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %46, align 4, !tbaa !11
  %47 = call i32 @s2n_calculate_stacktrace() #6
  br label %62

48:                                               ; preds = %37
  %49 = getelementptr inbounds i8, ptr %2, i64 32
  store i32 2, ptr %49, align 8, !tbaa !18
  %50 = call i32 @s2n_stuffer_read_uint8(ptr noundef nonnull %0, ptr noundef nonnull %5) #6
  %51 = icmp sgt i32 %50, -1
  br i1 %51, label %52, label %62

52:                                               ; preds = %48
  %53 = load i8, ptr %5, align 1, !tbaa !13
  %54 = zext i8 %53 to i32
  %55 = call i32 @s2n_ecc_evp_read_params_point(ptr noundef nonnull %0, i32 noundef %54, ptr noundef nonnull %2)
  %56 = icmp sgt i32 %55, -1
  br i1 %56, label %57, label %62

57:                                               ; preds = %52
  %58 = load i8, ptr %5, align 1, !tbaa !13
  %59 = zext i8 %58 to i32
  %60 = add nuw nsw i32 %59, 4
  %61 = getelementptr inbounds i8, ptr %1, i64 8
  store i32 %60, ptr %61, align 8, !tbaa !19
  br label %62

62:                                               ; preds = %52, %48, %24, %57, %40, %29, %16
  %.0 = phi i32 [ -1, %29 ], [ 0, %57 ], [ -1, %40 ], [ -1, %16 ], [ -1, %24 ], [ -1, %48 ], [ -1, %52 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %63

63:                                               ; preds = %62, %6
  %.1 = phi i32 [ %.0, %62 ], [ -1, %6 ]
  ret i32 %.1
}

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = !{!8, !8, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!16 = !{!17, !7, i64 24}
!17 = !{!"s2n_ecdhe_raw_server_params", !15, i64 0, !15, i64 24}
!18 = !{!17, !12, i64 32}
!19 = !{!15, !12, i64 8}


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