; 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_ecc_evp_params = type { ptr, ptr }
%struct.s2n_ecc_named_curve = type { i16, i32, ptr, i8, ptr }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.36 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.41 = 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

; 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
define dso_local i32 @s2n_ecc_evp_write_params_point(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %9

9:                                                ; preds = %2
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = icmp ne ptr %10, null
  br i1 %11, label %43, label %12

12:                                               ; preds = %9
  br label %13

13:                                               ; preds = %12
  br label %14

14:                                               ; preds = %13
  %15 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %16 = getelementptr inbounds %struct.s2n_debug_info, ptr %15, i32 0, i32 0
  store ptr @.str.36, ptr %16, align 8, !tbaa !9
  %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
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %19, i64 21
  %21 = call ptr @strrchr(ptr noundef %20, i32 noundef 47) #5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %30

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

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

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

41:                                               ; preds = %35
  store i32 -1, ptr %3, align 4
  br label %218

42:                                               ; No predecessors!
  br label %43

43:                                               ; preds = %42, %9
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !14
  %49 = icmp ne ptr %48, null
  br i1 %49, label %81, label %50

50:                                               ; preds = %45
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %54 = getelementptr inbounds %struct.s2n_debug_info, ptr %53, i32 0, i32 0
  store ptr @.str.37, ptr %54, align 8, !tbaa !9
  %55 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %56 = getelementptr inbounds %struct.s2n_debug_info, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds i8, ptr %57, i64 21
  %59 = call ptr @strrchr(ptr noundef %58, i32 noundef 47) #5
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %68

61:                                               ; preds = %52
  %62 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %63 = getelementptr inbounds %struct.s2n_debug_info, ptr %62, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = getelementptr inbounds i8, ptr %64, i64 21
  %66 = call ptr @strrchr(ptr noundef %65, i32 noundef 47) #5
  %67 = getelementptr inbounds i8, ptr %66, i64 1
  br label %73

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

73:                                               ; preds = %68, %61
  %74 = phi ptr [ %67, %61 ], [ %72, %68 ]
  %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 1
  store ptr %74, ptr %76, align 8, !tbaa !11
  %77 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %77, align 4, !tbaa !12
  %78 = call i32 @s2n_calculate_stacktrace()
  br label %79

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

80:                                               ; No predecessors!
  br label %81

81:                                               ; preds = %80, %45
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %84, i32 0, i32 1
  %86 = load ptr, ptr %85, align 8, !tbaa !16
  %87 = icmp ne ptr %86, null
  br i1 %87, label %119, label %88

88:                                               ; preds = %83
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  %91 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %92 = getelementptr inbounds %struct.s2n_debug_info, ptr %91, i32 0, i32 0
  store ptr @.str.38, ptr %92, align 8, !tbaa !9
  %93 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %94 = getelementptr inbounds %struct.s2n_debug_info, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  %96 = getelementptr inbounds i8, ptr %95, i64 21
  %97 = call ptr @strrchr(ptr noundef %96, i32 noundef 47) #5
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %106

99:                                               ; preds = %90
  %100 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %101 = getelementptr inbounds %struct.s2n_debug_info, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !9
  %103 = getelementptr inbounds i8, ptr %102, i64 21
  %104 = call ptr @strrchr(ptr noundef %103, i32 noundef 47) #5
  %105 = getelementptr inbounds i8, ptr %104, i64 1
  br label %111

106:                                              ; preds = %90
  %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
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %109, i64 21
  br label %111

111:                                              ; preds = %106, %99
  %112 = phi ptr [ %105, %99 ], [ %110, %106 ]
  %113 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %114 = getelementptr inbounds %struct.s2n_debug_info, ptr %113, i32 0, i32 1
  store ptr %112, ptr %114, align 8, !tbaa !11
  %115 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %115, align 4, !tbaa !12
  %116 = call i32 @s2n_calculate_stacktrace()
  br label %117

117:                                              ; preds = %111
  store i32 -1, ptr %3, align 4
  br label %218

118:                                              ; No predecessors!
  br label %119

119:                                              ; preds = %118, %83
  br label %120

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %155, label %124

124:                                              ; preds = %121
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  %127 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %128 = getelementptr inbounds %struct.s2n_debug_info, ptr %127, i32 0, i32 0
  store ptr @.str.39, ptr %128, align 8, !tbaa !9
  %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 0
  %131 = load ptr, ptr %130, align 8, !tbaa !9
  %132 = getelementptr inbounds i8, ptr %131, i64 21
  %133 = call ptr @strrchr(ptr noundef %132, i32 noundef 47) #5
  %134 = icmp ne ptr %133, null
  br i1 %134, label %135, label %142

135:                                              ; preds = %126
  %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 !9
  %139 = getelementptr inbounds i8, ptr %138, i64 21
  %140 = call ptr @strrchr(ptr noundef %139, i32 noundef 47) #5
  %141 = getelementptr inbounds i8, ptr %140, i64 1
  br label %147

142:                                              ; preds = %126
  %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 !9
  %146 = getelementptr inbounds i8, ptr %145, i64 21
  br label %147

147:                                              ; preds = %142, %135
  %148 = phi ptr [ %141, %135 ], [ %146, %142 ]
  %149 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %150 = getelementptr inbounds %struct.s2n_debug_info, ptr %149, i32 0, i32 1
  store ptr %148, ptr %150, align 8, !tbaa !11
  %151 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %151, align 4, !tbaa !12
  %152 = call i32 @s2n_calculate_stacktrace()
  br label %153

153:                                              ; preds = %147
  store i32 -1, ptr %3, align 4
  br label %218

154:                                              ; No predecessors!
  br label %155

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

156:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %157, i32 0, i32 1
  %159 = load ptr, ptr %158, align 8, !tbaa !16
  %160 = call i64 @EVP_PKEY_get1_encoded_public_key(ptr noundef %159, ptr noundef %6)
  store i64 %160, ptr %7, align 8, !tbaa !17
  %161 = load i64, ptr %7, align 8, !tbaa !17
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %162, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8, !tbaa !14
  %165 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %164, i32 0, i32 3
  %166 = load i8, ptr %165, align 8, !tbaa !19
  %167 = zext i8 %166 to i64
  %168 = icmp ne i64 %161, %167
  br i1 %168, label %169, label %203

169:                                              ; preds = %156
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %170, ptr noundef @.str.40, i32 noundef 419)
  br label %171

