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

; 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.SM3_CTX = type { [8 x i32], i64, [64 x i8], 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 [57 x i8], align 1
@__FUNCTION__.cms_signed_data_verify_from_der = external hidden unnamed_addr constant [32 x i8], align 1

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

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

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

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

declare i32 @asn1_check(i32 noundef) #3

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

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

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

declare void @sm3_init(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @cms_signed_data_verify_from_der(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14) #2 {
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca i32, align 4
  %33 = alloca [4 x i32], align 16
  %34 = alloca i64, align 8
  %35 = alloca %struct.SM3_CTX, align 8
  %36 = alloca [128 x i8], align 16
  %37 = alloca i64, align 8
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca i64, align 8
  %41 = alloca i32, align 4
  %42 = alloca ptr, align 8
  %43 = alloca i64, align 8
  %44 = alloca ptr, align 8
  %45 = alloca i64, align 8
  %46 = alloca ptr, align 8
  %47 = alloca i64, align 8
  %48 = alloca ptr, align 8
  %49 = alloca i64, align 8
  %50 = alloca ptr, align 8
  %51 = alloca i64, align 8
  store ptr %0, ptr %17, align 8, !tbaa !5
  store i64 %1, ptr %18, align 8, !tbaa !9
  store ptr %2, ptr %19, align 8, !tbaa !5
  store i64 %3, ptr %20, align 8, !tbaa !9
  store ptr %4, ptr %21, align 8, !tbaa !5
  store ptr %5, ptr %22, align 8, !tbaa !5
  store ptr %6, ptr %23, align 8, !tbaa !5
  store ptr %7, ptr %24, align 8, !tbaa !5
  store ptr %8, ptr %25, align 8, !tbaa !5
  store ptr %9, ptr %26, align 8, !tbaa !5
  store ptr %10, ptr %27, align 8, !tbaa !5
  store ptr %11, ptr %28, align 8, !tbaa !5
  store ptr %12, ptr %29, align 8, !tbaa !5
  store ptr %13, ptr %30, align 8, !tbaa !5
  store ptr %14, ptr %31, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #4
  call void @llvm.lifetime.start.p0(i64 112, ptr %35) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr %36) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #4
  %52 = getelementptr inbounds [128 x i8], ptr %36, i64 0, i64 0
  store ptr %52, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #4
  %53 = getelementptr inbounds [4 x i32], ptr %33, i64 0, i64 0
  %54 = load ptr, ptr %21, align 8, !tbaa !5
  %55 = load ptr, ptr %22, align 8, !tbaa !5
  %56 = load ptr, ptr %23, align 8, !tbaa !5
  %57 = load ptr, ptr %24, align 8, !tbaa !5
  %58 = load ptr, ptr %25, align 8, !tbaa !5
  %59 = load ptr, ptr %26, align 8, !tbaa !5
  %60 = load ptr, ptr %27, align 8, !tbaa !5
  %61 = load ptr, ptr %30, align 8, !tbaa !5
  %62 = load ptr, ptr %31, align 8, !tbaa !5
  %63 = call i32 @cms_signed_data_from_der(ptr noundef %32, ptr noundef %53, ptr noundef %34, i64 noundef 4, ptr noundef %54, ptr noundef %55, ptr noundef %56, ptr noundef %57, ptr noundef %58, ptr noundef %59, ptr noundef %60, ptr noundef %39, ptr noundef %40, ptr noundef %61, ptr noundef %62)
  %64 = icmp ne i32 %63, 1
  br i1 %64, label %84, label %65

65:                                               ; preds = %15
  %66 = load i32, ptr %32, align 4, !tbaa !11
  %67 = icmp eq i32 %66, 1
  %68 = zext i1 %67 to i32
  %69 = call i32 @asn1_check(i32 noundef %68)
  %70 = icmp ne i32 %69, 1
  br i1 %70, label %84, label %71

71:                                               ; preds = %65
  %72 = getelementptr inbounds [4 x i32], ptr %33, i64 0, i64 0
  %73 = load i32, ptr %72, align 16, !tbaa !11
  %74 = icmp eq i32 %73, 13
  %75 = zext i1 %74 to i32
  %76 = call i32 @asn1_check(i32 noundef %75)
  %77 = icmp ne i32 %76, 1
  br i1 %77, label %84, label %78

78:                                               ; preds = %71
  %79 = load i64, ptr %34, align 8, !tbaa !9
  %80 = icmp eq i64 %79, 1
  %81 = zext i1 %80 to i32
  %82 = call i32 @asn1_check(i32 noundef %81)
  %83 = icmp ne i32 %82, 1
  br i1 %83, label %84, label %90

84:                                               ; preds = %78, %71, %65, %15
  br label %85

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

88:                                               ; preds = %85
  br label %89

89:                                               ; preds = %88
  store i32 -1, ptr %16, align 4
  store i32 1, ptr %41, align 4
  br label %135

90:                                               ; preds = %78
  %91 = load ptr, ptr %39, align 8, !tbaa !5
  %92 = load ptr, ptr %28, align 8, !tbaa !5
  store ptr %91, ptr %92, align 8, !tbaa !5
  %93 = load i64, ptr %40, align 8, !tbaa !9
  %94 = load ptr, ptr %29, align 8, !tbaa !5
  store i64 %93, ptr %94, align 8, !tbaa !9
  store i64 0, ptr %37, align 8, !tbaa !9
  %95 = load ptr, ptr %21, align 8, !tbaa !5
  %96 = load i32, ptr %95, align 4, !tbaa !11
  %97 = load ptr, ptr %23, align 8, !tbaa !5
  %98 = load i64, ptr %97, align 8, !tbaa !9
  %99 = call i32 @cms_content_info_header_to_der(i32 noundef %96, i64 noundef %98, ptr noundef %38, ptr noundef %37)
  %100 = icmp ne i32 %99, 1
  br i1 %100, label %101, label %107

101:                                              ; preds = %90
  br label %102

102:                                              ; preds = %101
  %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 1168, ptr noundef @__FUNCTION__.cms_signed_data_verify_from_der) #4
  br label %105

105:                                              ; preds = %102
  br label %106

106:                                              ; preds = %105
  store i32 -1, ptr %16, align 4
  store i32 1, ptr %41, align 4
  br label %135

107:                                              ; preds = %90
  call void @sm3_init(ptr noundef %35)
  %108 = getelementptr inbounds [128 x i8], ptr %36, i64 0, i64 0
  %109 = load i64, ptr %37, align 8, !tbaa !9
  call void @sm3_update(ptr noundef %35, ptr noundef %108, i64 noundef %109)
  %110 = load ptr, ptr %22, align 8, !tbaa !5
  %111 = load ptr, ptr %110, align 8, !tbaa !5
  %112 = load ptr, ptr %23, align 8, !tbaa !5
  %113 = load i64, ptr %112, align 8, !tbaa !9
  call void @sm3_update(ptr noundef %35, ptr noundef %111, i64 noundef %113)
  br label %114

114:                                              ; preds = %133, %107
  %115 = load i64, ptr %40, align 8, !tbaa !9
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %117, label %134

117:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %50) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #4
  %118 = load ptr, ptr %24, align 8, !tbaa !5
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = load ptr, ptr %25, align 8, !tbaa !5
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = call i32 @cms_signer_info_verify_from_der(ptr noundef %35, ptr noundef %119, i64 noundef %121, ptr noundef %42, ptr noundef %43, ptr noundef %44, ptr noundef %45, ptr noundef %46, ptr noundef %47, ptr noundef %48, ptr noundef %49, ptr noundef %50, ptr noundef %51, ptr noundef %39, ptr noundef %40)
  %123 = icmp ne i32 %122, 1
  br i1 %123, label %124, label %130

124:                                              ; preds = %117
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr @stderr, align 8, !tbaa !5
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1197, ptr noundef @__FUNCTION__.cms_signed_data_verify_from_der) #4
  br label %128

128:                                              ; preds = %125
  br label %129

129:                                              ; preds = %128
  store i32 -1, ptr %16, align 4
  store i32 1, ptr %41, align 4
  br label %131

130:                                              ; preds = %117
  store i32 0, ptr %41, align 4
  br label %131

131:                                              ; preds = %130, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %50) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #4
  %132 = load i32, ptr %41, align 4
  switch i32 %132, label %135 [
    i32 0, label %133
  ]

133:                                              ; preds = %131
  br label %114, !llvm.loop !13

134:                                              ; preds = %114
  store i32 1, ptr %16, align 4
  store i32 1, ptr %41, align 4
  br label %135

135:                                              ; preds = %134, %131, %106, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr %36) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  %136 = load i32, ptr %16, align 4
  ret i32 %136
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = !{!"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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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.SM3_CTX = type { [8 x i32], i64, [64 x i8], 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 [57 x i8], align 1
@__FUNCTION__.cms_signed_data_verify_from_der = external hidden unnamed_addr constant [32 x i8], align 1

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

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

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

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

declare i32 @asn1_check(i32 noundef) local_unnamed_addr #3

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

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

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

declare void @sm3_init(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @cms_signed_data_verify_from_der(ptr nocapture noundef readnone %0, i64 noundef %1, ptr nocapture noundef readnone %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr nocapture noundef writeonly %11, ptr nocapture noundef writeonly %12, ptr noundef %13, ptr noundef %14) local_unnamed_addr #2 {
  %16 = alloca i32, align 4
  %17 = alloca [4 x i32], align 16
  %18 = alloca i64, align 8
  %19 = alloca %struct.SM3_CTX, align 8
  %20 = alloca [128 x i8], align 16
  %21 = alloca i64, align 8
  %22 = alloca ptr, 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 i64, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i64, align 8
  %31 = alloca ptr, align 8
  %32 = alloca i64, align 8
  %33 = alloca ptr, align 8
  %34 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #4
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %19) #4
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #4
  store ptr %20, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #4
  %35 = call i32 @cms_signed_data_from_der(ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef nonnull %18, i64 noundef 4, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef nonnull %23, ptr noundef nonnull %24, ptr noundef %13, ptr noundef %14)
  %.not = icmp eq i32 %35, 1
  br i1 %.not, label %36, label %51

36:                                               ; preds = %15
  %37 = load i32, ptr %16, align 4, !tbaa !9
  %38 = icmp eq i32 %37, 1
  %39 = zext i1 %38 to i32
  %40 = call i32 @asn1_check(i32 noundef %39) #4
  %.not19 = icmp eq i32 %40, 1
  br i1 %.not19, label %41, label %51

41:                                               ; preds = %36
  %42 = load i32, ptr %17, align 16, !tbaa !9
  %43 = icmp eq i32 %42, 13
  %44 = zext i1 %43 to i32
  %45 = call i32 @asn1_check(i32 noundef %44) #4
  %.not20 = icmp eq i32 %45, 1
  br i1 %.not20, label %46, label %51

46:                                               ; preds = %41
  %47 = load i64, ptr %18, align 8, !tbaa !11
  %48 = icmp eq i64 %47, 1
  %49 = zext i1 %48 to i32
  %50 = call i32 @asn1_check(i32 noundef %49) #4
  %.not21 = icmp eq i32 %50, 1
  br i1 %.not21, label %54, label %51

51:                                               ; preds = %15, %36, %41, %46
  %52 = load ptr, ptr @stderr, align 8, !tbaa !5
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1159, ptr noundef nonnull @__FUNCTION__.cms_signed_data_verify_from_der) #5
  br label %.loopexit

54:                                               ; preds = %46
  %55 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %55, ptr %11, align 8, !tbaa !5
  %56 = load i64, ptr %24, align 8, !tbaa !11
  store i64 %56, ptr %12, align 8, !tbaa !11
  store i64 0, ptr %21, align 8, !tbaa !11
  %57 = load i32, ptr %4, align 4, !tbaa !9
  %58 = load i64, ptr %6, align 8, !tbaa !11
  %59 = call i32 @cms_content_info_header_to_der(i32 noundef %57, i64 noundef %58, ptr noundef nonnull %22, ptr noundef nonnull %21)
  %.not22 = icmp eq i32 %59, 1
  br i1 %.not22, label %63, label %60

60:                                               ; preds = %54
  %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 1168, ptr noundef nonnull @__FUNCTION__.cms_signed_data_verify_from_der) #5
  br label %.loopexit

63:                                               ; preds = %54
  call void @sm3_init(ptr noundef nonnull %19) #4
  %64 = load i64, ptr %21, align 8, !tbaa !11
  call void @sm3_update(ptr noundef nonnull %19, ptr noundef nonnull %20, i64 noundef %64) #4
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = load i64, ptr %6, align 8, !tbaa !11
  call void @sm3_update(ptr noundef nonnull %19, ptr noundef %65, i64 noundef %66) #4
  %67 = load i64, ptr %24, align 8, !tbaa !11
  %.not2325 = icmp eq i64 %67, 0
  br i1 %.not2325, label %.loopexit, label %.lr.ph

.critedge:                                        ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %34) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %33) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %32) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #4
  %68 = load i64, ptr %24, align 8, !tbaa !11
  %.not23 = icmp eq i64 %68, 0
  br i1 %.not23, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %63, %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %27) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %29) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %30) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %31) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %32) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %33) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %34) #4
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = load i64, ptr %8, align 8, !tbaa !11
  %71 = call i32 @cms_signer_info_verify_from_der(ptr noundef nonnull %19, ptr noundef %69, i64 noundef %70, ptr noundef nonnull %25, ptr noundef nonnull %26, ptr noundef nonnull %27, ptr noundef nonnull %28, ptr noundef nonnull %29, ptr noundef nonnull %30, ptr noundef nonnull %31, ptr noundef nonnull %32, ptr noundef nonnull %33, ptr noundef nonnull %34, ptr noundef nonnull %23, ptr noundef nonnull %24)
  %.not24 = icmp eq i32 %71, 1
  br i1 %.not24, label %.critedge, label %72

72:                                               ; preds = %.lr.ph
  %73 = load ptr, ptr @stderr, align 8, !tbaa !5
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1197, ptr noundef nonnull @__FUNCTION__.cms_signed_data_verify_from_der) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %34) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %33) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %32) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %25) #4
  br label %.loopexit, !llvm.loop !13

.loopexit:                                        ; preds = %.critedge, %63, %72, %60, %51
  %.2 = phi i32 [ -1, %51 ], [ -1, %60 ], [ -1, %72 ], [ 1, %63 ], [ 1, %.critedge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %20) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #4
  ret i32 %.2
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = !{!"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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass