; LLVM IR from openssl/openssl :: demos/mac (cmac-aes256)

; 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.ossl_param_st = type { ptr, i32, ptr, i64, i64 }

@__const.main.cipher_name = external hidden unnamed_addr constant [12 x i8], align 1
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@propq = external hidden global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@key = external hidden global [32 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@data = external hidden constant [756 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@stdout = external global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1
@expected_output = external hidden constant [16 x i8], align 16
@.str.12 = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca [4 x %struct.ossl_param_st], align 16
  %9 = alloca ptr, align 8
  %10 = alloca [12 x i8], align 1
  %11 = alloca %struct.ossl_param_st, align 8
  %12 = alloca %struct.ossl_param_st, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store ptr null, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store ptr null, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store ptr null, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 160, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %13 = getelementptr inbounds [4 x %struct.ossl_param_st], ptr %8, i64 0, i64 0
  store ptr %13, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %10, ptr align 1 @__const.main.cipher_name, i64 12, i1 false)
  %14 = call ptr @OSSL_LIB_CTX_new()
  store ptr %14, ptr %3, align 8, !tbaa !9
  %15 = load ptr, ptr %3, align 8, !tbaa !9
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %20

17:                                               ; preds = %0
  %18 = load ptr, ptr @stderr, align 8, !tbaa !9
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef @.str) #6
  br label %101

20:                                               ; preds = %0
  %21 = load ptr, ptr %3, align 8, !tbaa !9
  %22 = load ptr, ptr @propq, align 8, !tbaa !9
  %23 = call ptr @EVP_MAC_fetch(ptr noundef %21, ptr noundef @.str.1, ptr noundef %22)
  store ptr %23, ptr %4, align 8, !tbaa !9
  %24 = load ptr, ptr %4, align 8, !tbaa !9
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %29

26:                                               ; preds = %20
  %27 = load ptr, ptr @stderr, align 8, !tbaa !9
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str.2) #6
  br label %101

29:                                               ; preds = %20
  %30 = load ptr, ptr %4, align 8, !tbaa !9
  %31 = call ptr @EVP_MAC_CTX_new(ptr noundef %30)
  store ptr %31, ptr %5, align 8, !tbaa !9
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %37

34:                                               ; preds = %29
  %35 = load ptr, ptr @stderr, align 8, !tbaa !9
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.3) #6
  br label %101

37:                                               ; preds = %29
  %38 = load ptr, ptr %9, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.ossl_param_st, ptr %38, i32 1
  store ptr %39, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %11) #6
  %40 = getelementptr inbounds [12 x i8], ptr %10, i64 0, i64 0
  call void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %11, ptr noundef @.str.4, ptr noundef %40, i64 noundef 12)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %38, ptr align 8 %11, i64 40, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #6
  %41 = load ptr, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #6
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %12)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %41, ptr align 8 %12, i64 40, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #6
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = getelementptr inbounds [4 x %struct.ossl_param_st], ptr %8, i64 0, i64 0
  %44 = call i32 @EVP_MAC_init(ptr noundef %42, ptr noundef @key, i64 noundef 32, ptr noundef %43)
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %49, label %46

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

49:                                               ; preds = %37
  %50 = load ptr, ptr %5, align 8, !tbaa !9
  %51 = call i32 @EVP_MAC_update(ptr noundef %50, ptr noundef @data, i64 noundef 756)
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %56, label %53

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

56:                                               ; preds = %49
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = call i32 @EVP_MAC_final(ptr noundef %57, ptr noundef null, ptr noundef %7, i64 noundef 0)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %63, label %60

60:                                               ; preds = %56
  %61 = load ptr, ptr @stderr, align 8, !tbaa !9
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str.7) #6
  br label %101

63:                                               ; preds = %56
  %64 = load i64, ptr %7, align 8, !tbaa !11
  %65 = call ptr @CRYPTO_malloc(i64 noundef %64, ptr noundef @.str.8, i32 noundef 119)
  store ptr %65, ptr %6, align 8, !tbaa !9
  %66 = load ptr, ptr %6, align 8, !tbaa !9
  %67 = icmp eq ptr %66, null
  br i1 %67, label %68, label %71

