; LLVM IR from aws/s2n-tls :: crypto (s2n_pkey_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_result = type { i32 }
%struct.s2n_pkey = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.s2n_blob = type { ptr, i32, i32, i8 }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.17 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [92 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strrchr(ptr noundef, i32 noundef) #1

declare i32 @s2n_calculate_stacktrace() #2

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #4

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_pkey_evp_encrypt(ptr noundef %0, ptr noundef %1, ptr noundef %2) #5 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.s2n_result, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i64, 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 = icmp ne ptr %14, null
  br i1 %15, label %47, label %16

16:                                               ; preds = %13
  br label %17

17:                                               ; preds = %16
  br label %18

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

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

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

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

45:                                               ; preds = %39
  store i32 -1, ptr %4, align 4
  br label %434

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46, %13
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %83, label %52

52:                                               ; preds = %49
  br label %53

53:                                               ; preds = %52
  br label %54

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

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

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

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

81:                                               ; preds = %75
  store i32 -1, ptr %4, align 4
  br label %434

82:                                               ; No predecessors!
  br label %83

83:                                               ; preds = %82, %49
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = icmp ne ptr %86, null
  br i1 %87, label %119, label %88

88:                                               ; preds = %85
  br label %89

89:                                               ; preds = %88
  br label %90

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

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

106:                                              ; preds = %90
  %107 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %108 = getelementptr inbounds %struct.s2n_debug_info, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %109, i64 21
  br label %111

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

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

118:                                              ; No predecessors!
  br label %119

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

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.s2n_pkey, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !14
  %125 = icmp ne ptr %124, null
  br i1 %125, label %157, label %126

126:                                              ; preds = %121
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  %129 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %130 = getelementptr inbounds %struct.s2n_debug_info, ptr %129, i32 0, i32 0
  store ptr @.str.20, ptr %130, align 8, !tbaa !9
  %131 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %132 = getelementptr inbounds %struct.s2n_debug_info, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !9
  %134 = getelementptr inbounds i8, ptr %133, i64 21
  %135 = call ptr @strrchr(ptr noundef %134, i32 noundef 47) #6
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %144

137:                                              ; preds = %128
  %138 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %139 = getelementptr inbounds %struct.s2n_debug_info, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !9
  %141 = getelementptr inbounds i8, ptr %140, i64 21
  %142 = call ptr @strrchr(ptr noundef %141, i32 noundef 47) #6
  %143 = getelementptr inbounds i8, ptr %142, i64 1
  br label %149

144:                                              ; preds = %128
  %145 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %146 = getelementptr inbounds %struct.s2n_debug_info, ptr %145, i32 0, i32 0
  %147 = load ptr, ptr %146, align 8, !tbaa !9
  %148 = getelementptr inbounds i8, ptr %147, i64 21
  br label %149

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

155:                                              ; preds = %149
  store i32 -1, ptr %4, align 4
  br label %434

156:                                              ; No predecessors!
  br label %157

157:                                              ; preds = %156, %121
  br label %158

158:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !12
  br label %159

159:                                              ; preds = %158
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.s2n_pkey, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !14
  %163 = call i32 @s2n_pkey_get_type(ptr noundef %162, ptr noundef %8)
  %164 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %163, ptr %164, align 4
  %165 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  %166 = load i32, ptr %165, align 4
  %167 = call zeroext i1 @s2n_result_is_ok(i32 %166)
  br i1 %167, label %169, label %168

168:                                              ; preds = %159
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %433

169:                                              ; preds = %159
  br label %170

170:                                              ; preds = %169
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %8, align 4, !tbaa !12
  %174 = icmp eq i32 %173, 0
  br i1 %174, label %208, label %175

175:                                              ; preds = %172
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176
  %178 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %179 = getelementptr inbounds %struct.s2n_debug_info, ptr %178, i32 0, i32 0
  store ptr @.str.21, ptr %179, align 8, !tbaa !9
  %180 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %181 = getelementptr inbounds %struct.s2n_debug_info, ptr %180, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !9
  %183 = getelementptr inbounds i8, ptr %182, i64 21
  %184 = call ptr @strrchr(ptr noundef %183, i32 noundef 47) #6
  %185 = icmp ne ptr %184, null
  br i1 %185, label %186, label %193

186:                                              ; preds = %177
  %187 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %188 = getelementptr inbounds %struct.s2n_debug_info, ptr %187, i32 0, i32 0
  %189 = load ptr, ptr %188, align 8, !tbaa !9
  %190 = getelementptr inbounds i8, ptr %189, i64 21
  %191 = call ptr @strrchr(ptr noundef %190, i32 noundef 47) #6
  %192 = getelementptr inbounds i8, ptr %191, i64 1
  br label %198

193:                                              ; preds = %177
  %194 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %195 = getelementptr inbounds %struct.s2n_debug_info, ptr %194, i32 0, i32 0
  %196 = load ptr, ptr %195, align 8, !tbaa !9
  %197 = getelementptr inbounds i8, ptr %196, i64 21
  br label %198

198:                                              ; preds = %193, %186
  %199 = phi ptr [ %192, %186 ], [ %197, %193 ]
  %200 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %201 = getelementptr inbounds %struct.s2n_debug_info, ptr %200, i32 0, i32 1
  store ptr %199, ptr %201, align 8, !tbaa !11
  %202 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653231, ptr %202, align 4, !tbaa !12
  %203 = call i32 @s2n_calculate_stacktrace()
  br label %204

204:                                              ; preds = %198
  br label %205

205:                                              ; preds = %204
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %433

206:                                              ; No predecessors!
  br label %207

207:                                              ; preds = %206
  br label %208

208:                                              ; preds = %207, %172
  br label %209

209:                                              ; preds = %208
  br label %210

210:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %211 = load ptr, ptr %5, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.s2n_pkey, ptr %211, i32 0, i32 0
  %213 = load ptr, ptr %212, align 8, !tbaa !14
  %214 = call ptr @EVP_PKEY_CTX_new(ptr noundef %213, ptr noundef null)
  store ptr %214, ptr %11, align 8, !tbaa !5
  br label %215

215:                                              ; preds = %210
  %216 = load ptr, ptr %11, align 8, !tbaa !5
  %217 = icmp ne ptr %216, null
  br i1 %217, label %251, label %218

218:                                              ; preds = %215
  br label %219

219:                                              ; preds = %218
  br label %220

220:                                              ; preds = %219
  %221 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %222 = getelementptr inbounds %struct.s2n_debug_info, ptr %221, i32 0, i32 0
  store ptr @.str.22, ptr %222, align 8, !tbaa !9
  %223 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %224 = getelementptr inbounds %struct.s2n_debug_info, ptr %223, i32 0, i32 0
  %225 = load ptr, ptr %224, align 8, !tbaa !9
  %226 = getelementptr inbounds i8, ptr %225, i64 21
  %227 = call ptr @strrchr(ptr noundef %226, i32 noundef 47) #6
  %228 = icmp ne ptr %227, null
  br i1 %228, label %229, label %236

229:                                              ; preds = %220
  %230 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %231 = getelementptr inbounds %struct.s2n_debug_info, ptr %230, i32 0, i32 0
  %232 = load ptr, ptr %231, align 8, !tbaa !9
  %233 = getelementptr inbounds i8, ptr %232, i64 21
  %234 = call ptr @strrchr(ptr noundef %233, i32 noundef 47) #6
  %235 = getelementptr inbounds i8, ptr %234, i64 1
  br label %241

236:                                              ; preds = %220
  %237 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %238 = getelementptr inbounds %struct.s2n_debug_info, ptr %237, i32 0, i32 0
  %239 = load ptr, ptr %238, align 8, !tbaa !9
  %240 = getelementptr inbounds i8, ptr %239, i64 21
  br label %241

241:                                              ; preds = %236, %229
  %242 = phi ptr [ %235, %229 ], [ %240, %236 ]
  %243 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %244 = getelementptr inbounds %struct.s2n_debug_info, ptr %243, i32 0, i32 1
  store ptr %242, ptr %244, align 8, !tbaa !11
  %245 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %245, align 4, !tbaa !12
  %246 = call i32 @s2n_calculate_stacktrace()
  br label %247

247:                                              ; preds = %241
  br label %248

248:                                              ; preds = %247
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %432

249:                                              ; No predecessors!
  br label %250

250:                                              ; preds = %249
  br label %251

251:                                              ; preds = %250, %215
  br label %252

252:                                              ; preds = %251
  br label %253

253:                                              ; preds = %252
  br label %254

254:                                              ; preds = %253
  %255 = load ptr, ptr %11, align 8, !tbaa !5
  %256 = call i32 @EVP_PKEY_encrypt_init(ptr noundef %255)
  %257 = icmp eq i32 %256, 1
  br i1 %257, label %291, label %258

258:                                              ; preds = %254
  br label %259

259:                                              ; preds = %258
  br label %260

260:                                              ; preds = %259
  %261 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %262 = getelementptr inbounds %struct.s2n_debug_info, ptr %261, i32 0, i32 0
  store ptr @.str.23, ptr %262, align 8, !tbaa !9
  %263 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %264 = getelementptr inbounds %struct.s2n_debug_info, ptr %263, i32 0, i32 0
  %265 = load ptr, ptr %264, align 8, !tbaa !9
  %266 = getelementptr inbounds i8, ptr %265, i64 21
  %267 = call ptr @strrchr(ptr noundef %266, i32 noundef 47) #6
  %268 = icmp ne ptr %267, null
  br i1 %268, label %269, label %276

269:                                              ; preds = %260
  %270 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %271 = getelementptr inbounds %struct.s2n_debug_info, ptr %270, i32 0, i32 0
  %272 = load ptr, ptr %271, align 8, !tbaa !9
  %273 = getelementptr inbounds i8, ptr %272, i64 21
  %274 = call ptr @strrchr(ptr noundef %273, i32 noundef 47) #6
  %275 = getelementptr inbounds i8, ptr %274, i64 1
  br label %281

276:                                              ; preds = %260
  %277 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %278 = getelementptr inbounds %struct.s2n_debug_info, ptr %277, i32 0, i32 0
  %279 = load ptr, ptr %278, align 8, !tbaa !9
  %280 = getelementptr inbounds i8, ptr %279, i64 21
  br label %281

281:                                              ; preds = %276, %269
  %282 = phi ptr [ %275, %269 ], [ %280, %276 ]
  %283 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %284 = getelementptr inbounds %struct.s2n_debug_info, ptr %283, i32 0, i32 1
  store ptr %282, ptr %284, align 8, !tbaa !11
  %285 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653263, ptr %285, align 4, !tbaa !12
  %286 = call i32 @s2n_calculate_stacktrace()
  br label %287

287:                                              ; preds = %281
  br label %288

288:                                              ; preds = %287
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %432

289:                                              ; No predecessors!
  br label %290

290:                                              ; preds = %289
  br label %291

291:                                              ; preds = %290, %254
  br label %292

292:                                              ; preds = %291
  br label %293

293:                                              ; preds = %292
  br label %294

294:                                              ; preds = %293
  %295 = load ptr, ptr %11, align 8, !tbaa !5
  %296 = call i32 @EVP_PKEY_CTX_set_rsa_padding(ptr noundef %295, i32 noundef 1)
  %297 = icmp eq i32 %296, 1
  br i1 %297, label %331, label %298

298:                                              ; preds = %294
  br label %299

299:                                              ; preds = %298
  br label %300

300:                                              ; preds = %299
  %301 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %302 = getelementptr inbounds %struct.s2n_debug_info, ptr %301, i32 0, i32 0
  store ptr @.str.24, ptr %302, align 8, !tbaa !9
  %303 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %304 = getelementptr inbounds %struct.s2n_debug_info, ptr %303, i32 0, i32 0
  %305 = load ptr, ptr %304, align 8, !tbaa !9
  %306 = getelementptr inbounds i8, ptr %305, i64 21
  %307 = call ptr @strrchr(ptr noundef %306, i32 noundef 47) #6
  %308 = icmp ne ptr %307, null
  br i1 %308, label %309, label %316

309:                                              ; preds = %300
  %310 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %311 = getelementptr inbounds %struct.s2n_debug_info, ptr %310, i32 0, i32 0
  %312 = load ptr, ptr %311, align 8, !tbaa !9
  %313 = getelementptr inbounds i8, ptr %312, i64 21
  %314 = call ptr @strrchr(ptr noundef %313, i32 noundef 47) #6
  %315 = getelementptr inbounds i8, ptr %314, i64 1
  br label %321

316:                                              ; preds = %300
  %317 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %318 = getelementptr inbounds %struct.s2n_debug_info, ptr %317, i32 0, i32 0
  %319 = load ptr, ptr %318, align 8, !tbaa !9
  %320 = getelementptr inbounds i8, ptr %319, i64 21
  br label %321

321:                                              ; preds = %316, %309
  %322 = phi ptr [ %315, %309 ], [ %320, %316 ]
  %323 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %324 = getelementptr inbounds %struct.s2n_debug_info, ptr %323, i32 0, i32 1
  store ptr %322, ptr %324, align 8, !tbaa !11
  %325 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653263, ptr %325, align 4, !tbaa !12
  %326 = call i32 @s2n_calculate_stacktrace()
  br label %327

327:                                              ; preds = %321
  br label %328

328:                                              ; preds = %327
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %432

329:                                              ; No predecessors!
  br label %330

330:                                              ; preds = %329
  br label %331

331:                                              ; preds = %330, %294
  br label %332

332:                                              ; preds = %331
  br label %333

333:                                              ; preds = %332
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %334 = load ptr, ptr %7, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.s2n_blob, ptr %334, i32 0, i32 1
  %336 = load i32, ptr %335, align 8, !tbaa !16
  %337 = zext i32 %336 to i64
  store i64 %337, ptr %12, align 8, !tbaa !18
  br label %338

338:                                              ; preds = %333
  %339 = load ptr, ptr %11, align 8, !tbaa !5
  %340 = load ptr, ptr %7, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.s2n_blob, ptr %340, i32 0, i32 0
  %342 = load ptr, ptr %341, align 8, !tbaa !20
  %343 = load ptr, ptr %6, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.s2n_blob, ptr %343, i32 0, i32 0
  %345 = load ptr, ptr %344, align 8, !tbaa !20
  %346 = load ptr, ptr %6, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct.s2n_blob, ptr %346, i32 0, i32 1
  %348 = load i32, ptr %347, align 8, !tbaa !16
  %349 = zext i32 %348 to i64
  %350 = call i32 @EVP_PKEY_encrypt(ptr noundef %339, ptr noundef %342, ptr noundef %12, ptr noundef %345, i64 noundef %349)
  %351 = icmp eq i32 %350, 1
  br i1 %351, label %385, label %352

352:                                              ; preds = %338
  br label %353

353:                                              ; preds = %352
  br label %354

354:                                              ; preds = %353
  %355 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %356 = getelementptr inbounds %struct.s2n_debug_info, ptr %355, i32 0, i32 0
  store ptr @.str.25, ptr %356, align 8, !tbaa !9
  %357 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %358 = getelementptr inbounds %struct.s2n_debug_info, ptr %357, i32 0, i32 0
  %359 = load ptr, ptr %358, align 8, !tbaa !9
  %360 = getelementptr inbounds i8, ptr %359, i64 21
  %361 = call ptr @strrchr(ptr noundef %360, i32 noundef 47) #6
  %362 = icmp ne ptr %361, null
  br i1 %362, label %363, label %370

363:                                              ; preds = %354
  %364 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %365 = getelementptr inbounds %struct.s2n_debug_info, ptr %364, i32 0, i32 0
  %366 = load ptr, ptr %365, align 8, !tbaa !9
  %367 = getelementptr inbounds i8, ptr %366, i64 21
  %368 = call ptr @strrchr(ptr noundef %367, i32 noundef 47) #6
  %369 = getelementptr inbounds i8, ptr %368, i64 1
  br label %375

370:                                              ; preds = %354
  %371 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %372 = getelementptr inbounds %struct.s2n_debug_info, ptr %371, i32 0, i32 0
  %373 = load ptr, ptr %372, align 8, !tbaa !9
  %374 = getelementptr inbounds i8, ptr %373, i64 21
  br label %375

375:                                              ; preds = %370, %363
  %376 = phi ptr [ %369, %363 ], [ %374, %370 ]
  %377 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %378 = getelementptr inbounds %struct.s2n_debug_info, ptr %377, i32 0, i32 1
  store ptr %376, ptr %378, align 8, !tbaa !11
  %379 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544320, ptr %379, align 4, !tbaa !12
  %380 = call i32 @s2n_calculate_stacktrace()
  br label %381

381:                                              ; preds = %375
  br label %382

382:                                              ; preds = %381
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %431

383:                                              ; No predecessors!
  br label %384

384:                                              ; preds = %383
  br label %385

385:                                              ; preds = %384, %338
  br label %386

386:                                              ; preds = %385
  br label %387

387:                                              ; preds = %386
  br label %388

388:                                              ; preds = %387
  %389 = load i64, ptr %12, align 8, !tbaa !18
  %390 = load ptr, ptr %7, align 8, !tbaa !5
  %391 = getelementptr inbounds %struct.s2n_blob, ptr %390, i32 0, i32 1
  %392 = load i32, ptr %391, align 8, !tbaa !16
  %393 = zext i32 %392 to i64
  %394 = icmp eq i64 %389, %393
  br i1 %394, label %428, label %395

395:                                              ; preds = %388
  br label %396

396:                                              ; preds = %395
  br label %397

397:                                              ; preds = %396
  %398 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %399 = getelementptr inbounds %struct.s2n_debug_info, ptr %398, i32 0, i32 0
  store ptr @.str.26, ptr %399, align 8, !tbaa !9
  %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 !9
  %403 = getelementptr inbounds i8, ptr %402, i64 21
  %404 = call ptr @strrchr(ptr noundef %403, i32 noundef 47) #6
  %405 = icmp ne ptr %404, null
  br i1 %405, label %406, label %413

406:                                              ; preds = %397
  %407 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %408 = getelementptr inbounds %struct.s2n_debug_info, ptr %407, i32 0, i32 0
  %409 = load ptr, ptr %408, align 8, !tbaa !9
  %410 = getelementptr inbounds i8, ptr %409, i64 21
  %411 = call ptr @strrchr(ptr noundef %410, i32 noundef 47) #6
  %412 = getelementptr inbounds i8, ptr %411, i64 1
  br label %418

413:                                              ; preds = %397
  %414 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %415 = getelementptr inbounds %struct.s2n_debug_info, ptr %414, i32 0, i32 0
  %416 = load ptr, ptr %415, align 8, !tbaa !9
  %417 = getelementptr inbounds i8, ptr %416, i64 21
  br label %418

418:                                              ; preds = %413, %406
  %419 = phi ptr [ %412, %406 ], [ %417, %413 ]
  %420 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %421 = getelementptr inbounds %struct.s2n_debug_info, ptr %420, i32 0, i32 1
  store ptr %419, ptr %421, align 8, !tbaa !11
  %422 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653220, ptr %422, align 4, !tbaa !12
  %423 = call i32 @s2n_calculate_stacktrace()
  br label %424

424:                                              ; preds = %418
  br label %425

425:                                              ; preds = %424
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %431

426:                                              ; No predecessors!
  br label %427

427:                                              ; preds = %426
  br label %428

428:                                              ; preds = %427, %388
  br label %429

429:                                              ; preds = %428
  br label %430

430:                                              ; preds = %429
  store i32 0, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %431

431:                                              ; preds = %430, %425, %382
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %432

432:                                              ; preds = %431, %328, %288, %248
  call void @EVP_PKEY_CTX_free_pointer(ptr noundef %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %433

433:                                              ; preds = %432, %205, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %434

434:                                              ; preds = %433, %155, %117, %81, %45
  %435 = load i32, ptr %4, align 4
  ret i32 %435
}

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

declare ptr @EVP_PKEY_CTX_new(ptr noundef, ptr noundef) #2

declare i32 @EVP_PKEY_encrypt_init(ptr noundef) #2

declare i32 @EVP_PKEY_encrypt(ptr noundef, ptr noundef, 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 = { 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_debug_info", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"s2n_pkey", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!16 = !{!17, !13, i64 8}
!17 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!18 = !{!19, !19, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!17, !6, 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.17 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [92 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #1

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #2

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_pkey_evp_encrypt(ptr noundef readonly %0, ptr noundef readonly %1, ptr noundef readonly %2) local_unnamed_addr #5 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %7, label %15

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

15:                                               ; preds = %3
  %.not26 = icmp eq ptr %1, null
  br i1 %.not26, label %16, label %24

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

24:                                               ; preds = %15
  %.not28 = icmp eq ptr %2, null
  br i1 %.not28, label %25, label %33

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

33:                                               ; preds = %24
  %34 = load ptr, ptr %0, align 8, !tbaa !13
  %.not30 = icmp eq ptr %34, null
  br i1 %.not30, label %35, label %43

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

43:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !11
  %44 = call i32 @s2n_pkey_get_type(ptr noundef nonnull %34, ptr noundef nonnull %4) #7
  %45 = call zeroext i1 @s2n_result_is_ok(i32 %44)
  br i1 %45, label %46, label %115

46:                                               ; preds = %43
  %47 = load i32, ptr %4, align 4, !tbaa !11
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %57, label %49

49:                                               ; preds = %46
  %50 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.21, ptr %50, align 8, !tbaa !5
  %51 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.21, i64 21), i32 noundef 47) #6
  %.not32 = icmp eq ptr %51, null
  %52 = getelementptr inbounds i8, ptr %51, i64 1
  %53 = select i1 %.not32, ptr getelementptr inbounds (i8, ptr @.str.21, i64 21), ptr %52
  %54 = getelementptr inbounds i8, ptr %50, i64 8
  store ptr %53, ptr %54, align 8, !tbaa !10
  %55 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653231, ptr %55, align 4, !tbaa !11
  %56 = call i32 @s2n_calculate_stacktrace() #7
  br label %115

57:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %58 = load ptr, ptr %0, align 8, !tbaa !13
  %59 = call ptr @EVP_PKEY_CTX_new(ptr noundef %58, ptr noundef null) #7
  store ptr %59, ptr %5, align 8, !tbaa !15
  %.not33 = icmp eq ptr %59, null
  br i1 %.not33, label %60, label %68

60:                                               ; preds = %57
  %61 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.22, ptr %61, align 8, !tbaa !5
  %62 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.22, i64 21), i32 noundef 47) #6
  %.not34 = icmp eq ptr %62, null
  %63 = getelementptr inbounds i8, ptr %62, i64 1
  %64 = select i1 %.not34, ptr getelementptr inbounds (i8, ptr @.str.22, i64 21), ptr %63
  %65 = getelementptr inbounds i8, ptr %61, i64 8
  store ptr %64, ptr %65, align 8, !tbaa !10
  %66 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %66, align 4, !tbaa !11
  %67 = call i32 @s2n_calculate_stacktrace() #7
  br label %114

68:                                               ; preds = %57
  %69 = call i32 @EVP_PKEY_encrypt_init(ptr noundef nonnull %59) #7
  %70 = icmp eq i32 %69, 1
  br i1 %70, label %79, label %71

71:                                               ; preds = %68
  %72 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.23, ptr %72, align 8, !tbaa !5
  %73 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.23, i64 21), i32 noundef 47) #6
  %.not35 = icmp eq ptr %73, null
  %74 = getelementptr inbounds i8, ptr %73, i64 1
  %75 = select i1 %.not35, ptr getelementptr inbounds (i8, ptr @.str.23, i64 21), ptr %74
  %76 = getelementptr inbounds i8, ptr %72, i64 8
  store ptr %75, ptr %76, align 8, !tbaa !10
  %77 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653263, ptr %77, align 4, !tbaa !11
  %78 = call i32 @s2n_calculate_stacktrace() #7
  br label %114

