; 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_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.47 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.55 = 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 ptr @EVP_PKEY_new() #2

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @EVP_PKEY_CTX_free_pointer(ptr noundef) #4

declare i32 @EVP_PKEY_paramgen_init(ptr noundef) #2

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

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

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

declare i32 @EVP_PKEY_set1_encoded_public_key(ptr noundef, ptr noundef, i64 noundef) #2

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

8:                                                ; preds = %2
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.s2n_blob, ptr %9, i32 0, i32 0
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = icmp ne ptr %11, null
  br i1 %12, label %44, label %13

13:                                               ; preds = %8
  br label %14

14:                                               ; preds = %13
  br label %15

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

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

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

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

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

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %8
  br label %45

45:                                               ; preds = %44
  br label %46

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

51:                                               ; preds = %46
  br label %52

52:                                               ; preds = %51
  br label %53

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

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

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

74:                                               ; preds = %69, %62
  %75 = phi ptr [ %68, %62 ], [ %73, %69 ]
  %76 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %77 = getelementptr inbounds %struct.s2n_debug_info, ptr %76, i32 0, i32 1
  store ptr %75, ptr %77, align 8, !tbaa !14
  %78 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %78, align 4, !tbaa !15
  %79 = call i32 @s2n_calculate_stacktrace()
  br label %80

80:                                               ; preds = %74
  store i32 -1, ptr %3, align 4
  br label %414

81:                                               ; No predecessors!
  br label %82

82:                                               ; preds = %81, %46
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.s2n_blob, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 8, !tbaa !18
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !16
  %91 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %90, i32 0, i32 3
  %92 = load i8, ptr %91, align 8, !tbaa !19
  %93 = zext i8 %92 to i32
  %94 = icmp ne i32 %87, %93
  br i1 %94, label %95, label %126

95:                                               ; preds = %84
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  %98 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %99 = getelementptr inbounds %struct.s2n_debug_info, ptr %98, i32 0, i32 0
  store ptr @.str.49, ptr %99, align 8, !tbaa !12
  %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 !12
  %103 = getelementptr inbounds i8, ptr %102, i64 21
  %104 = call ptr @strrchr(ptr noundef %103, i32 noundef 47) #6
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %113

106:                                              ; preds = %97
  %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 !12
  %110 = getelementptr inbounds i8, ptr %109, i64 21
  %111 = call ptr @strrchr(ptr noundef %110, i32 noundef 47) #6
  %112 = getelementptr inbounds i8, ptr %111, i64 1
  br label %118

113:                                              ; preds = %97
  %114 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %115 = getelementptr inbounds %struct.s2n_debug_info, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !12
  %117 = getelementptr inbounds i8, ptr %116, i64 21
  br label %118

118:                                              ; preds = %113, %106
  %119 = phi ptr [ %112, %106 ], [ %117, %113 ]
  %120 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %121 = getelementptr inbounds %struct.s2n_debug_info, ptr %120, i32 0, i32 1
  store ptr %119, ptr %121, align 8, !tbaa !14
  %122 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %122, align 4, !tbaa !15
  %123 = call i32 @s2n_calculate_stacktrace()
  br label %124

124:                                              ; preds = %118
  store i32 -1, ptr %3, align 4
  br label %414

125:                                              ; No predecessors!
  br label %126

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

127:                                              ; preds = %126
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !16
  %131 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !22
  %133 = icmp eq i32 %132, 1034
  br i1 %133, label %134, label %196

134:                                              ; preds = %127
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %135, i32 0, i32 1
  %137 = load ptr, ptr %136, align 8, !tbaa !23
  %138 = icmp eq ptr %137, null
  br i1 %138, label %139, label %143

139:                                              ; preds = %134
  %140 = call ptr @EVP_PKEY_new()
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %141, i32 0, i32 1
  store ptr %140, ptr %142, align 8, !tbaa !23
  br label %143

143:                                              ; preds = %139, %134
  br label %144

144:                                              ; preds = %143
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %145, i32 0, i32 1
  %147 = load ptr, ptr %146, align 8, !tbaa !23
  %148 = icmp eq ptr %147, null
  br i1 %148, label %149, label %180

149:                                              ; preds = %144
  br label %150

150:                                              ; preds = %149
  br label %151

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

