; 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.14 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.23 = 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: nounwind uwtable
declare hidden i32 @s2n_ecc_evp_compute_shared_secret(ptr noundef, ptr noundef, i16 noundef zeroext, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_ecc_evp_compute_shared_secret_as_server(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %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 %struct.s2n_blob, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  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 %13

13:                                               ; preds = %3
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = icmp ne ptr %16, null
  br i1 %17, label %49, label %18

18:                                               ; preds = %13
  br label %19

19:                                               ; preds = %18
  br label %20

20:                                               ; preds = %19
  %21 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %22 = getelementptr inbounds %struct.s2n_debug_info, ptr %21, i32 0, i32 0
  store ptr @.str.14, ptr %22, align 8, !tbaa !11
  %23 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %24 = getelementptr inbounds %struct.s2n_debug_info, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  %26 = getelementptr inbounds i8, ptr %25, i64 21
  %27 = call ptr @strrchr(ptr noundef %26, i32 noundef 47) #7
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %36

29:                                               ; preds = %20
  %30 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %31 = getelementptr inbounds %struct.s2n_debug_info, ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  %33 = getelementptr inbounds i8, ptr %32, i64 21
  %34 = call ptr @strrchr(ptr noundef %33, i32 noundef 47) #7
  %35 = getelementptr inbounds i8, ptr %34, i64 1
  br label %41

36:                                               ; preds = %20
  %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 0
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %39, i64 21
  br label %41

41:                                               ; preds = %36, %29
  %42 = phi ptr [ %35, %29 ], [ %40, %36 ]
  %43 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %44 = getelementptr inbounds %struct.s2n_debug_info, ptr %43, i32 0, i32 1
  store ptr %42, ptr %44, align 8, !tbaa !13
  %45 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %45, align 4, !tbaa !14
  %46 = call i32 @s2n_calculate_stacktrace()
  br label %47

47:                                               ; preds = %41
  store i32 -1, ptr %4, align 4
  br label %468

48:                                               ; No predecessors!
  br label %49

49:                                               ; preds = %48, %13
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = icmp ne ptr %54, null
  br i1 %55, label %87, 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.15, ptr %60, align 8, !tbaa !11
  %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 !11
  %64 = getelementptr inbounds i8, ptr %63, i64 21
  %65 = call ptr @strrchr(ptr noundef %64, i32 noundef 47) #7
  %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 !11
  %71 = getelementptr inbounds i8, ptr %70, i64 21
  %72 = call ptr @strrchr(ptr noundef %71, i32 noundef 47) #7
  %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 !11
  %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 !13
  %83 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %83, align 4, !tbaa !14
  %84 = call i32 @s2n_calculate_stacktrace()
  br label %85

85:                                               ; preds = %79
  store i32 -1, ptr %4, align 4
  br label %468

86:                                               ; No predecessors!
  br label %87

87:                                               ; preds = %86, %51
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = icmp ne ptr %90, null
  br i1 %91, label %123, label %92

92:                                               ; preds = %89
  br label %93

93:                                               ; preds = %92
  br label %94

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

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

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

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

121:                                              ; preds = %115
  store i32 -1, ptr %4, align 4
  br label %468

122:                                              ; No predecessors!
  br label %123

123:                                              ; preds = %122, %89
  br label %124

124:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #8
  store i8 0, ptr %8, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #8
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %125 = call ptr @EVP_PKEY_new()
  store ptr %125, ptr %10, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %124
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = icmp eq ptr %127, null
  br i1 %128, label %129, label %162

129:                                              ; preds = %126
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  %132 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %133 = getelementptr inbounds %struct.s2n_debug_info, ptr %132, i32 0, i32 0
  store ptr @.str.17, ptr %133, align 8, !tbaa !11
  %134 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %135 = getelementptr inbounds %struct.s2n_debug_info, ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !11
  %137 = getelementptr inbounds i8, ptr %136, i64 21
  %138 = call ptr @strrchr(ptr noundef %137, i32 noundef 47) #7
  %139 = icmp ne ptr %138, null
  br i1 %139, label %140, label %147

140:                                              ; preds = %131
  %141 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %142 = getelementptr inbounds %struct.s2n_debug_info, ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !11
  %144 = getelementptr inbounds i8, ptr %143, i64 21
  %145 = call ptr @strrchr(ptr noundef %144, i32 noundef 47) #7
  %146 = getelementptr inbounds i8, ptr %145, i64 1
  br label %152

147:                                              ; preds = %131
  %148 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %149 = getelementptr inbounds %struct.s2n_debug_info, ptr %148, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8, !tbaa !11
  %151 = getelementptr inbounds i8, ptr %150, i64 21
  br label %152

152:                                              ; preds = %147, %140
  %153 = phi ptr [ %146, %140 ], [ %151, %147 ]
  %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 1
  store ptr %153, ptr %155, align 8, !tbaa !13
  %156 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544322, ptr %156, align 4, !tbaa !14
  %157 = call i32 @s2n_calculate_stacktrace()
  br label %158

158:                                              ; preds = %152
  br label %159

159:                                              ; preds = %158
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %467

160:                                              ; No predecessors!
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161, %126
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = call i32 @s2n_stuffer_read_uint8(ptr noundef %166, ptr noundef %8)
  %168 = icmp sgt i32 %167, -1
  br i1 %168, label %170, label %169

169:                                              ; preds = %165
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %467

170:                                              ; preds = %165
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  %173 = load i8, ptr %8, align 1, !tbaa !17
  %174 = zext i8 %173 to i32
  %175 = getelementptr inbounds %struct.s2n_blob, ptr %9, i32 0, i32 1
  store i32 %174, ptr %175, align 8, !tbaa !18
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.s2n_blob, ptr %9, i32 0, i32 1
  %178 = load i32, ptr %177, align 8, !tbaa !18
  %179 = call ptr @s2n_stuffer_raw_read(ptr noundef %176, i32 noundef %178)
  %180 = getelementptr inbounds %struct.s2n_blob, ptr %9, i32 0, i32 0
  store ptr %179, ptr %180, align 8, !tbaa !20
  br label %181

181:                                              ; preds = %172
  %182 = getelementptr inbounds %struct.s2n_blob, ptr %9, i32 0, i32 0
  %183 = load ptr, ptr %182, align 8, !tbaa !20
  %184 = icmp ne ptr %183, null
  br i1 %184, label %218, label %185

185:                                              ; preds = %181
  br label %186

186:                                              ; preds = %185
  br label %187

187:                                              ; preds = %186
  %188 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %189 = getelementptr inbounds %struct.s2n_debug_info, ptr %188, i32 0, i32 0
  store ptr @.str.18, ptr %189, align 8, !tbaa !11
  %190 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %191 = getelementptr inbounds %struct.s2n_debug_info, ptr %190, i32 0, i32 0
  %192 = load ptr, ptr %191, align 8, !tbaa !11
  %193 = getelementptr inbounds i8, ptr %192, i64 21
  %194 = call ptr @strrchr(ptr noundef %193, i32 noundef 47) #7
  %195 = icmp ne ptr %194, null
  br i1 %195, label %196, label %203

196:                                              ; preds = %187
  %197 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %198 = getelementptr inbounds %struct.s2n_debug_info, ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !11
  %200 = getelementptr inbounds i8, ptr %199, i64 21
  %201 = call ptr @strrchr(ptr noundef %200, i32 noundef 47) #7
  %202 = getelementptr inbounds i8, ptr %201, i64 1
  br label %208

203:                                              ; preds = %187
  %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
  %206 = load ptr, ptr %205, align 8, !tbaa !11
  %207 = getelementptr inbounds i8, ptr %206, i64 21
  br label %208

208:                                              ; preds = %203, %196
  %209 = phi ptr [ %202, %196 ], [ %207, %203 ]
  %210 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %211 = getelementptr inbounds %struct.s2n_debug_info, ptr %210, i32 0, i32 1
  store ptr %209, ptr %211, align 8, !tbaa !13
  %212 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %212, align 4, !tbaa !14
  %213 = call i32 @s2n_calculate_stacktrace()
  br label %214

214:                                              ; preds = %208
  br label %215

215:                                              ; preds = %214
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %467

216:                                              ; No predecessors!
  br label %217

217:                                              ; preds = %216
  br label %218

218:                                              ; preds = %217, %181
  br label %219

219:                                              ; preds = %218
  br label %220

220:                                              ; preds = %219
  %221 = load ptr, ptr %5, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %221, i32 0, i32 0
  %223 = load ptr, ptr %222, align 8, !tbaa !9
  %224 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %223, i32 0, i32 1
  %225 = load i32, ptr %224, align 4, !tbaa !21
  %226 = icmp eq i32 %225, 1034
  br i1 %226, label %227, label %241

227:                                              ; preds = %220
  br label %228

228:                                              ; preds = %227
  %229 = load ptr, ptr %10, align 8, !tbaa !5
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %230, i32 0, i32 0
  %232 = load ptr, ptr %231, align 8, !tbaa !9
  %233 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %232, i32 0, i32 1
  %234 = load i32, ptr %233, align 4, !tbaa !21
  %235 = call i32 @EVP_PKEY_set_type(ptr noundef %229, i32 noundef %234)
  %236 = icmp sgt i32 %235, -1
  br i1 %236, label %238, label %237

237:                                              ; preds = %228
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %467

238:                                              ; preds = %228
  br label %239

239:                                              ; preds = %238
  br label %240

240:                                              ; preds = %239
  br label %410

241:                                              ; preds = %220
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %242 = call ptr @EVP_PKEY_CTX_new_id(i32 noundef 408, ptr noundef null)
  store ptr %242, ptr %12, align 8, !tbaa !5
  br label %243

243:                                              ; preds = %241
  %244 = load ptr, ptr %12, align 8, !tbaa !5
  %245 = icmp eq ptr %244, null
  br i1 %245, label %246, label %279

246:                                              ; preds = %243
  br label %247

247:                                              ; preds = %246
  br label %248

248:                                              ; preds = %247
  %249 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %250 = getelementptr inbounds %struct.s2n_debug_info, ptr %249, i32 0, i32 0
  store ptr @.str.19, ptr %250, align 8, !tbaa !11
  %251 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %252 = getelementptr inbounds %struct.s2n_debug_info, ptr %251, i32 0, i32 0
  %253 = load ptr, ptr %252, align 8, !tbaa !11
  %254 = getelementptr inbounds i8, ptr %253, i64 21
  %255 = call ptr @strrchr(ptr noundef %254, i32 noundef 47) #7
  %256 = icmp ne ptr %255, null
  br i1 %256, label %257, label %264

257:                                              ; preds = %248
  %258 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %259 = getelementptr inbounds %struct.s2n_debug_info, ptr %258, i32 0, i32 0
  %260 = load ptr, ptr %259, align 8, !tbaa !11
  %261 = getelementptr inbounds i8, ptr %260, i64 21
  %262 = call ptr @strrchr(ptr noundef %261, i32 noundef 47) #7
  %263 = getelementptr inbounds i8, ptr %262, i64 1
  br label %269

264:                                              ; preds = %248
  %265 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %266 = getelementptr inbounds %struct.s2n_debug_info, ptr %265, i32 0, i32 0
  %267 = load ptr, ptr %266, align 8, !tbaa !11
  %268 = getelementptr inbounds i8, ptr %267, i64 21
  br label %269

269:                                              ; preds = %264, %257
  %270 = phi ptr [ %263, %257 ], [ %268, %264 ]
  %271 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %272 = getelementptr inbounds %struct.s2n_debug_info, ptr %271, i32 0, i32 1
  store ptr %270, ptr %272, align 8, !tbaa !13
  %273 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %273, align 4, !tbaa !14
  %274 = call i32 @s2n_calculate_stacktrace()
  br label %275

275:                                              ; preds = %269
  br label %276

276:                                              ; preds = %275
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %407

277:                                              ; No predecessors!
  br label %278

278:                                              ; preds = %277
  br label %279

279:                                              ; preds = %278, %243
  br label %280

280:                                              ; preds = %279
  br label %281

281:                                              ; preds = %280
  br label %282

282:                                              ; preds = %281
  %283 = load ptr, ptr %12, align 8, !tbaa !5
  %284 = call i32 @EVP_PKEY_paramgen_init(ptr noundef %283)
  %285 = icmp eq i32 %284, 1
  br i1 %285, label %319, label %286

286:                                              ; preds = %282
  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.20, ptr %290, align 8, !tbaa !11
  %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 !11
  %294 = getelementptr inbounds i8, ptr %293, i64 21
  %295 = call ptr @strrchr(ptr noundef %294, i32 noundef 47) #7
  %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 !11
  %301 = getelementptr inbounds i8, ptr %300, i64 21
  %302 = call ptr @strrchr(ptr noundef %301, i32 noundef 47) #7
  %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 !11
  %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 !13
  %313 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %313, align 4, !tbaa !14
  %314 = call i32 @s2n_calculate_stacktrace()
  br label %315

315:                                              ; preds = %309
  br label %316

316:                                              ; preds = %315
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %407

317:                                              ; No predecessors!
  br label %318

318:                                              ; preds = %317
  br label %319

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

320:                                              ; preds = %319
  br label %321

321:                                              ; preds = %320
  br label %322

322:                                              ; preds = %321
  %323 = load ptr, ptr %12, 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 0
  %326 = load ptr, ptr %325, align 8, !tbaa !9
  %327 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %326, i32 0, i32 1
  %328 = load i32, ptr %327, align 4, !tbaa !21
  %329 = call i32 @EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ptr noundef %323, i32 noundef %328)
  %330 = icmp eq i32 %329, 1
  br i1 %330, label %364, label %331

331:                                              ; preds = %322
  br label %332

332:                                              ; preds = %331
  br label %333

333:                                              ; preds = %332
  %334 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %335 = getelementptr inbounds %struct.s2n_debug_info, ptr %334, i32 0, i32 0
  store ptr @.str.21, ptr %335, align 8, !tbaa !11
  %336 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %337 = getelementptr inbounds %struct.s2n_debug_info, ptr %336, i32 0, i32 0
  %338 = load ptr, ptr %337, align 8, !tbaa !11
  %339 = getelementptr inbounds i8, ptr %338, i64 21
  %340 = call ptr @strrchr(ptr noundef %339, i32 noundef 47) #7
  %341 = icmp ne ptr %340, null
  br i1 %341, label %342, label %349

342:                                              ; preds = %333
  %343 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %344 = getelementptr inbounds %struct.s2n_debug_info, ptr %343, i32 0, i32 0
  %345 = load ptr, ptr %344, align 8, !tbaa !11
  %346 = getelementptr inbounds i8, ptr %345, i64 21
  %347 = call ptr @strrchr(ptr noundef %346, i32 noundef 47) #7
  %348 = getelementptr inbounds i8, ptr %347, i64 1
  br label %354

349:                                              ; preds = %333
  %350 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %351 = getelementptr inbounds %struct.s2n_debug_info, ptr %350, i32 0, i32 0
  %352 = load ptr, ptr %351, align 8, !tbaa !11
  %353 = getelementptr inbounds i8, ptr %352, i64 21
  br label %354

354:                                              ; preds = %349, %342
  %355 = phi ptr [ %348, %342 ], [ %353, %349 ]
  %356 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %357 = getelementptr inbounds %struct.s2n_debug_info, ptr %356, i32 0, i32 1
  store ptr %355, ptr %357, align 8, !tbaa !13
  %358 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %358, align 4, !tbaa !14
  %359 = call i32 @s2n_calculate_stacktrace()
  br label %360

360:                                              ; preds = %354
  br label %361

361:                                              ; preds = %360
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %407

362:                                              ; No predecessors!
  br label %363

363:                                              ; preds = %362
  br label %364

364:                                              ; preds = %363, %322
  br label %365

365:                                              ; preds = %364
  br label %366

366:                                              ; preds = %365
  br label %367

367:                                              ; preds = %366
  %368 = load ptr, ptr %12, align 8, !tbaa !5
  %369 = call i32 @EVP_PKEY_paramgen(ptr noundef %368, ptr noundef %10)
  %370 = icmp eq i32 %369, 1
  br i1 %370, label %404, label %371

371:                                              ; preds = %367
  br label %372

372:                                              ; preds = %371
  br label %373

373:                                              ; preds = %372
  %374 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %375 = getelementptr inbounds %struct.s2n_debug_info, ptr %374, i32 0, i32 0
  store ptr @.str.22, ptr %375, align 8, !tbaa !11
  %376 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %377 = getelementptr inbounds %struct.s2n_debug_info, ptr %376, i32 0, i32 0
  %378 = load ptr, ptr %377, align 8, !tbaa !11
  %379 = getelementptr inbounds i8, ptr %378, i64 21
  %380 = call ptr @strrchr(ptr noundef %379, i32 noundef 47) #7
  %381 = icmp ne ptr %380, null
  br i1 %381, label %382, label %389

382:                                              ; preds = %373
  %383 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %384 = getelementptr inbounds %struct.s2n_debug_info, ptr %383, i32 0, i32 0
  %385 = load ptr, ptr %384, align 8, !tbaa !11
  %386 = getelementptr inbounds i8, ptr %385, i64 21
  %387 = call ptr @strrchr(ptr noundef %386, i32 noundef 47) #7
  %388 = getelementptr inbounds i8, ptr %387, i64 1
  br label %394

389:                                              ; preds = %373
  %390 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %391 = getelementptr inbounds %struct.s2n_debug_info, ptr %390, i32 0, i32 0
  %392 = load ptr, ptr %391, align 8, !tbaa !11
  %393 = getelementptr inbounds i8, ptr %392, i64 21
  br label %394

394:                                              ; preds = %389, %382
  %395 = phi ptr [ %388, %382 ], [ %393, %389 ]
  %396 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %397 = getelementptr inbounds %struct.s2n_debug_info, ptr %396, i32 0, i32 1
  store ptr %395, ptr %397, align 8, !tbaa !13
  %398 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %398, align 4, !tbaa !14
  %399 = call i32 @s2n_calculate_stacktrace()
  br label %400

400:                                              ; preds = %394
  br label %401

401:                                              ; preds = %400
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %407

402:                                              ; No predecessors!
  br label %403

403:                                              ; preds = %402
  br label %404

404:                                              ; preds = %403, %367
  br label %405

405:                                              ; preds = %404
  br label %406

406:                                              ; preds = %405
  store i32 0, ptr %11, align 4
  br label %407

407:                                              ; preds = %406, %401, %361, %316, %276
  call void @EVP_PKEY_CTX_free_pointer(ptr noundef %12)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  %408 = load i32, ptr %11, align 4
  switch i32 %408, label %467 [
    i32 0, label %409
  ]

409:                                              ; preds = %407
  br label %410

410:                                              ; preds = %409, %240
  br label %411

411:                                              ; preds = %410
  %412 = load ptr, ptr %10, align 8, !tbaa !5
  %413 = getelementptr inbounds %struct.s2n_blob, ptr %9, i32 0, i32 0
  %414 = load ptr, ptr %413, align 8, !tbaa !20
  %415 = getelementptr inbounds %struct.s2n_blob, ptr %9, i32 0, i32 1
  %416 = load i32, ptr %415, align 8, !tbaa !18
  %417 = zext i32 %416 to i64
  %418 = call i32 @EVP_PKEY_set1_encoded_public_key(ptr noundef %412, ptr noundef %414, i64 noundef %417)
  %419 = icmp eq i32 %418, 1
  br i1 %419, label %453, label %420

420:                                              ; preds = %411
  br label %421

421:                                              ; preds = %420
  br label %422

422:                                              ; preds = %421
  %423 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %424 = getelementptr inbounds %struct.s2n_debug_info, ptr %423, i32 0, i32 0
  store ptr @.str.23, ptr %424, align 8, !tbaa !11
  %425 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %426 = getelementptr inbounds %struct.s2n_debug_info, ptr %425, i32 0, i32 0
  %427 = load ptr, ptr %426, align 8, !tbaa !11
  %428 = getelementptr inbounds i8, ptr %427, i64 21
  %429 = call ptr @strrchr(ptr noundef %428, i32 noundef 47) #7
  %430 = icmp ne ptr %429, null
  br i1 %430, label %431, label %438

431:                                              ; preds = %422
  %432 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %433 = getelementptr inbounds %struct.s2n_debug_info, ptr %432, i32 0, i32 0
  %434 = load ptr, ptr %433, align 8, !tbaa !11
  %435 = getelementptr inbounds i8, ptr %434, i64 21
  %436 = call ptr @strrchr(ptr noundef %435, i32 noundef 47) #7
  %437 = getelementptr inbounds i8, ptr %436, i64 1
  br label %443

438:                                              ; preds = %422
  %439 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %440 = getelementptr inbounds %struct.s2n_debug_info, ptr %439, i32 0, i32 0
  %441 = load ptr, ptr %440, align 8, !tbaa !11
  %442 = getelementptr inbounds i8, ptr %441, i64 21
  br label %443

443:                                              ; preds = %438, %431
  %444 = phi ptr [ %437, %431 ], [ %442, %438 ]
  %445 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %446 = getelementptr inbounds %struct.s2n_debug_info, ptr %445, i32 0, i32 1
  store ptr %444, ptr %446, align 8, !tbaa !13
  %447 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %447, align 4, !tbaa !14
  %448 = call i32 @s2n_calculate_stacktrace()
  br label %449

449:                                              ; preds = %443
  br label %450

450:                                              ; preds = %449
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %467

451:                                              ; No predecessors!
  br label %452

452:                                              ; preds = %451
  br label %453

453:                                              ; preds = %452, %411
  br label %454

454:                                              ; preds = %453
  br label %455

455:                                              ; preds = %454
  %456 = load ptr, ptr %5, align 8, !tbaa !5
  %457 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %456, i32 0, i32 1
  %458 = load ptr, ptr %457, align 8, !tbaa !16
  %459 = load ptr, ptr %10, align 8, !tbaa !5
  %460 = load ptr, ptr %5, align 8, !tbaa !5
  %461 = getelementptr inbounds %struct.s2n_ecc_evp_params, ptr %460, i32 0, i32 0
  %462 = load ptr, ptr %461, align 8, !tbaa !9
  %463 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %462, i32 0, i32 0
  %464 = load i16, ptr %463, align 8, !tbaa !24
  %465 = load ptr, ptr %7, align 8, !tbaa !5
  %466 = call i32 @s2n_ecc_evp_compute_shared_secret(ptr noundef %458, ptr noundef %459, i16 noundef zeroext %464, ptr noundef %465)
  store i32 %466, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %467

467:                                              ; preds = %455, %450, %407, %237, %215, %169, %159
  call void @EVP_PKEY_free_pointer(ptr noundef %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #8
  br label %468

468:                                              ; preds = %467, %121, %85, %47
  %469 = load i32, ptr %4, align 4
  ret i32 %469
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare ptr @EVP_PKEY_new() #2

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

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

declare ptr @s2n_stuffer_raw_read(ptr noundef, i32 noundef) #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) #6

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) #4

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

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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_ecc_evp_params", !6, i64 0, !6, i64 8}
!11 = !{!12, !6, i64 0}
!12 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!10, !6, i64 8}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !15, i64 8}
!19 = !{!"s2n_blob", !6, i64 0, !15, i64 8, !15, i64 12, !15, i64 16}
!20 = !{!19, !6, i64 0}
!21 = !{!22, !15, i64 4}
!22 = !{!"s2n_ecc_named_curve", !23, i64 0, !15, i64 4, !6, i64 8, !7, i64 16, !6, i64 24}
!23 = !{!"short", !7, i64 0}
!24 = !{!22, !23, 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.14 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.23 = 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: nounwind uwtable
declare hidden i32 @s2n_ecc_evp_compute_shared_secret(ptr noundef, ptr noundef, i16 noundef zeroext, ptr noundef) local_unnamed_addr #3

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

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

16:                                               ; preds = %3
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !15
  %.not31 = icmp eq ptr %18, null
  br i1 %.not31, label %19, label %27

19:                                               ; preds = %16
  %20 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.15, ptr %20, align 8, !tbaa !10
  %21 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.15, i64 21), i32 noundef 47) #6
  %.not32 = icmp eq ptr %21, null
  %22 = getelementptr inbounds i8, ptr %21, i64 1
  %23 = select i1 %.not32, ptr getelementptr inbounds (i8, ptr @.str.15, i64 21), ptr %22
  %24 = getelementptr inbounds i8, ptr %20, i64 8
  store ptr %23, ptr %24, align 8, !tbaa !12
  %25 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %25, align 4, !tbaa !13
  %26 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %116

27:                                               ; preds = %16
  %.not33 = icmp eq ptr %1, null
  br i1 %.not33, label %28, label %36

28:                                               ; preds = %27
  %29 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.16, ptr %29, align 8, !tbaa !10
  %30 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.16, i64 21), i32 noundef 47) #6
  %.not34 = icmp eq ptr %30, null
  %31 = getelementptr inbounds i8, ptr %30, i64 1
  %32 = select i1 %.not34, ptr getelementptr inbounds (i8, ptr @.str.16, i64 21), ptr %31
  %33 = getelementptr inbounds i8, ptr %29, i64 8
  store ptr %32, ptr %33, align 8, !tbaa !12
  %34 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %34, align 4, !tbaa !13
  %35 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %116

36:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  store i8 0, ptr %4, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %37 = tail call ptr @EVP_PKEY_new() #7
  store ptr %37, ptr %5, align 8, !tbaa !17
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %47

39:                                               ; preds = %36
  %40 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.17, ptr %40, align 8, !tbaa !10
  %41 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.17, i64 21), i32 noundef 47) #6
  %.not42 = icmp eq ptr %41, null
  %42 = getelementptr inbounds i8, ptr %41, i64 1
  %43 = select i1 %.not42, ptr getelementptr inbounds (i8, ptr @.str.17, i64 21), ptr %42
  %44 = getelementptr inbounds i8, ptr %40, i64 8
  store ptr %43, ptr %44, align 8, !tbaa !12
  %45 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544322, ptr %45, align 4, !tbaa !13
  %46 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %115

