; LLVM IR from peacemakr-io/peacemakr-core-crypto :: src/core/src (Key)

; 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.PeacemakrKey = type { %struct.crypto_config_t, %union.anon, ptr }
%struct.crypto_config_t = type { i32, i32, i32, i32 }
%union.anon = type { ptr }

@peacemakr_global_malloc = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@__FUNCTION__.peacemakr_key_new_pem = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [30 x i8], align 1

declare void @log_printf(ptr noundef, i32 noundef, ptr noundef, ...) #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @peacemakr_key_free(ptr noundef) #2

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

declare void @openssl_log(ptr noundef, i32 noundef) #0

declare i32 @BIO_free(ptr noundef) #0

declare ptr @BIO_new_mem_buf(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local ptr @peacemakr_key_new_pem(i32 noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, i1 noundef zeroext %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i8, align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  store i32 %0, ptr %8, align 4, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !9
  store i64 %2, ptr %10, align 8, !tbaa !11
  store ptr %3, ptr %11, align 8, !tbaa !9
  store i64 %4, ptr %12, align 8, !tbaa !11
  %29 = zext i1 %5 to i8
  store i8 %29, ptr %13, align 1, !tbaa !13
  %30 = load ptr, ptr %9, align 8, !tbaa !9
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %35

32:                                               ; preds = %6
  %33 = load i64, ptr %10, align 8, !tbaa !11
  %34 = icmp ugt i64 %33, 0
  br i1 %34, label %36, label %35

35:                                               ; preds = %32, %6
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 591, ptr noundef @.str.25)
  store ptr null, ptr %7, align 8
  br label %257

36:                                               ; preds = %32
  %37 = load i64, ptr %10, align 8, !tbaa !11
  %38 = icmp ule i64 %37, 2147483647
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 593, ptr noundef @.str.26)
  store ptr null, ptr %7, align 8
  br label %257

40:                                               ; preds = %36
  %41 = load ptr, ptr %11, align 8, !tbaa !9
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %53

43:                                               ; preds = %40
  %44 = load i64, ptr %12, align 8, !tbaa !11
  %45 = icmp ne i64 %44, 0
  br i1 %45, label %46, label %53

46:                                               ; preds = %43
  %47 = load ptr, ptr %11, align 8, !tbaa !9
  %48 = call i64 @strlen(ptr noundef %47) #4
  %49 = load i64, ptr %12, align 8, !tbaa !11
  %50 = icmp eq i64 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %46
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 596, ptr noundef @.str.27)
  store ptr null, ptr %7, align 8
  br label %257

52:                                               ; preds = %46
  br label %53

53:                                               ; preds = %52, %43, %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %54 = load ptr, ptr @peacemakr_global_malloc, align 8, !tbaa !9
  %55 = call ptr %54(i64 noundef 32)
  store ptr %55, ptr %14, align 8, !tbaa !9
  %56 = load ptr, ptr %14, align 8, !tbaa !9
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %59

58:                                               ; preds = %53
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 600, ptr noundef @.str.8)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %256

59:                                               ; preds = %53
  %60 = load ptr, ptr %14, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.PeacemakrKey, ptr %60, i32 0, i32 0
  %62 = getelementptr inbounds %struct.crypto_config_t, ptr %61, i32 0, i32 0
  store i32 1, ptr %62, align 8, !tbaa !15
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = load ptr, ptr %14, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.PeacemakrKey, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %struct.crypto_config_t, ptr %65, i32 0, i32 1
  store i32 %63, ptr %66, align 4, !tbaa !18
  %67 = load ptr, ptr %14, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct.PeacemakrKey, ptr %67, i32 0, i32 0
  %69 = getelementptr inbounds %struct.crypto_config_t, ptr %68, i32 0, i32 3
  store i32 0, ptr %69, align 4, !tbaa !19
  %70 = load ptr, ptr %14, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.PeacemakrKey, ptr %70, i32 0, i32 1
  store ptr null, ptr %71, align 8, !tbaa !20
  %72 = load ptr, ptr %14, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.PeacemakrKey, ptr %72, i32 0, i32 2
  store ptr null, ptr %73, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %74 = load ptr, ptr %9, align 8, !tbaa !9
  %75 = load i64, ptr %10, align 8, !tbaa !11
  %76 = trunc i64 %75 to i32
  %77 = call ptr @BIO_new_mem_buf(ptr noundef %74, i32 noundef %76)
  store ptr %77, ptr %16, align 8, !tbaa !9
  %78 = load i8, ptr %13, align 1, !tbaa !13, !range !22, !noundef !23
  %79 = trunc i8 %78 to i1
  br i1 %79, label %80, label %96