160:                                              ; preds = %151
  %161 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %162 = getelementptr inbounds %struct.s2n_debug_info, ptr %161, i32 0, i32 0
  %163 = load ptr, ptr %162, align 8, !tbaa !12
  %164 = getelementptr inbounds i8, ptr %163, i64 21
  %165 = call ptr @strrchr(ptr noundef %164, i32 noundef 47) #6
  %166 = getelementptr inbounds i8, ptr %165, i64 1
  br label %172

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

172:                                              ; preds = %167, %160
  %173 = phi ptr [ %166, %160 ], [ %171, %167 ]
  %174 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %175 = getelementptr inbounds %struct.s2n_debug_info, ptr %174, i32 0, i32 1
  store ptr %173, ptr %175, align 8, !tbaa !14
  %176 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544322, ptr %176, align 4, !tbaa !15
  %177 = call i32 @s2n_calculate_stacktrace()
  br label %178

178:                                              ; preds = %172
  store i32 -1, ptr %3, align 4
  br label %414

179:                                              ; No predecessors!
  br label %180

180:                                              ; preds = %179, %144
  br label %181

181:                                              ; preds = %180
  br label %182

182:                                              ; preds = %181
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %183, i32 0, i32 1
  %185 = load ptr, ptr %184, align 8, !tbaa !23
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !16
  %189 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %188, i32 0, i32 1
  %190 = load i32, ptr %189, align 4, !tbaa !22
  %191 = call i32 @EVP_PKEY_set_type(ptr noundef %185, i32 noundef %190)
  %192 = icmp sgt i32 %191, -1
  br i1 %192, label %194, label %193

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

194:                                              ; preds = %182
  br label %195

195:                                              ; preds = %194
  br label %367

196:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %197 = call ptr @EVP_PKEY_CTX_new_id(i32 noundef 408, ptr noundef null)
  store ptr %197, ptr %6, align 8, !tbaa !5
  br label %198

198:                                              ; preds = %196
  %199 = load ptr, ptr %6, align 8, !tbaa !5
  %200 = icmp eq ptr %199, null
  br i1 %200, label %201, label %234

201:                                              ; preds = %198
  br label %202

202:                                              ; preds = %201
  br label %203

203:                                              ; preds = %202
  %204 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %205 = getelementptr inbounds %struct.s2n_debug_info, ptr %204, i32 0, i32 0
  store ptr @.str.51, ptr %205, align 8, !tbaa !12
  %206 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %207 = getelementptr inbounds %struct.s2n_debug_info, ptr %206, i32 0, i32 0
  %208 = load ptr, ptr %207, align 8, !tbaa !12
  %209 = getelementptr inbounds i8, ptr %208, i64 21
  %210 = call ptr @strrchr(ptr noundef %209, i32 noundef 47) #6
  %211 = icmp ne ptr %210, null
  br i1 %211, label %212, label %219

212:                                              ; preds = %203
  %213 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %214 = getelementptr inbounds %struct.s2n_debug_info, ptr %213, i32 0, i32 0
  %215 = load ptr, ptr %214, align 8, !tbaa !12
  %216 = getelementptr inbounds i8, ptr %215, i64 21
  %217 = call ptr @strrchr(ptr noundef %216, i32 noundef 47) #6
  %218 = getelementptr inbounds i8, ptr %217, i64 1
  br label %224

219:                                              ; preds = %203
  %220 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %221 = getelementptr inbounds %struct.s2n_debug_info, ptr %220, i32 0, i32 0
  %222 = load ptr, ptr %221, align 8, !tbaa !12
  %223 = getelementptr inbounds i8, ptr %222, i64 21
  br label %224

224:                                              ; preds = %219, %212
  %225 = phi ptr [ %218, %212 ], [ %223, %219 ]
  %226 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %227 = getelementptr inbounds %struct.s2n_debug_info, ptr %226, i32 0, i32 1
  store ptr %225, ptr %227, align 8, !tbaa !14
  %228 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %228, align 4, !tbaa !15
  %229 = call i32 @s2n_calculate_stacktrace()
  br label %230

230:                                              ; preds = %224
  br label %231

231:                                              ; preds = %230
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %364

232:                                              ; No predecessors!
  br label %233

233:                                              ; preds = %232
  br label %234