171:                                              ; preds = %169
  br label %172

172:                                              ; preds = %171
  %173 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %174 = getelementptr inbounds %struct.s2n_debug_info, ptr %173, i32 0, i32 0
  store ptr @.str.41, ptr %174, align 8, !tbaa !9
  %175 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %176 = getelementptr inbounds %struct.s2n_debug_info, ptr %175, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8, !tbaa !9
  %178 = getelementptr inbounds i8, ptr %177, i64 21
  %179 = call ptr @strrchr(ptr noundef %178, i32 noundef 47) #5
  %180 = icmp ne ptr %179, null
  br i1 %180, label %181, label %188

181:                                              ; preds = %172
  %182 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %183 = getelementptr inbounds %struct.s2n_debug_info, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !9
  %185 = getelementptr inbounds i8, ptr %184, i64 21
  %186 = call ptr @strrchr(ptr noundef %185, i32 noundef 47) #5
  %187 = getelementptr inbounds i8, ptr %186, i64 1
  br label %193

188:                                              ; preds = %172
  %189 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %190 = getelementptr inbounds %struct.s2n_debug_info, ptr %189, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8, !tbaa !9
  %192 = getelementptr inbounds i8, ptr %191, i64 21
  br label %193

193:                                              ; preds = %188, %181
  %194 = phi ptr [ %187, %181 ], [ %192, %188 ]
  %195 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %196 = getelementptr inbounds %struct.s2n_debug_info, ptr %195, i32 0, i32 1
  store ptr %194, ptr %196, align 8, !tbaa !11
  %197 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %197, align 4, !tbaa !12
  %198 = call i32 @s2n_calculate_stacktrace()
  br label %199

199:                                              ; preds = %193
  br label %200

200:                                              ; preds = %199
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %217

201:                                              ; No predecessors!
  br label %202

202:                                              ; preds = %201
  br label %216

203:                                              ; preds = %156
  br label %204

204:                                              ; preds = %203
  %205 = load ptr, ptr %5, align 8, !tbaa !5
  %206 = load ptr, ptr %6, align 8, !tbaa !5
  %207 = load i64, ptr %7, align 8, !tbaa !17
  %208 = trunc i64 %207 to i32
  %209 = call i32 @s2n_stuffer_write_bytes(ptr noundef %205, ptr noundef %206, i32 noundef %208)
  %210 = icmp sgt i32 %209, -1
  br i1 %210, label %212, label %211

211:                                              ; preds = %204
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %217

212:                                              ; preds = %204
  br label %213

213:                                              ; preds = %212
  br label %214

214:                                              ; preds = %213
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %215, ptr noundef @.str.40, i32 noundef 423)
  br label %216

216:                                              ; preds = %214, %202
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %217

217:                                              ; preds = %216, %211, %200
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %218

218:                                              ; preds = %217, %153, %117, %79, %41
  %219 = load i32, ptr %3, align 4
  ret i32 %219
}

declare i64 @EVP_PKEY_get1_encoded_public_key(ptr noundef, ptr noundef) #2

