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

; 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.SM2_SIGN_CTX = type { %struct.SM3_CTX, %struct.SM3_CTX, %struct.SM2_KEY, [4 x i64], [32 x %struct.SM2_SIGN_PRE_COMP], i32, [16 x %struct.SM2_Z256_POINT] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }
%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.SM2_SIGN_PRE_COMP = type { [4 x i64], [4 x i64] }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@__FUNCTION__.x509_req_sign_to_der = external hidden unnamed_addr constant [21 x i8], align 1

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

declare i32 @asn1_header_to_der(i32 noundef, i64 noundef, ptr noundef, ptr noundef) #3

; 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 @x509_req_sign_to_der(i32 noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, i64 noundef %5, i32 noundef %6, ptr noundef %7, ptr noundef %8, i64 noundef %9, ptr noundef %10, ptr noundef %11) #0 {
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca [72 x i8], align 16
  %30 = alloca i64, align 8
  %31 = alloca i32, align 4
  %32 = alloca %struct.SM2_SIGN_CTX, align 8
  store i32 %0, ptr %14, align 4, !tbaa !5
  store ptr %1, ptr %15, align 8, !tbaa !9
  store i64 %2, ptr %16, align 8, !tbaa !11
  store ptr %3, ptr %17, align 8, !tbaa !9
  store ptr %4, ptr %18, align 8, !tbaa !9
  store i64 %5, ptr %19, align 8, !tbaa !11
  store i32 %6, ptr %20, align 4, !tbaa !5
  store ptr %7, ptr %21, align 8, !tbaa !9
  store ptr %8, ptr %22, align 8, !tbaa !9
  store i64 %9, ptr %23, align 8, !tbaa !11
  store ptr %10, ptr %24, align 8, !tbaa !9
  store ptr %11, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  store i64 0, ptr %26, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  store ptr null, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  store i32 16, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  store i64 71, ptr %30, align 8, !tbaa !11
  %33 = load i32, ptr %14, align 4, !tbaa !5
  %34 = load ptr, ptr %15, align 8, !tbaa !9
  %35 = load i64, ptr %16, align 8, !tbaa !11
  %36 = load ptr, ptr %17, align 8, !tbaa !9
  %37 = load ptr, ptr %18, align 8, !tbaa !9
  %38 = load i64, ptr %19, align 8, !tbaa !11
  %39 = call i32 @x509_request_info_to_der(i32 noundef %33, ptr noundef %34, i64 noundef %35, ptr noundef %36, ptr noundef %37, i64 noundef %38, ptr noundef null, ptr noundef %26)
  %40 = icmp ne i32 %39, 1
  br i1 %40, label %56, label %41

41:                                               ; preds = %12
  %42 = load i32, ptr %28, align 4, !tbaa !5
  %43 = call i32 @x509_signature_algor_to_der(i32 noundef %42, ptr noundef null, ptr noundef %26)
  %44 = icmp ne i32 %43, 1
  br i1 %44, label %56, label %45

45:                                               ; preds = %41
  %46 = getelementptr inbounds [72 x i8], ptr %29, i64 0, i64 0
  %47 = load i64, ptr %30, align 8, !tbaa !11
  %48 = call i32 @asn1_bit_octets_to_der_ex(i32 noundef 3, ptr noundef %46, i64 noundef %47, ptr noundef null, ptr noundef %26)
  %49 = icmp ne i32 %48, 1
  br i1 %49, label %56, label %50

50:                                               ; preds = %45
  %51 = load i64, ptr %26, align 8, !tbaa !11
  %52 = load ptr, ptr %24, align 8, !tbaa !9
  %53 = load ptr, ptr %25, align 8, !tbaa !9
  %54 = call i32 @asn1_header_to_der(i32 noundef 48, i64 noundef %51, ptr noundef %52, ptr noundef %53)
  %55 = icmp ne i32 %54, 1
  br i1 %55, label %56, label %62

56:                                               ; preds = %50, %45, %41, %12
  br label %57

57:                                               ; preds = %56
  %58 = load ptr, ptr @stderr, align 8, !tbaa !9
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 179, ptr noundef @__FUNCTION__.x509_req_sign_to_der) #4
  br label %60

60:                                               ; preds = %57
  br label %61

61:                                               ; preds = %60
  store i32 -1, ptr %13, align 4
  store i32 1, ptr %31, align 4
  br label %147

62:                                               ; preds = %50
  %63 = load ptr, ptr %24, align 8, !tbaa !9
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %72

65:                                               ; preds = %62
  %66 = load ptr, ptr %24, align 8, !tbaa !9
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %72

69:                                               ; preds = %65
  %70 = load ptr, ptr %24, align 8, !tbaa !9
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  store ptr %71, ptr %27, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %69, %65, %62
  %73 = load i32, ptr %14, align 4, !tbaa !5
  %74 = load ptr, ptr %15, align 8, !tbaa !9
  %75 = load i64, ptr %16, align 8, !tbaa !11
  %76 = load ptr, ptr %17, align 8, !tbaa !9
  %77 = load ptr, ptr %18, align 8, !tbaa !9
  %78 = load i64, ptr %19, align 8, !tbaa !11
  %79 = load ptr, ptr %24, align 8, !tbaa !9
  %80 = load ptr, ptr %25, align 8, !tbaa !9
  %81 = call i32 @x509_request_info_to_der(i32 noundef %73, ptr noundef %74, i64 noundef %75, ptr noundef %76, ptr noundef %77, i64 noundef %78, ptr noundef %79, ptr noundef %80)
  %82 = icmp ne i32 %81, 1
  br i1 %82, label %83, label %89

83:                                               ; preds = %72
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr @stderr, align 8, !tbaa !9
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 187, ptr noundef @__FUNCTION__.x509_req_sign_to_der) #4
  br label %87

87:                                               ; preds = %84
  br label %88

88:                                               ; preds = %87
  store i32 -1, ptr %13, align 4
  store i32 1, ptr %31, align 4
  br label %147

89:                                               ; preds = %72
  %90 = load ptr, ptr %24, align 8, !tbaa !9
  %91 = icmp ne ptr %90, null
  br i1 %91, label %92, label %127

92:                                               ; preds = %89
  %93 = load ptr, ptr %24, align 8, !tbaa !9
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %127

96:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 3976, ptr %32) #4
  %97 = load ptr, ptr %21, align 8, !tbaa !9
  %98 = load ptr, ptr %22, align 8, !tbaa !9
  %99 = load i64, ptr %23, align 8, !tbaa !11
  %100 = call i32 @sm2_sign_init(ptr noundef %32, ptr noundef %97, ptr noundef %98, i64 noundef %99)
  %101 = icmp ne i32 %100, 1
  br i1 %101, label %117, label %102

102:                                              ; preds = %96
  %103 = load ptr, ptr %27, align 8, !tbaa !9
  %104 = load ptr, ptr %24, align 8, !tbaa !9
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = load ptr, ptr %27, align 8, !tbaa !9
  %107 = ptrtoint ptr %105 to i64
  %108 = ptrtoint ptr %106 to i64
  %109 = sub i64 %107, %108
  %110 = call i32 @sm2_sign_update(ptr noundef %32, ptr noundef %103, i64 noundef %109)
  %111 = icmp ne i32 %110, 1
  br i1 %111, label %117, label %112

112:                                              ; preds = %102
  %113 = load i64, ptr %30, align 8, !tbaa !11
  %114 = getelementptr inbounds [72 x i8], ptr %29, i64 0, i64 0
  %115 = call i32 @sm2_sign_finish_fixlen(ptr noundef %32, i64 noundef %113, ptr noundef %114)
  %116 = icmp ne i32 %115, 1
  br i1 %116, label %117, label %123

117:                                              ; preds = %112, %102, %96
  call void @gmssl_secure_clear(ptr noundef %32, i64 noundef 3976)
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr @stderr, align 8, !tbaa !9
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 196, ptr noundef @__FUNCTION__.x509_req_sign_to_der) #4
  br label %121

121:                                              ; preds = %118
  br label %122

122:                                              ; preds = %121
  store i32 -1, ptr %13, align 4
  store i32 1, ptr %31, align 4
  br label %124

123:                                              ; preds = %112
  call void @gmssl_secure_clear(ptr noundef %32, i64 noundef 3976)
  store i32 0, ptr %31, align 4
  br label %124

124:                                              ; preds = %123, %122
  call void @llvm.lifetime.end.p0(i64 3976, ptr %32) #4
  %125 = load i32, ptr %31, align 4
  switch i32 %125, label %147 [
    i32 0, label %126
  ]

126:                                              ; preds = %124
  br label %127

127:                                              ; preds = %126, %92, %89
  %128 = load i32, ptr %28, align 4, !tbaa !5
  %129 = load ptr, ptr %24, align 8, !tbaa !9
  %130 = load ptr, ptr %25, align 8, !tbaa !9
  %131 = call i32 @x509_signature_algor_to_der(i32 noundef %128, ptr noundef %129, ptr noundef %130)
  %132 = icmp ne i32 %131, 1
  br i1 %132, label %140, label %133

133:                                              ; preds = %127
  %134 = getelementptr inbounds [72 x i8], ptr %29, i64 0, i64 0
  %135 = load i64, ptr %30, align 8, !tbaa !11
  %136 = load ptr, ptr %24, align 8, !tbaa !9
  %137 = load ptr, ptr %25, align 8, !tbaa !9
  %138 = call i32 @asn1_bit_octets_to_der_ex(i32 noundef 3, ptr noundef %134, i64 noundef %135, ptr noundef %136, ptr noundef %137)
  %139 = icmp ne i32 %138, 1
  br i1 %139, label %140, label %146

140:                                              ; preds = %133, %127
  br label %141

141:                                              ; preds = %140
  %142 = load ptr, ptr @stderr, align 8, !tbaa !9
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 203, ptr noundef @__FUNCTION__.x509_req_sign_to_der) #4
  br label %144

144:                                              ; preds = %141
  br label %145

145:                                              ; preds = %144
  store i32 -1, ptr %13, align 4
  store i32 1, ptr %31, align 4
  br label %147

146:                                              ; preds = %133
  store i32 1, ptr %13, align 4
  store i32 1, ptr %31, align 4
  br label %147

147:                                              ; preds = %146, %145, %124, %88, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  %148 = load i32, ptr %13, align 4
  ret i32 %148
}

declare i32 @x509_signature_algor_to_der(i32 noundef, ptr noundef, ptr noundef) #3

declare i32 @asn1_bit_octets_to_der_ex(i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

declare i32 @sm2_sign_init(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @sm2_sign_update(ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @sm2_sign_finish_fixlen(ptr noundef, i64 noundef, ptr noundef) #3

declare void @gmssl_secure_clear(ptr noundef, i64 noundef) #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}


; 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.SM2_SIGN_CTX = type { %struct.SM3_CTX, %struct.SM3_CTX, %struct.SM2_KEY, [4 x i64], [32 x %struct.SM2_SIGN_PRE_COMP], i32, [16 x %struct.SM2_Z256_POINT] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }
%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.SM2_SIGN_PRE_COMP = type { [4 x i64], [4 x i64] }

@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 [62 x i8], align 1
@__FUNCTION__.x509_req_sign_to_der = external hidden unnamed_addr constant [21 x i8], align 1

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

declare i32 @asn1_header_to_der(i32 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; 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 @x509_req_sign_to_der(i32 noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, i64 noundef %5, i32 noundef %6, ptr noundef %7, ptr noundef %8, i64 noundef %9, ptr noundef %10, ptr noundef %11) local_unnamed_addr #0 {
  %13 = alloca i64, align 8
  %14 = alloca [72 x i8], align 16
  %15 = alloca %struct.SM2_SIGN_CTX, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  store i64 0, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %14) #4
  %16 = call i32 @x509_request_info_to_der(i32 noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef null, ptr noundef nonnull %13)
  %.not = icmp eq i32 %16, 1
  br i1 %.not, label %17, label %24

17:                                               ; preds = %12
  %18 = call i32 @x509_signature_algor_to_der(i32 noundef 16, ptr noundef null, ptr noundef nonnull %13) #4
  %.not42 = icmp eq i32 %18, 1
  br i1 %.not42, label %19, label %24

19:                                               ; preds = %17
  %20 = call i32 @asn1_bit_octets_to_der_ex(i32 noundef 3, ptr noundef nonnull %14, i64 noundef 71, ptr noundef null, ptr noundef nonnull %13) #4
  %.not43 = icmp eq i32 %20, 1
  br i1 %.not43, label %21, label %24

21:                                               ; preds = %19
  %22 = load i64, ptr %13, align 8, !tbaa !5
  %23 = call i32 @asn1_header_to_der(i32 noundef 48, i64 noundef %22, ptr noundef %10, ptr noundef %11) #4
  %.not44 = icmp eq i32 %23, 1
  br i1 %.not44, label %27, label %24

24:                                               ; preds = %12, %17, %19, %21
  %25 = load ptr, ptr @stderr, align 8, !tbaa !9
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 179, ptr noundef nonnull @__FUNCTION__.x509_req_sign_to_der) #5
  br label %57

27:                                               ; preds = %21
  %.not45 = icmp eq ptr %10, null
  br i1 %.not45, label %28, label %.thread

28:                                               ; preds = %27
  %29 = call i32 @x509_request_info_to_der(i32 noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef null, ptr noundef %11)
  %.not47 = icmp eq i32 %29, 1
  br i1 %.not47, label %50, label %32

.thread:                                          ; preds = %27
  %30 = load ptr, ptr %10, align 8, !tbaa !9
  %31 = call i32 @x509_request_info_to_der(i32 noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef nonnull %10, ptr noundef %11)
  %.not4755 = icmp eq i32 %31, 1
  br i1 %.not4755, label %35, label %32

32:                                               ; preds = %.thread, %28
  %33 = load ptr, ptr @stderr, align 8, !tbaa !9
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 187, ptr noundef nonnull @__FUNCTION__.x509_req_sign_to_der) #5
  br label %57

35:                                               ; preds = %.thread
  %36 = load ptr, ptr %10, align 8, !tbaa !9
  %.not48 = icmp eq ptr %36, null
  br i1 %.not48, label %50, label %37

37:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 3976, ptr nonnull %15) #4
  %38 = call i32 @sm2_sign_init(ptr noundef nonnull %15, ptr noundef %7, ptr noundef %8, i64 noundef %9) #4
  %.not49 = icmp eq i32 %38, 1
  br i1 %.not49, label %39, label %.critedge

39:                                               ; preds = %37
  %40 = load ptr, ptr %10, align 8, !tbaa !9
  %41 = ptrtoint ptr %40 to i64
  %42 = ptrtoint ptr %30 to i64
  %43 = sub i64 %41, %42
  %44 = call i32 @sm2_sign_update(ptr noundef nonnull %15, ptr noundef %30, i64 noundef %43) #4
  %.not50 = icmp eq i32 %44, 1
  br i1 %.not50, label %45, label %.critedge

45:                                               ; preds = %39
  %46 = call i32 @sm2_sign_finish_fixlen(ptr noundef nonnull %15, i64 noundef 71, ptr noundef nonnull %14) #4
  %.not51 = icmp eq i32 %46, 1
  br i1 %.not51, label %49, label %.critedge

.critedge:                                        ; preds = %45, %39, %37
  call void @gmssl_secure_clear(ptr noundef nonnull %15, i64 noundef 3976) #4
  %47 = load ptr, ptr @stderr, align 8, !tbaa !9
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 196, ptr noundef nonnull @__FUNCTION__.x509_req_sign_to_der) #5
  call void @llvm.lifetime.end.p0(i64 3976, ptr nonnull %15) #4
  br label %57

49:                                               ; preds = %45
  call void @gmssl_secure_clear(ptr noundef nonnull %15, i64 noundef 3976) #4
  call void @llvm.lifetime.end.p0(i64 3976, ptr nonnull %15) #4
  br label %50

50:                                               ; preds = %28, %49, %35
  %51 = call i32 @x509_signature_algor_to_der(i32 noundef 16, ptr noundef %10, ptr noundef %11) #4
  %.not52 = icmp eq i32 %51, 1
  br i1 %.not52, label %52, label %54

52:                                               ; preds = %50
  %53 = call i32 @asn1_bit_octets_to_der_ex(i32 noundef 3, ptr noundef nonnull %14, i64 noundef 71, ptr noundef %10, ptr noundef %11) #4
  %.not53 = icmp eq i32 %53, 1
  br i1 %.not53, label %57, label %54

54:                                               ; preds = %50, %52
  %55 = load ptr, ptr @stderr, align 8, !tbaa !9
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 203, ptr noundef nonnull @__FUNCTION__.x509_req_sign_to_der) #5
  br label %57

57:                                               ; preds = %52, %.critedge, %54, %32, %24
  %.1 = phi i32 [ -1, %24 ], [ -1, %32 ], [ -1, %54 ], [ -1, %.critedge ], [ 1, %52 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  ret i32 %.1
}

declare i32 @x509_signature_algor_to_der(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @asn1_bit_octets_to_der_ex(i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @sm2_sign_init(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @sm2_sign_update(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @sm2_sign_finish_fixlen(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

declare void @gmssl_secure_clear(ptr noundef, i64 noundef) local_unnamed_addr #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass