; LLVM IR from intel/QAT_Engine :: kpt/apps (kpt_rsa_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.kpt_rsa_key = type { i64, ptr, ptr, i64, ptr, ptr, ptr }
%struct.kpt_rsa_wpk_st = type { i64, i64, [32 x [512 x i8]], [32 x [512 x i8]], [2064 x i8], [3600 x i8], [1024 x i8], [1024 x i8], [32 x i32], [32 x i32], i32, i32, i32, i32, i32, i32 }
%struct.wrapping_metadata = type { ptr, ptr, ptr }
%struct.e_swk = type { ptr, ptr }
%struct.rsa_public_key = type { ptr, ptr }

@.str.16 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @d2i_KPTRSAKEY(ptr noundef, ptr noundef, i64 noundef) #0

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

declare ptr @BIO_new(ptr noundef) #2

declare ptr @BIO_s_file() #2

declare i32 @xlog(i32 noundef, ptr noundef, ...) #2

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

declare i32 @BIO_free(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @hex_log(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @kpt_rsa_wpk_parse(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr null, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %21 = call ptr @BIO_s_file()
  %22 = call ptr @BIO_new(ptr noundef %21)
  store ptr %22, ptr %9, align 8, !tbaa !5
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call i64 @BIO_ctrl(ptr noundef %23, i32 noundef 108, i64 noundef 3, ptr noundef %24)
  %26 = trunc i64 %25 to i32
  %27 = icmp sle i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %2
  br label %291

29:                                               ; preds = %2
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = call i32 @PEM_read_bio(ptr noundef %30, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %14)
  store i32 %31, ptr %15, align 4, !tbaa !9
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %32, ptr %13, align 8, !tbaa !5
  %33 = load i64, ptr %14, align 8, !tbaa !11
  %34 = call ptr @d2i_KPTRSAKEY(ptr noundef %6, ptr noundef %13, i64 noundef %33)
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %38, label %37

37:                                               ; preds = %29
  br label %291

38:                                               ; preds = %29
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = call i32 @BIO_free(ptr noundef %39)
  store ptr null, ptr %9, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.kpt_rsa_key, ptr %41, i32 0, i32 0
  %43 = load i64, ptr %42, align 8, !tbaa !13
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %44, i32 0, i32 0
  store i64 %43, ptr %45, align 8, !tbaa !15
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.kpt_rsa_key, ptr %46, i32 0, i32 3
  %48 = load i64, ptr %47, align 8, !tbaa !17
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %49, i32 0, i32 1
  store i64 %48, ptr %50, align 8, !tbaa !18
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.kpt_rsa_key, ptr %51, i32 0, i32 4
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = call i32 @OBJ_obj2nid(ptr noundef %53)
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %55, i32 0, i32 14
  store i32 %54, ptr %56, align 8, !tbaa !20
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.kpt_rsa_key, ptr %57, i32 0, i32 6
  %59 = load ptr, ptr %58, align 8, !tbaa !21
  store ptr %59, ptr %7, align 8, !tbaa !5
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.wrapping_metadata, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !22
  %63 = call i32 @OBJ_obj2nid(ptr noundef %62)
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %64, i32 0, i32 15
  store i32 %63, ptr %65, align 4, !tbaa !24
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %131, %38
  %67 = load i32, ptr %18, align 4, !tbaa !9
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.wrapping_metadata, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !25
  %71 = call i32 @sk_ESWK_num(ptr noundef %70)
  %72 = icmp slt i32 %67, %71
  br i1 %72, label %73, label %134

73:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.wrapping_metadata, ptr %74, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !25
  %77 = load i32, ptr %18, align 4, !tbaa !9
  %78 = call ptr @sk_ESWK_value(ptr noundef %76, i32 noundef %77)
  store ptr %78, ptr %19, align 8, !tbaa !5
  %79 = load ptr, ptr %19, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.e_swk, ptr %79, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  %82 = call i32 @ASN1_STRING_length(ptr noundef %81)
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %83, i32 0, i32 8
  %85 = load i32, ptr %18, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [32 x i32], ptr %84, i64 0, i64 %86
  store i32 %82, ptr %87, align 4, !tbaa !9
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %88, i32 0, i32 2
  %90 = load i32, ptr %18, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [32 x [512 x i8]], ptr %89, i64 0, i64 %91
  %93 = getelementptr inbounds [512 x i8], ptr %92, i64 0, i64 0
  %94 = load ptr, ptr %19, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.e_swk, ptr %94, i32 0, i32 1
  %96 = load ptr, ptr %95, align 8, !tbaa !26
  %97 = call ptr @ASN1_STRING_get0_data(ptr noundef %96)
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %98, i32 0, i32 8
  %100 = load i32, ptr %18, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [32 x i32], ptr %99, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %93, ptr align 1 %97, i64 %104, i1 false)
  %105 = load ptr, ptr %19, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.e_swk, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !28
  %108 = call i32 @ASN1_STRING_length(ptr noundef %107)
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %109, i32 0, i32 9
  %111 = load i32, ptr %18, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [32 x i32], ptr %110, i64 0, i64 %112
  store i32 %108, ptr %113, align 4, !tbaa !9
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %114, i32 0, i32 3
  %116 = load i32, ptr %18, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [32 x [512 x i8]], ptr %115, i64 0, i64 %117
  %119 = getelementptr inbounds [512 x i8], ptr %118, i64 0, i64 0
  %120 = load ptr, ptr %19, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.e_swk, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !28
  %123 = call ptr @ASN1_STRING_get0_data(ptr noundef %122)
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %124, i32 0, i32 9
  %126 = load i32, ptr %18, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [32 x i32], ptr %125, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %119, ptr align 1 %123, i64 %130, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %131

131:                                              ; preds = %73
  %132 = load i32, ptr %18, align 4, !tbaa !9
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %18, align 4, !tbaa !9
  br label %66, !llvm.loop !29

134:                                              ; preds = %66
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.kpt_rsa_key, ptr %135, i32 0, i32 1
  %137 = load ptr, ptr %136, align 8, !tbaa !31
  %138 = call i32 @ASN1_STRING_length(ptr noundef %137)
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %139, i32 0, i32 10
  store i32 %138, ptr %140, align 8, !tbaa !32
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %141, i32 0, i32 4
  %143 = getelementptr inbounds [2064 x i8], ptr %142, i64 0, i64 0
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.kpt_rsa_key, ptr %144, i32 0, i32 1
  %146 = load ptr, ptr %145, align 8, !tbaa !31
  %147 = call ptr @ASN1_STRING_get0_data(ptr noundef %146)
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %148, i32 0, i32 10
  %150 = load i32, ptr %149, align 8, !tbaa !32
  %151 = sext i32 %150 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %143, ptr align 1 %147, i64 %151, i1 false)
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.kpt_rsa_key, ptr %152, i32 0, i32 2
  %154 = load ptr, ptr %153, align 8, !tbaa !33
  %155 = call i32 @ASN1_STRING_length(ptr noundef %154)
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %156, i32 0, i32 11
  store i32 %155, ptr %157, align 4, !tbaa !34
  %158 = load ptr, ptr %4, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %158, i32 0, i32 5
  %160 = getelementptr inbounds [3600 x i8], ptr %159, i64 0, i64 0
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.kpt_rsa_key, ptr %161, i32 0, i32 2
  %163 = load ptr, ptr %162, align 8, !tbaa !33
  %164 = call ptr @ASN1_STRING_get0_data(ptr noundef %163)
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %165, i32 0, i32 11
  %167 = load i32, ptr %166, align 4, !tbaa !34
  %168 = sext i32 %167 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %160, ptr align 1 %164, i64 %168, i1 false)
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.kpt_rsa_key, ptr %169, i32 0, i32 5
  %171 = load ptr, ptr %170, align 8, !tbaa !35
  %172 = getelementptr inbounds %struct.rsa_public_key, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !36
  %174 = call ptr @ASN1_INTEGER_to_BN(ptr noundef %173, ptr noundef null)
  store ptr %174, ptr %16, align 8, !tbaa !5
  %175 = load ptr, ptr %6, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.kpt_rsa_key, ptr %175, i32 0, i32 5
  %177 = load ptr, ptr %176, align 8, !tbaa !35
  %178 = getelementptr inbounds %struct.rsa_public_key, ptr %177, i32 0, i32 1
  %179 = load ptr, ptr %178, align 8, !tbaa !38
  %180 = call ptr @ASN1_INTEGER_to_BN(ptr noundef %179, ptr noundef null)
  store ptr %180, ptr %17, align 8, !tbaa !5
  %181 = load ptr, ptr %16, align 8, !tbaa !5
  %182 = call i32 @BN_num_bits(ptr noundef %181)
  %183 = add nsw i32 %182, 7
  %184 = sdiv i32 %183, 8
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %185, i32 0, i32 12
  store i32 %184, ptr %186, align 8, !tbaa !39
  %187 = load ptr, ptr %17, align 8, !tbaa !5
  %188 = call i32 @BN_num_bits(ptr noundef %187)
  %189 = add nsw i32 %188, 7
  %190 = sdiv i32 %189, 8
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %191, i32 0, i32 13
  store i32 %190, ptr %192, align 4, !tbaa !40
  %193 = load ptr, ptr %16, align 8, !tbaa !5
  %194 = load ptr, ptr %4, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %194, i32 0, i32 6
  %196 = getelementptr inbounds [1024 x i8], ptr %195, i64 0, i64 0
  %197 = call i32 @BN_bn2bin(ptr noundef %193, ptr noundef %196)
  %198 = load ptr, ptr %17, align 8, !tbaa !5
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %199, i32 0, i32 7
  %201 = getelementptr inbounds [1024 x i8], ptr %200, i64 0, i64 0
  %202 = call i32 @BN_bn2bin(ptr noundef %198, ptr noundef %201)
  %203 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef @.str.16)
  %204 = load ptr, ptr %4, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %204, i32 0, i32 0
  %206 = load i64, ptr %205, align 8, !tbaa !15
  %207 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef @.str.17, i64 noundef %206)
  %208 = load ptr, ptr %4, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %208, i32 0, i32 4
  %210 = getelementptr inbounds [2064 x i8], ptr %209, i64 0, i64 0
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %211, i32 0, i32 10
  %213 = load i32, ptr %212, align 8, !tbaa !32
  call void @hex_log(ptr noundef %210, i32 noundef %213, ptr noundef @.str.18)
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %214, i32 0, i32 5
  %216 = getelementptr inbounds [3600 x i8], ptr %215, i64 0, i64 0
  %217 = load ptr, ptr %4, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %217, i32 0, i32 11
  %219 = load i32, ptr %218, align 4, !tbaa !34
  call void @hex_log(ptr noundef %216, i32 noundef %219, ptr noundef @.str.19)
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %220, i32 0, i32 1
  %222 = load i64, ptr %221, align 8, !tbaa !18
  %223 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef @.str.20, i64 noundef %222)
  %224 = load ptr, ptr %4, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %224, i32 0, i32 14
  %226 = load i32, ptr %225, align 8, !tbaa !20
  %227 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef @.str.21, i32 noundef %226)
  %228 = load ptr, ptr %4, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %228, i32 0, i32 6
  %230 = getelementptr inbounds [1024 x i8], ptr %229, i64 0, i64 0
  %231 = load ptr, ptr %4, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %231, i32 0, i32 12
  %233 = load i32, ptr %232, align 8, !tbaa !39
  call void @hex_log(ptr noundef %230, i32 noundef %233, ptr noundef @.str.22)
  %234 = load ptr, ptr %4, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %234, i32 0, i32 7
  %236 = getelementptr inbounds [1024 x i8], ptr %235, i64 0, i64 0
  %237 = load ptr, ptr %4, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %237, i32 0, i32 13
  %239 = load i32, ptr %238, align 4, !tbaa !40
  call void @hex_log(ptr noundef %236, i32 noundef %239, ptr noundef @.str.23)
  %240 = load ptr, ptr %7, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.wrapping_metadata, ptr %240, i32 0, i32 0
  %242 = load ptr, ptr %241, align 8, !tbaa !41
  %243 = call ptr @ASN1_STRING_get0_data(ptr noundef %242)
  %244 = load ptr, ptr %7, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.wrapping_metadata, ptr %244, i32 0, i32 0
  %246 = load ptr, ptr %245, align 8, !tbaa !41
  %247 = call i32 @ASN1_STRING_length(ptr noundef %246)
  call void @hex_log(ptr noundef %243, i32 noundef %247, ptr noundef @.str.24)
  %248 = load ptr, ptr %4, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %248, i32 0, i32 15
  %250 = load i32, ptr %249, align 4, !tbaa !24
  %251 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef @.str.25, i32 noundef %250)
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %252

252:                                              ; preds = %286, %134
  %253 = load i32, ptr %18, align 4, !tbaa !9
  %254 = load ptr, ptr %7, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.wrapping_metadata, ptr %254, i32 0, i32 2
  %256 = load ptr, ptr %255, align 8, !tbaa !25
  %257 = call i32 @sk_ESWK_num(ptr noundef %256)
  %258 = icmp slt i32 %253, %257
  br i1 %258, label %259, label %289

259:                                              ; preds = %252
  %260 = load i32, ptr %18, align 4, !tbaa !9
  %261 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef @.str.26, i32 noundef %260)
  %262 = load ptr, ptr %4, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %262, i32 0, i32 2
  %264 = load i32, ptr %18, align 4, !tbaa !9
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [32 x [512 x i8]], ptr %263, i64 0, i64 %265
  %267 = getelementptr inbounds [512 x i8], ptr %266, i64 0, i64 0
  %268 = load ptr, ptr %4, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %268, i32 0, i32 8
  %270 = load i32, ptr %18, align 4, !tbaa !9
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [32 x i32], ptr %269, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !9
  call void @hex_log(ptr noundef %267, i32 noundef %273, ptr noundef @.str.27)
  %274 = load ptr, ptr %4, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %274, i32 0, i32 3
  %276 = load i32, ptr %18, align 4, !tbaa !9
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [32 x [512 x i8]], ptr %275, i64 0, i64 %277
  %279 = getelementptr inbounds [512 x i8], ptr %278, i64 0, i64 0
  %280 = load ptr, ptr %4, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.kpt_rsa_wpk_st, ptr %280, i32 0, i32 9
  %282 = load i32, ptr %18, align 4, !tbaa !9
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [32 x i32], ptr %281, i64 0, i64 %283
  %285 = load i32, ptr %284, align 4, !tbaa !9
  call void @hex_log(ptr noundef %279, i32 noundef %285, ptr noundef @.str.28)
  br label %286

286:                                              ; preds = %259
  %287 = load i32, ptr %18, align 4, !tbaa !9
  %288 = add nsw i32 %287, 1
  store i32 %288, ptr %18, align 4, !tbaa !9
  br label %252, !llvm.loop !42

289:                                              ; preds = %252
  %290 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef @.str.29)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %298

291:                                              ; preds = %37, %28
  %292 = load ptr, ptr %9, align 8, !tbaa !5
  %293 = icmp ne ptr %292, null
  br i1 %293, label %294, label %297

294:                                              ; preds = %291
  %295 = load ptr, ptr %9, align 8, !tbaa !5
  %296 = call i32 @BIO_free(ptr noundef %295)
  store ptr null, ptr %9, align 8, !tbaa !5
  br label %297

297:                                              ; preds = %294, %291
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %20, align 4
  br label %298

298:                                              ; preds = %297, %289
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %299 = load i32, ptr %3, align 4
  ret i32 %299
}

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

declare i32 @OBJ_obj2nid(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @sk_ESWK_value(ptr noundef, i32 noundef) #4

declare i32 @ASN1_STRING_length(ptr noundef) #2

declare ptr @ASN1_STRING_get0_data(ptr noundef) #2

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

declare i32 @BN_num_bits(ptr noundef) #2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 }

!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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"kpt_rsa_key", !12, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!15 = !{!16, !12, i64 0}
!16 = !{!"kpt_rsa_wpk_st", !12, i64 0, !12, i64 8, !7, i64 16, !7, i64 16400, !7, i64 32784, !7, i64 34848, !7, i64 38448, !7, i64 39472, !7, i64 40496, !7, i64 40624, !10, i64 40752, !10, i64 40756, !10, i64 40760, !10, i64 40764, !10, i64 40768, !10, i64 40772}
!17 = !{!14, !12, i64 24}
!18 = !{!16, !12, i64 8}
!19 = !{!14, !6, i64 32}
!20 = !{!16, !10, i64 40768}
!21 = !{!14, !6, i64 48}
!22 = !{!23, !6, i64 8}
!23 = !{!"wrapping_metadata", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!16, !10, i64 40772}
!25 = !{!23, !6, i64 16}
!26 = !{!27, !6, i64 8}
!27 = !{!"e_swk", !6, i64 0, !6, i64 8}
!28 = !{!27, !6, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!14, !6, i64 8}
!32 = !{!16, !10, i64 40752}
!33 = !{!14, !6, i64 16}
!34 = !{!16, !10, i64 40756}
!35 = !{!14, !6, i64 40}
!36 = !{!37, !6, i64 0}
!37 = !{!"rsa_public_key", !6, i64 0, !6, i64 8}
!38 = !{!37, !6, i64 8}
!39 = !{!16, !10, i64 40760}
!40 = !{!16, !10, i64 40764}
!41 = !{!23, !6, i64 0}
!42 = distinct !{!42, !30}


; 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"

@.str.16 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @d2i_KPTRSAKEY(ptr noundef, ptr noundef, i64 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

declare ptr @BIO_new(ptr noundef) local_unnamed_addr #2

declare ptr @BIO_s_file() local_unnamed_addr #2

declare i32 @xlog(i32 noundef, ptr noundef, ...) local_unnamed_addr #2

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

declare i32 @BIO_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @hex_log(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @sk_ESWK_num(ptr noundef) 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) #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @kpt_rsa_wpk_parse(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  store ptr null, ptr %6, align 8, !tbaa !5
  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
  %9 = tail call ptr @BIO_s_file() #5
  %10 = tail call ptr @BIO_new(ptr noundef %9) #5
  %11 = tail call i64 @BIO_ctrl(ptr noundef %10, i32 noundef 108, i64 noundef 3, ptr noundef %1) #5
  %12 = trunc i64 %11 to i32
  %13 = icmp slt i32 %12, 1
  br i1 %13, label %156, label %14

14:                                               ; preds = %2
  %15 = call i32 @PEM_read_bio(ptr noundef %10, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %8) #5
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %16, ptr %7, align 8, !tbaa !5
  %17 = load i64, ptr %8, align 8, !tbaa !9
  %18 = call ptr @d2i_KPTRSAKEY(ptr noundef nonnull %3, ptr noundef nonnull %7, i64 noundef %17)
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %.not = icmp eq ptr %19, null
  br i1 %.not, label %156, label %20

20:                                               ; preds = %14
  %21 = call i32 @BIO_free(ptr noundef %10) #5
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = load i64, ptr %22, align 8, !tbaa !11
  store i64 %23, ptr %0, align 8, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %22, i64 24
  %25 = load i64, ptr %24, align 8, !tbaa !16
  %26 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %25, ptr %26, align 8, !tbaa !17
  %27 = getelementptr inbounds i8, ptr %22, i64 32
  %28 = load ptr, ptr %27, align 8, !tbaa !18
  %29 = call i32 @OBJ_obj2nid(ptr noundef %28) #5
  %30 = getelementptr inbounds i8, ptr %0, i64 40768
  store i32 %29, ptr %30, align 8, !tbaa !19
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 48
  %33 = load ptr, ptr %32, align 8, !tbaa !20
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !21
  %36 = call i32 @OBJ_obj2nid(ptr noundef %35) #5
  %37 = getelementptr inbounds i8, ptr %0, i64 40772
  store i32 %36, ptr %37, align 4, !tbaa !23
  %38 = getelementptr inbounds i8, ptr %33, i64 16
  %39 = load ptr, ptr %38, align 8, !tbaa !24
  %40 = call i32 @sk_ESWK_num(ptr noundef %39)
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %20
  %42 = getelementptr inbounds i8, ptr %0, i64 40496
  %43 = getelementptr inbounds i8, ptr %0, i64 16
  %44 = getelementptr inbounds i8, ptr %0, i64 40624
  %45 = getelementptr inbounds i8, ptr %0, i64 16400
  br label %46

46:                                               ; preds = %.lr.ph, %46
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %46 ]
  %47 = load ptr, ptr %38, align 8, !tbaa !24
  %48 = trunc nuw nsw i64 %indvars.iv to i32
  %49 = call ptr @sk_ESWK_value(ptr noundef %47, i32 noundef %48)
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  %51 = load ptr, ptr %50, align 8, !tbaa !25
  %52 = call i32 @ASN1_STRING_length(ptr noundef %51) #5
  %53 = getelementptr inbounds [32 x i32], ptr %42, i64 0, i64 %indvars.iv
  store i32 %52, ptr %53, align 4, !tbaa !27
  %54 = getelementptr inbounds [32 x [512 x i8]], ptr %43, i64 0, i64 %indvars.iv
  %55 = load ptr, ptr %50, align 8, !tbaa !25
  %56 = call ptr @ASN1_STRING_get0_data(ptr noundef %55) #5
  %57 = load i32, ptr %53, align 4, !tbaa !27
  %58 = sext i32 %57 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %54, ptr align 1 %56, i64 %58, i1 false)
  %59 = load ptr, ptr %49, align 8, !tbaa !28
  %60 = call i32 @ASN1_STRING_length(ptr noundef %59) #5
  %61 = getelementptr inbounds [32 x i32], ptr %44, i64 0, i64 %indvars.iv
  store i32 %60, ptr %61, align 4, !tbaa !27
  %62 = getelementptr inbounds [32 x [512 x i8]], ptr %45, i64 0, i64 %indvars.iv
  %63 = load ptr, ptr %49, align 8, !tbaa !28
  %64 = call ptr @ASN1_STRING_get0_data(ptr noundef %63) #5
  %65 = load i32, ptr %61, align 4, !tbaa !27
  %66 = sext i32 %65 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %62, ptr align 1 %64, i64 %66, i1 false)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %67 = load ptr, ptr %38, align 8, !tbaa !24
  %68 = call i32 @sk_ESWK_num(ptr noundef %67)
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next, %69
  br i1 %70, label %46, label %._crit_edge, !llvm.loop !29

._crit_edge:                                      ; preds = %46, %20
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i64 8
  %73 = load ptr, ptr %72, align 8, !tbaa !31
  %74 = call i32 @ASN1_STRING_length(ptr noundef %73) #5
  %75 = getelementptr inbounds i8, ptr %0, i64 40752
  store i32 %74, ptr %75, align 8, !tbaa !32
  %76 = getelementptr inbounds i8, ptr %0, i64 32784
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %77, i64 8
  %79 = load ptr, ptr %78, align 8, !tbaa !31
  %80 = call ptr @ASN1_STRING_get0_data(ptr noundef %79) #5
  %81 = load i32, ptr %75, align 8, !tbaa !32
  %82 = sext i32 %81 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %76, ptr align 1 %80, i64 %82, i1 false)
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %83, i64 16
  %85 = load ptr, ptr %84, align 8, !tbaa !33
  %86 = call i32 @ASN1_STRING_length(ptr noundef %85) #5
  %87 = getelementptr inbounds i8, ptr %0, i64 40756
  store i32 %86, ptr %87, align 4, !tbaa !34
  %88 = getelementptr inbounds i8, ptr %0, i64 34848
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %89, i64 16
  %91 = load ptr, ptr %90, align 8, !tbaa !33
  %92 = call ptr @ASN1_STRING_get0_data(ptr noundef %91) #5
  %93 = load i32, ptr %87, align 4, !tbaa !34
  %94 = sext i32 %93 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %88, ptr align 1 %92, i64 %94, i1 false)
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 40
  %97 = load ptr, ptr %96, align 8, !tbaa !35
  %98 = load ptr, ptr %97, align 8, !tbaa !36
  %99 = call ptr @ASN1_INTEGER_to_BN(ptr noundef %98, ptr noundef null) #5
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 40
  %102 = load ptr, ptr %101, align 8, !tbaa !35
  %103 = getelementptr inbounds i8, ptr %102, i64 8
  %104 = load ptr, ptr %103, align 8, !tbaa !38
  %105 = call ptr @ASN1_INTEGER_to_BN(ptr noundef %104, ptr noundef null) #5
  %106 = call i32 @BN_num_bits(ptr noundef %99) #5
  %107 = add nsw i32 %106, 7
  %108 = sdiv i32 %107, 8
  %109 = getelementptr inbounds i8, ptr %0, i64 40760
  store i32 %108, ptr %109, align 8, !tbaa !39
  %110 = call i32 @BN_num_bits(ptr noundef %105) #5
  %111 = add nsw i32 %110, 7
  %112 = sdiv i32 %111, 8
  %113 = getelementptr inbounds i8, ptr %0, i64 40764
  store i32 %112, ptr %113, align 4, !tbaa !40
  %114 = getelementptr inbounds i8, ptr %0, i64 38448
  %115 = call i32 @BN_bn2bin(ptr noundef %99, ptr noundef nonnull %114) #5
  %116 = getelementptr inbounds i8, ptr %0, i64 39472
  %117 = call i32 @BN_bn2bin(ptr noundef %105, ptr noundef nonnull %116) #5
  %118 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef nonnull @.str.16) #5
  %119 = load i64, ptr %0, align 8, !tbaa !13
  %120 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef nonnull @.str.17, i64 noundef %119) #5
  %121 = load i32, ptr %75, align 8, !tbaa !32
  call void @hex_log(ptr noundef nonnull %76, i32 noundef %121, ptr noundef nonnull @.str.18)
  %122 = load i32, ptr %87, align 4, !tbaa !34
  call void @hex_log(ptr noundef nonnull %88, i32 noundef %122, ptr noundef nonnull @.str.19)
  %123 = load i64, ptr %26, align 8, !tbaa !17
  %124 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef nonnull @.str.20, i64 noundef %123) #5
  %125 = load i32, ptr %30, align 8, !tbaa !19
  %126 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef nonnull @.str.21, i32 noundef %125) #5
  %127 = load i32, ptr %109, align 8, !tbaa !39
  call void @hex_log(ptr noundef nonnull %114, i32 noundef %127, ptr noundef nonnull @.str.22)
  %128 = load i32, ptr %113, align 4, !tbaa !40
  call void @hex_log(ptr noundef nonnull %116, i32 noundef %128, ptr noundef nonnull @.str.23)
  %129 = load ptr, ptr %33, align 8, !tbaa !41
  %130 = call ptr @ASN1_STRING_get0_data(ptr noundef %129) #5
  %131 = load ptr, ptr %33, align 8, !tbaa !41
  %132 = call i32 @ASN1_STRING_length(ptr noundef %131) #5
  call void @hex_log(ptr noundef %130, i32 noundef %132, ptr noundef nonnull @.str.24)
  %133 = load i32, ptr %37, align 4, !tbaa !23
  %134 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef nonnull @.str.25, i32 noundef %133) #5
  %135 = load ptr, ptr %38, align 8, !tbaa !24
  %136 = call i32 @sk_ESWK_num(ptr noundef %135)
  %137 = icmp sgt i32 %136, 0
  br i1 %137, label %.lr.ph78, label %._crit_edge79

.lr.ph78:                                         ; preds = %._crit_edge
  %138 = getelementptr inbounds i8, ptr %0, i64 16
  %139 = getelementptr inbounds i8, ptr %0, i64 40496
  %140 = getelementptr inbounds i8, ptr %0, i64 16400
  %141 = getelementptr inbounds i8, ptr %0, i64 40624
  br label %142

142:                                              ; preds = %.lr.ph78, %142
  %indvars.iv81 = phi i64 [ 0, %.lr.ph78 ], [ %indvars.iv.next82, %142 ]
  %143 = trunc nuw nsw i64 %indvars.iv81 to i32
  %144 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef nonnull @.str.26, i32 noundef %143) #5
  %145 = getelementptr inbounds [32 x [512 x i8]], ptr %138, i64 0, i64 %indvars.iv81
  %146 = getelementptr inbounds [32 x i32], ptr %139, i64 0, i64 %indvars.iv81
  %147 = load i32, ptr %146, align 4, !tbaa !27
  call void @hex_log(ptr noundef nonnull %145, i32 noundef %147, ptr noundef nonnull @.str.27)
  %148 = getelementptr inbounds [32 x [512 x i8]], ptr %140, i64 0, i64 %indvars.iv81
  %149 = getelementptr inbounds [32 x i32], ptr %141, i64 0, i64 %indvars.iv81
  %150 = load i32, ptr %149, align 4, !tbaa !27
  call void @hex_log(ptr noundef nonnull %148, i32 noundef %150, ptr noundef nonnull @.str.28)
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %151 = load ptr, ptr %38, align 8, !tbaa !24
  %152 = call i32 @sk_ESWK_num(ptr noundef %151)
  %153 = sext i32 %152 to i64
  %154 = icmp slt i64 %indvars.iv.next82, %153
  br i1 %154, label %142, label %._crit_edge79, !llvm.loop !42

._crit_edge79:                                    ; preds = %142, %._crit_edge
  %155 = call i32 (i32, ptr, ...) @xlog(i32 noundef 2, ptr noundef nonnull @.str.29) #5
  br label %159

156:                                              ; preds = %14, %2
  %.not74 = icmp eq ptr %10, null
  br i1 %.not74, label %159, label %157

157:                                              ; preds = %156
  %158 = call i32 @BIO_free(ptr noundef nonnull %10) #5
  br label %159

159:                                              ; preds = %156, %157, %._crit_edge79
  %.0 = phi i32 [ 0, %._crit_edge79 ], [ -1, %157 ], [ -1, %156 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i32 %.0
}

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

declare i32 @OBJ_obj2nid(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @sk_ESWK_value(ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @ASN1_STRING_length(ptr noundef) local_unnamed_addr #2

declare ptr @ASN1_STRING_get0_data(ptr noundef) local_unnamed_addr #2

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

declare i32 @BN_num_bits(ptr noundef) local_unnamed_addr #2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 }

!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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"kpt_rsa_key", !10, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!13 = !{!14, !10, i64 0}
!14 = !{!"kpt_rsa_wpk_st", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 16400, !7, i64 32784, !7, i64 34848, !7, i64 38448, !7, i64 39472, !7, i64 40496, !7, i64 40624, !15, i64 40752, !15, i64 40756, !15, i64 40760, !15, i64 40764, !15, i64 40768, !15, i64 40772}
!15 = !{!"int", !7, i64 0}
!16 = !{!12, !10, i64 24}
!17 = !{!14, !10, i64 8}
!18 = !{!12, !6, i64 32}
!19 = !{!14, !15, i64 40768}
!20 = !{!12, !6, i64 48}
!21 = !{!22, !6, i64 8}
!22 = !{!"wrapping_metadata", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!14, !15, i64 40772}
!24 = !{!22, !6, i64 16}
!25 = !{!26, !6, i64 8}
!26 = !{!"e_swk", !6, i64 0, !6, i64 8}
!27 = !{!15, !15, i64 0}
!28 = !{!26, !6, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!12, !6, i64 8}
!32 = !{!14, !15, i64 40752}
!33 = !{!12, !6, i64 16}
!34 = !{!14, !15, i64 40756}
!35 = !{!12, !6, i64 40}
!36 = !{!37, !6, i64 0}
!37 = !{!"rsa_public_key", !6, i64 0, !6, i64 8}
!38 = !{!37, !6, i64 8}
!39 = !{!14, !15, i64 40760}
!40 = !{!14, !15, i64 40764}
!41 = !{!22, !6, i64 0}
!42 = distinct !{!42, !30}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass