; LLVM IR from openssl/openssl :: crypto/modes (siv128)

; 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 }
%struct.siv128_context = type { %union.siv_block_u, %union.siv_block_u, ptr, ptr, ptr, i32, i32 }
%union.siv_block_u = type { [2 x i64] }

@ossl_siv128_init.zero = external hidden constant [16 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 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 uwtable
define dso_local i32 @ossl_siv128_init(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #1 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %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 ptr, align 8
  %18 = alloca [3 x %struct.ossl_param_st], align 16
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca %struct.ossl_param_st, align 8
  %22 = alloca %struct.ossl_param_st, align 8
  %23 = alloca %struct.ossl_param_st, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i32 %2, ptr %11, align 4, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 16, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr null, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 120, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %7
  store i32 0, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %135

27:                                               ; preds = %7
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.siv128_context, ptr %28, i32 0, i32 0
  call void @llvm.memset.p0.i64(ptr align 8 %29, i8 0, i64 16, i1 false)
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.siv128_context, ptr %30, i32 0, i32 2
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  call void @EVP_CIPHER_CTX_free(ptr noundef %32)
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.siv128_context, ptr %33, i32 0, i32 4
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  call void @EVP_MAC_CTX_free(ptr noundef %35)
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.siv128_context, ptr %36, i32 0, i32 3
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  call void @EVP_MAC_free(ptr noundef %38)
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.siv128_context, ptr %39, i32 0, i32 3
  store ptr null, ptr %40, align 8, !tbaa !16
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.siv128_context, ptr %41, i32 0, i32 2
  store ptr null, ptr %42, align 8, !tbaa !13
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.siv128_context, ptr %43, i32 0, i32 4
  store ptr null, ptr %44, align 8, !tbaa !15
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = icmp eq ptr %45, null
  br i1 %46, label %53, label %47

47:                                               ; preds = %27
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = icmp eq ptr %48, null
  br i1 %49, label %53, label %50

50:                                               ; preds = %47
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  %52 = icmp eq ptr %51, null
  br i1 %52, label %53, label %54

53:                                               ; preds = %50, %47, %27
  store i32 0, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %135

54:                                               ; preds = %50
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = call ptr @EVP_CIPHER_get0_name(ptr noundef %55)
  store ptr %56, ptr %19, align 8, !tbaa !5
  %57 = getelementptr inbounds [3 x %struct.ossl_param_st], ptr %18, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 40, ptr %21) #5
  %58 = load ptr, ptr %19, align 8, !tbaa !5
  call void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %21, ptr noundef @.str.1, ptr noundef %58, i64 noundef 0)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %57, ptr align 8 %21, i64 40, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 40, ptr %21) #5
  %59 = getelementptr inbounds [3 x %struct.ossl_param_st], ptr %18, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 40, ptr %22) #5
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %22, ptr noundef @.str.2, ptr noundef %60, i64 noundef %62)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %59, ptr align 8 %22, i64 40, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 40, ptr %22) #5
  %63 = getelementptr inbounds [3 x %struct.ossl_param_st], ptr %18, i64 0, i64 2
  call void @llvm.lifetime.start.p0(i64 40, ptr %23) #5
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %23)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %63, ptr align 8 %23, i64 40, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #5
  %64 = call ptr @EVP_CIPHER_CTX_new()
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.siv128_context, ptr %65, i32 0, i32 2
  store ptr %64, ptr %66, align 8, !tbaa !13
  %67 = icmp eq ptr %64, null
  br i1 %67, label %118, label %68

68:                                               ; preds = %54
  %69 = load ptr, ptr %14, align 8, !tbaa !5
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  %71 = call ptr @EVP_MAC_fetch(ptr noundef %69, ptr noundef @.str.3, ptr noundef %70)
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.siv128_context, ptr %72, i32 0, i32 3
  store ptr %71, ptr %73, align 8, !tbaa !16
  %74 = icmp eq ptr %71, null
  br i1 %74, label %118, label %75

75:                                               ; preds = %68
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.siv128_context, ptr %76, i32 0, i32 3
  %78 = load ptr, ptr %77, align 8, !tbaa !16
  %79 = call ptr @EVP_MAC_CTX_new(ptr noundef %78)
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.siv128_context, ptr %80, i32 0, i32 4
  store ptr %79, ptr %81, align 8, !tbaa !15
  %82 = icmp eq ptr %79, null
  br i1 %82, label %118, label %83

83:                                               ; preds = %75
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.siv128_context, ptr %84, i32 0, i32 4
  %86 = load ptr, ptr %85, align 8, !tbaa !15
  %87 = getelementptr inbounds [3 x %struct.ossl_param_st], ptr %18, i64 0, i64 0
  %88 = call i32 @EVP_MAC_CTX_set_params(ptr noundef %86, ptr noundef %87)
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %118

90:                                               ; preds = %83
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.siv128_context, ptr %91, i32 0, i32 2
  %93 = load ptr, ptr %92, align 8, !tbaa !13
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = load i32, ptr %11, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i8, ptr %95, i64 %97
  %99 = call i32 @EVP_EncryptInit_ex(ptr noundef %93, ptr noundef %94, ptr noundef null, ptr noundef %98, ptr noundef null)
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %118

