; LLVM IR from specinfo-ua/UAPKI :: library/common/pkix (private-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.SubjectPublicKeyInfo = type { %struct.AlgorithmIdentifier, %struct.BIT_STRING_s, %struct.asn_struct_ctx_s }
%struct.AlgorithmIdentifier = type { %struct.ASN__PRIMITIVE_TYPE_s, ptr, %struct.asn_struct_ctx_s }
%struct.ASN__PRIMITIVE_TYPE_s = type { ptr, i32 }
%struct.BIT_STRING_s = type { ptr, i32, i32, %struct.asn_struct_ctx_s }
%struct.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }

@OID_DSTU4145_WITH_DSTU7564 = external global ptr, align 8
@OID_DSTU4145_WITH_GOST3411 = external global ptr, align 8
@OID_EC_KEY = external global ptr, align 8
@OID_ECKCDSA = external global ptr, align 8
@OID_ECGDSA_STD = external global ptr, align 8
@OID_GOST_KEY_3410_2012_256 = external global ptr, align 8
@OID_GOST_KEY_3410_2012_512 = external global ptr, align 8
@OID_SM2 = external global ptr, align 8
@OID_RSA = external global ptr, align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1

declare zeroext i1 @oid_is_parent(ptr noundef, ptr noundef) #0

declare zeroext i1 @oid_is_equal(ptr 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

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #0

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

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #0

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

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

declare void @asn_free(ptr noundef, ptr noundef) #0

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

declare ptr @get_SubjectPublicKeyInfo_desc() #0

; Function Attrs: nounwind uwtable
define dso_local i32 @spki_get_algo_param(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store ptr null, ptr %10, align 8, !tbaa !5
  br label %11

11:                                               ; preds = %3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %16, label %14

14:                                               ; preds = %11
  store i32 2, ptr %7, align 4, !tbaa !9
  %15 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 620, i32 noundef %15, ptr noundef null)
  br label %149

16:                                               ; preds = %11
  br label %17

17:                                               ; preds = %16
  br label %18

18:                                               ; preds = %17
  br label %19

19:                                               ; preds = %18
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %25

22:                                               ; preds = %19
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %27, label %25

25:                                               ; preds = %22, %19
  store i32 2, ptr %7, align 4, !tbaa !9
  %26 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 621, i32 noundef %26, ptr noundef null)
  br label %149

27:                                               ; preds = %22
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  %31 = call ptr @get_SubjectPublicKeyInfo_desc()
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = call ptr @asn_decode_ba_with_alloc(ptr noundef %31, ptr noundef %32)
  store ptr %33, ptr %8, align 8, !tbaa !5
  %34 = icmp eq ptr null, %33
  br i1 %34, label %35, label %37

35:                                               ; preds = %30
  store i32 2, ptr %7, align 4, !tbaa !9
  %36 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 623, i32 noundef %36)
  br label %149

37:                                               ; preds = %30
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.SubjectPublicKeyInfo, ptr %41, i32 0, i32 0
  %43 = getelementptr inbounds %struct.AlgorithmIdentifier, ptr %42, i32 0, i32 0
  %44 = call i32 @asn_oid_to_text(ptr noundef %43, ptr noundef %9)
  store i32 %44, ptr %7, align 4, !tbaa !9
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %49

47:                                               ; preds = %40
  %48 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 624, i32 noundef %48)
  br label %149

49:                                               ; preds = %40
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr @OID_DSTU4145_WITH_GOST3411, align 8, !tbaa !5
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = call zeroext i1 @oid_is_parent(ptr noundef %52, ptr noundef %53)
  br i1 %54, label %59, label %55

55:                                               ; preds = %51
  %56 = load ptr, ptr @OID_DSTU4145_WITH_DSTU7564, align 8, !tbaa !5
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = call zeroext i1 @oid_is_parent(ptr noundef %56, ptr noundef %57)
  br i1 %58, label %59, label %73

59:                                               ; preds = %55, %51
  br label %60

60:                                               ; preds = %59
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.SubjectPublicKeyInfo, ptr %61, i32 0, i32 0
  %63 = getelementptr inbounds %struct.AlgorithmIdentifier, ptr %62, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  %65 = call i32 @private_key_get_param_dstu(ptr noundef %64, ptr noundef %10)
  store i32 %65, ptr %7, align 4, !tbaa !9
  %66 = load i32, ptr %7, align 4, !tbaa !9
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %70

68:                                               ; preds = %60
  %69 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 628, i32 noundef %69)
  br label %149

70:                                               ; preds = %60
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  br label %136

73:                                               ; preds = %55
  %74 = load ptr, ptr @OID_EC_KEY, align 8, !tbaa !5
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = call zeroext i1 @oid_is_equal(ptr noundef %74, ptr noundef %75)
  br i1 %76, label %97, label %77

77:                                               ; preds = %73
  %78 = load ptr, ptr @OID_ECKCDSA, align 8, !tbaa !5
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = call zeroext i1 @oid_is_equal(ptr noundef %78, ptr noundef %79)
  br i1 %80, label %97, label %81

81:                                               ; preds = %77
  %82 = load ptr, ptr @OID_ECGDSA_STD, align 8, !tbaa !5
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = call zeroext i1 @oid_is_parent(ptr noundef %82, ptr noundef %83)
  br i1 %84, label %97, label %85

85:                                               ; preds = %81
  %86 = load ptr, ptr @OID_GOST_KEY_3410_2012_256, align 8, !tbaa !5
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = call zeroext i1 @oid_is_equal(ptr noundef %86, ptr noundef %87)
  br i1 %88, label %97, label %89

89:                                               ; preds = %85
  %90 = load ptr, ptr @OID_GOST_KEY_3410_2012_512, align 8, !tbaa !5
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = call zeroext i1 @oid_is_equal(ptr noundef %90, ptr noundef %91)
  br i1 %92, label %97, label %93

93:                                               ; preds = %89
  %94 = load ptr, ptr @OID_SM2, align 8, !tbaa !5
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = call zeroext i1 @oid_is_equal(ptr noundef %94, ptr noundef %95)
  br i1 %96, label %97, label %111

97:                                               ; preds = %93, %89, %85, %81, %77, %73
  br label %98

98:                                               ; preds = %97
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.SubjectPublicKeyInfo, ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds %struct.AlgorithmIdentifier, ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !11
  %103 = call i32 @private_key_get_param_ec(ptr noundef %102, ptr noundef %10)
  store i32 %103, ptr %7, align 4, !tbaa !9
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %108

106:                                              ; preds = %98
  %107 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 636, i32 noundef %107)
  br label %149

108:                                              ; preds = %98
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  br label %135

111:                                              ; preds = %93
  %112 = load ptr, ptr @OID_RSA, align 8, !tbaa !5
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = call zeroext i1 @oid_is_equal(ptr noundef %112, ptr noundef %113)
  br i1 %114, label %115, label %129

115:                                              ; preds = %111
  br label %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.SubjectPublicKeyInfo, ptr %117, i32 0, i32 0
  %119 = getelementptr inbounds %struct.AlgorithmIdentifier, ptr %118, i32 0, i32 1
  %120 = load ptr, ptr %119, align 8, !tbaa !11
  %121 = call i32 @spki_get_param_rsa(ptr noundef %120, ptr noundef %10)
  store i32 %121, ptr %7, align 4, !tbaa !9
  %122 = load i32, ptr %7, align 4, !tbaa !9
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %126

124:                                              ; preds = %116
  %125 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 639, i32 noundef %125)
  br label %149

126:                                              ; preds = %116
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  br label %134

129:                                              ; preds = %111
  br label %130

130:                                              ; preds = %129
  store i32 1047, ptr %7, align 4, !tbaa !9
  %131 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 642, i32 noundef %131, ptr noundef null)
  br label %149

132:                                              ; No predecessors!
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133, %128
  br label %135

135:                                              ; preds = %134, %110
  br label %136

136:                                              ; preds = %135, %72
  %137 = load ptr, ptr %9, align 8, !tbaa !5
  %138 = icmp ne ptr %137, null
  br i1 %138, label %139, label %142

139:                                              ; preds = %136
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %140, ptr %141, align 8, !tbaa !5
  store ptr null, ptr %9, align 8, !tbaa !5
  br label %142

142:                                              ; preds = %139, %136
  %143 = load ptr, ptr %10, align 8, !tbaa !5
  %144 = icmp ne ptr %143, null
  br i1 %144, label %145, label %148

145:                                              ; preds = %142
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %146, ptr %147, align 8, !tbaa !5
  store ptr null, ptr %10, align 8, !tbaa !5
  br label %148

148:                                              ; preds = %145, %142
  br label %149

149:                                              ; preds = %148, %130, %124, %106, %68, %47, %35, %25, %14
  %150 = call ptr @get_SubjectPublicKeyInfo_desc()
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  call void @asn_free(ptr noundef %150, ptr noundef %151)
  %152 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %152) #4
  %153 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %153) #4
  %154 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret i32 %154
}

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

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

!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, !6, i64 16}
!12 = !{!"SubjectPublicKeyInfo", !13, i64 0, !18, i64 48, !15, i64 88}
!13 = !{!"AlgorithmIdentifier", !14, i64 0, !6, i64 16, !15, i64 24}
!14 = !{!"ASN__PRIMITIVE_TYPE_s", !6, i64 0, !10, i64 8}
!15 = !{!"asn_struct_ctx_s", !16, i64 0, !16, i64 2, !10, i64 4, !6, i64 8, !17, i64 16}
!16 = !{!"short", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"BIT_STRING_s", !6, i64 0, !10, i64 8, !10, i64 12, !15, i64 16}


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

@OID_DSTU4145_WITH_DSTU7564 = external local_unnamed_addr global ptr, align 8
@OID_DSTU4145_WITH_GOST3411 = external local_unnamed_addr global ptr, align 8
@OID_EC_KEY = external local_unnamed_addr global ptr, align 8
@OID_ECKCDSA = external local_unnamed_addr global ptr, align 8
@OID_ECGDSA_STD = external local_unnamed_addr global ptr, align 8
@OID_GOST_KEY_3410_2012_256 = external local_unnamed_addr global ptr, align 8
@OID_GOST_KEY_3410_2012_512 = external local_unnamed_addr global ptr, align 8
@OID_SM2 = external local_unnamed_addr global ptr, align 8
@OID_RSA = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1

declare zeroext i1 @oid_is_parent(ptr noundef, ptr noundef) local_unnamed_addr #0

declare zeroext i1 @oid_is_equal(ptr 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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

declare void @asn_free(ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare ptr @get_SubjectPublicKeyInfo_desc() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @spki_get_algo_param(ptr noundef %0, ptr noundef writeonly %1, ptr noundef writeonly %2) local_unnamed_addr #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store ptr null, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %7

6:                                                ; preds = %3
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 620, i32 noundef 2, ptr noundef null) #4
  br label %77

7:                                                ; preds = %3
  %8 = icmp ne ptr %1, null
  %9 = icmp ne ptr %2, null
  %or.cond = and i1 %8, %9
  br i1 %or.cond, label %11, label %10

10:                                               ; preds = %7
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 621, i32 noundef 2, ptr noundef null) #4
  br label %77

11:                                               ; preds = %7
  %12 = tail call ptr @get_SubjectPublicKeyInfo_desc() #4
  %13 = tail call ptr @asn_decode_ba_with_alloc(ptr noundef %12, ptr noundef nonnull %0) #4
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %11
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 623, i32 noundef 2) #4
  br label %77

16:                                               ; preds = %11
  %17 = call i32 @asn_oid_to_text(ptr noundef nonnull %13, ptr noundef nonnull %4) #4
  %.not39 = icmp eq i32 %17, 0
  br i1 %.not39, label %19, label %18

18:                                               ; preds = %16
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 624, i32 noundef %17) #4
  br label %77

19:                                               ; preds = %16
  %20 = load ptr, ptr @OID_DSTU4145_WITH_GOST3411, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call zeroext i1 @oid_is_parent(ptr noundef %20, ptr noundef %21) #4
  br i1 %22, label %27, label %23

23:                                               ; preds = %19
  %24 = load ptr, ptr @OID_DSTU4145_WITH_DSTU7564, align 8, !tbaa !5
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call zeroext i1 @oid_is_parent(ptr noundef %24, ptr noundef %25) #4
  br i1 %26, label %27, label %32

27:                                               ; preds = %19, %23
  %28 = getelementptr inbounds i8, ptr %13, i64 16
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = call i32 @private_key_get_param_dstu(ptr noundef %29, ptr noundef nonnull %5)
  %.not42 = icmp eq i32 %30, 0
  br i1 %.not42, label %71, label %31

31:                                               ; preds = %27
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 628, i32 noundef %30) #4
  br label %77

32:                                               ; preds = %23
  %33 = load ptr, ptr @OID_EC_KEY, align 8, !tbaa !5
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = call zeroext i1 @oid_is_equal(ptr noundef %33, ptr noundef %34) #4
  br i1 %35, label %56, label %36

36:                                               ; preds = %32
  %37 = load ptr, ptr @OID_ECKCDSA, align 8, !tbaa !5
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = call zeroext i1 @oid_is_equal(ptr noundef %37, ptr noundef %38) #4
  br i1 %39, label %56, label %40

40:                                               ; preds = %36
  %41 = load ptr, ptr @OID_ECGDSA_STD, align 8, !tbaa !5
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = call zeroext i1 @oid_is_parent(ptr noundef %41, ptr noundef %42) #4
  br i1 %43, label %56, label %44

44:                                               ; preds = %40
  %45 = load ptr, ptr @OID_GOST_KEY_3410_2012_256, align 8, !tbaa !5
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = call zeroext i1 @oid_is_equal(ptr noundef %45, ptr noundef %46) #4
  br i1 %47, label %56, label %48

48:                                               ; preds = %44
  %49 = load ptr, ptr @OID_GOST_KEY_3410_2012_512, align 8, !tbaa !5
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = call zeroext i1 @oid_is_equal(ptr noundef %49, ptr noundef %50) #4
  br i1 %51, label %56, label %52

52:                                               ; preds = %48
  %53 = load ptr, ptr @OID_SM2, align 8, !tbaa !5
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = call zeroext i1 @oid_is_equal(ptr noundef %53, ptr noundef %54) #4
  br i1 %55, label %56, label %61

56:                                               ; preds = %32, %36, %40, %44, %48, %52
  %57 = getelementptr inbounds i8, ptr %13, i64 16
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = call i32 @private_key_get_param_ec(ptr noundef %58, ptr noundef nonnull %5)
  %.not41 = icmp eq i32 %59, 0
  br i1 %.not41, label %71, label %60

60:                                               ; preds = %56
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 636, i32 noundef %59) #4
  br label %77

61:                                               ; preds = %52
  %62 = load ptr, ptr @OID_RSA, align 8, !tbaa !5
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = call zeroext i1 @oid_is_equal(ptr noundef %62, ptr noundef %63) #4
  br i1 %64, label %65, label %70

65:                                               ; preds = %61
  %66 = getelementptr inbounds i8, ptr %13, i64 16
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = call i32 @spki_get_param_rsa(ptr noundef %67, ptr noundef nonnull %5)
  %.not40 = icmp eq i32 %68, 0
  br i1 %.not40, label %71, label %69

69:                                               ; preds = %65
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 639, i32 noundef %68) #4
  br label %77

70:                                               ; preds = %61
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 642, i32 noundef 1047, ptr noundef null) #4
  br label %77

71:                                               ; preds = %56, %65, %27
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %.not43 = icmp eq ptr %72, null
  br i1 %.not43, label %74, label %73

73:                                               ; preds = %71
  store ptr %72, ptr %1, align 8, !tbaa !5
  store ptr null, ptr %4, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %73, %71
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %.not44 = icmp eq ptr %75, null
  br i1 %.not44, label %77, label %76

76:                                               ; preds = %74
  store ptr %75, ptr %2, align 8, !tbaa !5
  store ptr null, ptr %5, align 8, !tbaa !5
  br label %77

77:                                               ; preds = %74, %76, %70, %69, %60, %31, %18, %15, %10, %6
  %.1 = phi i32 [ 2, %15 ], [ %17, %18 ], [ %30, %31 ], [ 0, %76 ], [ 0, %74 ], [ %59, %60 ], [ %68, %69 ], [ 1047, %70 ], [ 2, %10 ], [ 2, %6 ]
  %.0 = phi ptr [ null, %15 ], [ %13, %18 ], [ %13, %31 ], [ %13, %76 ], [ %13, %74 ], [ %13, %60 ], [ %13, %69 ], [ %13, %70 ], [ null, %10 ], [ null, %6 ]
  %78 = call ptr @get_SubjectPublicKeyInfo_desc() #4
  call void @asn_free(ptr noundef %78, ptr noundef %.0) #4
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %79) #4
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %80) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  ret i32 %.1
}

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

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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 }

!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 16}
!10 = !{!"SubjectPublicKeyInfo", !11, i64 0, !17, i64 48, !14, i64 88}
!11 = !{!"AlgorithmIdentifier", !12, i64 0, !6, i64 16, !14, i64 24}
!12 = !{!"ASN__PRIMITIVE_TYPE_s", !6, i64 0, !13, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!"asn_struct_ctx_s", !15, i64 0, !15, i64 2, !13, i64 4, !6, i64 8, !16, i64 16}
!15 = !{!"short", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"BIT_STRING_s", !6, i64 0, !13, i64 8, !13, i64 12, !14, i64 16}


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