80:                                               ; preds = %59
  %81 = load ptr, ptr %16, align 8, !tbaa !9
  %82 = call ptr @PEM_read_bio_PrivateKey(ptr noundef %81, ptr noundef null, ptr noundef null, ptr noundef null)
  %83 = load ptr, ptr %14, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.PeacemakrKey, ptr %83, i32 0, i32 1
  store ptr %82, ptr %84, align 8, !tbaa !20
  %85 = load ptr, ptr %14, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.PeacemakrKey, ptr %85, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !20
  %88 = icmp eq ptr %87, null
  br i1 %88, label %89, label %93

89:                                               ; preds = %80
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 619, ptr noundef @.str.28)
  %90 = load ptr, ptr %16, align 8, !tbaa !9
  %91 = call i32 @BIO_free(ptr noundef %90)
  %92 = load ptr, ptr %14, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %92)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %255

93:                                               ; preds = %80
  %94 = load ptr, ptr %16, align 8, !tbaa !9
  %95 = call i32 @BIO_free(ptr noundef %94)
  br label %174

96:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr null, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store ptr null, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store ptr null, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  store i64 0, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %97 = load ptr, ptr %16, align 8, !tbaa !9
  %98 = call i32 @PEM_read_bio(ptr noundef %97, ptr noundef %17, ptr noundef %18, ptr noundef %19, ptr noundef %20)
  store i32 %98, ptr %21, align 4, !tbaa !5
  %99 = load i32, ptr %21, align 4, !tbaa !5
  %100 = icmp ne i32 1, %99
  br i1 %100, label %101, label %103

101:                                              ; preds = %96
  call void @openssl_log(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 627)
  %102 = load ptr, ptr %14, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %102)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %171

103:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %104 = load ptr, ptr %19, align 8, !tbaa !9
  store ptr %104, ptr %22, align 8, !tbaa !9
  %105 = load ptr, ptr %17, align 8, !tbaa !9
  %106 = call i32 @strncmp(ptr noundef %105, ptr noundef @.str.29, i64 noundef 11) #4
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %108, label %139

108:                                              ; preds = %103
  %109 = load ptr, ptr %17, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %109, ptr noundef @.str.30, i32 noundef 638)
  %110 = load ptr, ptr %18, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %110, ptr noundef @.str.30, i32 noundef 639)
  %111 = load i64, ptr %20, align 8, !tbaa !11
  %112 = call ptr @d2i_X509(ptr noundef null, ptr noundef %22, i64 noundef %111)
  %113 = load ptr, ptr %14, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.PeacemakrKey, ptr %113, i32 0, i32 2
  store ptr %112, ptr %114, align 8, !tbaa !21
  %115 = load ptr, ptr %16, align 8, !tbaa !9
  %116 = call i32 @BIO_free(ptr noundef %115)
  %117 = load ptr, ptr %19, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %117, ptr noundef @.str.30, i32 noundef 643)
  %118 = load ptr, ptr %14, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.PeacemakrKey, ptr %118, i32 0, i32 2
  %120 = load ptr, ptr %119, align 8, !tbaa !21
  %121 = icmp eq ptr %120, null
  br i1 %121, label %122, label %124

