; 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.PrivateKeyInfo = type { %struct.ASN__PRIMITIVE_TYPE_s, %struct.AlgorithmIdentifier, %struct.OCTET_STRING, ptr, %struct.asn_struct_ctx_s }
%struct.ASN__PRIMITIVE_TYPE_s = type { ptr, i32 }
%struct.AlgorithmIdentifier = type { %struct.ASN__PRIMITIVE_TYPE_s, ptr, %struct.asn_struct_ctx_s }
%struct.OCTET_STRING = type { ptr, 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: nounwind uwtable
define dso_local i32 @private_key_get_info(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %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 380, i32 noundef %15, ptr noundef null)
  br label %147

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 %27, label %22

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
  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 381, i32 noundef %26, ptr noundef null)
  br label %147

27:                                               ; preds = %22, %19
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  br label %30

30:                                               ; preds = %29
  %31 = call ptr @get_PrivateKeyInfo_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 383, i32 noundef %36)
  br label %147

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.PrivateKeyInfo, ptr %41, i32 0, i32 1
  %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 384, i32 noundef %48)
  br label %147

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.PrivateKeyInfo, ptr %61, i32 0, i32 1
  %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 388, i32 noundef %69)
  br label %147

70:                                               ; preds = %60
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  br label %134

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.PrivateKeyInfo, ptr %99, i32 0, i32 1
  %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 396, i32 noundef %107)
  br label %147

108:                                              ; preds = %98
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  br label %133

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 %127

115:                                              ; preds = %111
  br label %116

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

122:                                              ; preds = %116
  %123 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 399, i32 noundef %123)
  br label %147

124:                                              ; preds = %116
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  br label %132

127:                                              ; preds = %111
  br label %128

128:                                              ; preds = %127
  store i32 1047, ptr %7, align 4, !tbaa !9
  %129 = load i32, ptr %7, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 402, i32 noundef %129, ptr noundef null)
  br label %147

130:                                              ; No predecessors!
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131, %126
  br label %133

133:                                              ; preds = %132, %110
  br label %134

134:                                              ; preds = %133, %72
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %140

137:                                              ; preds = %134
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %138, ptr %139, align 8, !tbaa !5
  store ptr null, ptr %9, align 8, !tbaa !5
  br label %140

140:                                              ; preds = %137, %134
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = icmp ne ptr %141, null
  br i1 %142, label %143, label %146

143:                                              ; preds = %140
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %144, ptr %145, align 8, !tbaa !5
  store ptr null, ptr %10, align 8, !tbaa !5
  br label %146

146:                                              ; preds = %143, %140
  br label %147

147:                                              ; preds = %146, %128, %122, %106, %68, %47, %35, %25, %14
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %148) #4
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %149) #4
  %150 = call ptr @get_PrivateKeyInfo_desc()
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  call void @asn_free(ptr noundef %150, ptr noundef %151)
  %152 = 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 %152
}

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

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 ptr @get_PrivateKeyInfo_desc() #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) #1

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

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

; 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) #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 32}
!12 = !{!"PrivateKeyInfo", !13, i64 0, !14, i64 16, !18, i64 64, !6, i64 104, !15, i64 112}
!13 = !{!"ASN__PRIMITIVE_TYPE_s", !6, i64 0, !10, i64 8}
!14 = !{!"AlgorithmIdentifier", !13, i64 0, !6, i64 16, !15, i64 24}
!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 = !{!"OCTET_STRING", !6, i64 0, !10, i64 8, !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: nounwind uwtable
define dso_local i32 @private_key_get_info(ptr noundef %0, ptr noundef writeonly %1, ptr noundef writeonly %2) local_unnamed_addr #1 {
  %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 380, 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 = or 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 381, i32 noundef 2, ptr noundef null) #4
  br label %77

11:                                               ; preds = %7
  %12 = tail call ptr @get_PrivateKeyInfo_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 383, i32 noundef 2) #4
  br label %77

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

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

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

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

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

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

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

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

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

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

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

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

57:                                               ; preds = %33, %37, %41, %45, %49, %53
  %58 = getelementptr inbounds i8, ptr %13, i64 32
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = call i32 @private_key_get_param_ec(ptr noundef %59, ptr noundef nonnull %5)
  %.not41 = icmp eq i32 %60, 0
  br i1 %.not41, label %71, label %61

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

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

66:                                               ; preds = %62
  %67 = getelementptr inbounds i8, ptr %13, i64 64
  %68 = call i32 @private_key_get_param_rsa(ptr noundef nonnull %67, ptr noundef nonnull %5)
  %.not40 = icmp eq i32 %68, 0
  br i1 %.not40, label %71, label %69

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

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

71:                                               ; preds = %57, %66, %28
  br i1 %8, label %72, label %74

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

74:                                               ; preds = %72, %71
  br i1 %9, label %75, label %77

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

77:                                               ; preds = %74, %75, %70, %69, %61, %32, %19, %15, %10, %6
  %.1 = phi i32 [ 2, %15 ], [ %18, %19 ], [ %31, %32 ], [ 0, %75 ], [ 0, %74 ], [ %60, %61 ], [ %68, %69 ], [ 1047, %70 ], [ 2, %10 ], [ 2, %6 ]
  %.0 = phi ptr [ null, %15 ], [ %13, %19 ], [ %13, %32 ], [ %13, %75 ], [ %13, %74 ], [ %13, %61 ], [ %13, %69 ], [ %13, %70 ], [ null, %10 ], [ null, %6 ]
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %78) #4
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %79) #4
  %80 = call ptr @get_PrivateKeyInfo_desc() #4
  call void @asn_free(ptr noundef %80, ptr noundef %.0) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

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 ptr @get_PrivateKeyInfo_desc() 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 #1

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

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

; 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) #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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 32}
!10 = !{!"PrivateKeyInfo", !11, i64 0, !13, i64 16, !17, i64 64, !6, i64 104, !14, i64 112}
!11 = !{!"ASN__PRIMITIVE_TYPE_s", !6, i64 0, !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"AlgorithmIdentifier", !11, i64 0, !6, i64 16, !14, i64 24}
!14 = !{!"asn_struct_ctx_s", !15, i64 0, !15, i64 2, !12, i64 4, !6, i64 8, !16, i64 16}
!15 = !{!"short", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"OCTET_STRING", !6, i64 0, !12, i64 8, !14, i64 16}


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