68:                                               ; preds = %63
  %69 = load ptr, ptr @stderr, align 8, !tbaa !9
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef @.str.9) #6
  br label %101

71:                                               ; preds = %63
  %72 = load ptr, ptr %5, align 8, !tbaa !9
  %73 = load ptr, ptr %6, align 8, !tbaa !9
  %74 = load i64, ptr %7, align 8, !tbaa !11
  %75 = call i32 @EVP_MAC_final(ptr noundef %72, ptr noundef %73, ptr noundef %7, i64 noundef %74)
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %80, label %77

77:                                               ; preds = %71
  %78 = load ptr, ptr @stderr, align 8, !tbaa !9
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef @.str.7) #6
  br label %101

80:                                               ; preds = %71
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %82 = load ptr, ptr @stdout, align 8, !tbaa !9
  %83 = load ptr, ptr %6, align 8, !tbaa !9
  %84 = load i64, ptr %7, align 8, !tbaa !11
  %85 = trunc i64 %84 to i32
  %86 = call i32 @BIO_dump_indent_fp(ptr noundef %82, ptr noundef %83, i32 noundef %85, i32 noundef 2)
  %87 = call i32 @putchar(i32 noundef 10)
  %88 = load i64, ptr %7, align 8, !tbaa !11
  %89 = icmp ne i64 %88, 16
  br i1 %89, label %90, label %93

90:                                               ; preds = %80
  %91 = load ptr, ptr @stderr, align 8, !tbaa !9
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef @.str.11) #6
  br label %101

93:                                               ; preds = %80
  %94 = load ptr, ptr %6, align 8, !tbaa !9
  %95 = call i32 @CRYPTO_memcmp(ptr noundef @expected_output, ptr noundef %94, i64 noundef 16)
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %100

97:                                               ; preds = %93
  %98 = load ptr, ptr @stderr, align 8, !tbaa !9
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef @.str.12) #6
  br label %101

100:                                              ; preds = %93
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %100, %97, %90, %77, %68, %60, %53, %46, %34, %26, %17
  %102 = load i32, ptr %2, align 4, !tbaa !5
  %103 = icmp ne i32 %102, 0
  br i1 %103, label %104, label %106

104:                                              ; preds = %101
  %105 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %105)
  br label %106

106:                                              ; preds = %104, %101
  %107 = load ptr, ptr %6, align 8, !tbaa !9
  call void @CRYPTO_free(ptr noundef %107, ptr noundef @.str.8, i32 noundef 149)
  %108 = load ptr, ptr %5, align 8, !tbaa !9
  call void @EVP_MAC_CTX_free(ptr noundef %108)
  %109 = load ptr, ptr %4, align 8, !tbaa !9
  call void @EVP_MAC_free(ptr noundef %109)
  %110 = load ptr, ptr %3, align 8, !tbaa !9
  call void @OSSL_LIB_CTX_free(ptr noundef %110)
  %111 = load i32, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 160, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 %111
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare ptr @OSSL_LIB_CTX_new() #3

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

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

declare ptr @EVP_MAC_CTX_new(ptr noundef) #3

declare void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef, i64 noundef) #3

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

declare void @OSSL_PARAM_construct_end(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8) #3

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

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

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

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

declare i32 @printf(ptr noundef, ...) #3

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

; Function Attrs: inlinehint nounwind uwtable
declare i32 @putchar(i32 noundef) #5

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

declare void @ERR_print_errors_fp(ptr noundef) #3

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

declare void @EVP_MAC_CTX_free(ptr noundef) #3

declare void @EVP_MAC_free(ptr noundef) #3

declare void @OSSL_LIB_CTX_free(ptr noundef) #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 "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 = { inlinehint 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 #6 = { 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}
!13 = !{i64 0, i64 8, !9, i64 8, i64 4, !5, i64 16, i64 8, !9, i64 24, i64 8, !11, i64 32, i64 8, !11}


