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

; 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_crl_sign_to_der = external hidden unnamed_addr constant [21 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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @x509_tbs_crl_to_der(i32 noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @x509_crl_sign_to_der(i32 noundef %0, i32 noundef %1, ptr noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8, i64 noundef %9, ptr noundef %10, ptr noundef %11, i64 noundef %12, ptr noundef %13, ptr noundef %14) #3 {
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i64, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca i64, align 8
  %33 = alloca ptr, align 8
  %34 = alloca [72 x i8], align 16
  %35 = alloca i64, align 8
  %36 = alloca i32, align 4
  %37 = alloca %struct.SM2_SIGN_CTX, align 8
  store i32 %0, ptr %17, align 4, !tbaa !5
  store i32 %1, ptr %18, align 4, !tbaa !5
  store ptr %2, ptr %19, align 8, !tbaa !9
  store i64 %3, ptr %20, align 8, !tbaa !11
  store i64 %4, ptr %21, align 8, !tbaa !11
  store i64 %5, ptr %22, align 8, !tbaa !11
  store ptr %6, ptr %23, align 8, !tbaa !9
  store i64 %7, ptr %24, align 8, !tbaa !11
  store ptr %8, ptr %25, align 8, !tbaa !9
  store i64 %9, ptr %26, align 8, !tbaa !11
  store ptr %10, ptr %27, align 8, !tbaa !9
  store ptr %11, ptr %28, align 8, !tbaa !9
  store i64 %12, ptr %29, align 8, !tbaa !11
  store ptr %13, ptr %30, align 8, !tbaa !9
  store ptr %14, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #4
  store i64 0, ptr %32, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #4
  store ptr null, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %34) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #4
  store i64 71, ptr %35, align 8, !tbaa !11
  %38 = load i32, ptr %18, align 4, !tbaa !5
  %39 = icmp ne i32 %38, 16
  br i1 %39, label %40, label %46

40:                                               ; preds = %15
  br label %41

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

44:                                               ; preds = %41
  br label %45

45:                                               ; preds = %44
  store i32 -1, ptr %16, align 4
  store i32 1, ptr %36, align 4
  br label %169

46:                                               ; preds = %15
  %47 = load i32, ptr %17, align 4, !tbaa !5
  %48 = load i32, ptr %18, align 4, !tbaa !5
  %49 = load ptr, ptr %19, align 8, !tbaa !9
  %50 = load i64, ptr %20, align 8, !tbaa !11
  %51 = load i64, ptr %21, align 8, !tbaa !11
  %52 = load i64, ptr %22, align 8, !tbaa !11
  %53 = load ptr, ptr %23, align 8, !tbaa !9
  %54 = load i64, ptr %24, align 8, !tbaa !11
  %55 = load ptr, ptr %25, align 8, !tbaa !9
  %56 = load i64, ptr %26, align 8, !tbaa !11
  %57 = call i32 @x509_tbs_crl_to_der(i32 noundef %47, i32 noundef %48, ptr noundef %49, i64 noundef %50, i64 noundef %51, i64 noundef %52, ptr noundef %53, i64 noundef %54, ptr noundef %55, i64 noundef %56, ptr noundef null, ptr noundef %32)
  %58 = icmp ne i32 %57, 1
  br i1 %58, label %74, label %59

59:                                               ; preds = %46
  %60 = load i32, ptr %18, align 4, !tbaa !5
  %61 = call i32 @x509_signature_algor_to_der(i32 noundef %60, ptr noundef null, ptr noundef %32)
  %62 = icmp ne i32 %61, 1
  br i1 %62, label %74, label %63

63:                                               ; preds = %59
  %64 = getelementptr inbounds [72 x i8], ptr %34, i64 0, i64 0
  %65 = load i64, ptr %35, align 8, !tbaa !11
  %66 = call i32 @asn1_bit_octets_to_der_ex(i32 noundef 3, ptr noundef %64, i64 noundef %65, ptr noundef null, ptr noundef %32)
  %67 = icmp ne i32 %66, 1
  br i1 %67, label %74, label %68

68:                                               ; preds = %63
  %69 = load i64, ptr %32, align 8, !tbaa !11
  %70 = load ptr, ptr %30, align 8, !tbaa !9
  %71 = load ptr, ptr %31, align 8, !tbaa !9
  %72 = call i32 @asn1_header_to_der(i32 noundef 48, i64 noundef %69, ptr noundef %70, ptr noundef %71)
  %73 = icmp ne i32 %72, 1
  br i1 %73, label %74, label %80

74:                                               ; preds = %68, %63, %59, %46
  br label %75

75:                                               ; preds = %74
  %76 = load ptr, ptr @stderr, align 8, !tbaa !9
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1444, ptr noundef @__FUNCTION__.x509_crl_sign_to_der) #4
  br label %78

78:                                               ; preds = %75
  br label %79

79:                                               ; preds = %78
  store i32 -1, ptr %16, align 4
  store i32 1, ptr %36, align 4
  br label %169

80:                                               ; preds = %68
  %81 = load ptr, ptr %30, align 8, !tbaa !9
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %90

83:                                               ; preds = %80
  %84 = load ptr, ptr %30, align 8, !tbaa !9
  %85 = load ptr, ptr %84, align 8, !tbaa !9
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %90

87:                                               ; preds = %83
  %88 = load ptr, ptr %30, align 8, !tbaa !9
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  store ptr %89, ptr %33, align 8, !tbaa !9
  br label %90

90:                                               ; preds = %87, %83, %80
  %91 = load i32, ptr %17, align 4, !tbaa !5
  %92 = load i32, ptr %18, align 4, !tbaa !5
  %93 = load ptr, ptr %19, align 8, !tbaa !9
  %94 = load i64, ptr %20, align 8, !tbaa !11
  %95 = load i64, ptr %21, align 8, !tbaa !11
  %96 = load i64, ptr %22, align 8, !tbaa !11
  %97 = load ptr, ptr %23, align 8, !tbaa !9
  %98 = load i64, ptr %24, align 8, !tbaa !11
  %99 = load ptr, ptr %25, align 8, !tbaa !9
  %100 = load i64, ptr %26, align 8, !tbaa !11
  %101 = load ptr, ptr %30, align 8, !tbaa !9
  %102 = load ptr, ptr %31, align 8, !tbaa !9
  %103 = call i32 @x509_tbs_crl_to_der(i32 noundef %91, i32 noundef %92, ptr noundef %93, i64 noundef %94, i64 noundef %95, i64 noundef %96, ptr noundef %97, i64 noundef %98, ptr noundef %99, i64 noundef %100, ptr noundef %101, ptr noundef %102)
  %104 = icmp ne i32 %103, 1
  br i1 %104, label %105, label %111

105:                                              ; preds = %90
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr @stderr, align 8, !tbaa !9
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1453, ptr noundef @__FUNCTION__.x509_crl_sign_to_der) #4
  br label %109

109:                                              ; preds = %106
  br label %110

110:                                              ; preds = %109
  store i32 -1, ptr %16, align 4
  store i32 1, ptr %36, align 4
  br label %169

111:                                              ; preds = %90
  %112 = load ptr, ptr %30, align 8, !tbaa !9
  %113 = icmp ne ptr %112, null
  br i1 %113, label %114, label %149

114:                                              ; preds = %111
  %115 = load ptr, ptr %30, align 8, !tbaa !9
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = icmp ne ptr %116, null
  br i1 %117, label %118, label %149

118:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 3976, ptr %37) #4
  %119 = load ptr, ptr %27, align 8, !tbaa !9
  %120 = load ptr, ptr %28, align 8, !tbaa !9
  %121 = load i64, ptr %29, align 8, !tbaa !11
  %122 = call i32 @sm2_sign_init(ptr noundef %37, ptr noundef %119, ptr noundef %120, i64 noundef %121)
  %123 = icmp ne i32 %122, 1
  br i1 %123, label %139, label %124

124:                                              ; preds = %118
  %125 = load ptr, ptr %33, align 8, !tbaa !9
  %126 = load ptr, ptr %30, align 8, !tbaa !9
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = load ptr, ptr %33, align 8, !tbaa !9
  %129 = ptrtoint ptr %127 to i64
  %130 = ptrtoint ptr %128 to i64
  %131 = sub i64 %129, %130
  %132 = call i32 @sm2_sign_update(ptr noundef %37, ptr noundef %125, i64 noundef %131)
  %133 = icmp ne i32 %132, 1
  br i1 %133, label %139, label %134

134:                                              ; preds = %124
  %135 = load i64, ptr %35, align 8, !tbaa !11
  %136 = getelementptr inbounds [72 x i8], ptr %34, i64 0, i64 0
  %137 = call i32 @sm2_sign_finish_fixlen(ptr noundef %37, i64 noundef %135, ptr noundef %136)
  %138 = icmp ne i32 %137, 1
  br i1 %138, label %139, label %145

139:                                              ; preds = %134, %124, %118
  call void @gmssl_secure_clear(ptr noundef %37, i64 noundef 3976)
  br label %140

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

143:                                              ; preds = %140
  br label %144

144:                                              ; preds = %143
  store i32 -1, ptr %16, align 4
  store i32 1, ptr %36, align 4
  br label %146

145:                                              ; preds = %134
  call void @gmssl_secure_clear(ptr noundef %37, i64 noundef 3976)
  store i32 0, ptr %36, align 4
  br label %146

146:                                              ; preds = %145, %144
  call void @llvm.lifetime.end.p0(i64 3976, ptr %37) #4
  %147 = load i32, ptr %36, align 4
  switch i32 %147, label %169 [
    i32 0, label %148
  ]

148:                                              ; preds = %146
  br label %149

149:                                              ; preds = %148, %114, %111
  %150 = load i32, ptr %18, align 4, !tbaa !5
  %151 = load ptr, ptr %30, align 8, !tbaa !9
  %152 = load ptr, ptr %31, align 8, !tbaa !9
  %153 = call i32 @x509_signature_algor_to_der(i32 noundef %150, ptr noundef %151, ptr noundef %152)
  %154 = icmp ne i32 %153, 1
  br i1 %154, label %162, label %155

155:                                              ; preds = %149
  %156 = getelementptr inbounds [72 x i8], ptr %34, i64 0, i64 0
  %157 = load i64, ptr %35, align 8, !tbaa !11
  %158 = load ptr, ptr %30, align 8, !tbaa !9
  %159 = load ptr, ptr %31, align 8, !tbaa !9
  %160 = call i32 @asn1_bit_octets_to_der_ex(i32 noundef 3, ptr noundef %156, i64 noundef %157, ptr noundef %158, ptr noundef %159)
  %161 = icmp ne i32 %160, 1
  br i1 %161, label %162, label %168

162:                                              ; preds = %155, %149
  br label %163

163:                                              ; preds = %162
  %164 = load ptr, ptr @stderr, align 8, !tbaa !9
  %165 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %164, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1469, ptr noundef @__FUNCTION__.x509_crl_sign_to_der) #4
  br label %166

166:                                              ; preds = %163
  br label %167

167:                                              ; preds = %166
  store i32 -1, ptr %16, align 4
  store i32 1, ptr %36, align 4
  br label %169

168:                                              ; preds = %155
  store i32 1, ptr %16, align 4
  store i32 1, ptr %36, align 4
  br label %169

169:                                              ; preds = %168, %167, %146, %110, %79, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #4
  %170 = load i32, ptr %16, align 4
  ret i32 %170
}

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

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

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

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

declare void @gmssl_secure_clear(ptr noundef, i64 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 = !{!"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_crl_sign_to_der = external hidden unnamed_addr constant [21 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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @x509_tbs_crl_to_der(i32 noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @x509_crl_sign_to_der(i32 noundef %0, i32 noundef %1, ptr noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8, i64 noundef %9, ptr noundef %10, ptr noundef %11, i64 noundef %12, ptr noundef %13, ptr noundef %14) local_unnamed_addr #3 {
  %16 = alloca i64, align 8
  %17 = alloca [72 x i8], align 16
  %18 = alloca %struct.SM2_SIGN_CTX, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #4
  store i64 0, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %17) #4
  %.not = icmp eq i32 %1, 16
  br i1 %.not, label %22, label %19

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

22:                                               ; preds = %15
  %23 = call i32 @x509_tbs_crl_to_der(i32 noundef %0, i32 noundef 16, ptr noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8, i64 noundef %9, ptr noundef null, ptr noundef nonnull %16)
  %.not52 = icmp eq i32 %23, 1
  br i1 %.not52, label %24, label %31

24:                                               ; preds = %22
  %25 = call i32 @x509_signature_algor_to_der(i32 noundef 16, ptr noundef null, ptr noundef nonnull %16) #4
  %.not53 = icmp eq i32 %25, 1
  br i1 %.not53, label %26, label %31

26:                                               ; preds = %24
  %27 = call i32 @asn1_bit_octets_to_der_ex(i32 noundef 3, ptr noundef nonnull %17, i64 noundef 71, ptr noundef null, ptr noundef nonnull %16) #4
  %.not54 = icmp eq i32 %27, 1
  br i1 %.not54, label %28, label %31

28:                                               ; preds = %26
  %29 = load i64, ptr %16, align 8, !tbaa !5
  %30 = call i32 @asn1_header_to_der(i32 noundef 48, i64 noundef %29, ptr noundef %13, ptr noundef %14) #4
  %.not55 = icmp eq i32 %30, 1
  br i1 %.not55, label %34, label %31

31:                                               ; preds = %22, %24, %26, %28
  %32 = load ptr, ptr @stderr, align 8, !tbaa !9
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1444, ptr noundef nonnull @__FUNCTION__.x509_crl_sign_to_der) #5
  br label %64

34:                                               ; preds = %28
  %.not56 = icmp eq ptr %13, null
  br i1 %.not56, label %35, label %.thread

35:                                               ; preds = %34
  %36 = call i32 @x509_tbs_crl_to_der(i32 noundef %0, i32 noundef 16, ptr noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8, i64 noundef %9, ptr noundef null, ptr noundef %14)
  %.not58 = icmp eq i32 %36, 1
  br i1 %.not58, label %57, label %39

.thread:                                          ; preds = %34
  %37 = load ptr, ptr %13, align 8, !tbaa !9
  %38 = call i32 @x509_tbs_crl_to_der(i32 noundef %0, i32 noundef 16, ptr noundef %2, i64 noundef %3, i64 noundef %4, i64 noundef %5, ptr noundef %6, i64 noundef %7, ptr noundef %8, i64 noundef %9, ptr noundef nonnull %13, ptr noundef %14)
  %.not5866 = icmp eq i32 %38, 1
  br i1 %.not5866, label %42, label %39

39:                                               ; preds = %.thread, %35
  %40 = load ptr, ptr @stderr, align 8, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1453, ptr noundef nonnull @__FUNCTION__.x509_crl_sign_to_der) #5
  br label %64

42:                                               ; preds = %.thread
  %43 = load ptr, ptr %13, align 8, !tbaa !9
  %.not59 = icmp eq ptr %43, null
  br i1 %.not59, label %57, label %44

44:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 3976, ptr nonnull %18) #4
  %45 = call i32 @sm2_sign_init(ptr noundef nonnull %18, ptr noundef %10, ptr noundef %11, i64 noundef %12) #4
  %.not60 = icmp eq i32 %45, 1
  br i1 %.not60, label %46, label %.critedge

46:                                               ; preds = %44
  %47 = load ptr, ptr %13, align 8, !tbaa !9
  %48 = ptrtoint ptr %47 to i64
  %49 = ptrtoint ptr %37 to i64
  %50 = sub i64 %48, %49
  %51 = call i32 @sm2_sign_update(ptr noundef nonnull %18, ptr noundef %37, i64 noundef %50) #4
  %.not61 = icmp eq i32 %51, 1
  br i1 %.not61, label %52, label %.critedge

52:                                               ; preds = %46
  %53 = call i32 @sm2_sign_finish_fixlen(ptr noundef nonnull %18, i64 noundef 71, ptr noundef nonnull %17) #4
  %.not62 = icmp eq i32 %53, 1
  br i1 %.not62, label %56, label %.critedge

.critedge:                                        ; preds = %52, %46, %44
  call void @gmssl_secure_clear(ptr noundef nonnull %18, i64 noundef 3976) #4
  %54 = load ptr, ptr @stderr, align 8, !tbaa !9
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1462, ptr noundef nonnull @__FUNCTION__.x509_crl_sign_to_der) #5
  call void @llvm.lifetime.end.p0(i64 3976, ptr nonnull %18) #4
  br label %64

56:                                               ; preds = %52
  call void @gmssl_secure_clear(ptr noundef nonnull %18, i64 noundef 3976) #4
  call void @llvm.lifetime.end.p0(i64 3976, ptr nonnull %18) #4
  br label %57

57:                                               ; preds = %35, %56, %42
  %58 = call i32 @x509_signature_algor_to_der(i32 noundef 16, ptr noundef %13, ptr noundef %14) #4
  %.not63 = icmp eq i32 %58, 1
  br i1 %.not63, label %59, label %61

59:                                               ; preds = %57
  %60 = call i32 @asn1_bit_octets_to_der_ex(i32 noundef 3, ptr noundef nonnull %17, i64 noundef 71, ptr noundef %13, ptr noundef %14) #4
  %.not64 = icmp eq i32 %60, 1
  br i1 %.not64, label %64, label %61

61:                                               ; preds = %57, %59
  %62 = load ptr, ptr @stderr, align 8, !tbaa !9
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1469, ptr noundef nonnull @__FUNCTION__.x509_crl_sign_to_der) #5
  br label %64

64:                                               ; preds = %59, %.critedge, %61, %39, %31, %19
  %.1 = phi i32 [ -1, %19 ], [ -1, %31 ], [ -1, %39 ], [ -1, %61 ], [ -1, %.critedge ], [ 1, %59 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #4
  ret i32 %.1
}

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

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

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

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

declare void @gmssl_secure_clear(ptr noundef, i64 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 = !{!"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,TailCallElimPass