; LLVM IR from openssl/openssl :: crypto/evp (mac_lib)

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

@.str = external hidden unnamed_addr constant [70 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@__func__.EVP_Q_mac = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @EVP_MAC_CTX_new(ptr noundef) #0

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

declare void @ERR_new() #2

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

declare void @ERR_set_error(i32 noundef, i32 noundef, ptr noundef, ...) #2

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @EVP_MAC_CTX_free(ptr noundef) #0

declare void @EVP_MAC_free(ptr noundef) #2

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

; 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) #3

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @EVP_MAC_CTX_set_params(ptr noundef, ptr noundef) #0

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

41:                                               ; preds = %12
  %42 = load ptr, ptr %25, align 8, !tbaa !5
  store i64 0, ptr %42, align 8, !tbaa !9
  br label %43

43:                                               ; preds = %41, %12
  %44 = load ptr, ptr %26, align 8, !tbaa !5
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %47

46:                                               ; preds = %43
  store ptr null, ptr %13, align 8
  store i32 1, ptr %31, align 4
  br label %145

47:                                               ; preds = %43
  %48 = load ptr, ptr %17, align 8, !tbaa !5
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %71

50:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %51 = load ptr, ptr %26, align 8, !tbaa !5
  %52 = call ptr @EVP_MAC_settable_ctx_params(ptr noundef %51)
  store ptr %52, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  store ptr @.str.3, ptr %33, align 8, !tbaa !5
  %53 = load ptr, ptr %32, align 8, !tbaa !5
  %54 = load ptr, ptr %33, align 8, !tbaa !5
  %55 = call ptr @OSSL_PARAM_locate_const(ptr noundef %53, ptr noundef %54)
  %56 = icmp eq ptr %55, null
  br i1 %56, label %57, label %64

57:                                               ; preds = %50
  store ptr @.str.4, ptr %33, align 8, !tbaa !5
  %58 = load ptr, ptr %32, align 8, !tbaa !5
  %59 = load ptr, ptr %33, align 8, !tbaa !5
  %60 = call ptr @OSSL_PARAM_locate_const(ptr noundef %58, ptr noundef %59)
  %61 = icmp eq ptr %60, null
  br i1 %61, label %62, label %63

62:                                               ; preds = %57
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 283, ptr noundef @__func__.EVP_Q_mac)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 6, i32 noundef 524550, ptr noundef null)
  store i32 2, ptr %31, align 4
  br label %68

63:                                               ; preds = %57
  br label %64

64:                                               ; preds = %63, %50
  %65 = getelementptr inbounds [2 x %struct.ossl_param_st], ptr %27, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 40, ptr %34) #5
  %66 = load ptr, ptr %33, align 8, !tbaa !5
  %67 = load ptr, ptr %17, align 8, !tbaa !5
  call void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %34, ptr noundef %66, ptr noundef %67, i64 noundef 0)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %65, ptr align 8 %34, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %34) #5
  store i32 0, ptr %31, align 4
  br label %68

68:                                               ; preds = %64, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  %69 = load i32, ptr %31, align 4
  switch i32 %69, label %145 [
    i32 0, label %70
    i32 2, label %141
  ]

70:                                               ; preds = %68
  br label %71

71:                                               ; preds = %70, %47
  %72 = load ptr, ptr %19, align 8, !tbaa !5
  %73 = icmp eq ptr %72, null
  br i1 %73, label %74, label %79

74:                                               ; preds = %71
  %75 = load i64, ptr %20, align 8, !tbaa !9
  %76 = icmp eq i64 %75, 0
  br i1 %76, label %77, label %79

77:                                               ; preds = %74
  %78 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %78, ptr %19, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %77, %74, %71
  %80 = load ptr, ptr %26, align 8, !tbaa !5
  %81 = call ptr @EVP_MAC_CTX_new(ptr noundef %80)
  store ptr %81, ptr %28, align 8, !tbaa !5
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %140

83:                                               ; preds = %79
  %84 = load ptr, ptr %28, align 8, !tbaa !5
  %85 = getelementptr inbounds [2 x %struct.ossl_param_st], ptr %27, i64 0, i64 0
  %86 = call i32 @EVP_MAC_CTX_set_params(ptr noundef %84, ptr noundef %85)
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %140

88:                                               ; preds = %83
  %89 = load ptr, ptr %28, align 8, !tbaa !5
  %90 = load ptr, ptr %18, align 8, !tbaa !5
  %91 = call i32 @EVP_MAC_CTX_set_params(ptr noundef %89, ptr noundef %90)
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %140

93:                                               ; preds = %88
  %94 = load ptr, ptr %28, align 8, !tbaa !5
  %95 = load ptr, ptr %19, align 8, !tbaa !5
  %96 = load i64, ptr %20, align 8, !tbaa !9
  %97 = load ptr, ptr %18, align 8, !tbaa !5
  %98 = call i32 @EVP_MAC_init(ptr noundef %94, ptr noundef %95, i64 noundef %96, ptr noundef %97)
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %140

100:                                              ; preds = %93
  %101 = load ptr, ptr %28, align 8, !tbaa !5
  %102 = load ptr, ptr %21, align 8, !tbaa !5
  %103 = load i64, ptr %22, align 8, !tbaa !9
  %104 = call i32 @EVP_MAC_update(ptr noundef %101, ptr noundef %102, i64 noundef %103)
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %140

106:                                              ; preds = %100
  %107 = load ptr, ptr %28, align 8, !tbaa !5
  %108 = load ptr, ptr %23, align 8, !tbaa !5
  %109 = load i64, ptr %24, align 8, !tbaa !9
  %110 = call i32 @EVP_MAC_final(ptr noundef %107, ptr noundef %108, ptr noundef %29, i64 noundef %109)
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %140

112:                                              ; preds = %106
  %113 = load ptr, ptr %23, align 8, !tbaa !5
  %114 = icmp eq ptr %113, null
  br i1 %114, label %115, label %129

115:                                              ; preds = %112
  %116 = load i64, ptr %29, align 8, !tbaa !9
  %117 = call ptr @CRYPTO_malloc(i64 noundef %116, ptr noundef @.str, i32 noundef 300)
  store ptr %117, ptr %23, align 8, !tbaa !5
  %118 = load ptr, ptr %23, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %128

120:                                              ; preds = %115
  %121 = load ptr, ptr %28, align 8, !tbaa !5
  %122 = load ptr, ptr %23, align 8, !tbaa !5
  %123 = load i64, ptr %29, align 8, !tbaa !9
  %124 = call i32 @EVP_MAC_final(ptr noundef %121, ptr noundef %122, ptr noundef null, i64 noundef %123)
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %128, label %126

126:                                              ; preds = %120
  %127 = load ptr, ptr %23, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %127, ptr noundef @.str, i32 noundef 302)
  store ptr null, ptr %23, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %126, %120, %115
  br label %129

129:                                              ; preds = %128, %112
  %130 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %130, ptr %30, align 8, !tbaa !5
  %131 = load ptr, ptr %30, align 8, !tbaa !5
  %132 = icmp ne ptr %131, null
  br i1 %132, label %133, label %139

133:                                              ; preds = %129
  %134 = load ptr, ptr %25, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %139

136:                                              ; preds = %133
  %137 = load i64, ptr %29, align 8, !tbaa !9
  %138 = load ptr, ptr %25, align 8, !tbaa !5
  store i64 %137, ptr %138, align 8, !tbaa !9
  br label %139

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

140:                                              ; preds = %139, %106, %100, %93, %88, %83, %79
  br label %141

141:                                              ; preds = %140, %68
  %142 = load ptr, ptr %28, align 8, !tbaa !5
  call void @EVP_MAC_CTX_free(ptr noundef %142)
  %143 = load ptr, ptr %26, align 8, !tbaa !5
  call void @EVP_MAC_free(ptr noundef %143)
  %144 = load ptr, ptr %30, align 8, !tbaa !5
  store ptr %144, ptr %13, align 8
  store i32 1, ptr %31, align 4
  br label %145

145:                                              ; preds = %141, %68, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  %146 = load ptr, ptr %13, align 8
  ret ptr %146
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare ptr @EVP_MAC_settable_ctx_params(ptr noundef) #2

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

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) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{i64 0, i64 8, !5, i64 8, i64 4, !12, i64 16, i64 8, !5, i64 24, i64 8, !9, i64 32, i64 8, !9}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ossl_param_st = type { ptr, i32, ptr, i64, i64 }

@.str = external hidden unnamed_addr constant [70 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@__func__.EVP_Q_mac = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @EVP_MAC_CTX_new(ptr noundef) local_unnamed_addr #0

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

declare void @ERR_new() local_unnamed_addr #2

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

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

declare void @CRYPTO_free(ptr noundef, ptr noundef, i32 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: nounwind uwtable
declare dso_local void @EVP_MAC_CTX_free(ptr noundef) local_unnamed_addr #0

declare void @EVP_MAC_free(ptr noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @EVP_MAC_CTX_set_params(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @EVP_Q_mac(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i64 noundef %6, ptr noundef %7, i64 noundef %8, ptr noundef %9, i64 noundef %10, ptr noundef writeonly %11) local_unnamed_addr #0 {
  %13 = alloca [2 x %struct.ossl_param_st], align 16
  %14 = alloca i64, align 8
  %15 = tail call ptr @EVP_MAC_fetch(ptr noundef %0, ptr noundef %1, ptr noundef %2) #4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %13) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) %13, i8 0, i64 80, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  store i64 0, ptr %14, align 8, !tbaa !5
  %.not75 = icmp eq ptr %11, null
  br i1 %.not75, label %17, label %16

16:                                               ; preds = %12
  store i64 0, ptr %11, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %16, %12
  %18 = icmp eq ptr %15, null
  br i1 %18, label %54, label %19

19:                                               ; preds = %17
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %28, label %20

20:                                               ; preds = %19
  %21 = tail call ptr @EVP_MAC_settable_ctx_params(ptr noundef nonnull %15) #4
  %22 = tail call ptr @OSSL_PARAM_locate_const(ptr noundef %21, ptr noundef nonnull @.str.3) #4
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %.thread

24:                                               ; preds = %20
  %25 = tail call ptr @OSSL_PARAM_locate_const(ptr noundef %21, ptr noundef nonnull @.str.4) #4
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %.thread

.thread:                                          ; preds = %20, %24
  %.0 = phi ptr [ @.str.4, %24 ], [ @.str.3, %20 ]
  call void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %13, ptr noundef nonnull %.0, ptr noundef nonnull %3, i64 noundef 0) #4
  br label %28

27:                                               ; preds = %24
  tail call void @ERR_new() #4
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 283, ptr noundef nonnull @__func__.EVP_Q_mac) #4
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 6, i32 noundef 524550, ptr noundef null) #4
  br label %.thread72

28:                                               ; preds = %.thread, %19
  %29 = icmp eq ptr %5, null
  %30 = icmp eq i64 %6, 0
  %or.cond = and i1 %29, %30
  %spec.select = select i1 %or.cond, ptr %7, ptr %5
  %31 = call ptr @EVP_MAC_CTX_new(ptr noundef nonnull %15)
  %.not61 = icmp eq ptr %31, null
  br i1 %.not61, label %.thread72, label %32

32:                                               ; preds = %28
  %33 = call i32 @EVP_MAC_CTX_set_params(ptr noundef nonnull %31, ptr noundef nonnull %13)
  %.not62 = icmp eq i32 %33, 0
  br i1 %.not62, label %.thread72, label %34

34:                                               ; preds = %32
  %35 = call i32 @EVP_MAC_CTX_set_params(ptr noundef nonnull %31, ptr noundef %4)
  %.not63 = icmp eq i32 %35, 0
  br i1 %.not63, label %.thread72, label %36

36:                                               ; preds = %34
  %37 = call i32 @EVP_MAC_init(ptr noundef nonnull %31, ptr noundef %spec.select, i64 noundef %6, ptr noundef %4)
  %.not64 = icmp eq i32 %37, 0
  br i1 %.not64, label %.thread72, label %38

38:                                               ; preds = %36
  %39 = call i32 @EVP_MAC_update(ptr noundef nonnull %31, ptr noundef %7, i64 noundef %8)
  %.not65 = icmp eq i32 %39, 0
  br i1 %.not65, label %.thread72, label %40

40:                                               ; preds = %38
  %41 = call i32 @EVP_MAC_final(ptr noundef nonnull %31, ptr noundef %9, ptr noundef nonnull %14, i64 noundef %10)
  %.not66 = icmp eq i32 %41, 0
  br i1 %.not66, label %.thread72, label %42

42:                                               ; preds = %40
  %43 = icmp eq ptr %9, null
  br i1 %43, label %44, label %51

44:                                               ; preds = %42
  %45 = load i64, ptr %14, align 8, !tbaa !5
  %46 = call ptr @CRYPTO_malloc(i64 noundef %45, ptr noundef nonnull @.str, i32 noundef 300) #4
  %.not67 = icmp eq ptr %46, null
  br i1 %.not67, label %.thread72, label %47

47:                                               ; preds = %44
  %48 = load i64, ptr %14, align 8, !tbaa !5
  %49 = call i32 @EVP_MAC_final(ptr noundef nonnull %31, ptr noundef nonnull %46, ptr noundef null, i64 noundef %48)
  %.not68 = icmp eq i32 %49, 0
  br i1 %.not68, label %50, label %51

50:                                               ; preds = %47
  call void @CRYPTO_free(ptr noundef nonnull %46, ptr noundef nonnull @.str, i32 noundef 302) #4
  br label %.thread72

51:                                               ; preds = %47, %42
  %.052 = phi ptr [ %46, %47 ], [ %9, %42 ]
  br i1 %.not75, label %.thread72, label %52

52:                                               ; preds = %51
  %53 = load i64, ptr %14, align 8, !tbaa !5
  store i64 %53, ptr %11, align 8, !tbaa !5
  br label %.thread72

.thread72:                                        ; preds = %44, %50, %27, %28, %32, %34, %36, %38, %40, %52, %51
  %.050 = phi ptr [ null, %27 ], [ %31, %52 ], [ %31, %51 ], [ %31, %40 ], [ %31, %38 ], [ %31, %36 ], [ %31, %34 ], [ %31, %32 ], [ null, %28 ], [ %31, %50 ], [ %31, %44 ]
  %.049 = phi ptr [ null, %27 ], [ %.052, %52 ], [ %.052, %51 ], [ null, %40 ], [ null, %38 ], [ null, %36 ], [ null, %34 ], [ null, %32 ], [ null, %28 ], [ null, %50 ], [ null, %44 ]
  call void @EVP_MAC_CTX_free(ptr noundef %.050)
  call void @EVP_MAC_free(ptr noundef nonnull %15) #4
  br label %54

54:                                               ; preds = %17, %.thread72
  %.047 = phi ptr [ %.049, %.thread72 ], [ null, %17 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %13) #4
  ret ptr %.047
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare ptr @EVP_MAC_settable_ctx_params(ptr noundef) local_unnamed_addr #2

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

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 #2

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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