; 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.ossl_param_st = type { ptr, i32, ptr, i64, i64 }

@__const.main.cipher_name = external hidden unnamed_addr constant [12 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@propq = external hidden local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@key = external hidden global [32 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@data = external hidden constant [756 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1
@expected_output = external hidden constant [16 x i8], align 16
@.str.12 = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca [4 x %struct.ossl_param_st], align 16
  %3 = alloca [12 x i8], align 1
  %4 = alloca %struct.ossl_param_st, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store i64 0, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(12) %3, ptr noundef nonnull align 1 dereferenceable(12) @__const.main.cipher_name, i64 12, i1 false)
  %5 = tail call ptr @OSSL_LIB_CTX_new() #6
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %10

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

10:                                               ; preds = %0
  %11 = load ptr, ptr @propq, align 8, !tbaa !9
  %12 = tail call ptr @EVP_MAC_fetch(ptr noundef nonnull %5, ptr noundef nonnull @.str.1, ptr noundef %11) #6
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %17

14:                                               ; preds = %10
  %15 = load ptr, ptr @stderr, align 8, !tbaa !9
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.2) #7
  br label %68

17:                                               ; preds = %10
  %18 = tail call ptr @EVP_MAC_CTX_new(ptr noundef nonnull %12) #6
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %23

20:                                               ; preds = %17
  %21 = load ptr, ptr @stderr, align 8, !tbaa !9
  %22 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str.3) #7
  br label %68

23:                                               ; preds = %17
  %24 = getelementptr inbounds i8, ptr %2, i64 40
  call void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %2, ptr noundef nonnull @.str.4, ptr noundef nonnull %3, i64 noundef 12) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #6
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef nonnull align 8 dereferenceable(40) %4, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  %25 = call i32 @EVP_MAC_init(ptr noundef nonnull %18, ptr noundef nonnull @key, i64 noundef 32, ptr noundef nonnull %2) #6
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %26, label %29

26:                                               ; preds = %23
  %27 = load ptr, ptr @stderr, align 8, !tbaa !9
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.5) #7
  br label %68

29:                                               ; preds = %23
  %30 = call i32 @EVP_MAC_update(ptr noundef nonnull %18, ptr noundef nonnull @data, i64 noundef 756) #6
  %.not29 = icmp eq i32 %30, 0
  br i1 %.not29, label %31, label %34

31:                                               ; preds = %29
  %32 = load ptr, ptr @stderr, align 8, !tbaa !9
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.6) #7
  br label %68

34:                                               ; preds = %29
  %35 = call i32 @EVP_MAC_final(ptr noundef nonnull %18, ptr noundef null, ptr noundef nonnull %1, i64 noundef 0) #6
  %.not30 = icmp eq i32 %35, 0
  br i1 %.not30, label %36, label %39

36:                                               ; preds = %34
  %37 = load ptr, ptr @stderr, align 8, !tbaa !9
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.7) #7
  br label %68

39:                                               ; preds = %34
  %40 = load i64, ptr %1, align 8, !tbaa !5
  %41 = call ptr @CRYPTO_malloc(i64 noundef %40, ptr noundef nonnull @.str.8, i32 noundef 119) #6
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %46

43:                                               ; preds = %39
  %44 = load ptr, ptr @stderr, align 8, !tbaa !9
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.9) #7
  br label %68

46:                                               ; preds = %39
  %47 = load i64, ptr %1, align 8, !tbaa !5
  %48 = call i32 @EVP_MAC_final(ptr noundef nonnull %18, ptr noundef nonnull %41, ptr noundef nonnull %1, i64 noundef %47) #6
  %.not31 = icmp eq i32 %48, 0
  br i1 %.not31, label %49, label %52

49:                                               ; preds = %46
  %50 = load ptr, ptr @stderr, align 8, !tbaa !9
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.7) #7
  br label %68

52:                                               ; preds = %46
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %54 = load ptr, ptr @stdout, align 8, !tbaa !9
  %55 = load i64, ptr %1, align 8, !tbaa !5
  %56 = trunc i64 %55 to i32
  %57 = call i32 @BIO_dump_indent_fp(ptr noundef %54, ptr noundef nonnull %41, i32 noundef %56, i32 noundef 2) #6
  %58 = call i32 @putchar(i32 noundef 10)
  %59 = load i64, ptr %1, align 8, !tbaa !5
  %.not32 = icmp eq i64 %59, 16
  br i1 %.not32, label %63, label %60

60:                                               ; preds = %52
  %61 = load ptr, ptr @stderr, align 8, !tbaa !9
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.11) #7
  br label %68

63:                                               ; preds = %52
  %64 = call i32 @CRYPTO_memcmp(ptr noundef nonnull @expected_output, ptr noundef nonnull %41, i64 noundef 16) #6
  %.not33 = icmp eq i32 %64, 0
  br i1 %.not33, label %70, label %65

65:                                               ; preds = %63
  %66 = load ptr, ptr @stderr, align 8, !tbaa !9
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.12) #7
  br label %68

68:                                               ; preds = %7, %14, %20, %43, %60, %65, %49, %36, %31, %26
  %.021.ph = phi ptr [ %12, %26 ], [ %12, %31 ], [ %12, %36 ], [ %12, %49 ], [ %12, %65 ], [ %12, %60 ], [ %12, %43 ], [ %12, %20 ], [ null, %14 ], [ null, %7 ]
  %.020.ph = phi ptr [ %18, %26 ], [ %18, %31 ], [ %18, %36 ], [ %18, %49 ], [ %18, %65 ], [ %18, %60 ], [ %18, %43 ], [ null, %20 ], [ null, %14 ], [ null, %7 ]
  %.0.ph = phi ptr [ null, %26 ], [ null, %31 ], [ null, %36 ], [ %41, %49 ], [ %41, %65 ], [ %41, %60 ], [ null, %43 ], [ null, %20 ], [ null, %14 ], [ null, %7 ]
  %69 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %69) #6
  br label %70

70:                                               ; preds = %63, %68
  %.047 = phi ptr [ %.0.ph, %68 ], [ %41, %63 ]
  %.02045 = phi ptr [ %.020.ph, %68 ], [ %18, %63 ]
  %.02143 = phi ptr [ %.021.ph, %68 ], [ %12, %63 ]
  %.02241 = phi i32 [ 1, %68 ], [ 0, %63 ]
  call void @CRYPTO_free(ptr noundef %.047, ptr noundef nonnull @.str.8, i32 noundef 149) #6
  call void @EVP_MAC_CTX_free(ptr noundef %.02045) #6
  call void @EVP_MAC_free(ptr noundef %.02143) #6
  call void @OSSL_LIB_CTX_free(ptr noundef %5) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 %.02241
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare ptr @OSSL_LIB_CTX_new() local_unnamed_addr #3

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

declare ptr @EVP_MAC_fetch(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare ptr @EVP_MAC_CTX_new(ptr noundef) local_unnamed_addr #3

declare void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

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

declare void @OSSL_PARAM_construct_end(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8) local_unnamed_addr #3

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

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

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

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

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

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

; Function Attrs: inlinehint nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5

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

declare void @ERR_print_errors_fp(ptr noundef) local_unnamed_addr #3

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

declare void @EVP_MAC_CTX_free(ptr noundef) local_unnamed_addr #3

declare void @EVP_MAC_free(ptr noundef) local_unnamed_addr #3

declare void @OSSL_LIB_CTX_free(ptr noundef) local_unnamed_addr #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { inlinehint nofree 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 #6 = { nounwind }
attributes #7 = { 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}
!11 = !{i64 0, i64 8, !9, i64 8, i64 4, !12, i64 16, i64 8, !9, i64 24, i64 8, !5, i64 32, i64 8, !5}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass