; LLVM IR from openanolis/openssl :: demos/digest (EVP_MD_demo)

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

@hamlet_1 = external dso_local global ptr, align 8
@hamlet_2 = external dso_local global ptr, align 8
@known_answer = external dso_local constant [64 x i8], align 16
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [27 x i8], align 1
@stdout = external global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @demonstrate_digest() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store ptr null, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store ptr null, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store ptr null, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %9 = call ptr @OSSL_LIB_CTX_new()
  store ptr %9, ptr %1, align 8, !tbaa !9
  %10 = load ptr, ptr %1, align 8, !tbaa !9
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %15

12:                                               ; preds = %0
  %13 = load ptr, ptr @stderr, align 8, !tbaa !9
  %14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef @.str.2) #5
  br label %141

15:                                               ; preds = %0
  %16 = load ptr, ptr %1, align 8, !tbaa !9
  %17 = load ptr, ptr %3, align 8, !tbaa !9
  %18 = call ptr @EVP_MD_fetch(ptr noundef %16, ptr noundef @.str.3, ptr noundef %17)
  store ptr %18, ptr %4, align 8, !tbaa !9
  %19 = load ptr, ptr %4, align 8, !tbaa !9
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %24

21:                                               ; preds = %15
  %22 = load ptr, ptr @stderr, align 8, !tbaa !9
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef @.str.4) #5
  br label %141

24:                                               ; preds = %15
  %25 = load ptr, ptr %4, align 8, !tbaa !9
  %26 = call i32 @EVP_MD_get_size(ptr noundef %25)
  store i32 %26, ptr %6, align 4, !tbaa !5
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = icmp ule i32 %27, 0
  br i1 %28, label %29, label %32

29:                                               ; preds = %24
  %30 = load ptr, ptr @stderr, align 8, !tbaa !9
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str.5) #5
  br label %141

32:                                               ; preds = %24
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = zext i32 %33 to i64
  %35 = call ptr @CRYPTO_malloc(i64 noundef %34, ptr noundef @.str.6, i32 noundef 114)
  store ptr %35, ptr %7, align 8, !tbaa !9
  %36 = load ptr, ptr %7, align 8, !tbaa !9
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %41

38:                                               ; preds = %32
  %39 = load ptr, ptr @stderr, align 8, !tbaa !9
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.7) #5
  br label %141

41:                                               ; preds = %32
  %42 = call ptr @EVP_MD_CTX_new()
  store ptr %42, ptr %5, align 8, !tbaa !9
  %43 = load ptr, ptr %5, align 8, !tbaa !9
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %48

45:                                               ; preds = %41
  %46 = load ptr, ptr @stderr, align 8, !tbaa !9
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef @.str.8) #5
  br label %141

48:                                               ; preds = %41
  %49 = load ptr, ptr %5, align 8, !tbaa !9
  %50 = load ptr, ptr %4, align 8, !tbaa !9
  %51 = call i32 @EVP_DigestInit(ptr noundef %49, ptr noundef %50)
  %52 = icmp ne i32 %51, 1
  br i1 %52, label %53, label %56

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

56:                                               ; preds = %48
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = load ptr, ptr @hamlet_1, align 8, !tbaa !9
  %59 = load ptr, ptr @hamlet_1, align 8, !tbaa !9
  %60 = call i64 @strlen(ptr noundef %59) #6
  %61 = call i32 @EVP_DigestUpdate(ptr noundef %57, ptr noundef %58, i64 noundef %60)
  %62 = icmp ne i32 %61, 1
  br i1 %62, label %63, label %66

63:                                               ; preds = %56
  %64 = load ptr, ptr @stderr, align 8, !tbaa !9
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef @.str.10) #5
  br label %141

66:                                               ; preds = %56
  %67 = load ptr, ptr %5, align 8, !tbaa !9
  %68 = load ptr, ptr @hamlet_2, align 8, !tbaa !9
  %69 = load ptr, ptr @hamlet_2, align 8, !tbaa !9
  %70 = call i64 @strlen(ptr noundef %69) #6
  %71 = call i32 @EVP_DigestUpdate(ptr noundef %67, ptr noundef %68, i64 noundef %70)
  %72 = icmp ne i32 %71, 1
  br i1 %72, label %73, label %76