47:                                               ; preds = %36
  %48 = call i32 @s2n_stuffer_read_uint8(ptr noundef nonnull %1, ptr noundef nonnull %4) #7
  %49 = icmp sgt i32 %48, -1
  br i1 %49, label %50, label %115

50:                                               ; preds = %47
  %51 = load i8, ptr %4, align 1, !tbaa !16
  %52 = zext i8 %51 to i32
  %53 = call ptr @s2n_stuffer_raw_read(ptr noundef nonnull %1, i32 noundef %52) #7
  %.not35 = icmp eq ptr %53, null
  br i1 %.not35, label %54, label %62

54:                                               ; preds = %50
  %55 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.18, ptr %55, align 8, !tbaa !10
  %56 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.18, i64 21), i32 noundef 47) #6
  %.not36 = icmp eq ptr %56, null
  %57 = getelementptr inbounds i8, ptr %56, i64 1
  %58 = select i1 %.not36, ptr getelementptr inbounds (i8, ptr @.str.18, i64 21), ptr %57
  %59 = getelementptr inbounds i8, ptr %55, i64 8
  store ptr %58, ptr %59, align 8, !tbaa !12
  %60 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %60, align 4, !tbaa !13
  %61 = call i32 @s2n_calculate_stacktrace() #7
  br label %115

62:                                               ; preds = %50
  %63 = load ptr, ptr %0, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %63, i64 4
  %65 = load i32, ptr %64, align 4, !tbaa !18
  %66 = icmp eq i32 %65, 1034
  br i1 %66, label %67, label %71

67:                                               ; preds = %62
  %68 = load ptr, ptr %5, align 8, !tbaa !17
  %69 = call i32 @EVP_PKEY_set_type(ptr noundef %68, i32 noundef 1034) #7
  %70 = icmp sgt i32 %69, -1
  br i1 %70, label %89, label %115

71:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %72 = call ptr @EVP_PKEY_CTX_new_id(i32 noundef 408, ptr noundef null) #7
  store ptr %72, ptr %6, align 8, !tbaa !17
  %73 = icmp eq ptr %72, null
  br i1 %73, label %.critedge, label %74

74:                                               ; preds = %71
  %75 = call i32 @EVP_PKEY_paramgen_init(ptr noundef nonnull %72) #7
  %76 = icmp eq i32 %75, 1
  br i1 %76, label %77, label %.critedge

77:                                               ; preds = %74
  %78 = load ptr, ptr %6, align 8, !tbaa !17
  %79 = load ptr, ptr %0, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %79, i64 4
  %81 = load i32, ptr %80, align 4, !tbaa !18
  %82 = call i32 @EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ptr noundef %78, i32 noundef %81) #7
  %83 = icmp eq i32 %82, 1
  br i1 %83, label %84, label %.critedge

84:                                               ; preds = %77
  %85 = load ptr, ptr %6, align 8, !tbaa !17
  %86 = call i32 @EVP_PKEY_paramgen(ptr noundef %85, ptr noundef nonnull %5) #7
  %87 = icmp eq i32 %86, 1
  br i1 %87, label %88, label %.critedge

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

89:                                               ; preds = %88, %67
  %90 = load ptr, ptr %5, align 8, !tbaa !17
  %91 = zext i8 %51 to i64
  %92 = call i32 @EVP_PKEY_set1_encoded_public_key(ptr noundef %90, ptr noundef nonnull %53, i64 noundef %91) #7
  %93 = icmp eq i32 %92, 1
  br i1 %93, label %102, label %94

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

102:                                              ; preds = %89
  %103 = load ptr, ptr %17, align 8, !tbaa !15
  %104 = load ptr, ptr %5, align 8, !tbaa !17
  %105 = load ptr, ptr %0, align 8, !tbaa !5
  %106 = load i16, ptr %105, align 8, !tbaa !21
  %107 = call i32 @s2n_ecc_evp_compute_shared_secret(ptr noundef %103, ptr noundef %104, i16 noundef zeroext %106, ptr noundef %2)
  br label %115

.critedge:                                        ; preds = %84, %77, %74, %71
  %.str.20.sink = phi ptr [ @.str.19, %71 ], [ @.str.20, %74 ], [ @.str.21, %77 ], [ @.str.22, %84 ]
  %.sink48 = phi ptr [ getelementptr inbounds (i8, ptr @.str.19, i64 21), %71 ], [ getelementptr inbounds (i8, ptr @.str.20, i64 21), %74 ], [ getelementptr inbounds (i8, ptr @.str.21, i64 21), %77 ], [ getelementptr inbounds (i8, ptr @.str.22, i64 21), %84 ]
  %108 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.20.sink, ptr %108, align 8, !tbaa !10
  %109 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink48, i32 noundef 47) #6
  %.not37 = icmp eq ptr %109, null
  %110 = getelementptr inbounds i8, ptr %109, i64 1
  %111 = select i1 %.not37, ptr %.sink48, ptr %110
  %112 = getelementptr inbounds i8, ptr %108, i64 8
  store ptr %111, ptr %112, align 8, !tbaa !12
  %113 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544360, ptr %113, align 4, !tbaa !13
  %114 = call i32 @s2n_calculate_stacktrace() #7
  call void @EVP_PKEY_CTX_free_pointer(ptr noundef nonnull %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %115

115:                                              ; preds = %.critedge, %67, %47, %102, %94, %54, %39
  %.1 = phi i32 [ -1, %39 ], [ %107, %102 ], [ -1, %94 ], [ -1, %54 ], [ -1, %47 ], [ -1, %67 ], [ -1, %.critedge ]
  call void @EVP_PKEY_free_pointer(ptr noundef nonnull %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  br label %116

116:                                              ; preds = %115, %28, %19, %8
  %.2 = phi i32 [ %.1, %115 ], [ -1, %28 ], [ -1, %19 ], [ -1, %8 ]
  ret i32 %.2
}

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

declare ptr @EVP_PKEY_new() local_unnamed_addr #2

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

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

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 #5

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) #4

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

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


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