122:                                              ; preds = %108
  call void @openssl_log(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 645)
  %123 = load ptr, ptr %14, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %123)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %170

124:                                              ; preds = %108
  %125 = load ptr, ptr %14, align 8, !tbaa !9
  %126 = getelementptr inbounds %struct.PeacemakrKey, ptr %125, i32 0, i32 2
  %127 = load ptr, ptr %126, align 8, !tbaa !21
  %128 = load ptr, ptr %11, align 8, !tbaa !9
  %129 = call ptr @get_valid_pubkey(ptr noundef %127, ptr noundef %128)
  %130 = load ptr, ptr %14, align 8, !tbaa !9
  %131 = getelementptr inbounds %struct.PeacemakrKey, ptr %130, i32 0, i32 1
  store ptr %129, ptr %131, align 8, !tbaa !20
  %132 = load ptr, ptr %14, align 8, !tbaa !9
  %133 = getelementptr inbounds %struct.PeacemakrKey, ptr %132, i32 0, i32 1
  %134 = load ptr, ptr %133, align 8, !tbaa !20
  %135 = icmp eq ptr %134, null
  br i1 %135, label %136, label %138

136:                                              ; preds = %124
  call void @openssl_log(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 653)
  %137 = load ptr, ptr %14, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %137)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %170

138:                                              ; preds = %124
  br label %169

139:                                              ; preds = %103
  %140 = load ptr, ptr %17, align 8, !tbaa !9
  %141 = call i32 @strncmp(ptr noundef %140, ptr noundef @.str.31, i64 noundef 10) #4
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %160

143:                                              ; preds = %139
  %144 = load ptr, ptr %17, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %144, ptr noundef @.str.30, i32 noundef 659)
  %145 = load ptr, ptr %18, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %145, ptr noundef @.str.30, i32 noundef 660)
  %146 = load i64, ptr %20, align 8, !tbaa !11
  %147 = call ptr @d2i_PUBKEY(ptr noundef null, ptr noundef %22, i64 noundef %146)
  %148 = load ptr, ptr %14, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.PeacemakrKey, ptr %148, i32 0, i32 1
  store ptr %147, ptr %149, align 8, !tbaa !20
  %150 = load ptr, ptr %16, align 8, !tbaa !9
  %151 = call i32 @BIO_free(ptr noundef %150)
  %152 = load ptr, ptr %19, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %152, ptr noundef @.str.30, i32 noundef 665)
  %153 = load ptr, ptr %14, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct.PeacemakrKey, ptr %153, i32 0, i32 1
  %155 = load ptr, ptr %154, align 8, !tbaa !20
  %156 = icmp eq ptr %155, null
  br i1 %156, label %157, label %159

157:                                              ; preds = %143
  call void @openssl_log(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 667)
  %158 = load ptr, ptr %14, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %158)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %170

159:                                              ; preds = %143
  br label %168

160:                                              ; preds = %139
  %161 = load ptr, ptr %17, align 8, !tbaa !9
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 672, ptr noundef @.str.32, ptr noundef %161)
  %162 = load ptr, ptr %17, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %162, ptr noundef @.str.30, i32 noundef 673)
  %163 = load ptr, ptr %18, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %163, ptr noundef @.str.30, i32 noundef 674)
  %164 = load ptr, ptr %19, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %164, ptr noundef @.str.30, i32 noundef 675)
  %165 = load ptr, ptr %16, align 8, !tbaa !9
  %166 = call i32 @BIO_free(ptr noundef %165)
  %167 = load ptr, ptr %14, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %167)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %170

168:                                              ; preds = %159
  br label %169

169:                                              ; preds = %168, %138
  store i32 0, ptr %15, align 4
  br label %170

170:                                              ; preds = %169, %160, %157, %136, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %171

171:                                              ; preds = %170, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %172 = load i32, ptr %15, align 4
  switch i32 %172, label %255 [
    i32 0, label %173
  ]

173:                                              ; preds = %171
  br label %174

174:                                              ; preds = %173, %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %175 = load ptr, ptr %14, align 8, !tbaa !9
  %176 = getelementptr inbounds %struct.PeacemakrKey, ptr %175, i32 0, i32 1
  %177 = load ptr, ptr %176, align 8, !tbaa !20
  %178 = call i32 @EVP_PKEY_get_id(ptr noundef %177)
  store i32 %178, ptr %23, align 4, !tbaa !5
  %179 = load i32, ptr %23, align 4, !tbaa !5
  switch i32 %179, label %250 [
    i32 408, label %180
    i32 6, label %224
    i32 19, label %224
  ]

180:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %181 = load ptr, ptr %14, align 8, !tbaa !9
  %182 = getelementptr inbounds %struct.PeacemakrKey, ptr %181, i32 0, i32 1
  %183 = load ptr, ptr %182, align 8, !tbaa !20
  %184 = call ptr @EVP_PKEY_get0_EC_KEY(ptr noundef %183)
  store ptr %184, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %185 = load ptr, ptr %24, align 8, !tbaa !9
  %186 = call ptr @EC_KEY_get0_group(ptr noundef %185)
  store ptr %186, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %187 = load ptr, ptr %25, align 8, !tbaa !9
  %188 = call i32 @EC_GROUP_get_curve_name(ptr noundef %187)
  store i32 %188, ptr %26, align 4, !tbaa !5
  %189 = load i32, ptr %26, align 4, !tbaa !5
  %190 = icmp eq i32 %189, 415
  br i1 %190, label %191, label %195

191:                                              ; preds = %180
  %192 = load ptr, ptr %14, align 8, !tbaa !9
  %193 = getelementptr inbounds %struct.PeacemakrKey, ptr %192, i32 0, i32 0
  %194 = getelementptr inbounds %struct.crypto_config_t, ptr %193, i32 0, i32 2
  store i32 3, ptr %194, align 8, !tbaa !24
  br label %221

195:                                              ; preds = %180
  %196 = load i32, ptr %26, align 4, !tbaa !5
  %197 = icmp eq i32 %196, 715
  br i1 %197, label %198, label %202

198:                                              ; preds = %195
  %199 = load ptr, ptr %14, align 8, !tbaa !9
  %200 = getelementptr inbounds %struct.PeacemakrKey, ptr %199, i32 0, i32 0
  %201 = getelementptr inbounds %struct.crypto_config_t, ptr %200, i32 0, i32 2
  store i32 4, ptr %201, align 8, !tbaa !24
  br label %220

202:                                              ; preds = %195
  %203 = load i32, ptr %26, align 4, !tbaa !5
  %204 = icmp eq i32 %203, 716
  br i1 %204, label %205, label %209

205:                                              ; preds = %202
  %206 = load ptr, ptr %14, align 8, !tbaa !9
  %207 = getelementptr inbounds %struct.PeacemakrKey, ptr %206, i32 0, i32 0
  %208 = getelementptr inbounds %struct.crypto_config_t, ptr %207, i32 0, i32 2
  store i32 5, ptr %208, align 8, !tbaa !24
  br label %219

209:                                              ; preds = %202
  %210 = load i32, ptr %26, align 4, !tbaa !5
  %211 = icmp eq i32 %210, 714
  br i1 %211, label %212, label %216

212:                                              ; preds = %209
  %213 = load ptr, ptr %14, align 8, !tbaa !9
  %214 = getelementptr inbounds %struct.PeacemakrKey, ptr %213, i32 0, i32 0
  %215 = getelementptr inbounds %struct.crypto_config_t, ptr %214, i32 0, i32 2
  store i32 6, ptr %215, align 8, !tbaa !24
  br label %218

216:                                              ; preds = %209
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 699, ptr noundef @.str.33)
  %217 = load ptr, ptr %14, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %217)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %222

218:                                              ; preds = %212
  br label %219

219:                                              ; preds = %218, %205
  br label %220

