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

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

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

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

30:                                               ; preds = %27, %24, %21, %6
  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 473, ptr noundef @__FUNCTION__.sdf_import_key) #5
  br label %34

34:                                               ; preds = %31
  br label %35

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

36:                                               ; preds = %27
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.SDF_DEVICE, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !13
  %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 477, ptr noundef @__FUNCTION__.sdf_import_key) #5
  br label %45

45:                                               ; preds = %42
  br label %46

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

47:                                               ; preds = %36
  %48 = call i32 @sm2_ciphertext_from_der(ptr noundef %17, ptr noundef %11, ptr noundef %12)
  %49 = icmp ne i32 %48, 1
  br i1 %49, label %50, label %56

50:                                               ; preds = %47
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr @stderr, align 8, !tbaa !5
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 483, ptr noundef @__FUNCTION__.sdf_import_key) #5
  br label %54

54:                                               ; preds = %51
  br label %55

55:                                               ; preds = %54
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %127

56:                                               ; preds = %47
  %57 = load i64, ptr %12, align 8, !tbaa !11
  %58 = icmp ne i64 %57, 0
  br i1 %58, label %59, label %65

59:                                               ; preds = %56
  br label %60

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

63:                                               ; preds = %60
  br label %64

64:                                               ; preds = %63
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %127

65:                                               ; preds = %56
  call void @ECCCipher_from_SM2_CIPHERTEXT(ptr noundef %16, ptr noundef %17)
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.SDF_DEVICE, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !13
  %69 = call i32 @SDF_OpenSession(ptr noundef %68, ptr noundef %14)
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %77

71:                                               ; preds = %65
  br label %72

72:                                               ; preds = %71
  %73 = load ptr, ptr @stderr, align 8, !tbaa !5
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 496, ptr noundef @__FUNCTION__.sdf_import_key) #5
  br label %75

75:                                               ; preds = %72
  br label %76

76:                                               ; preds = %75
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %127

77:                                               ; preds = %65
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  %79 = load i32, ptr %9, align 4, !tbaa !9
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = call i64 @strlen(ptr noundef %81) #6
  %83 = trunc i64 %82 to i32
  %84 = call i32 @SDF_GetPrivateKeyAccessRight(ptr noundef %78, i32 noundef %79, ptr noundef %80, i32 noundef %83)
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %94

86:                                               ; preds = %77
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = call i32 @SDF_CloseSession(ptr noundef %87)
  br label %89

89:                                               ; preds = %86
  %90 = load ptr, ptr @stderr, align 8, !tbaa !5
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 502, ptr noundef @__FUNCTION__.sdf_import_key) #5
  br label %92

92:                                               ; preds = %89
  br label %93

93:                                               ; preds = %92
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %127

94:                                               ; preds = %77
  %95 = load ptr, ptr %14, align 8, !tbaa !5
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = call i32 @SDF_ImportKeyWithISK_ECC(ptr noundef %95, i32 noundef %96, ptr noundef %16, ptr noundef %15)
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %107

99:                                               ; preds = %94
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  %101 = call i32 @SDF_CloseSession(ptr noundef %100)
  br label %102

102:                                              ; preds = %99
  %103 = load ptr, ptr @stderr, align 8, !tbaa !5
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 507, ptr noundef @__FUNCTION__.sdf_import_key) #5
  br label %105

105:                                              ; preds = %102
  br label %106

106:                                              ; preds = %105
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %127

107:                                              ; preds = %94
  %108 = load ptr, ptr %14, align 8, !tbaa !5
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = call i32 @SDF_ReleasePrivateKeyAccessRight(ptr noundef %108, i32 noundef %109)
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %120

112:                                              ; preds = %107
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = call i32 @SDF_CloseSession(ptr noundef %113)
  br label %115

115:                                              ; preds = %112
  %116 = load ptr, ptr @stderr, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 512, ptr noundef @__FUNCTION__.sdf_import_key) #5
  br label %118

118:                                              ; preds = %115
  br label %119

119:                                              ; preds = %118
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %127

120:                                              ; preds = %107
  %121 = load ptr, ptr %14, align 8, !tbaa !5
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.SDF_KEY, ptr %122, i32 0, i32 0
  store ptr %121, ptr %123, align 8, !tbaa !15
  %124 = load ptr, ptr %15, align 8, !tbaa !5
  %125 = load ptr, ptr %13, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.SDF_KEY, ptr %125, i32 0, i32 1
  store ptr %124, ptr %126, align 8, !tbaa !17
  store i32 1, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %127

127:                                              ; preds = %120, %119, %106, %93, %76, %64, %55, %46, %35
  call void @llvm.lifetime.end.p0(i64 352, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 419, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %128 = load i32, ptr %7, align 4
  ret i32 %128
}

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

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

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

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

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

declare i32 @SDF_ReleasePrivateKeyAccessRight(ptr noundef, i32 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 willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

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

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


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

%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_import_key = external hidden unnamed_addr constant [15 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_import_key(ptr noundef readonly %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4, ptr nocapture noundef writeonly %5) local_unnamed_addr #3 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.ECCCipher_st, align 1
  %12 = alloca %struct.SM2_CIPHERTEXT, align 1
  store ptr %3, ptr %7, align 8, !tbaa !5
  store i64 %4, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 419, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 352, ptr nonnull %12) #5
  %13 = icmp ne ptr %0, null
  %14 = icmp ne ptr %2, null
  %or.cond = and i1 %13, %14
  %15 = icmp ne ptr %3, null
  %or.cond3 = and i1 %or.cond, %15
  %16 = icmp ne i64 %4, 0
  %or.cond5 = and i1 %or.cond3, %16
  br i1 %or.cond5, label %20, label %17

17:                                               ; preds = %6
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 473, ptr noundef nonnull @__FUNCTION__.sdf_import_key) #6
  br label %68

20:                                               ; preds = %6
  %21 = load ptr, ptr %0, align 8, !tbaa !11
  %.not = icmp eq ptr %21, null
  br i1 %.not, label %22, label %25

22:                                               ; preds = %20
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 477, ptr noundef nonnull @__FUNCTION__.sdf_import_key) #6
  br label %68

25:                                               ; preds = %20
  %26 = call i32 @sm2_ciphertext_from_der(ptr noundef nonnull %12, ptr noundef nonnull %7, ptr noundef nonnull %8) #5
  %.not18 = icmp eq i32 %26, 1
  br i1 %.not18, label %30, label %27

27:                                               ; preds = %25
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 483, ptr noundef nonnull @__FUNCTION__.sdf_import_key) #6
  br label %68

30:                                               ; preds = %25
  %31 = load i64, ptr %8, align 8, !tbaa !9
  %.not19 = icmp eq i64 %31, 0
  br i1 %.not19, label %35, label %32

32:                                               ; preds = %30
  %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 487, ptr noundef nonnull @__FUNCTION__.sdf_import_key) #6
  br label %68

35:                                               ; preds = %30
  call void @ECCCipher_from_SM2_CIPHERTEXT(ptr noundef nonnull %11, ptr noundef nonnull %12)
  %36 = load ptr, ptr %0, align 8, !tbaa !11
  %37 = call i32 @SDF_OpenSession(ptr noundef %36, ptr noundef nonnull %9) #5
  %.not20 = icmp eq i32 %37, 0
  br i1 %.not20, label %41, label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 496, ptr noundef nonnull @__FUNCTION__.sdf_import_key) #6
  br label %68

41:                                               ; preds = %35
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #7
  %44 = trunc i64 %43 to i32
  %45 = call i32 @SDF_GetPrivateKeyAccessRight(ptr noundef %42, i32 noundef %1, ptr noundef nonnull %2, i32 noundef %44) #5
  %.not21 = icmp eq i32 %45, 0
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  br i1 %.not21, label %51, label %47

47:                                               ; preds = %41
  %48 = call i32 @SDF_CloseSession(ptr noundef %46) #5
  %49 = load ptr, ptr @stderr, align 8, !tbaa !5
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 502, ptr noundef nonnull @__FUNCTION__.sdf_import_key) #6
  br label %68

51:                                               ; preds = %41
  %52 = call i32 @SDF_ImportKeyWithISK_ECC(ptr noundef %46, i32 noundef %1, ptr noundef nonnull %11, ptr noundef nonnull %10) #5
  %.not22 = icmp eq i32 %52, 0
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  br i1 %.not22, label %58, label %54

54:                                               ; preds = %51
  %55 = call i32 @SDF_CloseSession(ptr noundef %53) #5
  %56 = load ptr, ptr @stderr, align 8, !tbaa !5
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 507, ptr noundef nonnull @__FUNCTION__.sdf_import_key) #6
  br label %68

58:                                               ; preds = %51
  %59 = call i32 @SDF_ReleasePrivateKeyAccessRight(ptr noundef %53, i32 noundef %1) #5
  %.not23 = icmp eq i32 %59, 0
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  br i1 %.not23, label %65, label %61

61:                                               ; preds = %58
  %62 = call i32 @SDF_CloseSession(ptr noundef %60) #5
  %63 = load ptr, ptr @stderr, align 8, !tbaa !5
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 512, ptr noundef nonnull @__FUNCTION__.sdf_import_key) #6
  br label %68

65:                                               ; preds = %58
  store ptr %60, ptr %5, align 8, !tbaa !13
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %66, ptr %67, align 8, !tbaa !15
  br label %68

68:                                               ; preds = %65, %61, %54, %47, %38, %32, %27, %22, %17
  %.0 = phi i32 [ -1, %27 ], [ -1, %32 ], [ -1, %38 ], [ -1, %47 ], [ -1, %54 ], [ -1, %61 ], [ 1, %65 ], [ -1, %22 ], [ -1, %17 ]
  call void @llvm.lifetime.end.p0(i64 352, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 419, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  ret i32 %.0
}

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

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

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

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

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

declare i32 @SDF_ReleasePrivateKeyAccessRight(ptr noundef, i32 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { nounwind willreturn memory(read) }

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

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


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