declare void @CRYPTO_free(ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @s2n_stuffer_write_bytes(ptr noundef, 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 = { 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 = !{!15, !6, i64 0}
!15 = !{!"s2n_ecc_evp_params", !6, i64 0, !6, i64 8}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!20, !7, i64 16}
!20 = !{!"s2n_ecc_named_curve", !21, i64 0, !13, i64 4, !6, i64 8, !7, i64 16, !6, i64 24}
!21 = !{!"short", !7, 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.36 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.41 = 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

; 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
define dso_local range(i32 -1, 1) i32 @s2n_ecc_evp_write_params_point(ptr noundef readonly %0, ptr noundef %1) local_unnamed_addr #4 {
  %3 = alloca ptr, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %12

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

12:                                               ; preds = %2
  %13 = load ptr, ptr %0, align 8, !tbaa !13
  %.not18 = icmp eq ptr %13, null
  br i1 %.not18, label %14, label %22

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

22:                                               ; preds = %12
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %.not20 = icmp eq ptr %24, null
  br i1 %.not20, label %25, label %33

25:                                               ; preds = %22
  %26 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.38, ptr %26, align 8, !tbaa !5
  %27 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.38, i64 21), i32 noundef 47) #5
  %.not21 = icmp eq ptr %27, null
  %28 = getelementptr inbounds i8, ptr %27, i64 1
  %29 = select i1 %.not21, ptr getelementptr inbounds (i8, ptr @.str.38, i64 21), ptr %28
  %30 = getelementptr inbounds i8, ptr %26, i64 8
  store ptr %29, ptr %30, align 8, !tbaa !10
  %31 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %31, align 4, !tbaa !11
  %32 = tail call i32 @s2n_calculate_stacktrace() #6
  br label %64

33:                                               ; preds = %22
  %.not22 = icmp eq ptr %1, null
  br i1 %.not22, label %34, label %42

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

42:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store ptr null, ptr %3, align 8, !tbaa !16
  %43 = call i64 @EVP_PKEY_get1_encoded_public_key(ptr noundef nonnull %24, ptr noundef nonnull %3) #6
  %44 = load ptr, ptr %0, align 8, !tbaa !13
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %46 = load i8, ptr %45, align 8, !tbaa !17
  %47 = zext i8 %46 to i64
  %.not24 = icmp eq i64 %43, %47
  %48 = load ptr, ptr %3, align 8, !tbaa !16
  br i1 %.not24, label %57, label %49

49:                                               ; preds = %42
  call void @CRYPTO_free(ptr noundef %48, ptr noundef nonnull @.str.40, i32 noundef 419) #6
  %50 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.41, ptr %50, align 8, !tbaa !5
  %51 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.41, i64 21), i32 noundef 47) #5
  %.not25 = icmp eq ptr %51, null
  %52 = getelementptr inbounds i8, ptr %51, i64 1
  %53 = select i1 %.not25, ptr getelementptr inbounds (i8, ptr @.str.41, i64 21), ptr %52
  %54 = getelementptr inbounds i8, ptr %50, i64 8
  store ptr %53, ptr %54, align 8, !tbaa !10
  %55 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %55, align 4, !tbaa !11
  %56 = call i32 @s2n_calculate_stacktrace() #6
  br label %63

57:                                               ; preds = %42
  %58 = trunc nuw nsw i64 %43 to i32
  %59 = call i32 @s2n_stuffer_write_bytes(ptr noundef nonnull %1, ptr noundef %48, i32 noundef %58) #6
  %60 = icmp sgt i32 %59, -1
  br i1 %60, label %61, label %63

61:                                               ; preds = %57
  %62 = load ptr, ptr %3, align 8, !tbaa !16
  call void @CRYPTO_free(ptr noundef %62, ptr noundef nonnull @.str.40, i32 noundef 423) #6
  br label %63

63:                                               ; preds = %57, %61, %49
  %.0 = phi i32 [ -1, %49 ], [ 0, %61 ], [ -1, %57 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %64

64:                                               ; preds = %63, %34, %25, %14, %4
  %.1 = phi i32 [ %.0, %63 ], [ -1, %34 ], [ -1, %25 ], [ -1, %14 ], [ -1, %4 ]
  ret i32 %.1
}

declare i64 @EVP_PKEY_get1_encoded_public_key(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @CRYPTO_free(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @s2n_stuffer_write_bytes(ptr noundef, 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 = { 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 = !{!14, !7, i64 0}
!14 = !{!"s2n_ecc_evp_params", !7, i64 0, !7, i64 8}
!15 = !{!14, !7, i64 8}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !8, i64 16}
!18 = !{!"s2n_ecc_named_curve", !19, i64 0, !12, i64 4, !7, i64 8, !8, i64 16, !7, i64 24}
!19 = !{!"short", !8, i64 0}


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