101:                                              ; preds = %90
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.siv128_context, ptr %102, i32 0, i32 4
  %104 = load ptr, ptr %103, align 8, !tbaa !15
  %105 = call ptr @EVP_MAC_CTX_dup(ptr noundef %104)
  store ptr %105, ptr %17, align 8, !tbaa !5
  %106 = icmp eq ptr %105, null
  br i1 %106, label %118, label %107

107:                                              ; preds = %101
  %108 = load ptr, ptr %17, align 8, !tbaa !5
  %109 = call i32 @EVP_MAC_update(ptr noundef %108, ptr noundef @ossl_siv128_init.zero, i64 noundef 16)
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %118

111:                                              ; preds = %107
  %112 = load ptr, ptr %17, align 8, !tbaa !5
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.siv128_context, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds [16 x i8], ptr %114, i64 0, i64 0
  %116 = call i32 @EVP_MAC_final(ptr noundef %112, ptr noundef %115, ptr noundef %16, i64 noundef 16)
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %129, label %118

118:                                              ; preds = %111, %107, %101, %90, %83, %75, %68, %54
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.siv128_context, ptr %119, i32 0, i32 2
  %121 = load ptr, ptr %120, align 8, !tbaa !13
  call void @EVP_CIPHER_CTX_free(ptr noundef %121)
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.siv128_context, ptr %122, i32 0, i32 4
  %124 = load ptr, ptr %123, align 8, !tbaa !15
  call void @EVP_MAC_CTX_free(ptr noundef %124)
  %125 = load ptr, ptr %17, align 8, !tbaa !5
  call void @EVP_MAC_CTX_free(ptr noundef %125)
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.siv128_context, ptr %126, i32 0, i32 3
  %128 = load ptr, ptr %127, align 8, !tbaa !16
  call void @EVP_MAC_free(ptr noundef %128)
  store i32 0, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %135

129:                                              ; preds = %111
  %130 = load ptr, ptr %17, align 8, !tbaa !5
  call void @EVP_MAC_CTX_free(ptr noundef %130)
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.siv128_context, ptr %131, i32 0, i32 5
  store i32 -1, ptr %132, align 8, !tbaa !18
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.siv128_context, ptr %133, i32 0, i32 6
  store i32 1, ptr %134, align 4, !tbaa !19
  store i32 1, ptr %8, align 4
  store i32 1, ptr %20, align 4
  br label %135

135:                                              ; preds = %129, %118, %53, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 120, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %136 = load i32, ptr %8, align 4
  ret i32 %136
}

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

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

declare void @EVP_CIPHER_CTX_free(ptr noundef) #3

declare void @EVP_MAC_CTX_free(ptr noundef) #3

declare void @EVP_MAC_free(ptr noundef) #3

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

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

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

declare ptr @EVP_CIPHER_CTX_new() #3

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

declare ptr @EVP_MAC_CTX_new(ptr noundef) #3

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

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

declare ptr @EVP_MAC_CTX_dup(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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 32}
!14 = !{!"siv128_context", !7, i64 0, !7, i64 16, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 60}
!15 = !{!14, !6, i64 48}
!16 = !{!14, !6, i64 40}
!17 = !{i64 0, i64 8, !5, i64 8, i64 4, !9, i64 16, i64 8, !5, i64 24, i64 8, !11, i64 32, i64 8, !11}
!18 = !{!14, !10, i64 56}
!19 = !{!14, !10, i64 60}


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

@ossl_siv128_init.zero = external hidden constant [16 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @ossl_siv128_init(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #1 {
  %8 = alloca i64, align 8
  %9 = alloca [3 x %struct.ossl_param_st], align 16
  %10 = alloca %struct.ossl_param_st, align 8
  %11 = alloca %struct.ossl_param_st, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  store i64 16, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %9) #5
  %12 = icmp eq ptr %0, null
  br i1 %12, label %57, label %13

13:                                               ; preds = %7
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %0, i8 0, i64 16, i1 false)
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  tail call void @EVP_CIPHER_CTX_free(ptr noundef %15) #5
  %16 = getelementptr inbounds i8, ptr %0, i64 48
  %17 = load ptr, ptr %16, align 8, !tbaa !13
  tail call void @EVP_MAC_CTX_free(ptr noundef %17) #5
  %18 = getelementptr inbounds i8, ptr %0, i64 40
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  tail call void @EVP_MAC_free(ptr noundef %19) #5
  %20 = icmp eq ptr %1, null
  %21 = icmp eq ptr %3, null
  %or.cond = or i1 %20, %21
  %22 = icmp eq ptr %4, null
  %or.cond3 = or i1 %or.cond, %22
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %14, i8 0, i64 24, i1 false)
  br i1 %or.cond3, label %57, label %23

23:                                               ; preds = %13
  %24 = tail call ptr @EVP_CIPHER_get0_name(ptr noundef nonnull %3) #5
  call void @OSSL_PARAM_construct_utf8_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %9, ptr noundef nonnull @.str.1, ptr noundef %24, i64 noundef 0) #5
  %25 = getelementptr inbounds i8, ptr %9, i64 40
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #5
  %26 = sext i32 %2 to i64
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %10, ptr noundef nonnull @.str.2, ptr noundef nonnull %1, i64 noundef %26) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %25, ptr noundef nonnull align 8 dereferenceable(40) %10, i64 40, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #5
  %27 = getelementptr inbounds i8, ptr %9, i64 80
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #5
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %27, ptr noundef nonnull align 8 dereferenceable(40) %11, i64 40, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #5
  %28 = call ptr @EVP_CIPHER_CTX_new() #5
  store ptr %28, ptr %14, align 8, !tbaa !9
  %29 = icmp eq ptr %28, null
  br i1 %29, label %50, label %30

30:                                               ; preds = %23
  %31 = call ptr @EVP_MAC_fetch(ptr noundef %5, ptr noundef nonnull @.str.3, ptr noundef %6) #5
  store ptr %31, ptr %18, align 8, !tbaa !14
  %32 = icmp eq ptr %31, null
  br i1 %32, label %50, label %33

33:                                               ; preds = %30
  %34 = call ptr @EVP_MAC_CTX_new(ptr noundef nonnull %31) #5
  store ptr %34, ptr %16, align 8, !tbaa !13
  %35 = icmp eq ptr %34, null
  br i1 %35, label %50, label %36

36:                                               ; preds = %33
  %37 = call i32 @EVP_MAC_CTX_set_params(ptr noundef nonnull %34, ptr noundef nonnull %9) #5
  %.not = icmp eq i32 %37, 0
  br i1 %.not, label %50, label %38

38:                                               ; preds = %36
  %39 = load ptr, ptr %14, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %1, i64 %26
  %41 = call i32 @EVP_EncryptInit_ex(ptr noundef %39, ptr noundef nonnull %4, ptr noundef null, ptr noundef %40, ptr noundef null) #5
  %.not48 = icmp eq i32 %41, 0
  br i1 %.not48, label %50, label %42

42:                                               ; preds = %38
  %43 = load ptr, ptr %16, align 8, !tbaa !13
  %44 = call ptr @EVP_MAC_CTX_dup(ptr noundef %43) #5
  %45 = icmp eq ptr %44, null
  br i1 %45, label %50, label %46

46:                                               ; preds = %42
  %47 = call i32 @EVP_MAC_update(ptr noundef nonnull %44, ptr noundef nonnull @ossl_siv128_init.zero, i64 noundef 16) #5
  %.not49 = icmp eq i32 %47, 0
  br i1 %.not49, label %50, label %48

48:                                               ; preds = %46
  %49 = call i32 @EVP_MAC_final(ptr noundef nonnull %44, ptr noundef nonnull %0, ptr noundef nonnull %8, i64 noundef 16) #5
  %.not50 = icmp eq i32 %49, 0
  br i1 %.not50, label %50, label %54

50:                                               ; preds = %48, %46, %42, %38, %36, %33, %30, %23
  %.040 = phi ptr [ null, %23 ], [ null, %30 ], [ null, %33 ], [ null, %42 ], [ %44, %48 ], [ %44, %46 ], [ null, %38 ], [ null, %36 ]
  %51 = load ptr, ptr %14, align 8, !tbaa !9
  call void @EVP_CIPHER_CTX_free(ptr noundef %51) #5
  %52 = load ptr, ptr %16, align 8, !tbaa !13
  call void @EVP_MAC_CTX_free(ptr noundef %52) #5
  call void @EVP_MAC_CTX_free(ptr noundef %.040) #5
  %53 = load ptr, ptr %18, align 8, !tbaa !14
  call void @EVP_MAC_free(ptr noundef %53) #5
  br label %57

54:                                               ; preds = %48
  call void @EVP_MAC_CTX_free(ptr noundef nonnull %44) #5
  %55 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 -1, ptr %55, align 8, !tbaa !18
  %56 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 1, ptr %56, align 4, !tbaa !19
  br label %57

57:                                               ; preds = %13, %7, %54, %50
  %.0 = phi i32 [ 0, %50 ], [ 1, %54 ], [ 0, %7 ], [ 0, %13 ]
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  ret i32 %.0
}

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

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

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

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

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

declare ptr @EVP_CIPHER_CTX_new() local_unnamed_addr #3

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 i32 @EVP_MAC_CTX_set_params(ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare ptr @EVP_MAC_CTX_dup(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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 32}
!10 = !{!"siv128_context", !7, i64 0, !7, i64 16, !11, i64 32, !11, i64 40, !11, i64 48, !12, i64 56, !12, i64 60}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !11, i64 48}
!14 = !{!10, !11, i64 40}
!15 = !{i64 0, i64 8, !16, i64 8, i64 4, !17, i64 16, i64 8, !16, i64 24, i64 8, !5, i64 32, i64 8, !5}
!16 = !{!11, !11, i64 0}
!17 = !{!12, !12, i64 0}
!18 = !{!10, !12, i64 56}
!19 = !{!10, !12, i64 60}


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