79:                                               ; preds = %68
  %80 = call i32 @EVP_PKEY_CTX_set_rsa_padding(ptr noundef nonnull %59, i32 noundef 1) #7
  %81 = icmp eq i32 %80, 1
  br i1 %81, label %90, label %82

82:                                               ; preds = %79
  %83 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.24, ptr %83, align 8, !tbaa !5
  %84 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.24, i64 21), i32 noundef 47) #6
  %.not36 = icmp eq ptr %84, null
  %85 = getelementptr inbounds i8, ptr %84, i64 1
  %86 = select i1 %.not36, ptr getelementptr inbounds (i8, ptr @.str.24, i64 21), ptr %85
  %87 = getelementptr inbounds i8, ptr %83, i64 8
  store ptr %86, ptr %87, align 8, !tbaa !10
  %88 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653263, ptr %88, align 4, !tbaa !11
  %89 = call i32 @s2n_calculate_stacktrace() #7
  br label %114

90:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %91 = getelementptr inbounds i8, ptr %2, i64 8
  %92 = load i32, ptr %91, align 8, !tbaa !16
  %93 = zext i32 %92 to i64
  store i64 %93, ptr %6, align 8, !tbaa !18
  %94 = load ptr, ptr %2, align 8, !tbaa !20
  %95 = load ptr, ptr %1, align 8, !tbaa !20
  %96 = getelementptr inbounds i8, ptr %1, i64 8
  %97 = load i32, ptr %96, align 8, !tbaa !16
  %98 = zext i32 %97 to i64
  %99 = call i32 @EVP_PKEY_encrypt(ptr noundef nonnull %59, ptr noundef %94, ptr noundef nonnull %6, ptr noundef %95, i64 noundef %98) #7
  %100 = icmp eq i32 %99, 1
  br i1 %100, label %101, label %.sink.split