73:                                               ; preds = %66
  %74 = load ptr, ptr @stderr, align 8, !tbaa !9
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.11) #5
  br label %141

76:                                               ; preds = %66
  %77 = load ptr, ptr %5, align 8, !tbaa !9
  %78 = load ptr, ptr %7, align 8, !tbaa !9
  %79 = call i32 @EVP_DigestFinal(ptr noundef %77, ptr noundef %78, ptr noundef %6)
  %80 = icmp ne i32 %79, 1
  br i1 %80, label %81, label %84

81:                                               ; preds = %76
  %82 = load ptr, ptr @stderr, align 8, !tbaa !9
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.12) #5
  br label %141

84:                                               ; preds = %76
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %98, %84
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = icmp ult i32 %86, %87
  br i1 %88, label %89, label %101

89:                                               ; preds = %85
  %90 = load ptr, ptr @stdout, align 8, !tbaa !9
  %91 = load ptr, ptr %7, align 8, !tbaa !9
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i8, ptr %91, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !11
  %96 = zext i8 %95 to i32
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str.13, i32 noundef %96) #5
  br label %98

98:                                               ; preds = %89
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %8, align 4, !tbaa !5
  br label %85, !llvm.loop !12

101:                                              ; preds = %85
  %102 = load ptr, ptr @stdout, align 8, !tbaa !9
  %103 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %102, ptr noundef @.str.14) #5
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = zext i32 %104 to i64
  %106 = icmp ne i64 %105, 64
  br i1 %106, label %107, label %111

107:                                              ; preds = %101
  %108 = load ptr, ptr @stdout, align 8, !tbaa !9
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef @.str.15, i32 noundef %109, i64 noundef 64) #5
  br label %140

111:                                              ; preds = %101
  %112 = load ptr, ptr %7, align 8, !tbaa !9
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = zext i32 %113 to i64
  %115 = call i32 @memcmp(ptr noundef %112, ptr noundef @known_answer, i64 noundef %114) #6
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %136

117:                                              ; preds = %111
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %130, %117
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = icmp ult i64 %120, 64
  br i1 %121, label %122, label %133

122:                                              ; preds = %118
  %123 = load ptr, ptr @stdout, align 8, !tbaa !9
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [64 x i8], ptr @known_answer, i64 0, i64 %125
  %127 = load i8, ptr %126, align 1, !tbaa !11
  %128 = zext i8 %127 to i32
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str.13, i32 noundef %128) #5
  br label %130

130:                                              ; preds = %122
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %8, align 4, !tbaa !5
  br label %118, !llvm.loop !14

133:                                              ; preds = %118
  %134 = load ptr, ptr @stdout, align 8, !tbaa !9
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.16) #5
  br label %139

136:                                              ; preds = %111
  %137 = load ptr, ptr @stdout, align 8, !tbaa !9
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %137, ptr noundef @.str.17) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %136, %133
  br label %140

140:                                              ; preds = %139, %107
  br label %141

141:                                              ; preds = %140, %81, %73, %63, %53, %45, %38, %29, %21, %12
  %142 = load i32, ptr %2, align 4, !tbaa !5
  %143 = icmp ne i32 %142, 1
  br i1 %143, label %144, label %146

144:                                              ; preds = %141
  %145 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %145)
  br label %146

146:                                              ; preds = %144, %141
  %147 = load ptr, ptr %5, align 8, !tbaa !9
  call void @EVP_MD_CTX_free(ptr noundef %147)
  %148 = load ptr, ptr %7, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %148, ptr noundef @.str.6, i32 noundef 172)
  %149 = load ptr, ptr %4, align 8, !tbaa !9
  call void @EVP_MD_free(ptr noundef %149)
  %150 = load ptr, ptr %1, align 8, !tbaa !9
  call void @OSSL_LIB_CTX_free(ptr noundef %150)
  %151 = load i32, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret i32 %151
}

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

declare ptr @OSSL_LIB_CTX_new() #2

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