220:                                              ; preds = %219, %198
  br label %221

221:                                              ; preds = %220, %191
  store i32 2, ptr %15, align 4
  br label %222

222:                                              ; preds = %221, %216
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  %223 = load i32, ptr %15, align 4
  switch i32 %223, label %254 [
    i32 2, label %252
  ]

224:                                              ; preds = %174, %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %225 = load ptr, ptr %14, align 8, !tbaa !9
  %226 = getelementptr inbounds %struct.PeacemakrKey, ptr %225, i32 0, i32 1
  %227 = load ptr, ptr %226, align 8, !tbaa !20
  %228 = call ptr @EVP_PKEY_get0_RSA(ptr noundef %227)
  store ptr %228, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %229 = load ptr, ptr %27, align 8, !tbaa !9
  %230 = call i32 @RSA_size(ptr noundef %229)
  store i32 %230, ptr %28, align 4, !tbaa !5
  %231 = load i32, ptr %28, align 4, !tbaa !5
  %232 = icmp eq i32 %231, 256
  br i1 %232, label %233, label %237

233:                                              ; preds = %224
  %234 = load ptr, ptr %14, align 8, !tbaa !9
  %235 = getelementptr inbounds %struct.PeacemakrKey, ptr %234, i32 0, i32 0
  %236 = getelementptr inbounds %struct.crypto_config_t, ptr %235, i32 0, i32 2
  store i32 1, ptr %236, align 8, !tbaa !24
  br label %247

237:                                              ; preds = %224
  %238 = load i32, ptr %28, align 4, !tbaa !5
  %239 = icmp eq i32 %238, 512
  br i1 %239, label %240, label %244

240:                                              ; preds = %237
  %241 = load ptr, ptr %14, align 8, !tbaa !9
  %242 = getelementptr inbounds %struct.PeacemakrKey, ptr %241, i32 0, i32 0
  %243 = getelementptr inbounds %struct.crypto_config_t, ptr %242, i32 0, i32 2
  store i32 2, ptr %243, align 8, !tbaa !24
  br label %246

244:                                              ; preds = %237
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 718, ptr noundef @.str.34)
  %245 = load ptr, ptr %14, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %245)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %248

246:                                              ; preds = %240
  br label %247

247:                                              ; preds = %246, %233
  store i32 2, ptr %15, align 4
  br label %248

248:                                              ; preds = %247, %244
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  %249 = load i32, ptr %15, align 4
  switch i32 %249, label %254 [
    i32 2, label %252
  ]

250:                                              ; preds = %174
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 728, ptr noundef @.str.35)
  %251 = load ptr, ptr %14, align 8, !tbaa !9
  call void @peacemakr_key_free(ptr noundef %251)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %254

252:                                              ; preds = %248, %222
  %253 = load ptr, ptr %14, align 8, !tbaa !9
  store ptr %253, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %254

254:                                              ; preds = %252, %250, %248, %222
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %255

255:                                              ; preds = %254, %171, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %256

256:                                              ; preds = %255, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %257

257:                                              ; preds = %256, %51, %39, %35
  %258 = load ptr, ptr %7, align 8
  ret ptr %258
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

declare ptr @PEM_read_bio_PrivateKey(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare i32 @PEM_read_bio(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #3

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

declare ptr @d2i_X509(ptr noundef, ptr noundef, i64 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden ptr @get_valid_pubkey(ptr noundef, ptr noundef) #2

declare ptr @d2i_PUBKEY(ptr noundef, ptr noundef, i64 noundef) #0

declare i32 @EVP_PKEY_get_id(ptr noundef) #0

declare ptr @EVP_PKEY_get0_EC_KEY(ptr noundef) #0

declare ptr @EC_KEY_get0_group(ptr noundef) #0

declare i32 @EC_GROUP_get_curve_name(ptr noundef) #0

declare ptr @EVP_PKEY_get0_RSA(ptr noundef) #0

declare i32 @RSA_size(ptr noundef) #0

attributes #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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nounwind willreturn memory(read) }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"PeacemakrKey", !17, i64 0, !7, i64 16, !10, i64 24}
!17 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!18 = !{!16, !6, i64 4}
!19 = !{!16, !6, i64 12}
!20 = !{!7, !7, i64 0}
!21 = !{!16, !10, i64 24}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!16, !6, i64 8}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@peacemakr_global_malloc = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@__FUNCTION__.peacemakr_key_new_pem = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [30 x i8], align 1

declare void @log_printf(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @peacemakr_key_free(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) #1

declare void @openssl_log(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @BIO_free(ptr noundef) local_unnamed_addr #0

declare ptr @BIO_new_mem_buf(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @peacemakr_key_new_pem(i32 noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, i1 noundef zeroext %5) local_unnamed_addr #2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = icmp ne ptr %1, null
  %13 = icmp ne i64 %2, 0
  %or.cond = and i1 %12, %13
  br i1 %or.cond, label %15, label %14

14:                                               ; preds = %6
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 591, ptr noundef nonnull @.str.25) #5
  br label %108

15:                                               ; preds = %6
  %16 = icmp ult i64 %2, 2147483648
  br i1 %16, label %18, label %17

17:                                               ; preds = %15
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 593, ptr noundef nonnull @.str.26) #5
  br label %108

18:                                               ; preds = %15
  %19 = icmp ne ptr %3, null
  %20 = icmp ne i64 %4, 0
  %or.cond5 = and i1 %19, %20
  br i1 %or.cond5, label %21, label %25

21:                                               ; preds = %18
  %22 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #6
  %23 = icmp eq i64 %22, %4
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 596, ptr noundef nonnull @.str.27) #5
  br label %108

25:                                               ; preds = %21, %18
  %26 = load ptr, ptr @peacemakr_global_malloc, align 8, !tbaa !5
  %27 = tail call ptr %26(i64 noundef 32) #5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 600, ptr noundef nonnull @.str.8) #5
  br label %108

30:                                               ; preds = %25
  store i32 1, ptr %27, align 8, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %27, i64 4
  store i32 %0, ptr %31, align 4, !tbaa !13
  %32 = getelementptr inbounds i8, ptr %27, i64 12
  %33 = getelementptr inbounds i8, ptr %27, i64 16
  %34 = getelementptr inbounds i8, ptr %27, i64 24
  %35 = trunc nuw nsw i64 %2 to i32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %32, i8 0, i64 20, i1 false)
  %36 = tail call ptr @BIO_new_mem_buf(ptr noundef nonnull %1, i32 noundef %35) #5
  br i1 %5, label %37, label %44

37:                                               ; preds = %30
  %38 = tail call ptr @PEM_read_bio_PrivateKey(ptr noundef %36, ptr noundef null, ptr noundef null, ptr noundef null) #5
  store ptr %38, ptr %33, align 8, !tbaa !14
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %42

40:                                               ; preds = %37
  tail call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 619, ptr noundef nonnull @.str.28) #5
  %41 = tail call i32 @BIO_free(ptr noundef %36) #5
  tail call void @peacemakr_key_free(ptr noundef nonnull %27)
  br label %108

42:                                               ; preds = %37
  %43 = tail call i32 @BIO_free(ptr noundef %36) #5
  %.pre = load ptr, ptr %33, align 8, !tbaa !14
  br label %83

44:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  store i64 0, ptr %10, align 8, !tbaa !15
  %45 = call i32 @PEM_read_bio(ptr noundef %36, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10) #5
  %.not = icmp eq i32 %45, 1
  br i1 %.not, label %46, label %.critedge

.critedge:                                        ; preds = %44
  call void @openssl_log(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 627) #5
  call void @peacemakr_key_free(ptr noundef nonnull %27)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %108

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %47, ptr %11, align 8, !tbaa !5
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %48, ptr noundef nonnull dereferenceable(1) @.str.29, i64 noundef 11) #6
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %64

51:                                               ; preds = %46
  call void @CRYPTO_free(ptr noundef %48, ptr noundef nonnull @.str.30, i32 noundef 638) #5
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %52, ptr noundef nonnull @.str.30, i32 noundef 639) #5
  %53 = load i64, ptr %10, align 8, !tbaa !15
  %54 = call ptr @d2i_X509(ptr noundef null, ptr noundef nonnull %11, i64 noundef %53) #5
  store ptr %54, ptr %34, align 8, !tbaa !17
  %55 = call i32 @BIO_free(ptr noundef %36) #5
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %56, ptr noundef nonnull @.str.30, i32 noundef 643) #5
  %57 = load ptr, ptr %34, align 8, !tbaa !17
  %58 = icmp eq ptr %57, null
  br i1 %58, label %59, label %60

59:                                               ; preds = %51
  call void @openssl_log(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 645) #5
  br label %.critedge88

60:                                               ; preds = %51
  %61 = call ptr @get_valid_pubkey(ptr noundef nonnull %57, ptr noundef %3)
  store ptr %61, ptr %33, align 8, !tbaa !14
  %62 = icmp eq ptr %61, null
  br i1 %62, label %63, label %81

63:                                               ; preds = %60
  call void @openssl_log(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 653) #5
  br label %.critedge88

64:                                               ; preds = %46
  %65 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %48, ptr noundef nonnull dereferenceable(1) @.str.31, i64 noundef 10) #6
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %76

67:                                               ; preds = %64
  call void @CRYPTO_free(ptr noundef %48, ptr noundef nonnull @.str.30, i32 noundef 659) #5
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %68, ptr noundef nonnull @.str.30, i32 noundef 660) #5
  %69 = load i64, ptr %10, align 8, !tbaa !15
  %70 = call ptr @d2i_PUBKEY(ptr noundef null, ptr noundef nonnull %11, i64 noundef %69) #5
  store ptr %70, ptr %33, align 8, !tbaa !14
  %71 = call i32 @BIO_free(ptr noundef %36) #5
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %72, ptr noundef nonnull @.str.30, i32 noundef 665) #5
  %73 = load ptr, ptr %33, align 8, !tbaa !14
  %74 = icmp eq ptr %73, null
  br i1 %74, label %75, label %81

75:                                               ; preds = %67
  call void @openssl_log(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 667) #5
  br label %.critedge88

76:                                               ; preds = %64
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 672, ptr noundef nonnull @.str.32, ptr noundef %48) #5
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %77, ptr noundef nonnull @.str.30, i32 noundef 673) #5
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %78, ptr noundef nonnull @.str.30, i32 noundef 674) #5
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %79, ptr noundef nonnull @.str.30, i32 noundef 675) #5
  %80 = call i32 @BIO_free(ptr noundef %36) #5
  br label %.critedge88

81:                                               ; preds = %60, %67
  %82 = phi ptr [ %61, %60 ], [ %73, %67 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %83

83:                                               ; preds = %81, %42
  %84 = phi ptr [ %82, %81 ], [ %.pre, %42 ]
  %85 = call i32 @EVP_PKEY_get_id(ptr noundef %84) #5
  switch i32 %85, label %107 [
    i32 408, label %86
    i32 6, label %99
    i32 19, label %99
  ]

86:                                               ; preds = %83
  %87 = load ptr, ptr %33, align 8, !tbaa !14
  %88 = call ptr @EVP_PKEY_get0_EC_KEY(ptr noundef %87) #5
  %89 = call ptr @EC_KEY_get0_group(ptr noundef %88) #5
  %90 = call i32 @EC_GROUP_get_curve_name(ptr noundef %89) #5
  switch i32 %90, label %.critedge84 [
    i32 415, label %91
    i32 715, label %93
    i32 716, label %95
    i32 714, label %97
  ]

91:                                               ; preds = %86
  %92 = getelementptr inbounds i8, ptr %27, i64 8
  store i32 3, ptr %92, align 8, !tbaa !18
  br label %108

93:                                               ; preds = %86
  %94 = getelementptr inbounds i8, ptr %27, i64 8
  store i32 4, ptr %94, align 8, !tbaa !18
  br label %108

95:                                               ; preds = %86
  %96 = getelementptr inbounds i8, ptr %27, i64 8
  store i32 5, ptr %96, align 8, !tbaa !18
  br label %108

97:                                               ; preds = %86
  %98 = getelementptr inbounds i8, ptr %27, i64 8
  store i32 6, ptr %98, align 8, !tbaa !18
  br label %108

.critedge84:                                      ; preds = %86
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 699, ptr noundef nonnull @.str.33) #5
  call void @peacemakr_key_free(ptr noundef nonnull %27)
  br label %108