101:                                              ; preds = %90
  %102 = load i64, ptr %6, align 8, !tbaa !18
  %103 = load i32, ptr %91, align 8, !tbaa !16
  %104 = zext i32 %103 to i64
  %105 = icmp eq i64 %102, %104
  br i1 %105, label %113, label %.sink.split

.sink.split:                                      ; preds = %101, %90
  %.str.26.sink = phi ptr [ @.str.25, %90 ], [ @.str.26, %101 ]
  %.sink47 = phi ptr [ getelementptr inbounds (i8, ptr @.str.25, i64 21), %90 ], [ getelementptr inbounds (i8, ptr @.str.26, i64 21), %101 ]
  %.sink = phi i32 [ 335544320, %90 ], [ 402653220, %101 ]
  %106 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.26.sink, ptr %106, align 8, !tbaa !5
  %107 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink47, i32 noundef 47) #6
  %.not38 = icmp eq ptr %107, null
  %108 = getelementptr inbounds i8, ptr %107, i64 1
  %109 = select i1 %.not38, ptr %.sink47, ptr %108
  %110 = getelementptr inbounds i8, ptr %106, i64 8
  store ptr %109, ptr %110, align 8, !tbaa !10
  %111 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 %.sink, ptr %111, align 4, !tbaa !11
  %112 = call i32 @s2n_calculate_stacktrace() #7
  br label %113

113:                                              ; preds = %.sink.split, %101
  %.0 = phi i32 [ 0, %101 ], [ -1, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %114

114:                                              ; preds = %113, %82, %71, %60
  %.1 = phi i32 [ %.0, %113 ], [ -1, %82 ], [ -1, %71 ], [ -1, %60 ]
  call void @EVP_PKEY_CTX_free_pointer(ptr noundef nonnull %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %115

115:                                              ; preds = %43, %114, %49
  %.2 = phi i32 [ %.1, %114 ], [ -1, %49 ], [ -1, %43 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %116

116:                                              ; preds = %115, %35, %25, %16, %7
  %.3 = phi i32 [ %.2, %115 ], [ -1, %35 ], [ -1, %25 ], [ -1, %16 ], [ -1, %7 ]
  ret i32 %.3
}

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

declare ptr @EVP_PKEY_CTX_new(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @EVP_PKEY_encrypt_init(ptr noundef) local_unnamed_addr #2

declare i32 @EVP_PKEY_encrypt(ptr noundef, ptr noundef, 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 = { 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_debug_info", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!14, !7, i64 0}
!14 = !{!"s2n_pkey", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !12, i64 8}
!17 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!18 = !{!19, !19, i64 0}
!19 = !{!"long", !8, i64 0}
!20 = !{!17, !7, i64 0}


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