declare ptr @EVP_MD_fetch(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @EVP_MD_get_size(ptr noundef) #2

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

declare ptr @EVP_MD_CTX_new() #2

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

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

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

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

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

declare void @ERR_print_errors_fp(ptr noundef) #2

declare void @EVP_MD_CTX_free(ptr noundef) #2

declare void @CRYPTO_free(ptr noundef, ptr noundef, i32 noundef) #2

declare void @EVP_MD_free(ptr noundef) #2

declare void @OSSL_LIB_CTX_free(ptr noundef) #2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


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

@hamlet_1 = external dso_local local_unnamed_addr global ptr, align 8
@hamlet_2 = external dso_local local_unnamed_addr global ptr, align 8
@known_answer = external dso_local constant [64 x i8], align 16
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [27 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @demonstrate_digest() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %2 = tail call ptr @OSSL_LIB_CTX_new() #6
  %3 = icmp eq ptr %2, null
  br i1 %3, label %4, label %7

4:                                                ; preds = %0
  %5 = load ptr, ptr @stderr, align 8, !tbaa !5
  %6 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.2) #7
  br label %83

7:                                                ; preds = %0
  %8 = tail call ptr @EVP_MD_fetch(ptr noundef nonnull %2, ptr noundef nonnull @.str.3, ptr noundef null) #6
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %13

10:                                               ; preds = %7
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.4) #7
  br label %83

13:                                               ; preds = %7
  %14 = tail call i32 @EVP_MD_get_size(ptr noundef nonnull %8) #6
  store i32 %14, ptr %1, align 4, !tbaa !9
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %19

16:                                               ; preds = %13
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.5) #7
  br label %83

19:                                               ; preds = %13
  %20 = zext i32 %14 to i64
  %21 = tail call ptr @CRYPTO_malloc(i64 noundef %20, ptr noundef nonnull @.str.6, i32 noundef 114) #6
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %26

23:                                               ; preds = %19
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.7) #7
  br label %83

26:                                               ; preds = %19
  %27 = tail call ptr @EVP_MD_CTX_new() #6
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %32

29:                                               ; preds = %26
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.8) #7
  br label %83

32:                                               ; preds = %26
  %33 = tail call i32 @EVP_DigestInit(ptr noundef nonnull %27, ptr noundef nonnull %8) #6
  %.not = icmp eq i32 %33, 1
  br i1 %.not, label %37, label %34

34:                                               ; preds = %32
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.9) #7
  br label %83

37:                                               ; preds = %32
  %38 = load ptr, ptr @hamlet_1, align 8, !tbaa !5
  %39 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %38) #8
  %40 = tail call i32 @EVP_DigestUpdate(ptr noundef nonnull %27, ptr noundef %38, i64 noundef %39) #6
  %.not40 = icmp eq i32 %40, 1
  br i1 %.not40, label %44, label %41

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

44:                                               ; preds = %37
  %45 = load ptr, ptr @hamlet_2, align 8, !tbaa !5
  %46 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %45) #8
  %47 = tail call i32 @EVP_DigestUpdate(ptr noundef nonnull %27, ptr noundef %45, i64 noundef %46) #6
  %.not41 = icmp eq i32 %47, 1
  br i1 %.not41, label %51, label %48

48:                                               ; preds = %44
  %49 = load ptr, ptr @stderr, align 8, !tbaa !5
  %50 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.11) #7
  br label %83

51:                                               ; preds = %44
  %52 = call i32 @EVP_DigestFinal(ptr noundef nonnull %27, ptr noundef nonnull %21, ptr noundef nonnull %1) #6
  %.not42 = icmp eq i32 %52, 1
  br i1 %.not42, label %.preheader59, label %54

.preheader59:                                     ; preds = %51
  %53 = load i32, ptr %1, align 4, !tbaa !9
  %.not62 = icmp eq i32 %53, 0
  br i1 %.not62, label %._crit_edge, label %.lr.ph

54:                                               ; preds = %51
  %55 = load ptr, ptr @stderr, align 8, !tbaa !5
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.12) #7
  br label %83

.lr.ph:                                           ; preds = %.preheader59, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader59 ]
  %57 = load ptr, ptr @stdout, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %21, i64 %indvars.iv
  %59 = load i8, ptr %58, align 1, !tbaa !11
  %60 = zext i8 %59 to i32
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef nonnull @.str.13, i32 noundef %60) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %62 = load i32, ptr %1, align 4, !tbaa !9
  %63 = zext i32 %62 to i64
  %64 = icmp ult i64 %indvars.iv.next, %63
  br i1 %64, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph, %.preheader59
  %65 = load ptr, ptr @stdout, align 8, !tbaa !5
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef nonnull @.str.14) #6
  %67 = load i32, ptr %1, align 4, !tbaa !9
  %.not43 = icmp eq i32 %67, 64
  br i1 %.not43, label %71, label %68

68:                                               ; preds = %._crit_edge
  %69 = load ptr, ptr @stdout, align 8, !tbaa !5
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.15, i32 noundef %67, i64 noundef 64) #6
  br label %83

71:                                               ; preds = %._crit_edge
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(64) %21, ptr noundef nonnull dereferenceable(64) @known_answer, i64 64)
  %.not44 = icmp eq i32 %bcmp, 0
  br i1 %.not44, label %80, label %.preheader

.preheader:                                       ; preds = %71, %.preheader
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.preheader ], [ 0, %71 ]
  %72 = load ptr, ptr @stdout, align 8, !tbaa !5
  %73 = getelementptr inbounds [64 x i8], ptr @known_answer, i64 0, i64 %indvars.iv64
  %74 = load i8, ptr %73, align 1, !tbaa !11
  %75 = zext i8 %74 to i32
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.13, i32 noundef %75) #6
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next65, 64
  br i1 %exitcond.not, label %77, label %.preheader, !llvm.loop !14

77:                                               ; preds = %.preheader
  %78 = load ptr, ptr @stdout, align 8, !tbaa !5
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str.16) #6
  br label %83

80:                                               ; preds = %71
  %81 = load ptr, ptr @stdout, align 8, !tbaa !5
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef nonnull @.str.17) #6
  br label %85

83:                                               ; preds = %4, %10, %16, %23, %29, %34, %41, %48, %54, %68, %77
  %.028.ph = phi ptr [ %8, %77 ], [ %8, %68 ], [ %8, %54 ], [ %8, %48 ], [ %8, %41 ], [ %8, %34 ], [ %8, %29 ], [ %8, %23 ], [ %8, %16 ], [ null, %10 ], [ null, %4 ]
  %.027.ph = phi ptr [ %27, %77 ], [ %27, %68 ], [ %27, %54 ], [ %27, %48 ], [ %27, %41 ], [ %27, %34 ], [ null, %29 ], [ null, %23 ], [ null, %16 ], [ null, %10 ], [ null, %4 ]
  %.026.ph = phi ptr [ %21, %77 ], [ %21, %68 ], [ %21, %54 ], [ %21, %48 ], [ %21, %41 ], [ %21, %34 ], [ %21, %29 ], [ null, %23 ], [ null, %16 ], [ null, %10 ], [ null, %4 ]
  %84 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @ERR_print_errors_fp(ptr noundef %84) #6
  br label %85

85:                                               ; preds = %80, %83
  %.02658 = phi ptr [ %.026.ph, %83 ], [ %21, %80 ]
  %.02756 = phi ptr [ %.027.ph, %83 ], [ %27, %80 ]
  %.02854 = phi ptr [ %.028.ph, %83 ], [ %8, %80 ]
  %.02952 = phi i32 [ 0, %83 ], [ 1, %80 ]
  call void @EVP_MD_CTX_free(ptr noundef %.02756) #6
  call void @CRYPTO_free(ptr noundef %.02658, ptr noundef nonnull @.str.6, i32 noundef 172) #6
  call void @EVP_MD_free(ptr noundef %.02854) #6
  call void @OSSL_LIB_CTX_free(ptr noundef %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 %.02952
}

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

declare ptr @OSSL_LIB_CTX_new() local_unnamed_addr #2

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

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

declare i32 @EVP_MD_get_size(ptr noundef) local_unnamed_addr #2

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

declare ptr @EVP_MD_CTX_new() local_unnamed_addr #2

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

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

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

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

declare void @ERR_print_errors_fp(ptr noundef) local_unnamed_addr #2

declare void @EVP_MD_CTX_free(ptr noundef) local_unnamed_addr #2

declare void @CRYPTO_free(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @EVP_MD_free(ptr noundef) local_unnamed_addr #2

declare void @OSSL_LIB_CTX_free(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #5

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

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

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


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