; LLVM IR from guanzhi/GmSSL :: src/sdf (sdf)

; 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.ECCrefPublicKey_st = type { i32, [64 x i8], [64 x i8] }
%struct.ECCCipher_st = type <{ [64 x i8], [64 x i8], [32 x i8], i32, [1 x i8], [254 x i8] }>
%struct.SM2_CIPHERTEXT = type { %struct.SM2_POINT, [32 x i8], i8, [255 x i8] }
%struct.SM2_POINT = type { [32 x i8], [32 x i8] }
%struct.SDF_DEVICE = type { ptr, [41 x i8], [17 x i8], [17 x i8] }
%struct.SM2_KEY = type { %struct.SM2_Z256_POINT, [4 x i64] }
%struct.SM2_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SDF_KEY = type { ptr, ptr }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@__FUNCTION__.sdf_generate_key = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind
declare i32 @fprintf(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 i32 @SDF_OpenSession(ptr noundef, ptr noundef) #2

declare i32 @SDF_CloseSession(ptr noundef) #2

; 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 @sdf_generate_key(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #3 {
  %6 = alloca i32, align 4
  %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 %struct.ECCrefPublicKey_st, align 1
  %15 = alloca %struct.ECCCipher_st, align 1
  %16 = alloca %struct.SM2_CIPHERTEXT, align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 132, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 419, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 352, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %30

21:                                               ; preds = %5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %30

24:                                               ; preds = %21
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %30

27:                                               ; preds = %24
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %36, label %30

30:                                               ; preds = %27, %24, %21, %5
  br label %31

31:                                               ; preds = %30
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 395, ptr noundef @__FUNCTION__.sdf_generate_key) #4
  br label %34

34:                                               ; preds = %31
  br label %35

35:                                               ; preds = %34
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %18, align 4
  br label %115

36:                                               ; preds = %27
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.SDF_DEVICE, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = icmp ne ptr %39, null
  br i1 %40, label %47, label %41

41:                                               ; preds = %36
  br label %42

42:                                               ; preds = %41
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 399, ptr noundef @__FUNCTION__.sdf_generate_key) #4
  br label %45

45:                                               ; preds = %42
  br label %46

46:                                               ; preds = %45
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %18, align 4
  br label %115

47:                                               ; preds = %36
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = icmp ne ptr %48, null
  br i1 %49, label %52, label %50

50:                                               ; preds = %47
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 366, ptr %51, align 8, !tbaa !11
  store i32 1, ptr %6, align 4
  store i32 1, ptr %18, align 4
  br label %115

52:                                               ; preds = %47
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.SM2_KEY, ptr %53, i32 0, i32 0
  call void @ECCrefPublicKey_from_SM2_Z256_POINT(ptr noundef %14, ptr noundef %54)
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.SDF_DEVICE, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = call i32 @SDF_OpenSession(ptr noundef %57, ptr noundef %12)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %66

60:                                               ; preds = %52
  br label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr @stderr, align 8, !tbaa !5
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 412, ptr noundef @__FUNCTION__.sdf_generate_key) #4
  br label %64

64:                                               ; preds = %61
  br label %65

65:                                               ; preds = %64
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %18, align 4
  br label %115

66:                                               ; preds = %52
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = call i32 @SDF_GenerateKeyWithEPK_ECC(ptr noundef %67, i32 noundef 128, i32 noundef 133120, ptr noundef %14, ptr noundef %15, ptr noundef %13)
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %78

70:                                               ; preds = %66
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = call i32 @SDF_CloseSession(ptr noundef %71)
  br label %73

73:                                               ; preds = %70
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 417, ptr noundef @__FUNCTION__.sdf_generate_key) #4
  br label %76

76:                                               ; preds = %73
  br label %77

77:                                               ; preds = %76
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %18, align 4
  br label %115

78:                                               ; preds = %66
  %79 = call i32 @ECCCipher_to_SM2_CIPHERTEXT(ptr noundef %15, ptr noundef %16)
  %80 = icmp ne i32 %79, 1
  br i1 %80, label %81, label %92

81:                                               ; preds = %78
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = call i32 @SDF_DestroyKey(ptr noundef %82, ptr noundef %83)
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = call i32 @SDF_CloseSession(ptr noundef %85)
  br label %87

87:                                               ; preds = %81
  %88 = load ptr, ptr @stderr, align 8, !tbaa !5
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 425, ptr noundef @__FUNCTION__.sdf_generate_key) #4
  br label %90

90:                                               ; preds = %87
  br label %91

91:                                               ; preds = %90
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %18, align 4
  br label %115

92:                                               ; preds = %78
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 0, ptr %93, align 8, !tbaa !11
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = call i32 @sm2_ciphertext_to_der(ptr noundef %16, ptr noundef %10, ptr noundef %94)
  %96 = icmp ne i32 %95, 1
  br i1 %96, label %97, label %108

97:                                               ; preds = %92
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = call i32 @SDF_DestroyKey(ptr noundef %98, ptr noundef %99)
  %101 = load ptr, ptr %12, align 8, !tbaa !5
  %102 = call i32 @SDF_CloseSession(ptr noundef %101)
  br label %103

103:                                              ; preds = %97
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 432, ptr noundef @__FUNCTION__.sdf_generate_key) #4
  br label %106

106:                                              ; preds = %103
  br label %107

107:                                              ; preds = %106
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %18, align 4
  br label %115

108:                                              ; preds = %92
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.SDF_KEY, ptr %110, i32 0, i32 0
  store ptr %109, ptr %111, align 8, !tbaa !13
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.SDF_KEY, ptr %113, i32 0, i32 1
  store ptr %112, ptr %114, align 8, !tbaa !15
  store i32 1, ptr %6, align 4
  store i32 1, ptr %18, align 4
  br label %115

115:                                              ; preds = %108, %107, %91, %77, %65, %50, %46, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 352, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 419, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 132, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %116 = load i32, ptr %6, align 4
  ret i32 %116
}

; Function Attrs: nounwind uwtable
declare hidden void @ECCrefPublicKey_from_SM2_Z256_POINT(ptr noundef, ptr noundef) #3

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

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

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

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

attributes #0 = { 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 #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 = { 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 #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 0}
!10 = !{!"", !6, i64 0, !7, i64 8, !7, i64 49, !7, i64 66}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"", !6, i64 0, !6, i64 8}
!15 = !{!14, !6, i64 8}


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

%struct.ECCrefPublicKey_st = type { i32, [64 x i8], [64 x i8] }
%struct.ECCCipher_st = type <{ [64 x i8], [64 x i8], [32 x i8], i32, [1 x i8], [254 x i8] }>
%struct.SM2_CIPHERTEXT = type { %struct.SM2_POINT, [32 x i8], i8, [255 x i8] }
%struct.SM2_POINT = type { [32 x i8], [32 x i8] }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1
@__FUNCTION__.sdf_generate_key = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) 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 i32 @SDF_OpenSession(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @SDF_CloseSession(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @sdf_generate_key(ptr noundef readonly %0, ptr noundef writeonly %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #3 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.ECCrefPublicKey_st, align 1
  %10 = alloca %struct.ECCCipher_st, align 1
  %11 = alloca %struct.SM2_CIPHERTEXT, align 1
  store ptr %3, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 132, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 419, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 352, ptr nonnull %11) #4
  %12 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %13 = insertelement <4 x ptr> %12, ptr %1, i64 1
  %14 = insertelement <4 x ptr> %13, ptr %2, i64 2
  %15 = insertelement <4 x ptr> %14, ptr %4, i64 3
  %16 = icmp eq <4 x ptr> %15, zeroinitializer
  %17 = bitcast <4 x i1> %16 to i4
  %18 = icmp eq i4 %17, 0
  br i1 %18, label %22, label %19

19:                                               ; preds = %5
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 395, ptr noundef nonnull @__FUNCTION__.sdf_generate_key) #5
  br label %66

22:                                               ; preds = %5
  %23 = load ptr, ptr %0, align 8, !tbaa !9
  %.not = icmp eq ptr %23, null
  br i1 %.not, label %24, label %27

24:                                               ; preds = %22
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 399, ptr noundef nonnull @__FUNCTION__.sdf_generate_key) #5
  br label %66

27:                                               ; preds = %22
  %.not21 = icmp eq ptr %3, null
  br i1 %.not21, label %28, label %29

28:                                               ; preds = %27
  store i64 366, ptr %4, align 8, !tbaa !11
  br label %66

29:                                               ; preds = %27
  call void @ECCrefPublicKey_from_SM2_Z256_POINT(ptr noundef nonnull %9, ptr noundef nonnull %2)
  %30 = load ptr, ptr %0, align 8, !tbaa !9
  %31 = call i32 @SDF_OpenSession(ptr noundef %30, ptr noundef nonnull %7) #4
  %.not22 = icmp eq i32 %31, 0
  br i1 %.not22, label %35, label %32

32:                                               ; preds = %29
  %33 = load ptr, ptr @stderr, align 8, !tbaa !5
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 412, ptr noundef nonnull @__FUNCTION__.sdf_generate_key) #5
  br label %66

35:                                               ; preds = %29
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = call i32 @SDF_GenerateKeyWithEPK_ECC(ptr noundef %36, i32 noundef 128, i32 noundef 133120, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %8) #4
  %.not23 = icmp eq i32 %37, 0
  br i1 %.not23, label %43, label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call i32 @SDF_CloseSession(ptr noundef %39) #4
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 417, ptr noundef nonnull @__FUNCTION__.sdf_generate_key) #5
  br label %66

43:                                               ; preds = %35
  %44 = call i32 @ECCCipher_to_SM2_CIPHERTEXT(ptr noundef nonnull %10, ptr noundef nonnull %11)
  %.not24 = icmp eq i32 %44, 1
  br i1 %.not24, label %53, label %45

45:                                               ; preds = %43
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = call i32 @SDF_DestroyKey(ptr noundef %46, ptr noundef %47) #4
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = call i32 @SDF_CloseSession(ptr noundef %49) #4
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 425, ptr noundef nonnull @__FUNCTION__.sdf_generate_key) #5
  br label %66

53:                                               ; preds = %43
  store i64 0, ptr %4, align 8, !tbaa !11
  %54 = call i32 @sm2_ciphertext_to_der(ptr noundef nonnull %11, ptr noundef nonnull %6, ptr noundef nonnull %4) #4
  %.not25 = icmp eq i32 %54, 1
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  br i1 %.not25, label %63, label %56

56:                                               ; preds = %53
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = call i32 @SDF_DestroyKey(ptr noundef %55, ptr noundef %57) #4
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = call i32 @SDF_CloseSession(ptr noundef %59) #4
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 432, ptr noundef nonnull @__FUNCTION__.sdf_generate_key) #5
  br label %66

63:                                               ; preds = %53
  store ptr %55, ptr %1, align 8, !tbaa !13
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr %64, ptr %65, align 8, !tbaa !15
  br label %66

66:                                               ; preds = %63, %56, %45, %38, %32, %28, %24, %19
  %.0 = phi i32 [ -1, %32 ], [ -1, %38 ], [ -1, %45 ], [ -1, %56 ], [ 1, %63 ], [ 1, %28 ], [ -1, %24 ], [ -1, %19 ]
  call void @llvm.lifetime.end.p0(i64 352, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 419, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 132, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden void @ECCrefPublicKey_from_SM2_Z256_POINT(ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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

attributes #0 = { nofree 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 #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 = { 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 #4 = { nounwind }
attributes #5 = { cold nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !7, i64 8, !7, i64 49, !7, i64 66}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"", !6, i64 0, !6, i64 8}
!15 = !{!14, !6, i64 8}


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