; LLVM IR from PacktPublishing/Demystifying-Cryptography-with-OpenSSL-3 :: Chapter07 (ec-verify)

; 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"

@.str.7 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [38 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: nounwind uwtable
define dso_local i32 @verify(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 65536, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @ERR_clear_error()
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call i32 @fseek(ptr noundef %19, i64 noundef 0, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = call i64 @ftell(ptr noundef %21)
  store i64 %22, ptr %16, align 8, !tbaa !11
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call i32 @fseek(ptr noundef %23, i64 noundef 0, i32 noundef 0)
  %25 = load i64, ptr %16, align 8, !tbaa !11
  %26 = call noalias ptr @malloc(i64 noundef %25) #6
  store ptr %26, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %27 = load ptr, ptr %15, align 8, !tbaa !5
  %28 = load i64, ptr %16, align 8, !tbaa !11
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call i64 @fread(ptr noundef %27, i64 noundef 1, i64 noundef %28, ptr noundef %29)
  store i64 %30, ptr %17, align 8, !tbaa !11
  %31 = load i64, ptr %16, align 8, !tbaa !11
  %32 = icmp sle i64 %31, 0
  br i1 %32, label %37, label %33

33:                                               ; preds = %4
  %34 = load i64, ptr %17, align 8, !tbaa !11
  %35 = load i64, ptr %16, align 8, !tbaa !11
  %36 = icmp ne i64 %34, %35
  br i1 %36, label %37, label %44

37:                                               ; preds = %33, %4
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %43

40:                                               ; preds = %37
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.7) #5
  br label %43

43:                                               ; preds = %40, %37
  br label %109

44:                                               ; preds = %33
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = call ptr @PEM_read_PUBKEY(ptr noundef %45, ptr noundef null, ptr noundef null, ptr noundef null)
  store ptr %46, ptr %12, align 8, !tbaa !5
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %56, label %49

49:                                               ; preds = %44
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %55

52:                                               ; preds = %49
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str.8) #5
  br label %55

55:                                               ; preds = %52, %49
  br label %109

56:                                               ; preds = %44
  %57 = call ptr @EVP_MD_CTX_new()
  store ptr %57, ptr %13, align 8, !tbaa !5
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = call i32 @EVP_DigestVerifyInit_ex(ptr noundef %58, ptr noundef null, ptr noundef @.str.9, ptr noundef null, ptr noundef null, ptr noundef %59, ptr noundef null)
  store i32 %60, ptr %10, align 4, !tbaa !9
  %61 = call noalias ptr @malloc(i64 noundef 65536) #6
  store ptr %61, ptr %14, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %67, %56
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = call i32 @feof(ptr noundef %63) #5
  %65 = icmp ne i32 %64, 0
  %66 = xor i1 %65, true
  br i1 %66, label %67, label %75

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %68 = load ptr, ptr %14, align 8, !tbaa !5
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = call i64 @fread(ptr noundef %68, i64 noundef 1, i64 noundef 65536, ptr noundef %69)
  store i64 %70, ptr %18, align 8, !tbaa !11
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = load ptr, ptr %14, align 8, !tbaa !5
  %73 = load i64, ptr %18, align 8, !tbaa !11
  %74 = call i32 @EVP_DigestVerifyUpdate(ptr noundef %71, ptr noundef %72, i64 noundef %73)
  store i32 %74, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %62, !llvm.loop !13

75:                                               ; preds = %62
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = load ptr, ptr %15, align 8, !tbaa !5
  %78 = load i64, ptr %17, align 8, !tbaa !11
  %79 = call i32 @EVP_DigestVerifyFinal(ptr noundef %76, ptr noundef %77, i64 noundef %78)
  store i32 %79, ptr %10, align 4, !tbaa !9
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = call i32 @ferror(ptr noundef %80) #5
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %91, label %83

83:                                               ; preds = %75
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = call i32 @ferror(ptr noundef %84) #5
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %91, label %87

87:                                               ; preds = %83
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = call i32 @ferror(ptr noundef %88) #5
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %98

91:                                               ; preds = %87, %83, %75
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = icmp ne ptr %92, null
  br i1 %93, label %94, label %97

94:                                               ; preds = %91
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.10) #5
  br label %97

97:                                               ; preds = %94, %91
  br label %109