234:                                              ; preds = %233, %198
  br label %235

235:                                              ; preds = %234
  br label %236

236:                                              ; preds = %235
  br label %237

237:                                              ; preds = %236
  %238 = load ptr, ptr %6, align 8, !tbaa !5
  %239 = call i32 @EVP_PKEY_paramgen_init(ptr noundef %238)
  %240 = icmp eq i32 %239, 1
  br i1 %240, label %274, label %241

241:                                              ; preds = %237
  br label %242

242:                                              ; preds = %241
  br label %243

243:                                              ; preds = %242
  %244 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %245 = getelementptr inbounds %struct.s2n_debug_info, ptr %244, i32 0, i32 0
  store ptr @.str.52, ptr %245, align 8, !tbaa !12
  %246 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %247 = getelementptr inbounds %struct.s2n_debug_info, ptr %246, i32 0, i32 0
  %248 = load ptr, ptr %247, align 8, !tbaa !12
  %249 = getelementptr inbounds i8, ptr %248, i64 21
  %250 = call ptr @strrchr(ptr noundef %249, i32 noundef 47) #6
  %251 = icmp ne ptr %250, null
  br i1 %251, label %252, label %259

252:                                              ; preds = %243
  %253 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %254 = getelementptr inbounds %struct.s2n_debug_info, ptr %253, i32 0, i32 0
  %255 = load ptr, ptr %254, align 8, !tbaa !12
  %256 = getelementptr inbounds i8, ptr %255, i64 21
  %257 = call ptr @strrchr(ptr noundef %256, i32 noundef 47) #6
  %258 = getelementptr inbounds i8, ptr %257, i64 1
  br label %264

259:                                              ; preds = %243
  %260 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %261 = getelementptr inbounds %struct.s2n_debug_info, ptr %260, i32 0, i32 0
  %262 = load ptr, ptr %261, align 8, !tbaa !12
  %263 = getelementptr inbounds i8, ptr %262, i64 21
  br label %264

264:                                              ; preds = %259, %252
  %265 = phi ptr [ %258, %252 ], [ %263, %259 ]
  %266 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %267 = getelementptr inbounds %struct.s2n_debug_info, ptr %266, i32 0, i32 1
  store ptr %265, ptr %267, align 8, !tbaa !14
  %268 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %268, align 4, !tbaa !15
  %269 = call i32 @s2n_calculate_stacktrace()
  br label %270

270:                                              ; preds = %264
  br label %271

271:                                              ; preds = %270
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %364

272:                                              ; No predecessors!
  br label %273

273:                                              ; preds = %272
  br label %274

274:                                              ; preds = %273, %237
  br label %275

275:                                              ; preds = %274
  br label %276

276:                                              ; preds = %275
  br label %277

277:                                              ; preds = %276
  %278 = load ptr, ptr %6, align 8, !tbaa !5
  %279 = load ptr, ptr %5, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %279, i32 0, i32 0
  %281 = load ptr, ptr %280, align 8, !tbaa !16
  %282 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %281, i32 0, i32 1
  %283 = load i32, ptr %282, align 4, !tbaa !22
  %284 = call i32 @EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ptr noundef %278, i32 noundef %283)
  %285 = icmp eq i32 %284, 1
  br i1 %285, label %319, label %286

286:                                              ; preds = %277
  br label %287

287:                                              ; preds = %286
  br label %288

288:                                              ; preds = %287
  %289 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %290 = getelementptr inbounds %struct.s2n_debug_info, ptr %289, i32 0, i32 0
  store ptr @.str.53, ptr %290, align 8, !tbaa !12
  %291 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %292 = getelementptr inbounds %struct.s2n_debug_info, ptr %291, i32 0, i32 0
  %293 = load ptr, ptr %292, align 8, !tbaa !12
  %294 = getelementptr inbounds i8, ptr %293, i64 21
  %295 = call ptr @strrchr(ptr noundef %294, i32 noundef 47) #6
  %296 = icmp ne ptr %295, null
  br i1 %296, label %297, label %304

297:                                              ; preds = %288
  %298 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %299 = getelementptr inbounds %struct.s2n_debug_info, ptr %298, i32 0, i32 0
  %300 = load ptr, ptr %299, align 8, !tbaa !12
  %301 = getelementptr inbounds i8, ptr %300, i64 21
  %302 = call ptr @strrchr(ptr noundef %301, i32 noundef 47) #6
  %303 = getelementptr inbounds i8, ptr %302, i64 1
  br label %309

304:                                              ; preds = %288
  %305 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %306 = getelementptr inbounds %struct.s2n_debug_info, ptr %305, i32 0, i32 0
  %307 = load ptr, ptr %306, align 8, !tbaa !12
  %308 = getelementptr inbounds i8, ptr %307, i64 21
  br label %309

309:                                              ; preds = %304, %297
  %310 = phi ptr [ %303, %297 ], [ %308, %304 ]
  %311 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %312 = getelementptr inbounds %struct.s2n_debug_info, ptr %311, i32 0, i32 1
  store ptr %310, ptr %312, align 8, !tbaa !14
  %313 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %313, align 4, !tbaa !15
  %314 = call i32 @s2n_calculate_stacktrace()
  br label %315

315:                                              ; preds = %309
  br label %316

316:                                              ; preds = %315
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %364

317:                                              ; No predecessors!
  br label %318

318:                                              ; preds = %317
  br label %319

319:                                              ; preds = %318, %277
  br label %320

320:                                              ; preds = %319
  br label %321

321:                                              ; preds = %320
  br label %322

322:                                              ; preds = %321
  %323 = load ptr, ptr %6, align 8, !tbaa !5
  %324 = load ptr, ptr %5, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %324, i32 0, i32 1
  %326 = call i32 @EVP_PKEY_paramgen(ptr noundef %323, ptr noundef %325)
  %327 = icmp eq i32 %326, 1
  br i1 %327, label %361, label %328

328:                                              ; preds = %322
  br label %329

329:                                              ; preds = %328
  br label %330

330:                                              ; preds = %329
  %331 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %332 = getelementptr inbounds %struct.s2n_debug_info, ptr %331, i32 0, i32 0
  store ptr @.str.54, ptr %332, align 8, !tbaa !12
  %333 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %334 = getelementptr inbounds %struct.s2n_debug_info, ptr %333, i32 0, i32 0
  %335 = load ptr, ptr %334, align 8, !tbaa !12
  %336 = getelementptr inbounds i8, ptr %335, i64 21
  %337 = call ptr @strrchr(ptr noundef %336, i32 noundef 47) #6
  %338 = icmp ne ptr %337, null
  br i1 %338, label %339, label %346

339:                                              ; preds = %330
  %340 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %341 = getelementptr inbounds %struct.s2n_debug_info, ptr %340, i32 0, i32 0
  %342 = load ptr, ptr %341, align 8, !tbaa !12
  %343 = getelementptr inbounds i8, ptr %342, i64 21
  %344 = call ptr @strrchr(ptr noundef %343, i32 noundef 47) #6
  %345 = getelementptr inbounds i8, ptr %344, i64 1
  br label %351

346:                                              ; preds = %330
  %347 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %348 = getelementptr inbounds %struct.s2n_debug_info, ptr %347, i32 0, i32 0
  %349 = load ptr, ptr %348, align 8, !tbaa !12
  %350 = getelementptr inbounds i8, ptr %349, i64 21
  br label %351

351:                                              ; preds = %346, %339
  %352 = phi ptr [ %345, %339 ], [ %350, %346 ]
  %353 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %354 = getelementptr inbounds %struct.s2n_debug_info, ptr %353, i32 0, i32 1
  store ptr %352, ptr %354, align 8, !tbaa !14
  %355 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %355, align 4, !tbaa !15
  %356 = call i32 @s2n_calculate_stacktrace()
  br label %357

357:                                              ; preds = %351
  br label %358

358:                                              ; preds = %357
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %364

359:                                              ; No predecessors!
  br label %360

360:                                              ; preds = %359
  br label %361

361:                                              ; preds = %360, %322
  br label %362

362:                                              ; preds = %361
  br label %363

363:                                              ; preds = %362
  store i32 0, ptr %7, align 4
  br label %364

364:                                              ; preds = %363, %358, %316, %271, %231
  call void @EVP_PKEY_CTX_free_pointer(ptr noundef %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %365 = load i32, ptr %7, align 4
  switch i32 %365, label %416 [
    i32 0, label %366
    i32 1, label %414
  ]

366:                                              ; preds = %364
  br label %367

367:                                              ; preds = %366, %195
  br label %368

368:                                              ; preds = %367
  %369 = load ptr, ptr %5, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %369, i32 0, i32 1
  %371 = load ptr, ptr %370, align 8, !tbaa !23
  %372 = load ptr, ptr %4, align 8, !tbaa !5
  %373 = getelementptr inbounds %struct.s2n_blob, ptr %372, i32 0, i32 0
  %374 = load ptr, ptr %373, align 8, !tbaa !9
  %375 = load ptr, ptr %4, align 8, !tbaa !5
  %376 = getelementptr inbounds %struct.s2n_blob, ptr %375, i32 0, i32 1
  %377 = load i32, ptr %376, align 8, !tbaa !18
  %378 = zext i32 %377 to i64
  %379 = call i32 @EVP_PKEY_set1_encoded_public_key(ptr noundef %371, ptr noundef %374, i64 noundef %378)
  %380 = icmp eq i32 %379, 1
  br i1 %380, label %412, label %381

381:                                              ; preds = %368
  br label %382

382:                                              ; preds = %381
  br label %383

383:                                              ; preds = %382
  %384 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %385 = getelementptr inbounds %struct.s2n_debug_info, ptr %384, i32 0, i32 0
  store ptr @.str.55, ptr %385, align 8, !tbaa !12
  %386 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %387 = getelementptr inbounds %struct.s2n_debug_info, ptr %386, i32 0, i32 0
  %388 = load ptr, ptr %387, align 8, !tbaa !12
  %389 = getelementptr inbounds i8, ptr %388, i64 21
  %390 = call ptr @strrchr(ptr noundef %389, i32 noundef 47) #6
  %391 = icmp ne ptr %390, null
  br i1 %391, label %392, label %399

392:                                              ; preds = %383
  %393 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %394 = getelementptr inbounds %struct.s2n_debug_info, ptr %393, i32 0, i32 0
  %395 = load ptr, ptr %394, align 8, !tbaa !12
  %396 = getelementptr inbounds i8, ptr %395, i64 21
  %397 = call ptr @strrchr(ptr noundef %396, i32 noundef 47) #6
  %398 = getelementptr inbounds i8, ptr %397, i64 1
  br label %404

399:                                              ; preds = %383
  %400 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %401 = getelementptr inbounds %struct.s2n_debug_info, ptr %400, i32 0, i32 0
  %402 = load ptr, ptr %401, align 8, !tbaa !12
  %403 = getelementptr inbounds i8, ptr %402, i64 21
  br label %404

404:                                              ; preds = %399, %392
  %405 = phi ptr [ %398, %392 ], [ %403, %399 ]
  %406 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %407 = getelementptr inbounds %struct.s2n_debug_info, ptr %406, i32 0, i32 1
  store ptr %405, ptr %407, align 8, !tbaa !14
  %408 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %408, align 4, !tbaa !15
  %409 = call i32 @s2n_calculate_stacktrace()
  br label %410

410:                                              ; preds = %404
  store i32 -1, ptr %3, align 4
  br label %414

411:                                              ; No predecessors!
  br label %412

412:                                              ; preds = %411, %368
  br label %413

413:                                              ; preds = %412
  store i32 0, ptr %3, align 4
  br label %414

414:                                              ; preds = %413, %410, %364, %193, %178, %124, %80, %42
  %415 = load i32, ptr %3, align 4
  ret i32 %415

416:                                              ; preds = %364
  unreachable
}

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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind 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 #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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_blob", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!14 = !{!13, !6, i64 8}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !6, i64 0}
!17 = !{!"s2n_ecc_evp_params", !6, i64 0, !6, i64 8}
!18 = !{!10, !11, i64 8}
!19 = !{!20, !7, i64 16}
!20 = !{!"s2n_ecc_named_curve", !21, i64 0, !11, i64 4, !6, i64 8, !7, i64 16, !6, i64 24}
!21 = !{!"short", !7, i64 0}
!22 = !{!20, !11, i64 4}
!23 = !{!17, !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.47 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.55 = 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 ptr @EVP_PKEY_new() local_unnamed_addr #2

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @EVP_PKEY_CTX_free_pointer(ptr noundef) local_unnamed_addr #4

declare i32 @EVP_PKEY_paramgen_init(ptr noundef) local_unnamed_addr #2

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

declare i32 @EVP_PKEY_paramgen(ptr noundef, ptr 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

declare i32 @EVP_PKEY_set1_encoded_public_key(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_ecc_evp_parse_params_point(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #5 {
  %3 = alloca ptr, align 8
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %5, label %13

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

13:                                               ; preds = %2
  %14 = load ptr, ptr %1, align 8, !tbaa !15
  %.not30 = icmp eq ptr %14, null
  br i1 %.not30, label %15, label %23

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

23:                                               ; preds = %13
  %24 = getelementptr inbounds i8, ptr %0, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !17
  %26 = getelementptr inbounds i8, ptr %14, i64 16
  %27 = load i8, ptr %26, align 8, !tbaa !18
  %28 = zext i8 %27 to i32
  %.not32 = icmp eq i32 %25, %28
  br i1 %.not32, label %37, label %29

29:                                               ; preds = %23
  %30 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.49, ptr %30, align 8, !tbaa !11
  %31 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.49, i64 21), i32 noundef 47) #6
  %.not39 = icmp eq ptr %31, null
  %32 = getelementptr inbounds i8, ptr %31, i64 1
  %33 = select i1 %.not39, ptr getelementptr inbounds (i8, ptr @.str.49, i64 21), ptr %32
  %34 = getelementptr inbounds i8, ptr %30, i64 8
  store ptr %33, ptr %34, align 8, !tbaa !13
  %35 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %35, align 4, !tbaa !14
  %36 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %100

37:                                               ; preds = %23
  %38 = getelementptr inbounds i8, ptr %14, i64 4
  %39 = load i32, ptr %38, align 4, !tbaa !21
  %40 = icmp eq i32 %39, 1034
  br i1 %40, label %41, label %60

41:                                               ; preds = %37
  %42 = getelementptr inbounds i8, ptr %1, i64 8
  %43 = load ptr, ptr %42, align 8, !tbaa !22
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %.thread

45:                                               ; preds = %41
  %46 = tail call ptr @EVP_PKEY_new() #7
  store ptr %46, ptr %42, align 8, !tbaa !22
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %..thread_crit_edge

..thread_crit_edge:                               ; preds = %45
  %.pre = load ptr, ptr %1, align 8, !tbaa !15
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 4
  %.pre43 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !21
  br label %.thread

48:                                               ; preds = %45
  %49 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.50, ptr %49, align 8, !tbaa !11
  %50 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.50, i64 21), i32 noundef 47) #6
  %.not38 = icmp eq ptr %50, null
  %51 = getelementptr inbounds i8, ptr %50, i64 1
  %52 = select i1 %.not38, ptr getelementptr inbounds (i8, ptr @.str.50, i64 21), ptr %51
  %53 = getelementptr inbounds i8, ptr %49, i64 8
  store ptr %52, ptr %53, align 8, !tbaa !13
  %54 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544322, ptr %54, align 4, !tbaa !14
  %55 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %100

.thread:                                          ; preds = %..thread_crit_edge, %41
  %56 = phi i32 [ %.pre43, %..thread_crit_edge ], [ 1034, %41 ]
  %57 = phi ptr [ %46, %..thread_crit_edge ], [ %43, %41 ]
  %58 = tail call i32 @EVP_PKEY_set_type(ptr noundef nonnull %57, i32 noundef %56) #7
  %59 = icmp sgt i32 %58, -1
  br i1 %59, label %84, label %100

60:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %61 = tail call ptr @EVP_PKEY_CTX_new_id(i32 noundef 408, ptr noundef null) #7
  store ptr %61, ptr %3, align 8, !tbaa !23
  %62 = icmp eq ptr %61, null
  br i1 %62, label %.thread40, label %63

63:                                               ; preds = %60
  %64 = tail call i32 @EVP_PKEY_paramgen_init(ptr noundef nonnull %61) #7
  %65 = icmp eq i32 %64, 1
  br i1 %65, label %66, label %.thread40

66:                                               ; preds = %63
  %67 = load ptr, ptr %1, align 8, !tbaa !15
  %68 = getelementptr inbounds i8, ptr %67, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !21
  %70 = tail call i32 @EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ptr noundef nonnull %61, i32 noundef %69) #7
  %71 = icmp eq i32 %70, 1
  br i1 %71, label %72, label %.thread40

72:                                               ; preds = %66
  %73 = getelementptr inbounds i8, ptr %1, i64 8
  %74 = tail call i32 @EVP_PKEY_paramgen(ptr noundef nonnull %61, ptr noundef nonnull %73) #7
  %75 = icmp eq i32 %74, 1
  br i1 %75, label %83, label %.thread40

.thread40:                                        ; preds = %72, %66, %63, %60
  %.str.51.sink = phi ptr [ @.str.51, %60 ], [ @.str.52, %63 ], [ @.str.53, %66 ], [ @.str.54, %72 ]
  %.sink49 = phi ptr [ getelementptr inbounds (i8, ptr @.str.51, i64 21), %60 ], [ getelementptr inbounds (i8, ptr @.str.52, i64 21), %63 ], [ getelementptr inbounds (i8, ptr @.str.53, i64 21), %66 ], [ getelementptr inbounds (i8, ptr @.str.54, i64 21), %72 ]
  %76 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.51.sink, ptr %76, align 8, !tbaa !11
  %77 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink49, i32 noundef 47) #6
  %.not36 = icmp eq ptr %77, null
  %78 = getelementptr inbounds i8, ptr %77, i64 1
  %79 = select i1 %.not36, ptr %.sink49, ptr %78
  %80 = getelementptr inbounds i8, ptr %76, i64 8
  store ptr %79, ptr %80, align 8, !tbaa !13
  %81 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %81, align 4, !tbaa !14
  %82 = tail call i32 @s2n_calculate_stacktrace() #7
  call void @EVP_PKEY_CTX_free_pointer(ptr noundef nonnull %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %100

83:                                               ; preds = %72
  call void @EVP_PKEY_CTX_free_pointer(ptr noundef nonnull %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %84

84:                                               ; preds = %83, %.thread
  %85 = getelementptr inbounds i8, ptr %1, i64 8
  %86 = load ptr, ptr %85, align 8, !tbaa !22
  %87 = load ptr, ptr %0, align 8, !tbaa !5
  %88 = load i32, ptr %24, align 8, !tbaa !17
  %89 = zext i32 %88 to i64
  %90 = call i32 @EVP_PKEY_set1_encoded_public_key(ptr noundef %86, ptr noundef %87, i64 noundef %89) #7
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %100, label %92

92:                                               ; preds = %84
  %93 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.55, ptr %93, align 8, !tbaa !11
  %94 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.55, i64 21), i32 noundef 47) #6
  %.not37 = icmp eq ptr %94, null
  %95 = getelementptr inbounds i8, ptr %94, i64 1
  %96 = select i1 %.not37, ptr getelementptr inbounds (i8, ptr @.str.55, i64 21), ptr %95
  %97 = getelementptr inbounds i8, ptr %93, i64 8
  store ptr %96, ptr %97, align 8, !tbaa !13
  %98 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %98, align 4, !tbaa !14
  %99 = call i32 @s2n_calculate_stacktrace() #7
  br label %100

100:                                              ; preds = %.thread40, %84, %.thread, %92, %48, %29, %15, %5
  %.1 = phi i32 [ -1, %29 ], [ -1, %48 ], [ -1, %92 ], [ -1, %15 ], [ -1, %5 ], [ -1, %.thread ], [ 0, %84 ], [ -1, %.thread40 ]
  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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind 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 #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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_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, !7, i64 0}
!12 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!13 = !{!12, !7, i64 8}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !7, i64 0}
!16 = !{!"s2n_ecc_evp_params", !7, i64 0, !7, i64 8}
!17 = !{!6, !10, i64 8}
!18 = !{!19, !8, i64 16}
!19 = !{!"s2n_ecc_named_curve", !20, i64 0, !10, i64 4, !7, i64 8, !8, i64 16, !7, i64 24}
!20 = !{!"short", !8, i64 0}
!21 = !{!19, !10, i64 4}
!22 = !{!16, !7, i64 8}
!23 = !{!7, !7, i64 0}


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