99:                                               ; preds = %83, %83
  %100 = load ptr, ptr %33, align 8, !tbaa !14
  %101 = call ptr @EVP_PKEY_get0_RSA(ptr noundef %100) #5
  %102 = call i32 @RSA_size(ptr noundef %101) #5
  switch i32 %102, label %.critedge86 [
    i32 256, label %103
    i32 512, label %105
  ]

103:                                              ; preds = %99
  %104 = getelementptr inbounds i8, ptr %27, i64 8
  store i32 1, ptr %104, align 8, !tbaa !18
  br label %108

105:                                              ; preds = %99
  %106 = getelementptr inbounds i8, ptr %27, i64 8
  store i32 2, ptr %106, align 8, !tbaa !18
  br label %108

.critedge86:                                      ; preds = %99
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 718, ptr noundef nonnull @.str.34) #5
  call void @peacemakr_key_free(ptr noundef nonnull %27)
  br label %108

107:                                              ; preds = %83
  call void (ptr, i32, ptr, ...) @log_printf(ptr noundef nonnull @__FUNCTION__.peacemakr_key_new_pem, i32 noundef 728, ptr noundef nonnull @.str.35) #5
  call void @peacemakr_key_free(ptr noundef nonnull %27)
  br label %108

.critedge88:                                      ; preds = %76, %75, %63, %59
  call void @peacemakr_key_free(ptr noundef nonnull %27)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %108

108:                                              ; preds = %.critedge88, %29, %107, %.critedge84, %.critedge86, %105, %103, %93, %97, %95, %91, %.critedge, %40, %24, %17, %14
  %.8 = phi ptr [ null, %24 ], [ null, %17 ], [ null, %14 ], [ null, %29 ], [ null, %40 ], [ null, %.critedge ], [ null, %107 ], [ null, %.critedge84 ], [ null, %.critedge86 ], [ %27, %105 ], [ %27, %103 ], [ %27, %93 ], [ %27, %97 ], [ %27, %95 ], [ %27, %91 ], [ null, %.critedge88 ]
  ret ptr %.8
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

declare ptr @PEM_read_bio_PrivateKey(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @PEM_read_bio(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3

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

declare ptr @d2i_X509(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @get_valid_pubkey(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @d2i_PUBKEY(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

declare i32 @EVP_PKEY_get_id(ptr noundef) local_unnamed_addr #0

declare ptr @EVP_PKEY_get0_EC_KEY(ptr noundef) local_unnamed_addr #0

declare ptr @EC_KEY_get0_group(ptr noundef) local_unnamed_addr #0

declare i32 @EC_GROUP_get_curve_name(ptr noundef) local_unnamed_addr #0

declare ptr @EVP_PKEY_get0_RSA(ptr noundef) local_unnamed_addr #0

declare i32 @RSA_size(ptr noundef) local_unnamed_addr #0

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

attributes #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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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, !12, i64 0}
!10 = !{!"PeacemakrKey", !11, i64 0, !7, i64 16, !6, i64 24}
!11 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !12, i64 4}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!10, !6, i64 24}
!18 = !{!10, !12, i64 8}


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