98:                                               ; preds = %87
  %99 = load i32, ptr %10, align 4, !tbaa !9
  %100 = icmp ne i32 %99, 1
  br i1 %100, label %101, label %108

101:                                              ; preds = %98
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %107

104:                                              ; preds = %101
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef @.str.11) #5
  br label %107

107:                                              ; preds = %104, %101
  br label %109

108:                                              ; preds = %98
  br label %110

109:                                              ; preds = %107, %97, %55, %43
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %110

110:                                              ; preds = %109, %108
  %111 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %111) #5
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  call void @EVP_MD_CTX_free(ptr noundef %112)
  %113 = load ptr, ptr %12, align 8, !tbaa !5
  call void @EVP_PKEY_free(ptr noundef %113)
  %114 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %114) #5
  %115 = call i64 @ERR_peek_error()
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %117, label %125

117:                                              ; preds = %110
  store i32 1, ptr %9, align 4, !tbaa !9
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %124

120:                                              ; preds = %117
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef @.str.12) #5
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %123)
  br label %124

124:                                              ; preds = %120, %117
  call void @ERR_clear_error()
  br label %125

125:                                              ; preds = %124, %110
  %126 = load i32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret i32 %126
}

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

declare void @ERR_clear_error() #3

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

declare i64 @ftell(ptr noundef) #3

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

declare ptr @PEM_read_PUBKEY(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare ptr @EVP_MD_CTX_new() #3

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

; Function Attrs: nounwind
declare i32 @feof(ptr noundef) #1

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

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

; Function Attrs: nounwind
declare i32 @ferror(ptr noundef) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

declare void @EVP_MD_CTX_free(ptr noundef) #3

declare void @EVP_PKEY_free(ptr noundef) #3

declare i64 @ERR_peek_error() #3

declare void @ERR_print_errors_fp(ptr noundef) #3

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 allocsize(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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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"}


; 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"

@.str.7 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [38 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: nounwind uwtable
define dso_local range(i32 0, 2) i32 @verify(ptr nocapture noundef %0, ptr nocapture noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  tail call void @ERR_clear_error() #6
  %5 = tail call i32 @fseek(ptr noundef %1, i64 noundef 0, i32 noundef 2)
  %6 = tail call i64 @ftell(ptr noundef %1)
  %7 = tail call i32 @fseek(ptr noundef %1, i64 noundef 0, i32 noundef 0)
  %8 = tail call noalias ptr @malloc(i64 noundef %6) #7
  %9 = tail call i64 @fread(ptr noundef %8, i64 noundef 1, i64 noundef %6, ptr noundef %1)
  %10 = icmp sgt i64 %6, 0
  %.not = icmp eq i64 %9, %6
  %or.cond = and i1 %10, %.not
  br i1 %or.cond, label %12, label %11

11:                                               ; preds = %4
  %.not63 = icmp eq ptr %3, null
  br i1 %.not63, label %33, label %.sink.split

12:                                               ; preds = %4
  %13 = tail call ptr @PEM_read_PUBKEY(ptr noundef %2, ptr noundef null, ptr noundef null, ptr noundef null) #6
  %.not54 = icmp eq ptr %13, null
  br i1 %.not54, label %14, label %15

14:                                               ; preds = %12
  %.not55 = icmp eq ptr %3, null
  br i1 %.not55, label %33, label %.sink.split

15:                                               ; preds = %12
  %16 = tail call ptr @EVP_MD_CTX_new() #6
  %17 = tail call i32 @EVP_DigestVerifyInit_ex(ptr noundef %16, ptr noundef null, ptr noundef nonnull @.str.9, ptr noundef null, ptr noundef null, ptr noundef nonnull %13, ptr noundef null) #6
  %18 = tail call noalias dereferenceable_or_null(65536) ptr @malloc(i64 noundef 65536) #7
  %19 = tail call i32 @feof(ptr noundef %0) #6
  %.not5666 = icmp eq i32 %19, 0
  br i1 %.not5666, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %15, %.lr.ph
  %20 = tail call i64 @fread(ptr noundef %18, i64 noundef 1, i64 noundef 65536, ptr noundef %0)
  %21 = tail call i32 @EVP_DigestVerifyUpdate(ptr noundef %16, ptr noundef %18, i64 noundef %20) #6
  %22 = tail call i32 @feof(ptr noundef %0) #6
  %.not56 = icmp eq i32 %22, 0
  br i1 %.not56, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %.lr.ph, %15
  %23 = tail call i32 @EVP_DigestVerifyFinal(ptr noundef %16, ptr noundef %8, i64 noundef %6) #6
  %24 = tail call i32 @ferror(ptr noundef %0) #6
  %.not57 = icmp eq i32 %24, 0
  br i1 %.not57, label %25, label %29

25:                                               ; preds = %._crit_edge
  %26 = tail call i32 @ferror(ptr noundef %1) #6
  %.not58 = icmp eq i32 %26, 0
  br i1 %.not58, label %27, label %29

27:                                               ; preds = %25
  %28 = tail call i32 @ferror(ptr noundef %2) #6
  %.not59 = icmp eq i32 %28, 0
  br i1 %.not59, label %30, label %29

29:                                               ; preds = %27, %25, %._crit_edge
  %.not62 = icmp eq ptr %3, null
  br i1 %.not62, label %33, label %.sink.split

30:                                               ; preds = %27
  %.not60 = icmp eq i32 %23, 1
  br i1 %.not60, label %33, label %31

31:                                               ; preds = %30
  %.not61 = icmp eq ptr %3, null
  br i1 %.not61, label %33, label %.sink.split

.sink.split:                                      ; preds = %31, %29, %14, %11
  %.str.7.sink = phi ptr [ @.str.7, %11 ], [ @.str.8, %14 ], [ @.str.10, %29 ], [ @.str.11, %31 ]
  %.147.ph = phi ptr [ null, %11 ], [ null, %14 ], [ %16, %29 ], [ %16, %31 ]
  %.145.ph = phi ptr [ null, %11 ], [ null, %14 ], [ %18, %29 ], [ %18, %31 ]
  %.143.ph = phi ptr [ null, %11 ], [ null, %14 ], [ %13, %29 ], [ %13, %31 ]
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull %.str.7.sink) #6
  br label %33

33:                                               ; preds = %.sink.split, %11, %14, %29, %31, %30
  %.147 = phi ptr [ %16, %30 ], [ null, %11 ], [ %16, %29 ], [ %16, %31 ], [ null, %14 ], [ %.147.ph, %.sink.split ]
  %.145 = phi ptr [ %18, %30 ], [ null, %11 ], [ %18, %29 ], [ %18, %31 ], [ null, %14 ], [ %.145.ph, %.sink.split ]
  %.143 = phi ptr [ %13, %30 ], [ null, %11 ], [ %13, %29 ], [ %13, %31 ], [ null, %14 ], [ %.143.ph, %.sink.split ]
  %.0 = phi i32 [ 0, %30 ], [ 1, %11 ], [ 1, %29 ], [ 1, %31 ], [ 1, %14 ], [ 1, %.sink.split ]
  tail call void @free(ptr noundef %.145) #6
  tail call void @EVP_MD_CTX_free(ptr noundef %.147) #6
  tail call void @EVP_PKEY_free(ptr noundef %.143) #6
  tail call void @free(ptr noundef %8) #6
  %34 = tail call i64 @ERR_peek_error() #6
  %.not64 = icmp eq i64 %34, 0
  br i1 %.not64, label %39, label %35

35:                                               ; preds = %33
  %.not65 = icmp eq ptr %3, null
  br i1 %.not65, label %38, label %36

36:                                               ; preds = %35
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.12) #6
  tail call void @ERR_print_errors_fp(ptr noundef nonnull %3) #6
  br label %38

38:                                               ; preds = %36, %35
  tail call void @ERR_clear_error() #6
  br label %39

39:                                               ; preds = %38, %33
  %.1 = phi i32 [ 1, %38 ], [ %.0, %33 ]
  ret i32 %.1
}

declare void @ERR_clear_error() local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #0

declare ptr @PEM_read_PUBKEY(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @EVP_MD_CTX_new() local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @feof(ptr nocapture noundef) local_unnamed_addr #0

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

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

; Function Attrs: nofree nounwind memory(read)
declare noundef i32 @ferror(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

declare void @EVP_MD_CTX_free(ptr noundef) local_unnamed_addr #2

declare void @EVP_PKEY_free(ptr noundef) local_unnamed_addr #2

declare i64 @ERR_peek_error() local_unnamed_addr #2

declare void @ERR_print_errors_fp(ptr noundef) local_unnamed_addr #2

attributes #0 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nofree nounwind 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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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